- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Friends

# QPalette Class Reference

Search for all occurrences

## Detailed Description

Definition at line 61 of file qpalette.h.

`#include <qpalette.h>`

List of all members.

## Public Types
enum | ColorGroup { Active, Disabled, Inactive, NColorGroups, Current, All, Normal = Active }
enum | ColorRole { WindowText, Button, Light, Midlight, Dark, Mid, Text, BrightText, ButtonText, Base, Window, Shadow, Highlight, HighlightedText, Link, LinkVisited, AlternateBase, NoRole, ToolTipBase, ToolTipText, NColorRoles = ToolTipText + 1, Foreground = WindowText, Background = Window }
## Public Member Functions
| QPalette ()
| QPalette (const QColor &button)
| QPalette (Qt::GlobalColor button)
| QPalette (const QColor &button, const QColor &window)
| QPalette (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)
| QPalette (const QColor &windowText, const QColor &window, const QColor &light, const QColor &dark, const QColor &mid, const QColor &text, const QColor &base)
| QPalette (const QPalette &palette)
| ~QPalette ()
QPalette & | operator= (const QPalette &palette)
| operator QVariant () const
ColorGroup | currentColorGroup () const
void | setCurrentColorGroup (ColorGroup cg)
const QColor & | color (ColorGroup cg, ColorRole cr) const
const QBrush & | brush (ColorGroup cg, ColorRole cr) const
void | setColor (ColorGroup cg, ColorRole cr, const QColor &color)
void | setColor (ColorRole cr, const QColor &color)
void | setBrush (ColorRole cr, const QBrush &brush)
bool | isBrushSet (ColorGroup cg, ColorRole cr) const
void | setBrush (ColorGroup cg, ColorRole cr, const QBrush &brush)
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)
bool | isEqual (ColorGroup cr1, ColorGroup cr2) const
const QColor & | color (ColorRole cr) const
const QBrush & | brush (ColorRole cr) const
const QBrush & | foreground () const
const QBrush & | windowText () const
const QBrush & | button () const
const QBrush & | light () const
const QBrush & | dark () const
const QBrush & | mid () const
const QBrush & | text () const
const QBrush & | base () const
const QBrush & | alternateBase () const
const QBrush & | toolTipBase () const
const QBrush & | toolTipText () const
const QBrush & | background () const
const QBrush & | window () const
const QBrush & | midlight () const
const QBrush & | brightText () const
const QBrush & | buttonText () const
const QBrush & | shadow () const
const QBrush & | highlight () const
const QBrush & | highlightedText () const
const QBrush & | link () const
const QBrush & | linkVisited () const
bool | operator== (const QPalette &p) const
bool | operator!= (const QPalette &p) const
bool | isCopyOf (const QPalette &p) const
int | serialNumber () const
qint64 | cacheKey () const
QPalette | resolve (const QPalette &) const
uint | resolve () const
void | resolve (uint mask)
## Friends
Q_GUI_EXPORT QDataStream & | operator<< (QDataStream &s, const QPalette &p)

## Member Enumeration Documentation

enum ColorGroup

Search for all occurrences

Enumerator:

  Active | Search for all occurrences
  Disabled | Search for all occurrences
  Inactive | Search for all occurrences
  NColorGroups | Search for all occurrences
  Current | Search for all occurrences
  All | Search for all occurrences
  Normal | Search for all occurrences

Definition at line 84 of file qpalette.h.

    { Active, Disabled, Inactive, NColorGroups, Current, All, Normal = Active };

enum ColorRole

Search for all occurrences

Enumerator:

  WindowText | Search for all occurrences
  Button | Search for all occurrences
  Light | Search for all occurrences
  Midlight | Search for all occurrences
  Dark | Search for all occurrences
  Mid | Search for all occurrences
  Text | Search for all occurrences
  BrightText | Search for all occurrences
  ButtonText | Search for all occurrences
  Base | Search for all occurrences
  Window | Search for all occurrences
  Shadow | Search for all occurrences
  Highlight | Search for all occurrences
  HighlightedText | Search for all occurrences
  Link | Search for all occurrences
  LinkVisited | Search for all occurrences
  AlternateBase | Search for all occurrences
  NoRole | Search for all occurrences
  ToolTipBase | Search for all occurrences
  ToolTipText | Search for all occurrences
  NColorRoles | Search for all occurrences
  Foreground | Search for all occurrences
  Background | Search for all occurrences

Definition at line 85 of file qpalette.h.

                       { WindowText, Button, Light, Midlight, Dark, Mid,
                         Text, BrightText, ButtonText, Base, Window, Shadow,
                         Highlight, HighlightedText,
                         Link, LinkVisited, // ### Qt 5: remove
                         AlternateBase,
                         NoRole, // ### Qt 5: value should be 0 or -1
                         ToolTipBase, ToolTipText,
                         NColorRoles = ToolTipText + 1,
                         Foreground = WindowText, Background = Window // ### Qt 5: remove
                       };

## Constructor & Destructor Documentation

QPalette | ( |  | ) |

QPalette | ( | const QColor & | button | ) |

QPalette | ( | Qt::GlobalColor | button | ) |

QPalette | ( | const QColor & | button,
|  | const QColor & | window
| ) |  |

QPalette | ( | 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
| ) |  |

QPalette | ( | const QColor & | windowText,
|  | const QColor & | window,
|  | const QColor & | light,
|  | const QColor & | dark,
|  | const QColor & | mid,
|  | const QColor & | text,
|  | const QColor & | base
| ) |  |

