58 class QPalettePrivate;
76 QT3_SUPPORT_CONSTRUCTOR
QPalette(
const QColorGroup &active,
const QColorGroup &disabled,
const QColorGroup &inactive);
78 QPalette(
const QPalette &palette);
80 QPalette &operator=(
const QPalette &palette);
81 #ifdef Q_COMPILER_RVALUE_REFS
82 inline QPalette &operator=(QPalette &&other)
84 resolve_mask = other.resolve_mask;
85 current_group = other.current_group;
86 qSwap(d, other.d);
return *
this;
92 enum ColorGroup { Active, Disabled, Inactive, NColorGroups, Current, All, Normal = Active };
93 enum ColorRole {
WindowText, Button, Light, Midlight, Dark, Mid,
94 Text, BrightText, ButtonText, Base,
Window, Shadow,
100 NColorRoles = ToolTipText + 1,
101 Foreground = WindowText, Background = Window
108 {
return brush(cg, cr).color(); }
109 const QBrush &brush(ColorGroup cg, ColorRole cr)
const;
110 inline void setColor(ColorGroup cg, ColorRole cr,
const QColor &
color);
111 inline void setColor(ColorRole cr,
const QColor &
color);
112 inline void setBrush(ColorRole cr,
const QBrush &brush);
113 bool isBrushSet(ColorGroup cg, ColorRole cr)
const;
114 void setBrush(ColorGroup cg, ColorRole cr,
const QBrush &brush);
115 void setColorGroup(ColorGroup cr,
const QBrush &windowText,
const QBrush &button,
119 bool isEqual(ColorGroup cr1, ColorGroup cr2)
const;
146 inline QT3_SUPPORT QPalette copy()
const { QPalette
p = *
this; p.detach();
return p; }
147 QT3_SUPPORT QColorGroup normal()
const;
148 inline QT3_SUPPORT
void setNormal(
const QColorGroup &cg) { setColorGroup(Active, cg); }
150 QT3_SUPPORT QColorGroup active()
const;
151 QT3_SUPPORT QColorGroup disabled()
const;
152 QT3_SUPPORT QColorGroup inactive()
const;
153 inline QT3_SUPPORT
void setActive(
const QColorGroup &cg) { setColorGroup(Active, cg); }
154 inline QT3_SUPPORT
void setDisabled(
const QColorGroup &cg) { setColorGroup(Disabled, cg); }
155 inline QT3_SUPPORT
void setInactive(
const QColorGroup &cg) { setColorGroup(Inactive, cg); }
160 bool isCopyOf(
const QPalette &p)
const;
162 int serialNumber()
const;
165 QPalette resolve(
const QPalette &)
const;
166 inline uint
resolve()
const {
return resolve_mask; }
170 void setColorGroup(ColorGroup cr,
const QBrush &windowText,
const QBrush &button,
176 const QBrush &highlight,
const QBrush &highlighted_text,
178 void setColorGroup(ColorGroup cr,
const QBrush &windowText,
const QBrush &button,
184 const QBrush &highlight,
const QBrush &highlighted_text,
188 friend class QColorGroup;
189 void setColorGroup(ColorGroup,
const QColorGroup &);
190 QColorGroup createColorGroup(ColorGroup)
const;
196 uint current_group : 4;
197 uint resolve_mask : 28;
210 class Q_GUI_EXPORT QColorGroup :
public QPalette
213 inline QColorGroup() : QPalette() {}
214 inline QColorGroup(
const QBrush &foreground,
const QBrush &button,
const QBrush &light,
217 : QPalette(foreground, button, light, dark, mid, text, bright_text, base, background)
219 inline QColorGroup(
const QColor &foreground,
const QColor &background,
const QColor &light,
221 : QPalette(foreground, background, light, dark, mid, text, base) {}
222 inline QColorGroup(
const QColorGroup &cg) : QPalette(cg) {}
223 inline QColorGroup(
const QPalette &pal) : QPalette(pal) {}
224 bool operator==(
const QColorGroup &other)
const;
232 inline QT3_SUPPORT
const QColor &
mid()
const {
return color(Mid); }
246 #ifndef QT_NO_DATASTREAM
251 inline QColorGroup QPalette::inactive()
const {
return createColorGroup(
Inactive); }
252 inline QColorGroup QPalette::disabled()
const {
return createColorGroup(
Disabled); }
253 inline QColorGroup QPalette::active()
const {
return createColorGroup(
Active); }
254 inline QColorGroup QPalette::normal()
const {
return createColorGroup(
Active); }
261 #ifndef QT_NO_DATASTREAM
264 #endif // QT_NO_DATASTREAM
const QBrush & brush(ColorRole cr) const
Q_GUI_EXPORT QDataStream & operator<<(QDataStream &ds, const QPalette &p)
const QBrush & highlightedText() const
void setBrush(ColorRole cr, const QBrush &brush)
const QBrush & highlight() const
const QBrush & midlight() const
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
const QBrush & toolTipBase() const
const QBrush & window() const
const QColor & color(ColorGroup cg, ColorRole cr) const
const QBrush & windowText() const
const QBrush & dark() const
const QBrush & link() const
const QBrush & light() const
const QBrush & text() const
const QBrush & shadow() const
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
AttributeInstance< Color > acolor
#define QT_BEGIN_NAMESPACE
void setCurrentColorGroup(ColorGroup cg)
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
const QBrush & base() const
bool operator==(const QPalette &p) const
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &ds, QPalette &p)
const QBrush & foreground() const
bool operator!=(const QPalette &p) const
const QBrush & linkVisited() const
const QBrush & alternateBase() const
const QBrush & background() const
const QBrush & toolTipText() const
const QBrush & buttonText() const
const QBrush & brightText() const
const QBrush & button() const
const QColor & color(ColorRole cr) const
const QBrush & mid() const
ColorGroup currentColorGroup() const