<class name="QPalette" doc="/** <p>The <a href="QPalette.html#QPalette(com.trolltech.qt.gui.QColor, com.trolltech.qt.gui.QColor)"><tt>QPalette</tt></a> class contains color groups for each widget state.</p> <p>A palette consists of three color groups: <i>Active</i>, <i>Disabled</i>, and <i>Inactive</i>. All widgets in Qt contain a palette and use their palette to draw themselves. This makes the user interface easily configurable and easier to keep consistent.</p> <p>If you create a new widget we strongly recommend that you use the colors in the palette rather than hard-coding specific colors.</p> <p>The color groups:</p> <ul> <li>The Active group is used for the window that has keyboard focus.</li> <li>The Inactive group is used for other windows.</li> <li>The Disabled group is used for widgets (not windows) that are disabled for some reason.</li> </ul> <p>Both active and inactive windows can contain disabled widgets. (Disabled widgets are often called <i>inaccessible</i> or <i>grayed out</i>.)</p> <p>In most styles, Active and Inactive look the same.</p> <p>Colors and brushes can be set for particular roles in any of a palette's color groups with <a href="QPalette.html#setColor(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QColor)"><tt>setColor</tt></a> and <a href="QPalette.html#setBrush(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QBrush)"><tt>setBrush</tt></a>. A color group contains a group of colors used by widgets for drawing themselves. We recommend that widgets use color group roles from the palette such as &quot;foreground&quot; and &quot;base&quot; rather than literal colors like &quot;red&quot; or &quot;turquoise&quot;. The color roles are enumerated and defined in the <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> documentation.</p> <p>We strongly recommend that you use the default palette of the current style (returned by QApplication::palette()) and modify that as necessary. This is done by Qt's widgets when they are drawn.</p> <p>To modify a color group you call the functions <a href="QPalette.html#setColor(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QColor)"><tt>setColor</tt></a> and <a href="QPalette.html#setBrush(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QBrush)"><tt>setBrush</tt></a>, depending on whether you want a pure color or a pixmap pattern.</p> <p>There are also corresponding <a href="QPalette.html#color(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>color</tt></a> and <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> getters, and a commonly used convenience function to get the <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> for the current <a href="QPalette.html#ColorGroup-enum"><tt>ColorGroup</tt></a>: <a href="QPalette.html#window()"><tt>window</tt></a>, <a href="QPalette.html#windowText()"><tt>windowText</tt></a>, <a href="QPalette.html#base()"><tt>base</tt></a>, etc.</p> <p>You can copy a palette using the copy constructor and test to see if two palettes are <i>identical</i> using <a href="QPalette.html#isCopyOf(com.trolltech.qt.gui.QPalette)"><tt>isCopyOf</tt></a>.</p> <p><a href="QPalette.html#QPalette(com.trolltech.qt.gui.QColor, com.trolltech.qt.gui.QColor)"><tt>QPalette</tt></a> is optimized by the use of implicit sharing</tt>, so it is very efficient to pass <a href="QPalette.html#QPalette(com.trolltech.qt.gui.QColor, com.trolltech.qt.gui.QColor)"><tt>QPalette</tt></a> objects as arguments.</p> @see <tt>QApplication::setPalette</tt> @see <tt>QWidget::setPalette</tt> @see <a href="QColor.html"><tt>QColor</tt></a> */"> <method name="public QPalette(com.trolltech.qt.gui.QPalette palette)" doc="/** <p>Constructs a copy of <tt>palette</tt>.</p> <p>This constructor is fast thanks to implicit sharing</tt>.</p> */"/> <method name="public QPalette(com.trolltech.qt.gui.QColor button)" doc="/** <p>Constructs a palette from the <tt>button</tt> color. The other colors are automatically calculated, based on this color. <tt>Window</tt> will be the button color as well.</p> */"/> <method name="public QPalette(com.trolltech.qt.gui.QBrush windowText, com.trolltech.qt.gui.QBrush button, com.trolltech.qt.gui.QBrush light, com.trolltech.qt.gui.QBrush dark, com.trolltech.qt.gui.QBrush mid, com.trolltech.qt.gui.QBrush text, com.trolltech.qt.gui.QBrush bright_text, com.trolltech.qt.gui.QBrush base, com.trolltech.qt.gui.QBrush window)" doc="/** <p>Constructs a palette. You can pass either brushes, pixmaps or plain colors for <tt>windowText</tt>, <tt>button</tt>, <tt>light</tt>, <tt>dark</tt>, <tt>mid</tt>, <tt>text</tt>, <tt>bright_text</tt>, <tt>base</tt> and <tt>window</tt>.</p> @see <a href="QBrush.html"><tt>QBrush</tt></a> */"/> <method name="public QPalette(com.trolltech.qt.core.Qt.GlobalColor button)" doc="/** <p>Constructs a palette from the <tt>button</tt> color. The other colors are automatically calculated, based on this color. <tt>Window</tt> will be the button color as well.</p> */"/> <method name="public QPalette()" doc="/** <p>Constructs a palette object that uses the application's default palette.</p> @see <tt>QApplication::setPalette</tt> @see <tt>QApplication::palette</tt> */"/> <method name="public QPalette(com.trolltech.qt.gui.QColor button, com.trolltech.qt.gui.QColor window)" doc="/** <p>Constructs a palette from a <tt>button</tt> color and a <tt>window</tt>. The other colors are automatically calculated, based on these colors.</p> */"/> <method name="public final com.trolltech.qt.gui.QBrush alternateBase()" doc="/** <p>Returns the alternate base brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush base()" doc="/** <p>Returns the base brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush brightText()" doc="/** <p>Returns the bright text foreground brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush brush(com.trolltech.qt.gui.QPalette.ColorRole cr)" doc="/** <p>Returns the brush that has been set for the given color <tt>cr</tt> in the current <a href="QPalette.html#ColorGroup-enum"><tt>ColorGroup</tt></a>.</p> @see <a href="QPalette.html#color(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>color</tt></a> @see <a href="QPalette.html#setBrush(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QBrush)"><tt>setBrush</tt></a> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush brush(com.trolltech.qt.gui.QPalette.ColorGroup cg, com.trolltech.qt.gui.QPalette.ColorRole cr)" doc="/** <p>Returns the brush in the specified color <tt>cg</tt>, used for the given color <tt>cr</tt>.</p> @see <a href="QPalette.html#color(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>color</tt></a> @see <a href="QPalette.html#setBrush(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QBrush)"><tt>setBrush</tt></a> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush button()" doc="/** <p>Returns the button brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush buttonText()" doc="/** <p>Returns the button text foreground brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final long cacheKey()" doc="/** <p>Returns a number that identifies the contents of this <a href="QPalette.html#QPalette(com.trolltech.qt.gui.QColor, com.trolltech.qt.gui.QColor)"><tt>QPalette</tt></a> object. Distinct <a href="QPalette.html#QPalette(com.trolltech.qt.gui.QColor, com.trolltech.qt.gui.QColor)"><tt>QPalette</tt></a> objects can have the same key if they refer to the same contents.</p> <p>The <a href="QPalette.html#cacheKey()"><tt>cacheKey</tt></a> will change when the palette is altered.</p> */"/> <method name="public final com.trolltech.qt.gui.QColor color(com.trolltech.qt.gui.QPalette.ColorRole cr)" doc="/** <p>Returns the color that has been set for the given color <tt>cr</tt> in the current <a href="QPalette.html#ColorGroup-enum"><tt>ColorGroup</tt></a>.</p> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QColor color(com.trolltech.qt.gui.QPalette.ColorGroup cg, com.trolltech.qt.gui.QPalette.ColorRole cr)" doc="/** <p>Returns the color in the specified color <tt>cg</tt>, used for the given color <tt>cr</tt>.</p> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> @see <a href="QPalette.html#setColor(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QColor)"><tt>setColor</tt></a> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QPalette.ColorGroup currentColorGroup()" doc="/** <p>Returns the palette's current color group.</p> @see <a href="QPalette.html#setCurrentColorGroup(com.trolltech.qt.gui.QPalette.ColorGroup)"><tt>setCurrentColorGroup</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush dark()" doc="/** <p>Returns the dark brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush highlight()" doc="/** <p>Returns the highlight brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush highlightedText()" doc="/** <p>Returns the highlighted text brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final boolean isBrushSet(com.trolltech.qt.gui.QPalette.ColorGroup cg, com.trolltech.qt.gui.QPalette.ColorRole cr)" doc="/** <p>Returns true if the <a href="QPalette.html#ColorGroup-enum"><tt>ColorGroup</tt></a> <tt>cg</tt> and <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> <tt>cr</tt> has been set previously on this palette; otherwise returns false.</p> @see <a href="QPalette.html#setBrush(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QBrush)"><tt>setBrush</tt></a> */"/> <method name="public final boolean isCopyOf(com.trolltech.qt.gui.QPalette p)" doc="/** <p>Returns true if this palette and <tt>p</tt> are copies of each other, i.e&#x2e; one of them was created as a copy of the other and neither was subsequently modified; otherwise returns false. This is much stricter than equality.</p> @see <tt>operator=</tt> @see <tt>operator==</tt> */"/> <method name="public final boolean isEqual(com.trolltech.qt.gui.QPalette.ColorGroup cr1, com.trolltech.qt.gui.QPalette.ColorGroup cr2)" doc="/** <p>Returns true (usually quickly) if color group <tt>cr1</tt> is equal to <tt>cr2</tt>; otherwise returns false.</p> */"/> <method name="public final com.trolltech.qt.gui.QBrush light()" doc="/** <p>Returns the light brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush link()" doc="/** <p>Returns the unvisited link text brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush linkVisited()" doc="/** <p>Returns the visited link text brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush mid()" doc="/** <p>Returns the mid brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush midlight()" doc="/** <p>Returns the midlight brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final void writeTo(com.trolltech.qt.core.QDataStream ds)"/> <method name="public final void readFrom(com.trolltech.qt.core.QDataStream ds)"/> <method name="public final int resolve()" doc="/** <p>This method is used internally by Qt Jambi. Do not use it in your applications.</p> */"/> <method name="public final com.trolltech.qt.gui.QPalette resolve(com.trolltech.qt.gui.QPalette arg__1)" doc="/** <p>Returns a new <a href="QPalette.html#QPalette(com.trolltech.qt.gui.QColor, com.trolltech.qt.gui.QColor)"><tt>QPalette</tt></a> that has attributes copied from <tt>arg__1</tt>.</p> */"/> <method name="public final void resolve(int mask)" doc="/** <p>This method is used internally by Qt Jambi. Do not use it in your applications.</p> */"/> <method name="public final void setBrush(com.trolltech.qt.gui.QPalette.ColorGroup cg, com.trolltech.qt.gui.QPalette.ColorRole cr, com.trolltech.qt.gui.QBrush brush)" doc="/** <p>Sets the brush in the specified color <tt>cg</tt>, used for the given color <tt>cr</tt>, to <tt>brush</tt>.</p> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> @see <a href="QPalette.html#setColor(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QColor)"><tt>setColor</tt></a> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> */"/> <method name="public final void setBrush(com.trolltech.qt.gui.QPalette.ColorRole cr, com.trolltech.qt.gui.QBrush brush)" doc="/** <p>Sets the brush for the given color <tt>cr</tt> to the specified <tt>brush</tt> for all groups in the palette.</p> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> @see <a href="QPalette.html#setColor(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QColor)"><tt>setColor</tt></a> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> */"/> <method name="public final void setColor(com.trolltech.qt.gui.QPalette.ColorGroup cg, com.trolltech.qt.gui.QPalette.ColorRole cr, com.trolltech.qt.gui.QColor color)" doc="/** <p>Sets the brush in the specified color <tt>cg</tt>, used for the given color <tt>cr</tt>, to the specified solid <tt>color</tt>.</p> @see <a href="QPalette.html#setBrush(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QBrush)"><tt>setBrush</tt></a> @see <a href="QPalette.html#color(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>color</tt></a> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> */"/> <method name="public final void setColor(com.trolltech.qt.gui.QPalette.ColorRole cr, com.trolltech.qt.gui.QColor color)" doc="/** <p>Sets the color used for the given color <tt>cr</tt>, in all color groups, to the specified solid <tt>color</tt>.</p> @see <a href="QPalette.html#color(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>color</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> @see <a href="QPalette.html#setColor(com.trolltech.qt.gui.QPalette.ColorRole, com.trolltech.qt.gui.QColor)"><tt>setColor</tt></a> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> */"/> <method name="public final void setColorGroup(com.trolltech.qt.gui.QPalette.ColorGroup cr, com.trolltech.qt.gui.QBrush windowText, com.trolltech.qt.gui.QBrush button, com.trolltech.qt.gui.QBrush light, com.trolltech.qt.gui.QBrush dark, com.trolltech.qt.gui.QBrush mid, com.trolltech.qt.gui.QBrush text, com.trolltech.qt.gui.QBrush bright_text, com.trolltech.qt.gui.QBrush base, com.trolltech.qt.gui.QBrush window)" doc="/** <p>Sets a the group at <tt>cr</tt>. You can pass either brushes, pixmaps or plain colors for <tt>windowText</tt>, <tt>button</tt>, <tt>light</tt>, <tt>dark</tt>, <tt>mid</tt>, <tt>text</tt>, <tt>bright_text</tt>, <tt>base</tt> and <tt>window</tt>.</p> @see <a href="QBrush.html"><tt>QBrush</tt></a> */"/> <method name="public final void setCurrentColorGroup(com.trolltech.qt.gui.QPalette.ColorGroup cg)" doc="/** <p>Set the palette's current color group to <tt>cg</tt>.</p> @see <a href="QPalette.html#currentColorGroup()"><tt>currentColorGroup</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush shadow()" doc="/** <p>Returns the shadow brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush text()" doc="/** <p>Returns the text foreground brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush window()" doc="/** <p>Returns the window (general background) brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QBrush windowText()" doc="/** <p>Returns the window text (general foreground) brush of the current color group.</p> @see <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> @see <a href="QPalette.html#brush(com.trolltech.qt.gui.QPalette.ColorGroup, com.trolltech.qt.gui.QPalette.ColorRole)"><tt>brush</tt></a> */"/> <enum name="ColorGroup"> <enum-value name="Active" doc="/** Internal. */"/> <enum-value name="Disabled" doc="/** Internal. */"/> <enum-value name="Inactive" doc="/** Internal. */"/> <enum-value name="NColorGroups" doc="/** Internal. */"/> <enum-value name="Current" doc="/** Internal. */"/> <enum-value name="All" doc="/** Internal. */"/> <enum-value name="Normal" doc="/** <p>synonym for Active</p> */"/> </enum> <enum name="ColorRole" doc="/** <p align="center"><img src="%2E%2E/images/palette.png" alt="Color Roles" /></p><p>The <a href="QPalette.html#ColorRole-enum"><tt>ColorRole</tt></a> enum defines the different symbolic color roles used in current GUIs.</p> <p>The central roles are:</p> <p><table border="1" cellpadding="2" cellspacing="1" width="100%"> <tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr> <tr><td valign="top"><tt>Window</tt></td><td align="center" valign="top"><tt>10</tt></td><td valign="top">A general background color.</td></tr> <tr><td valign="top"><tt>Background</tt></td><td align="center" valign="top"><tt>10</tt></td><td valign="top">This value is obsolete. Use Window instead.</td></tr> <tr><td valign="top"><tt>WindowText</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">A general foreground color.</td></tr> <tr><td valign="top"><tt>Foreground</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">This value is obsolete. Use <a href="QPalette.html#ColorRole-enum"><tt>WindowText</tt></a> instead.</td></tr> <tr><td valign="top"><tt>Base</tt></td><td align="center" valign="top"><tt>9</tt></td><td valign="top">Used as the background color for text entry widgets; usually white or another light color.</td></tr> <tr><td valign="top"><tt>AlternateBase</tt></td><td align="center" valign="top"><tt>16</tt></td><td valign="top">Used as the alternate background color in views with alternating row colors (see QAbstractItemView::setAlternatingRowColors()).</td></tr> <tr><td valign="top"><tt>Text</tt></td><td align="center" valign="top"><tt>6</tt></td><td valign="top">The foreground color used with <tt>Base</tt>. This is usually the same as the <tt>WindowText</tt>, in which case it must provide good contrast with <tt>Window</tt> and <tt>Base</tt>.</td></tr> <tr><td valign="top"><tt>Button</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">The general button background color. This background can be different from <tt>Window</tt> as some styles require a different background color for buttons.</td></tr> <tr><td valign="top"><tt>ButtonText</tt></td><td align="center" valign="top"><tt>8</tt></td><td valign="top">A foreground color used with the <tt>Button</tt> color.</td></tr> <tr><td valign="top"><tt>BrightText</tt></td><td align="center" valign="top"><tt>7</tt></td><td valign="top">A text color that is very different from <tt>WindowText</tt>, and contrasts well with e.g&#x2e; <tt>Dark</tt>. Typically used for text that needs to be drawn where <tt>Text</tt> or <tt>WindowText</tt> would give poor contrast, such as on pressed push buttons. Note that text colors can be used for things other than just words; text colors are <i>usually</i> used for text, but it's quite common to use the text color roles for lines, icons, etc.</td></tr> </table></p> <p>There are some color roles used mostly for 3D bevel and shadow effects. All of these are normally derived from <tt>Window</tt>, and used in ways that depend on that relationship. For example, buttons depend on it to make the bevels look attractive, and Motif scroll bars depend on <tt>Mid</tt> to be slightly different from <tt>Window</tt>.</p> <p><table border="1" cellpadding="2" cellspacing="1" width="100%"> <tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr> <tr><td valign="top"><tt>Light</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">Lighter than <tt>Button</tt> color.</td></tr> <tr><td valign="top"><tt>Midlight</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Between <tt>Button</tt> and <tt>Light</tt>.</td></tr> <tr><td valign="top"><tt>Dark</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">Darker than <tt>Button</tt>.</td></tr> <tr><td valign="top"><tt>Mid</tt></td><td align="center" valign="top"><tt>5</tt></td><td valign="top">Between <tt>Button</tt> and <tt>Dark</tt>.</td></tr> <tr><td valign="top"><tt>Shadow</tt></td><td align="center" valign="top"><tt>11</tt></td><td valign="top">A very dark color. By default, the shadow color is Qt::black.</td></tr> </table></p> <p>Selected (marked) items have two roles:</p> <p><table border="1" cellpadding="2" cellspacing="1" width="100%"> <tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr> <tr><td valign="top"><tt>Highlight</tt></td><td align="center" valign="top"><tt>12</tt></td><td valign="top">A color to indicate a selected item or the current item. By default, the highlight color is Qt::darkBlue.</td></tr> <tr><td valign="top"><tt>HighlightedText</tt></td><td align="center" valign="top"><tt>13</tt></td><td valign="top">A text color that contrasts with <tt>Highlight</tt>. By default, the highlighted text color is Qt::white.</td></tr> </table></p> <p>There are two color roles related to hyperlinks:</p> <p><table border="1" cellpadding="2" cellspacing="1" width="100%"> <tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr> <tr><td valign="top"><tt>Link</tt></td><td align="center" valign="top"><tt>14</tt></td><td valign="top">A text color used for unvisited hyperlinks. By default, the link color is Qt::blue.</td></tr> <tr><td valign="top"><tt>LinkVisited</tt></td><td align="center" valign="top"><tt>15</tt></td><td valign="top">A text color used for already visited hyperlinks. By default, the linkvisited color is Qt::magenta.</td></tr> </table></p> <p>Note that we do not use the <tt>Link</tt> and <tt>LinkVisited</tt> roles when rendering rich text in Qt, and that we recommend that you use CSS and the QTextDocument::setDefaultStyleSheet() function to alter the appearance of links. For example:</p> <pre> QTextBrowser browser; QColor linkColor(Qt::red); QString sheet = QString::fromLatin1(&quot;a { text-decoration: underline; color: %1 }&quot;).arg(linkColor.name()); browser.document()-&gt;setDefaultStyleSheet(sheet);</pre> */"> <enum-value name="WindowText" doc="/** <p>A general foreground color.</p> */"/> <enum-value name="Button" doc="/** <p>The general button background color. This background can be different from <tt>Window</tt> as some styles require a different background color for buttons.</p> */"/> <enum-value name="Light" doc="/** <p>Lighter than <tt>Button</tt> color.</p> */"/> <enum-value name="Midlight" doc="/** <p>Between <tt>Button</tt> and <tt>Light</tt>.</p> */"/> <enum-value name="Dark" doc="/** <p>Darker than <tt>Button</tt>.</p> */"/> <enum-value name="Mid" doc="/** <p>Between <tt>Button</tt> and <tt>Dark</tt>.</p> */"/> <enum-value name="Text" doc="/** <p>The foreground color used with <tt>Base</tt>. This is usually the same as the <tt>WindowText</tt>, in which case it must provide good contrast with <tt>Window</tt> and <tt>Base</tt>.</p> */"/> <enum-value name="BrightText" doc="/** <p>A text color that is very different from <tt>WindowText</tt>, and contrasts well with e.g&#x2e; <tt>Dark</tt>. Typically used for text that needs to be drawn where <tt>Text</tt> or <tt>WindowText</tt> would give poor contrast, such as on pressed push buttons. Note that text colors can be used for things other than just words; text colors are <i>usually</i> used for text, but it's quite common to use the text color roles for lines, icons, etc.</p> */"/> <enum-value name="ButtonText" doc="/** <p>A foreground color used with the <tt>Button</tt> color.</p> */"/> <enum-value name="Base" doc="/** <p>Used as the background color for text entry widgets; usually white or another light color.</p> */"/> <enum-value name="Window" doc="/** <p>A general background color.</p> */"/> <enum-value name="Shadow" doc="/** <p>A very dark color. By default, the shadow color is Qt::black.</p> */"/> <enum-value name="Highlight" doc="/** <p>A color to indicate a selected item or the current item. By default, the highlight color is Qt::darkBlue.</p> */"/> <enum-value name="HighlightedText" doc="/** <p>A text color that contrasts with <tt>Highlight</tt>. By default, the highlighted text color is Qt::white.</p> */"/> <enum-value name="Link" doc="/** <p>A text color used for unvisited hyperlinks. By default, the link color is Qt::blue.</p> */"/> <enum-value name="LinkVisited" doc="/** <p>A text color used for already visited hyperlinks. By default, the linkvisited color is Qt::magenta.</p> */"/> <enum-value name="AlternateBase" doc="/** <p>Used as the alternate background color in views with alternating row colors (see QAbstractItemView::setAlternatingRowColors()).</p> */"/> <enum-value name="NoRole" doc="/** Internal. */"/> <enum-value name="NColorRoles" doc="/** Internal. */"/> <enum-value name="Foreground" doc="/** <p>This value is obsolete. Use <a href="QPalette.html#ColorRole-enum"><tt>WindowText</tt></a> instead.</p> */"/> <enum-value name="Background" doc="/** <p>This value is obsolete. Use Window instead.</p> */"/> </enum> </class>