QPalette | ( | const QPalette & | palette | ) |

~QPalette | ( |  | ) |

## Member Function Documentation

QPalette& operator= | ( | const QPalette & | palette | ) |

operator QVariant | ( |  | ) | const

ColorGroup currentColorGroup | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 96 of file qpalette.h.

    { return static_cast<ColorGroup>(current_group); }

void setCurrentColorGroup | ( | ColorGroup | cg | ) | `[inline]`

Search for all occurrences

Definition at line 97 of file qpalette.h.

    { current_group = cg; }

const QColor& color | ( | ColorGroup | cg,
|  | ColorRole | cr
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 99 of file qpalette.h.

        { return brush(cg, cr).color(); }

const QBrush& brush | ( | ColorGroup | cg,
|  | ColorRole | cr
| ) |  | const

Search for all occurrences

void setColor | ( | ColorGroup | cg,
|  | ColorRole | cr,
|  | const QColor & | color
| ) |  | `[inline]`

Search for all occurrences

Definition at line 193 of file qpalette.h.

    { setBrush(acg, acr, QBrush(acolor)); }

void setColor | ( | ColorRole | cr,
|  | const QColor & | color
| ) |  | `[inline]`

Search for all occurrences

Definition at line 196 of file qpalette.h.

    { setColor(All, acr, acolor); }

void setBrush | ( | ColorRole | cr,
|  | const QBrush & | brush
| ) |  | `[inline]`

Search for all occurrences

Definition at line 198 of file qpalette.h.

    { setBrush(All, acr, abrush); }

bool isBrushSet | ( | ColorGroup | cg,
|  | ColorRole | cr
| ) |  | const

Search for all occurrences

void setBrush | ( | ColorGroup | cg,
|  | ColorRole | cr,
|  | const QBrush & | brush
| ) |  |

Search for all occurrences

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
| ) |  |

Search for all occurrences

bool isEqual | ( | ColorGroup | cr1,
|  | ColorGroup | cr2
| ) |  | const

Search for all occurrences

const QColor& color | ( | ColorRole | cr | ) | const `[inline]`

Search for all occurrences

Definition at line 113 of file qpalette.h.

    { return color(Current, cr); }

const QBrush& brush | ( | ColorRole | cr | ) | const `[inline]`

Search for all occurrences

Definition at line 114 of file qpalette.h.

    { return brush(Current, cr); }

const QBrush& foreground | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 115 of file qpalette.h.

    { return brush(WindowText); }

const QBrush& windowText | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 116 of file qpalette.h.

    { return brush(WindowText); }

const QBrush& button | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 117 of file qpalette.h.

    { return brush(Button); }

const QBrush& light | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 118 of file qpalette.h.

    { return brush(Light); }

const QBrush& dark | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 119 of file qpalette.h.

    { return brush(Dark); }

const QBrush& mid | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 120 of file qpalette.h.

    { return brush(Mid); }

const QBrush& text | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 121 of file qpalette.h.

    { return brush(Text); }

const QBrush& base | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 122 of file qpalette.h.

    { return brush(Base); }

const QBrush& alternateBase | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 123 of file qpalette.h.

    { return brush(AlternateBase); }

const QBrush& toolTipBase | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 124 of file qpalette.h.

    { return brush(ToolTipBase); }

const QBrush& toolTipText | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 125 of file qpalette.h.

    { return brush(ToolTipText); }

const QBrush& background | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 126 of file qpalette.h.

    { return brush(Window); }

const QBrush& window | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 127 of file qpalette.h.

    { return brush(Window); }

const QBrush& midlight | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 128 of file qpalette.h.

    { return brush(Midlight); }

const QBrush& brightText | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 129 of file qpalette.h.

    { return brush(BrightText); }

const QBrush& buttonText | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 130 of file qpalette.h.

    { return brush(ButtonText); }

const QBrush& shadow | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 131 of file qpalette.h.

    { return brush(Shadow); }

const QBrush& highlight | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 132 of file qpalette.h.

    { return brush(Highlight); }

const QBrush& highlightedText | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 133 of file qpalette.h.

    { return brush(HighlightedText); }

const QBrush& link | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 134 of file qpalette.h.

    { return brush(Link); }

const QBrush& linkVisited | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 135 of file qpalette.h.

    { return brush(LinkVisited); }

bool operator== | ( | const QPalette & | p | ) | const

bool operator!= | ( | const QPalette & | p | ) | const `[inline]`

Definition at line 151 of file qpalette.h.

    { return !(operator==(p)); }

bool isCopyOf | ( | const QPalette & | p | ) | const

Search for all occurrences

int serialNumber | ( |  | ) | const

Search for all occurrences

qint64 cacheKey | ( |  | ) | const

Search for all occurrences

QPalette resolve | ( | const QPalette & |  | ) | const

Search for all occurrences

uint resolve | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 158 of file qpalette.h.

    { return resolve_mask; }

void resolve | ( | uint | mask | ) | `[inline]`

Search for all occurrences

Definition at line 159 of file qpalette.h.

    { resolve_mask = mask; }

## Friends And Related Function Documentation

Q_GUI_EXPORT QDataStream& operator<< | ( | QDataStream & | s,
|  | const QPalette & | p
| ) |  | `[friend]`

The documentation for this class was generated from the following file:

- QtGui/qpalette.h

QPalette QPalette QPalette QPalette QPalette QPalette QPalette QPalette QPalette QPalette
QPalette QPalette QPalette QPalette QPalette QPalette QPalette QPalette QPalette QPalette