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

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

Страниц: [1]   Вниз
  Печать  
Автор Тема: Можно ли получить QPalette для обычного QWidget, не создавая его ?  (Прочитано 3582 раз)
Red Devil
Гость
« : Июль 16, 2008, 13:02 »

Мне нужна стандартная палитра, которая задается при создании виджета. Можно ли ее получить не создовая самого виджета ?
Записан
ритт
Гость
« Ответ #1 : Июль 16, 2008, 13:07 »

Цитировать
QWidget::palette : QPalette
This property holds the widget's palette.
As long as no special palette has been set, this is either a special palette for the widget class, the parent's palette or (if this widget is a top level widget), the default application palette.
Note: The palette's background color will only have an effect on the appearance of the widget if the autoFillBackground property is set.
Warning: Do not use this function in conjunction with Qt Style Sheets. When using style sheets, the palette of a widget can be customized using the "color", "background-color", "selection-color", "selection-background-color" and "alternate-background-color".

Цитировать
QPalette QApplication::palette ()   [static]
Returns the application palette.

QPalette QApplication::palette ( const QWidget * widget )   [static]
This is an overloaded member function, provided for convenience.
If a widget is passed, the default palette for the widget's class is returned. This may or may not be the application palette. In most cases there isn't a special palette for certain types of widgets, but one notable exception is the popup menu under Windows, if the user has defined a special background color for menus in the display settings.

QPalette QApplication::palette ( const char * className )   [static]
This is an overloaded member function, provided for convenience.
Returns the palette for widgets of the given className.

угадай откуда я это взял?
Записан
Red Devil
Гость
« Ответ #2 : Июль 16, 2008, 13:44 »

А я сейчас болею - в голове одни сопли, поэтому сам не додумался.
Спасибо.
Записан
Страниц: [1]   Вверх
  Печать  
 
Перейти в:  


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