The QPalette class contains color groups. More...
#include <qpalette.h>
A palette consists of three color groups: a normal, a disabled and an active color group. All widgets contain a palette, and all the widgets in Qt use their palette to draw themselves. This makes the user interface consistent and easily configurable.
If you make a new widget you are strongly advised to use the colors in the palette rather than hard-coding specific colors.
The active group is used for the widget in focus. Normally it contains the same colors as normal so as not to overwhelm the user with bright and flashing colors, but if you need to you can change it.
The disabled group is used for widgets that are currently inactive or not usable.
The normal color group is used in all other cases.
See also: QApplication::setPalette(), QWidget::setPalette(), QColorGroup and QColor.
Examples: widgets/widgets.cpp
Constructs a palette that consists of the three color groups normal, disabled and active.
Constructs a palette that is a copy of p.
Constructs a palette that consists of color groups with only black colors.
Destroys the palette.
Returns the active color group of this palette.
See also: QColorGroup, normal(), disabled() and setActive().
Returns a deep copy of the palette.
Returns the disabled color group of this palette.
See also: QColorGroup, normal(), active() and setDisabled().
Returns the normal color group of this palette.
See also: QColorGroup, disabled(), active() and setNormal().
Returns TRUE if this palette is different from p, or FALSE if they are equal.
Assigns p to this palette and returns a reference to this palette.
Returns TRUE if this palette is equal to p, or FALSE if they are different.
Sets the active
color group to g.
See also: active().
Sets the disabled
color group to g.
See also: disabled().
Sets the normal
color group to g.
See also: normal().
Writes a palette to the stream and returns a reference to the stream.
Serialization format:
Reads a palette from the stream and returns a reference to the stream.
This file is part of the Qt toolkit, copyright © 1995-96 Troll Tech, all rights reserved.
It was generated from the following files: