Russian Qt Forum
Октябрь 03, 2024, 01:31 *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

Войти
 
  Начало   Форум  WIKI (Вики)FAQ Помощь Поиск Войти Регистрация  

Страниц: [1]   Вниз
  Печать  
Автор Тема: Прозрачность QLabel  (Прочитано 6132 раз)
IGHOR
Крякер
****
Offline Offline

Сообщений: 390



Просмотр профиля WWW
« : Декабрь 23, 2007, 15:00 »

есть прозрачная QLabel.
Можно ли сделать чтобы все клики на прозрачной области пропускались на все елементы что под ней?
Записан
ритт
Гость
« Ответ #1 : Декабрь 23, 2007, 15:31 »

Цитировать
void QWidget::setMask ( const QBitmap & bitmap )
Causes only the pixels of the widget for which bitmap has a corresponding 1 bit to be visible. If the region includes pixels outside the rect() of the widget, window system controls in that area may or may not be visible, depending on the platform.
Note that this effect can be slow if the region is particularly complex.
The following code shows how an image with an alpha channel can be used to generate a mask for a widget:
     QLabel topLevelLabel;
     QPixmap pixmap(":/images/tux.png");
     topLevelLabel.setPixmap(pixmap);
     topLevelLabel.setMask(pixmap.mask());
The label shown by this code is masked using the image it contains, giving the appearance that an irregularly-shaped image is being drawn directly onto the screen.
Masked widgets receive mouse events only on their visible portions.

подозреваю, что ты очень занятой человек и тебе просто жаль своего времени на чтение документации
Записан
IGHOR
Крякер
****
Offline Offline

Сообщений: 390



Просмотр профиля WWW
« Ответ #2 : Декабрь 23, 2007, 15:40 »

Времени сейчас мало, на завтра висит курсак и превью проги..
хер, Спасибо за ваше время Улыбающийся
Записан
Страниц: [1]   Вверх
  Печать  
 
Перейти в:  


Страница сгенерирована за 0.068 секунд. Запросов: 23.