The QPalette class contains color groups for each widget state. 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: xform/xform.cpp widgets/widgets.cpp
Constructs a palette that consists of color groups with only black colors.
Constructs a palette from the background color. The other colors are automatically calculated, based on this color.
Constructs a palette that consists of the three color groups normal, disabled and active.
Constructs a palette that is a shallow copy of p.
See also: copy().
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 TRUE if this palette and p are copies of each other, ie. one of them was created as a copy of the other and neither was subsequently modified. This is much stricter than equality.
See also: operator= and operator==.
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. Note that a shallow copy of p is used.
See also: copy().
Returns TRUE if this palette is equal to p, or FALSE if they are different.
Returns a number that uniquely identifies this QPalette object. The serial number is very useful for caching.
See also: QPixmap and QPixmapCache.
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.
Search the documentation, FAQ, qt-interest archive and more (uses
www.troll.no):
This file is part of the Qt toolkit, copyright © 1995-98 Troll Tech, all rights reserved.
It was generated from the following files:
Copyright © 1998 Troll Tech | Trademarks | Qt version 1.42
|