Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6119

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qpalette.cpp -->
  <title>Qt 4.8: QPalette Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QPalette</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QPalette Class Reference</h1>
<!-- $$$QPalette-brief -->
<p>The QPalette class contains color groups for each widget state. <a href="#details">More...</a></p>
<!-- @@@QPalette -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QPalette&gt;</span></pre><p><b>Inherited by: </b><a href="qcolorgroup.html" class="compat">QColorGroup</a>.</p>
<ul>
<li><a href="qpalette-members.html">List of all members, including inherited members</a></li>
<li><a href="qpalette-obsolete.html">Obsolete members</a></li>
<li><a href="qpalette-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#ColorGroup-enum">ColorGroup</a></b> { Disabled, Active, Inactive, Normal }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#ColorRole-enum">ColorRole</a></b> { Window, Background, WindowText, Foreground, ..., NoRole }</td></tr>
</table>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#QPalette">QPalette</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#QPalette-2">QPalette</a></b> ( const QColor &amp; <i>button</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#QPalette-3">QPalette</a></b> ( Qt::GlobalColor <i>button</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#QPalette-4">QPalette</a></b> ( const QColor &amp; <i>button</i>, const QColor &amp; <i>window</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#QPalette-5">QPalette</a></b> ( const QBrush &amp; <i>windowText</i>, const QBrush &amp; <i>button</i>, const QBrush &amp; <i>light</i>, const QBrush &amp; <i>dark</i>, const QBrush &amp; <i>mid</i>, const QBrush &amp; <i>text</i>, const QBrush &amp; <i>bright_text</i>, const QBrush &amp; <i>base</i>, const QBrush &amp; <i>window</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#QPalette-8">QPalette</a></b> ( const QPalette &amp; <i>p</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#dtor.QPalette">~QPalette</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#alternateBase">alternateBase</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#base">base</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#brightText">brightText</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#brush">brush</a></b> ( ColorGroup <i>group</i>, ColorRole <i>role</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#brush-2">brush</a></b> ( ColorRole <i>role</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#button">button</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#buttonText">buttonText</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#cacheKey">cacheKey</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QColor &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#color">color</a></b> ( ColorGroup <i>group</i>, ColorRole <i>role</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QColor &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#color-2">color</a></b> ( ColorRole <i>role</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> ColorGroup </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#currentColorGroup">currentColorGroup</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#dark">dark</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#highlight">highlight</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#highlightedText">highlightedText</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#isBrushSet">isBrushSet</a></b> ( ColorGroup <i>cg</i>, ColorRole <i>cr</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#isCopyOf">isCopyOf</a></b> ( const QPalette &amp; <i>p</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#isEqual">isEqual</a></b> ( ColorGroup <i>cg1</i>, ColorGroup <i>cg2</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#light">light</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#link">link</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#linkVisited">linkVisited</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#mid">mid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#midlight">midlight</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPalette </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#resolve">resolve</a></b> ( const QPalette &amp; <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#setBrush">setBrush</a></b> ( ColorRole <i>role</i>, const QBrush &amp; <i>brush</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#setBrush-2">setBrush</a></b> ( ColorGroup <i>group</i>, ColorRole <i>role</i>, const QBrush &amp; <i>brush</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#setColor">setColor</a></b> ( ColorGroup <i>group</i>, ColorRole <i>role</i>, const QColor &amp; <i>color</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#setColor-2">setColor</a></b> ( ColorRole <i>role</i>, const QColor &amp; <i>color</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#setColorGroup">setColorGroup</a></b> ( ColorGroup <i>cg</i>, const QBrush &amp; <i>windowText</i>, const QBrush &amp; <i>button</i>, const QBrush &amp; <i>light</i>, const QBrush &amp; <i>dark</i>, const QBrush &amp; <i>mid</i>, const QBrush &amp; <i>text</i>, const QBrush &amp; <i>bright_text</i>, const QBrush &amp; <i>base</i>, const QBrush &amp; <i>window</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#setCurrentColorGroup">setCurrentColorGroup</a></b> ( ColorGroup <i>cg</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#shadow">shadow</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#text">text</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#toolTipBase">toolTipBase</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#toolTipText">toolTipText</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#window">window</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QBrush &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#windowText">windowText</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#operator-QVariant">operator QVariant</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#operator-not-eq">operator!=</a></b> ( const QPalette &amp; <i>p</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPalette &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#operator-eq">operator=</a></b> ( const QPalette &amp; <i>p</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#operator-eq-eq">operator==</a></b> ( const QPalette &amp; <i>p</i> ) const</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#operator-lt-lt-35">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>s</i>, const QPalette &amp; <i>p</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpalette.html#operator-gt-gt-22">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>s</i>, QPalette &amp; <i>p</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QPalette-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QPalette 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">setColor</a>() and <a href="qpalette.html#setBrush">setBrush</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">ColorRole</a> documentation.</p>
<p>We strongly recommend that you use the default palette of the current style (returned by <a href="qapplication.html#palette">QApplication::palette</a>()) 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">setColor</a>() and <a href="qpalette.html#setBrush">setBrush</a>(), depending on whether you want a pure color or a pixmap pattern.</p>
<p>There are also corresponding <a href="qpalette.html#color">color</a>() and <a href="qpalette.html#brush">brush</a>() getters, and a commonly used convenience function to get the <a href="qpalette.html#ColorRole-enum">ColorRole</a> for the current <a href="qpalette.html#ColorGroup-enum">ColorGroup</a>: <a href="qpalette.html#window">window</a>(), <a href="qpalette.html#windowText">windowText</a>(), <a href="qpalette.html#base">base</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">isCopyOf</a>().</p>
<p>QPalette is optimized by the use of <a href="implicit-sharing.html">implicit sharing</a>, so it is very efficient to pass QPalette objects as arguments.</p>
<p><b>Warning:</b> Some styles do not use the palette for all drawing, for instance, if they make use of native theme engines. This is the case for both the Windows XP, Windows Vista, and the Mac OS X styles.</p>
</div>
<p><b>See also </b><a href="qapplication.html#setPalette">QApplication::setPalette</a>(), <a href="qwidget.html#palette-prop">QWidget::setPalette</a>(), and <a href="qcolor.html">QColor</a>.</p>
<!-- @@@QPalette -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ColorGroup$$$Active$$$Disabled$$$Inactive$$$NColorGroups$$$Current$$$All$$$Normal -->
<h3 class="fn"><a name="ColorGroup-enum"></a>enum QPalette::<span class="name">ColorGroup</span></h3>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QPalette::Disabled</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QPalette::Active</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QPalette::Inactive</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">&nbsp;</td></tr>
<tr><td class="topAlign"><tt>QPalette::Normal</tt></td><td class="topAlign"><tt>Active</tt></td><td class="topAlign">synonym for Active</td></tr>
</table>
<!-- @@@ColorGroup -->
<!-- $$$ColorRole$$$WindowText$$$Button$$$Light$$$Midlight$$$Dark$$$Mid$$$Text$$$BrightText$$$ButtonText$$$Base$$$Window$$$Shadow$$$Highlight$$$HighlightedText$$$Link$$$LinkVisited$$$AlternateBase$$$NoRole$$$ToolTipBase$$$ToolTipText$$$NColorRoles$$$Foreground$$$Background -->
<h3 class="fn"><a name="ColorRole-enum"></a>enum QPalette::<span class="name">ColorRole</span></h3>
<p class="centerAlign"><img src="images/palette.png" alt="Color Roles" /></p><p>The ColorRole enum defines the different symbolic color roles used in current GUIs.</p>
<p>The central roles are:</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QPalette::Window</tt></td><td class="topAlign"><tt>10</tt></td><td class="topAlign">A general background color.</td></tr>
<tr><td class="topAlign"><tt>QPalette::Background</tt></td><td class="topAlign"><tt>Window</tt></td><td class="topAlign">This value is obsolete. Use Window instead.</td></tr>
<tr><td class="topAlign"><tt>QPalette::WindowText</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">A general foreground color.</td></tr>
<tr><td class="topAlign"><tt>QPalette::Foreground</tt></td><td class="topAlign"><tt>WindowText</tt></td><td class="topAlign">This value is obsolete. Use WindowText instead.</td></tr>
<tr><td class="topAlign"><tt>QPalette::Base</tt></td><td class="topAlign"><tt>9</tt></td><td class="topAlign">Used mostly as the background color for text entry widgets, but can also be used for other painting - such as the background of combobox drop down lists and toolbar handles. It is usually white or another light color.</td></tr>
<tr><td class="topAlign"><tt>QPalette::AlternateBase</tt></td><td class="topAlign"><tt>16</tt></td><td class="topAlign">Used as the alternate background color in views with alternating row colors (see <a href="qabstractitemview.html#alternatingRowColors-prop">QAbstractItemView::setAlternatingRowColors</a>()).</td></tr>
<tr><td class="topAlign"><tt>QPalette::ToolTipBase</tt></td><td class="topAlign"><tt>18</tt></td><td class="topAlign">Used as the background color for <a href="qtooltip.html">QToolTip</a> and <a href="qwhatsthis.html">QWhatsThis</a>. Tool tips use the Inactive color group of <a href="qpalette.html">QPalette</a>, because tool tips are not active windows.</td></tr>
<tr><td class="topAlign"><tt>QPalette::ToolTipText</tt></td><td class="topAlign"><tt>19</tt></td><td class="topAlign">Used as the foreground color for <a href="qtooltip.html">QToolTip</a> and <a href="qwhatsthis.html">QWhatsThis</a>. Tool tips use the Inactive color group of <a href="qpalette.html">QPalette</a>, because tool tips are not active windows.</td></tr>
<tr><td class="topAlign"><tt>QPalette::Text</tt></td><td class="topAlign"><tt>6</tt></td><td class="topAlign">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 class="topAlign"><tt>QPalette::Button</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">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 class="topAlign"><tt>QPalette::ButtonText</tt></td><td class="topAlign"><tt>8</tt></td><td class="topAlign">A foreground color used with the <tt>Button</tt> color.</td></tr>
<tr><td class="topAlign"><tt>QPalette::BrightText</tt></td><td class="topAlign"><tt>7</tt></td><td class="topAlign">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>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>
<table class="valuelist"><tr valign="top" class="even"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QPalette::Light</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">Lighter than <tt>Button</tt> color.</td></tr>
<tr><td class="topAlign"><tt>QPalette::Midlight</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">Between <tt>Button</tt> and <tt>Light</tt>.</td></tr>
<tr><td class="topAlign"><tt>QPalette::Dark</tt></td><td class="topAlign"><tt>4</tt></td><td class="topAlign">Darker than <tt>Button</tt>.</td></tr>
<tr><td class="topAlign"><tt>QPalette::Mid</tt></td><td class="topAlign"><tt>5</tt></td><td class="topAlign">Between <tt>Button</tt> and <tt>Dark</tt>.</td></tr>
<tr><td class="topAlign"><tt>QPalette::Shadow</tt></td><td class="topAlign"><tt>11</tt></td><td class="topAlign">A very dark color. By default, the shadow color is <a href="qt.html#GlobalColor-enum">Qt::black</a>.</td></tr>
</table>
<p>Selected (marked) items have two roles:</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QPalette::Highlight</tt></td><td class="topAlign"><tt>12</tt></td><td class="topAlign">A color to indicate a selected item or the current item. By default, the highlight color is <a href="qt.html#GlobalColor-enum">Qt::darkBlue</a>.</td></tr>
<tr><td class="topAlign"><tt>QPalette::HighlightedText</tt></td><td class="topAlign"><tt>13</tt></td><td class="topAlign">A text color that contrasts with <tt>Highlight</tt>. By default, the highlighted text color is <a href="qt.html#GlobalColor-enum">Qt::white</a>.</td></tr>
</table>
<p>There are two color roles related to hyperlinks:</p>
<table class="valuelist"><tr valign="top" class="even"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QPalette::Link</tt></td><td class="topAlign"><tt>14</tt></td><td class="topAlign">A text color used for unvisited hyperlinks. By default, the link color is <a href="qt.html#GlobalColor-enum">Qt::blue</a>.</td></tr>
<tr><td class="topAlign"><tt>QPalette::LinkVisited</tt></td><td class="topAlign"><tt>15</tt></td><td class="topAlign">A text color used for already visited hyperlinks. By default, the linkvisited color is <a href="qt.html#GlobalColor-enum">Qt::magenta</a>.</td></tr>
</table>
<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 <a href="qtextdocument.html#defaultStyleSheet-prop">QTextDocument::setDefaultStyleSheet</a>() function to alter the appearance of links. For example:</p>
<pre class="cpp">     <span class="type"><a href="qtextbrowser.html">QTextBrowser</a></span> browser;
     <span class="type"><a href="qcolor.html">QColor</a></span> linkColor(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>red);
     <span class="type"><a href="qstring.html">QString</a></span> sheet <span class="operator">=</span> <span class="type"><a href="qstring.html">QString</a></span><span class="operator">::</span>fromLatin1(<span class="string">&quot;a { text-decoration: underline; color: %1 }&quot;</span>)<span class="operator">.</span>arg(linkColor<span class="operator">.</span>name());
     browser<span class="operator">.</span>document()<span class="operator">-</span><span class="operator">&gt;</span>setDefaultStyleSheet(sheet);</pre>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QPalette::NoRole</tt></td><td class="topAlign"><tt>17</tt></td><td class="topAlign">No role; this special role is often used to indicate that a role has not been assigned.</td></tr>
