A container for a "state-aware" brush.
KStatefulBrush provides an easy and safe way to store a color for use in a user interface. It is "safe" both in that it will make it easy to deal with widget states in a correct manner, and that it insulates you against changes in QPalette::ColorGroup.
Basically, a stateful brush is used to cache a particular "color" from the KDE system palette (usually, one which does not live in QPalette). When you are ready to draw using the brush, you use the current state to retrieve the appropriate brush.
Stateful brushes can also be used to apply state effects to arbitrary brushes, for example when working with a application specific user-defined color palette.
- As of Qt 4.3, QPalette::ColorGroup is missing a state for disabled widgets in an inactive window. Hopefully Trolltech will fix this bug, at which point KColorScheme and KStatefulBrush will be updated to recognize the new state. Using KStatefulBrush will allow your application to inherit these changes "for free", without even recompiling.
Definition at line 477 of file kcolorscheme.h.
||const QBrush &
Construct a stateful background brush from a specified QBrush (or QColor, via QBrush's implicit constructor).
The various states are determined from the base QBrush (which fills in the Active state) according to the same rules used to build stateful color schemes from the system color scheme. The state effects from the given KConfig are used (if null, the application's state effects are used).
Definition at line 675 of file kcolorscheme.cpp.