KStatefulBrush Class Reference
from PyKDE4.kdeui import *
Detailed Description
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) in the way you would have used a QColor in KDE3. 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.
- Note:
- 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.
Methods | |
__init__ (self) | |
__init__ (self, KColorScheme.ColorSet a0, KColorScheme.ForegroundRole a1, KSharedConfigPtr a2=KSharedConfigPtr()) | |
__init__ (self, KColorScheme.ColorSet a0, KColorScheme.BackgroundRole a1, KSharedConfigPtr a2=KSharedConfigPtr()) | |
__init__ (self, KColorScheme.ColorSet a0, KColorScheme.DecorationRole a1, KSharedConfigPtr a2=KSharedConfigPtr()) | |
__init__ (self, QBrush a0, KSharedConfigPtr a1=KSharedConfigPtr()) | |
__init__ (self, QBrush a0, QBrush background, KSharedConfigPtr a2=KSharedConfigPtr()) | |
__init__ (self, KStatefulBrush a0) | |
QBrush | brush (self, QPalette.ColorGroup a0) |
QBrush | brush (self, QPalette a0) |
QBrush | brush (self, QWidget a0) |
Method Documentation
__init__ | ( | self ) |
__init__ | ( | self, | ||
KColorScheme.ColorSet | a0, | |||
KColorScheme.ForegroundRole | a1, | |||
KSharedConfigPtr | a2=KSharedConfigPtr() | |||
) |
__init__ | ( | self, | ||
KColorScheme.ColorSet | a0, | |||
KColorScheme.BackgroundRole | a1, | |||
KSharedConfigPtr | a2=KSharedConfigPtr() | |||
) |
__init__ | ( | self, | ||
KColorScheme.ColorSet | a0, | |||
KColorScheme.DecorationRole | a1, | |||
KSharedConfigPtr | a2=KSharedConfigPtr() | |||
) |
__init__ | ( | self, | ||
QBrush | a0, | |||
KSharedConfigPtr | a1=KSharedConfigPtr() | |||
) |
__init__ | ( | self, | ||
QBrush | a0, | |||
QBrush | background, | |||
KSharedConfigPtr | a2=KSharedConfigPtr() | |||
) |
__init__ | ( | self, | ||
KStatefulBrush | a0 | |||
) |
QBrush brush | ( | self, | ||
QPalette.ColorGroup | a0 | |||
) |
Retrieve the brush, using a QWidget pointer to determine the correct state. Use when you have a pointer to the widget that you are painting. The state used is the current state of the widget.
- Note:
- If you pass an invalid widget, you will get a default brush (i.e. <tt>QBrush()</tt>).
Retrieve the brush, using a QWidget pointer to determine the correct state. Use when you have a pointer to the widget that you are painting. The state used is the current state of the widget.
- Note:
- If you pass an invalid widget, you will get a default brush (i.e. <tt>QBrush()</tt>).
Retrieve the brush, using a QWidget pointer to determine the correct state. Use when you have a pointer to the widget that you are painting. The state used is the current state of the widget.
- Note:
- If you pass an invalid widget, you will get a default brush (i.e. <tt>QBrush()</tt>).