</table>
<!-- @@@ColorRole -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPalette[overload1]$$$QPalette -->
<h3 class="fn"><a name="QPalette"></a>QPalette::<span class="name">QPalette</span> ()</h3>
<p>Constructs a palette object that uses the application's default palette.</p>
<p><b>See also </b><a href="qapplication.html#setPalette">QApplication::setPalette</a>() and <a href="qapplication.html#palette">QApplication::palette</a>().</p>
<!-- @@@QPalette -->
<!-- $$$QPalette$$$QPaletteconstQColor& -->
<h3 class="fn"><a name="QPalette-2"></a>QPalette::<span class="name">QPalette</span> ( const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; <i>button</i> )</h3>
<p>Constructs a palette from the <i>button</i> color. The other colors are automatically calculated, based on this color. <tt>Window</tt> will be the button color as well.</p>
<!-- @@@QPalette -->
<!-- $$$QPalette$$$QPaletteQt::GlobalColor -->
<h3 class="fn"><a name="QPalette-3"></a>QPalette::<span class="name">QPalette</span> ( <span class="type"><a href="qt.html#GlobalColor-enum">Qt::GlobalColor</a></span> <i>button</i> )</h3>
<p>Constructs a palette from the <i>button</i> color. The other colors are automatically calculated, based on this color. <tt>Window</tt> will be the button color as well.</p>
<!-- @@@QPalette -->
<!-- $$$QPalette$$$QPaletteconstQColor&constQColor& -->
<h3 class="fn"><a name="QPalette-4"></a>QPalette::<span class="name">QPalette</span> ( const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; <i>button</i>, const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; <i>window</i> )</h3>
<p>Constructs a palette from a <i>button</i> color and a <i>window</i>. The other colors are automatically calculated, based on these colors.</p>
<!-- @@@QPalette -->
<!-- $$$QPalette$$$QPaletteconstQBrush&constQBrush&constQBrush&constQBrush&constQBrush&constQBrush&constQBrush&constQBrush&constQBrush& -->
<h3 class="fn"><a name="QPalette-5"></a>QPalette::<span class="name">QPalette</span> ( const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>windowText</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>button</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>light</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>dark</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>mid</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>text</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>bright_text</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>base</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>window</i> )</h3>
<p>Constructs a palette. You can pass either brushes, pixmaps or plain colors for <i>windowText</i>, <i>button</i>, <i>light</i>, <i>dark</i>, <i>mid</i>, <i>text</i>, <i>bright_text</i>, <i>base</i> and <i>window</i>.</p>
<p><b>See also </b><a href="qbrush.html">QBrush</a>.</p>
<!-- @@@QPalette -->
<!-- $$$QPalette$$$QPaletteconstQPalette& -->
<h3 class="fn"><a name="QPalette-8"></a>QPalette::<span class="name">QPalette</span> ( const <span class="type">QPalette</span> &amp; <i>p</i> )</h3>
<p>Constructs a copy of <i>p</i>.</p>
<p>This constructor is fast thanks to <a href="implicit-sharing.html">implicit sharing</a>.</p>
<!-- @@@QPalette -->
<!-- $$$~QPalette[overload1]$$$~QPalette -->
<h3 class="fn"><a name="dtor.QPalette"></a>QPalette::<span class="name">~QPalette</span> ()</h3>
<p>Destroys the palette.</p>
<!-- @@@~QPalette -->
<!-- $$$alternateBase[overload1]$$$alternateBase -->
<h3 class="fn"><a name="alternateBase"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">alternateBase</span> () const</h3>
<p>Returns the alternate base brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@alternateBase -->
<!-- $$$base[overload1]$$$base -->
<h3 class="fn"><a name="base"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">base</span> () const</h3>
<p>Returns the base brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@base -->
<!-- $$$brightText[overload1]$$$brightText -->
<h3 class="fn"><a name="brightText"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">brightText</span> () const</h3>
<p>Returns the bright text foreground brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@brightText -->
<!-- $$$brush[overload1]$$$brushColorGroupColorRole -->
<h3 class="fn"><a name="brush"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">brush</span> ( <span class="type"><a href="qpalette.html#ColorGroup-enum">ColorGroup</a></span> <i>group</i>, <span class="type"><a href="qpalette.html#ColorRole-enum">ColorRole</a></span> <i>role</i> ) const</h3>
<p>Returns the brush in the specified color <i>group</i>, used for the given color <i>role</i>.</p>
<p><b>See also </b><a href="qpalette.html#color">color</a>(), <a href="qpalette.html#setBrush">setBrush</a>(), and <a href="qpalette.html#ColorRole-enum">ColorRole</a>.</p>
<!-- @@@brush -->
<!-- $$$brush$$$brushColorRole -->
<h3 class="fn"><a name="brush-2"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">brush</span> ( <span class="type"><a href="qpalette.html#ColorRole-enum">ColorRole</a></span> <i>role</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the brush that has been set for the given color <i>role</i> in the current <a href="qpalette.html#ColorGroup-enum">ColorGroup</a>.</p>
<p><b>See also </b><a href="qpalette.html#color">color</a>(), <a href="qpalette.html#setBrush">setBrush</a>(), and <a href="qpalette.html#ColorRole-enum">ColorRole</a>.</p>
<!-- @@@brush -->
<!-- $$$button[overload1]$$$button -->
<h3 class="fn"><a name="button"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">button</span> () const</h3>
<p>Returns the button brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@button -->
<!-- $$$buttonText[overload1]$$$buttonText -->
<h3 class="fn"><a name="buttonText"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">buttonText</span> () const</h3>
<p>Returns the button text foreground brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@buttonText -->
<!-- $$$cacheKey[overload1]$$$cacheKey -->
<h3 class="fn"><a name="cacheKey"></a><span class="type"><a href="qtglobal.html#qint64-typedef">qint64</a></span> QPalette::<span class="name">cacheKey</span> () const</h3>
<p>Returns a number that identifies the contents of this <a href="qpalette.html">QPalette</a> object. Distinct <a href="qpalette.html">QPalette</a> objects can have the same key if they refer to the same contents.</p>
<p>The cacheKey() will change when the palette is altered.</p>
<!-- @@@cacheKey -->
<!-- $$$color[overload1]$$$colorColorGroupColorRole -->
<h3 class="fn"><a name="color"></a>const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; QPalette::<span class="name">color</span> ( <span class="type"><a href="qpalette.html#ColorGroup-enum">ColorGroup</a></span> <i>group</i>, <span class="type"><a href="qpalette.html#ColorRole-enum">ColorRole</a></span> <i>role</i> ) const</h3>
<p>Returns the color in the specified color <i>group</i>, used for the given color <i>role</i>.</p>
<p><b>See also </b><a href="qpalette.html#brush">brush</a>(), <a href="qpalette.html#setColor">setColor</a>(), and <a href="qpalette.html#ColorRole-enum">ColorRole</a>.</p>
<!-- @@@color -->
<!-- $$$color$$$colorColorRole -->
<h3 class="fn"><a name="color-2"></a>const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; QPalette::<span class="name">color</span> ( <span class="type"><a href="qpalette.html#ColorRole-enum">ColorRole</a></span> <i>role</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the color that has been set for the given color <i>role</i> in the current <a href="qpalette.html#ColorGroup-enum">ColorGroup</a>.</p>
<p><b>See also </b><a href="qpalette.html#brush">brush</a>() and <a href="qpalette.html#ColorRole-enum">ColorRole</a>.</p>
<!-- @@@color -->
<!-- $$$currentColorGroup[overload1]$$$currentColorGroup -->
<h3 class="fn"><a name="currentColorGroup"></a><span class="type"><a href="qpalette.html#ColorGroup-enum">ColorGroup</a></span> QPalette::<span class="name">currentColorGroup</span> () const</h3>
<p>Returns the palette's current color group.</p>
<p><b>See also </b><a href="qpalette.html#setCurrentColorGroup">setCurrentColorGroup</a>().</p>
<!-- @@@currentColorGroup -->
<!-- $$$dark[overload1]$$$dark -->
<h3 class="fn"><a name="dark"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">dark</span> () const</h3>
<p>Returns the dark brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@dark -->
<!-- $$$highlight[overload1]$$$highlight -->
<h3 class="fn"><a name="highlight"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">highlight</span> () const</h3>
<p>Returns the highlight brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@highlight -->
<!-- $$$highlightedText[overload1]$$$highlightedText -->
<h3 class="fn"><a name="highlightedText"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">highlightedText</span> () const</h3>
<p>Returns the highlighted text brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@highlightedText -->
<!-- $$$isBrushSet[overload1]$$$isBrushSetColorGroupColorRole -->
<h3 class="fn"><a name="isBrushSet"></a><span class="type">bool</span> QPalette::<span class="name">isBrushSet</span> ( <span class="type"><a href="qpalette.html#ColorGroup-enum">ColorGroup</a></span> <i>cg</i>, <span class="type"><a href="qpalette.html#ColorRole-enum">ColorRole</a></span> <i>cr</i> ) const</h3>
<p>Returns true if the <a href="qpalette.html#ColorGroup-enum">ColorGroup</a> <i>cg</i> and <a href="qpalette.html#ColorRole-enum">ColorRole</a> <i>cr</i> has been set previously on this palette; otherwise returns false.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also </b><a href="qpalette.html#setBrush">setBrush</a>().</p>
<!-- @@@isBrushSet -->
<!-- $$$isCopyOf[overload1]$$$isCopyOfconstQPalette& -->
<h3 class="fn"><a name="isCopyOf"></a><span class="type">bool</span> QPalette::<span class="name">isCopyOf</span> ( const <span class="type">QPalette</span> &amp; <i>p</i> ) const</h3>
<p>Returns true if this palette and <i>p</i> 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>
<p><b>See also </b><a href="qpalette.html#operator-eq">operator=</a>() and <a href="qpalette.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@isCopyOf -->
<!-- $$$isEqual[overload1]$$$isEqualColorGroupColorGroup -->
<h3 class="fn"><a name="isEqual"></a><span class="type">bool</span> QPalette::<span class="name">isEqual</span> ( <span class="type"><a href="qpalette.html#ColorGroup-enum">ColorGroup</a></span> <i>cg1</i>, <span class="type"><a href="qpalette.html#ColorGroup-enum">ColorGroup</a></span> <i>cg2</i> ) const</h3>
<p>Returns true (usually quickly) if color group <i>cg1</i> is equal to <i>cg2</i>; otherwise returns false.</p>
<!-- @@@isEqual -->
<!-- $$$light[overload1]$$$light -->
<h3 class="fn"><a name="light"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">light</span> () const</h3>
<p>Returns the light brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@light -->
<!-- $$$link[overload1]$$$link -->
<h3 class="fn"><a name="link"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">link</span> () const</h3>
<p>Returns the unvisited link text brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@link -->
<!-- $$$linkVisited[overload1]$$$linkVisited -->
<h3 class="fn"><a name="linkVisited"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">linkVisited</span> () const</h3>
<p>Returns the visited link text brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@linkVisited -->
<!-- $$$mid[overload1]$$$mid -->
<h3 class="fn"><a name="mid"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">mid</span> () const</h3>
<p>Returns the mid brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@mid -->
<!-- $$$midlight[overload1]$$$midlight -->
<h3 class="fn"><a name="midlight"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">midlight</span> () const</h3>
<p>Returns the midlight brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@midlight -->
<!-- $$$resolve[overload1]$$$resolveconstQPalette& -->
<h3 class="fn"><a name="resolve"></a><span class="type">QPalette</span> QPalette::<span class="name">resolve</span> ( const <span class="type">QPalette</span> &amp; <i>other</i> ) const</h3>
<p>Returns a new <a href="qpalette.html">QPalette</a> that has attributes copied from <i>other</i>.</p>
<!-- @@@resolve -->
<!-- $$$setBrush[overload1]$$$setBrushColorRoleconstQBrush& -->
<h3 class="fn"><a name="setBrush"></a><span class="type">void</span> QPalette::<span class="name">setBrush</span> ( <span class="type"><a href="qpalette.html#ColorRole-enum">ColorRole</a></span> <i>role</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>brush</i> )</h3>
<p>Sets the brush for the given color <i>role</i> to the specified <i>brush</i> for all groups in the palette.</p>
<p><b>See also </b><a href="qpalette.html#brush">brush</a>(), <a href="qpalette.html#setColor">setColor</a>(), and <a href="qpalette.html#ColorRole-enum">ColorRole</a>.</p>
<!-- @@@setBrush -->
<!-- $$$setBrush$$$setBrushColorGroupColorRoleconstQBrush& -->
<h3 class="fn"><a name="setBrush-2"></a><span class="type">void</span> QPalette::<span class="name">setBrush</span> ( <span class="type"><a href="qpalette.html#ColorGroup-enum">ColorGroup</a></span> <i>group</i>, <span class="type"><a href="qpalette.html#ColorRole-enum">ColorRole</a></span> <i>role</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>brush</i> )</h3>
<p>This is an overloaded function.</p>
<p>Sets the brush in the specified color <i>group</i>, used for the given color <i>role</i>, to <i>brush</i>.</p>
<p><b>See also </b><a href="qpalette.html#brush">brush</a>(), <a href="qpalette.html#setColor">setColor</a>(), and <a href="qpalette.html#ColorRole-enum">ColorRole</a>.</p>
<!-- @@@setBrush -->
<!-- $$$setColor[overload1]$$$setColorColorGroupColorRoleconstQColor& -->
<h3 class="fn"><a name="setColor"></a><span class="type">void</span> QPalette::<span class="name">setColor</span> ( <span class="type"><a href="qpalette.html#ColorGroup-enum">ColorGroup</a></span> <i>group</i>, <span class="type"><a href="qpalette.html#ColorRole-enum">ColorRole</a></span> <i>role</i>, const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; <i>color</i> )</h3>
<p>Sets the color in the specified color <i>group</i>, used for the given color <i>role</i>, to the specified solid <i>color</i>.</p>
<p><b>See also </b><a href="qpalette.html#setBrush">setBrush</a>(), <a href="qpalette.html#color">color</a>(), and <a href="qpalette.html#ColorRole-enum">ColorRole</a>.</p>
<!-- @@@setColor -->
<!-- $$$setColor$$$setColorColorRoleconstQColor& -->
<h3 class="fn"><a name="setColor-2"></a><span class="type">void</span> QPalette::<span class="name">setColor</span> ( <span class="type"><a href="qpalette.html#ColorRole-enum">ColorRole</a></span> <i>role</i>, const <span class="type"><a href="qcolor.html">QColor</a></span> &amp; <i>color</i> )</h3>
<p>This is an overloaded function.</p>
<p>Sets the color used for the given color <i>role</i>, in all color groups, to the specified solid <i>color</i>.</p>
<p><b>See also </b><a href="qpalette.html#brush">brush</a>(), <a href="qpalette.html#setColor">setColor</a>(), and <a href="qpalette.html#ColorRole-enum">ColorRole</a>.</p>
<!-- @@@setColor -->
<!-- $$$setColorGroup[overload1]$$$setColorGroupColorGroupconstQBrush&constQBrush&constQBrush&constQBrush&constQBrush&constQBrush&constQBrush&constQBrush&constQBrush& -->
<h3 class="fn"><a name="setColorGroup"></a><span class="type">void</span> QPalette::<span class="name">setColorGroup</span> ( <span class="type"><a href="qpalette.html#ColorGroup-enum">ColorGroup</a></span> <i>cg</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>windowText</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>button</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>light</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>dark</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>mid</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>text</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>bright_text</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>base</i>, const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; <i>window</i> )</h3>
<p>Sets a the group at <i>cg</i>. You can pass either brushes, pixmaps or plain colors for <i>windowText</i>, <i>button</i>, <i>light</i>, <i>dark</i>, <i>mid</i>, <i>text</i>, <i>bright_text</i>, <i>base</i> and <i>window</i>.</p>
<p><b>See also </b><a href="qbrush.html">QBrush</a>.</p>
<!-- @@@setColorGroup -->
<!-- $$$setCurrentColorGroup[overload1]$$$setCurrentColorGroupColorGroup -->
<h3 class="fn"><a name="setCurrentColorGroup"></a><span class="type">void</span> QPalette::<span class="name">setCurrentColorGroup</span> ( <span class="type"><a href="qpalette.html#ColorGroup-enum">ColorGroup</a></span> <i>cg</i> )</h3>
<p>Set the palette's current color group to <i>cg</i>.</p>
<p><b>See also </b><a href="qpalette.html#currentColorGroup">currentColorGroup</a>().</p>
<!-- @@@setCurrentColorGroup -->
<!-- $$$shadow[overload1]$$$shadow -->
<h3 class="fn"><a name="shadow"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">shadow</span> () const</h3>
<p>Returns the shadow brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@shadow -->
<!-- $$$text[overload1]$$$text -->
<h3 class="fn"><a name="text"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">text</span> () const</h3>
<p>Returns the text foreground brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@text -->
<!-- $$$toolTipBase[overload1]$$$toolTipBase -->
<h3 class="fn"><a name="toolTipBase"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">toolTipBase</span> () const</h3>
<p>Returns the tool tip base brush of the current color group. This brush is used by <a href="qtooltip.html">QToolTip</a> and <a href="qwhatsthis.html">QWhatsThis</a>.</p>
<p><b>Note:</b> Tool tips use the Inactive color group of <a href="qpalette.html">QPalette</a>, because tool tips are not active windows.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@toolTipBase -->
<!-- $$$toolTipText[overload1]$$$toolTipText -->
<h3 class="fn"><a name="toolTipText"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">toolTipText</span> () const</h3>
<p>Returns the tool tip text brush of the current color group. This brush is used by <a href="qtooltip.html">QToolTip</a> and <a href="qwhatsthis.html">QWhatsThis</a>.</p>
<p><b>Note:</b> Tool tips use the Inactive color group of <a href="qpalette.html">QPalette</a>, because tool tips are not active windows.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@toolTipText -->
<!-- $$$window[overload1]$$$window -->
<h3 class="fn"><a name="window"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">window</span> () const</h3>
<p>Returns the window (general background) brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@window -->
<!-- $$$windowText[overload1]$$$windowText -->
<h3 class="fn"><a name="windowText"></a>const <span class="type"><a href="qbrush.html">QBrush</a></span> &amp; QPalette::<span class="name">windowText</span> () const</h3>
<p>Returns the window text (general foreground) brush of the current color group.</p>
<p><b>See also </b><a href="qpalette.html#ColorRole-enum">ColorRole</a> and <a href="qpalette.html#brush">brush</a>().</p>
<!-- @@@windowText -->
<!-- $$$operator QVariant[overload1]$$$operator QVariant -->
<h3 class="fn"><a name="operator-QVariant"></a>QPalette::<span class="name">operator QVariant</span> () const</h3>
<p>Returns the palette as a <a href="qvariant.html">QVariant</a></p>
<!-- @@@operator QVariant -->
<!-- $$$operator!=[overload1]$$$operator!=constQPalette& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QPalette::<span class="name">operator!=</span> ( const <span class="type">QPalette</span> &amp; <i>p</i> ) const</h3>
<p>Returns true (slowly) if this palette is different from <i>p</i>; otherwise returns false (usually quickly).</p>
<p><b>Note:</b> The current <a href="qpalette.html#ColorGroup-enum">ColorGroup</a> is not taken into account when comparing palettes</p>
<p><b>See also </b><a href="qpalette.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQPalette& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QPalette</span> &amp; QPalette::<span class="name">operator=</span> ( const <span class="type">QPalette</span> &amp; <i>p</i> )</h3>
<p>Assigns <i>p</i> to this palette and returns a reference to this palette.</p>
<p>This operation is fast thanks to <a href="implicit-sharing.html">implicit sharing</a>.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQPalette& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QPalette::<span class="name">operator==</span> ( const <span class="type">QPalette</span> &amp; <i>p</i> ) const</h3>
<p>Returns true (usually quickly) if this palette is equal to <i>p</i>; otherwise returns false (slowly).</p>
<p><b>Note:</b> The current <a href="qpalette.html#ColorGroup-enum">ColorGroup</a> is not taken into account when comparing palettes</p>
<p><b>See also </b><a href="qpalette.html#operator-not-eq">operator!=</a>().</p>
<!-- @@@operator== -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<<$$$operator<<QDataStream&constQPalette& -->
<h3 class="fn"><a name="operator-lt-lt-35"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>s</i>, const <span class="type">QPalette</span> &amp; <i>p</i> )</h3>
<p>Writes the palette, <i>p</i> to the stream <i>s</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Format of the QDataStream operators</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>$$$operator>>QDataStream&QPalette& -->
<h3 class="fn"><a name="operator-gt-gt-22"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>s</i>, <span class="type">QPalette</span> &amp; <i>p</i> )</h3>
<p>Reads a palette from the stream, <i>s</i> into the palette <i>p</i>, and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Format of the QDataStream operators</a>.</p>
<!-- @@@operator>> -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>