68 #ifndef QT_NO_DATASTREAM 82 for(
int r = 0 ; r < max ; r++)
92 s >> fg >> bg >> light >> dark >> mid >> text >>
base;
111 for(
int r = 0 ; r < max; r++) {
121 return qt_stream_out_qcolorgroup(s, g);
126 return qt_stream_in_qcolorgroup(s, g);
128 #endif // QT_NO_DATASTREAM 139 setColorGroup(Active, active);
140 setColorGroup(Disabled, disabled);
141 setColorGroup(Inactive, inactive);
144 QColorGroup QPalette::createColorGroup(ColorGroup cr)
const 147 ret.setCurrentColorGroup(cr);
153 setColorGroup(cg, g.brush(WindowText), g.brush(
Button), g.brush(Light),
154 g.brush(Dark), g.brush(Mid), g.brush(
Text), g.brush(BrightText),
155 g.brush(Base), g.brush(AlternateBase), g.brush(
Window),
156 g.brush(Midlight), g.brush(ButtonText), g.brush(Shadow),
157 g.brush(Highlight), g.brush(HighlightedText), g.brush(Link),
158 g.brush(LinkVisited), g.brush(ToolTipBase), g.brush(ToolTipText));
161 #endif // QT3_SUPPORT 675 current_group(Active),
881 qWarning(
"QPalette::brush: Unknown ColorGroup: %d", (
int)gr);
885 return d->
br[gr][cr];
918 for(
int i = 0; i < (int)NColorGroups; i++)
925 qWarning(
"QPalette::setBrush: Unknown ColorGroup: %d", (
int)cg);
959 x->
br[grp][role] =
d->
br[grp][role];
997 for(
int role = 0; role < (int)
NColorRoles; role++) {
998 if(
d->
br[grp][role] != p.
d->
br[grp][role])
1010 for (
int role = 0; role < int(
NColorRoles); role++) {
1020 QColorGroup::operator
QVariant()
const 1022 return QVariant(QVariant::ColorGroup,
this);
1041 qWarning(
"QPalette::brush: Unknown ColorGroup(1): %d", (
int)group1);
1045 if(group2 >= (
int)NColorGroups) {
1049 qWarning(
"QPalette::brush: Unknown ColorGroup(2): %d", (
int)group2);
1053 if(group1 == group2)
1055 for(
int role = 0; role < (int)
NColorRoles; role++) {
1056 if(
d->
br[group1][role] !=
d->
br[group2][role])
1113 for(
int role = 0; role < (int)
NColorRoles; role++)
1116 palette.
d->
br[grp][role] = other.
d->
br[grp][role];
1136 #ifndef QT_NO_DATASTREAM 1167 for (
int r = 0; r < max; r++)
1168 s << p.
d->
br[grp][r];
1214 for(
int role = 0; role < max; ++role) {
1222 #endif //QT_NO_DATASTREAM 1256 setColorGroup(cg, windowText, button, light, dark, mid, text, bright_text, base,
1257 alt_base, window, mid_light, text,
1281 text, bright_text, base, alternate_base, background,
1282 midlight, button_text, shadow, highlight, highlighted_text,
1283 link, link_visited, background, foreground);
The QVariant class acts like a union for the most common Qt data types.
The QColor class provides colors based on RGB, HSV or CMYK values.
int serialNumber() const
Returns a number that identifies the contents of this QPalette object.
const QBrush & highlight() const
Returns the highlight brush of the current color group.
The QApplication class manages the GUI application's control flow and main settings.
const QBrush & base() const
Returns the base brush of the current color group.
#define QT_END_NAMESPACE
This macro expands to.
const QColor & color() const
Returns the brush color.
ColorRole
The ColorRole enum defines the different symbolic color roles used in current GUIs.
const QBrush & dark() const
Returns the dark brush of the current color group.
static void qt_palette_from_color(QPalette &pal, const QColor &button)
The QAtomicInt class provides platform-independent atomic operations on integers. ...
static const int NumOldRoles
const QBrush & background() const
Use window() instead.
friend Q_GUI_EXPORT QDataStream & operator<<(QDataStream &s, const QPalette &p)
Writes the palette, p to the stream s and returns a reference to the stream.
qint64 cacheKey() const
Returns a number that identifies the contents of this QPalette object.
const QBrush & foreground() const
Use windowText() instead.
long ASN1_INTEGER_get ASN1_INTEGER * a
bool ref()
Atomically increments the value of this QAtomicInt.
ushort red
Returns the red color component of this color.
static QColor qt_mix_colors(QColor a, QColor b)
void getHsv(int *h, int *s, int *v, int *a=0) const
Sets the contents pointed to by h, s, v, and a, to the hue, saturation, value, and alpha-channel (tra...
#define QT_BEGIN_NAMESPACE
This macro expands to.
void setBrush(ColorRole cr, const QBrush &brush)
Sets the brush for the given color role to the specified brush for all groups in the palette...
bool isCopyOf(const QPalette &p) const
Returns true if this palette and p are copies of each other, i.e.
const QBrush & light() const
Returns the light brush of the current color group.
QPalette & operator=(const QPalette &palette)
Assigns p to this palette and returns a reference to this palette.
bool deref()
Atomically decrements the value of this QAtomicInt.
const QBrush & midlight() const
Returns the midlight brush of the current color group.
const QBrush & mid() const
Returns the mid brush of the current color group.
Q_CORE_EXPORT void qWarning(const char *,...)
static void readV1ColorGroup(QDataStream &s, QPalette &pal, QPalette::ColorGroup grp)
QBrush br[QPalette::NColorGroups][QPalette::NColorRoles]
bool isEqual(ColorGroup cr1, ColorGroup cr2) const
Returns true (usually quickly) if color group cg1 is equal to cg2; otherwise returns false...
const QBrush & brush(ColorGroup cg, ColorRole cr) const
Returns the brush in the specified color group, used for the given color role.
void setColorGroup(ColorGroup cr, const QBrush &windowText, const QBrush &button, const QBrush &light, const QBrush &dark, const QBrush &mid, const QBrush &text, const QBrush &bright_text, const QBrush &base, const QBrush &window)
Sets a the group at cg.
int version() const
Returns the version number of the data serialization format.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
const QBrush & shadow() const
Returns the shadow brush of the current color group.
const QBrush & windowText() const
Returns the window text (general foreground) brush of the current color group.
ushort blue
Returns the blue color component of this color.
static int qt_palette_count
ushort alpha
Returns the alpha color component of this color.
bool isBrushSet(ColorGroup cg, ColorRole cr) const
Returns true if the ColorGroup cg and ColorRole cr has been set previously on this palette; otherwise...
QDataStream & operator>>(QDataStream &s, QAxBase &c)
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Sets the color in the specified color group, used for the given color role, to the specified solid co...
const QBrush & toolTipBase() const
Returns the tool tip base brush of the current color group.
The QColorGroup class contains color groups for each widget state.
const QBrush & toolTipText() const
Returns the tool tip text brush of the current color group.
QDataStream & operator<<(QDataStream &s, const QAxBase &c)
const QBrush & link() const
Returns the unvisited link text brush of the current color group.
bool operator==(const QPalette &p) const
Returns true (usually quickly) if this palette is equal to p; otherwise returns false (slowly)...
The QDataStream class provides serialization of binary data to a QIODevice.
QPalette()
Constructs a palette object that uses the application's default palette.
QDataStream & operator>>(QDataStream &s, QPalette &p)
Reads a palette from the stream, s into the palette p, and returns a reference to the stream...
~QPalette()
Destroys the palette.
const QBrush & button() const
Returns the button brush of the current color group.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
ushort green
Returns the green color component of this color.
bool operator==(QBool b1, bool b2)
const QBrush & window() const
Returns the window (general background) brush of the current color group.
static const int oldRoles[7]
const QBrush & text() const
Returns the text foreground brush of the current color group.
The Text item allows you to add formatted text to a scene.
The QPalette class contains color groups for each widget state.