qml-palette.html 6.23 KB
Newer Older
xuebingbing's avatar
xuebingbing committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtquickcontrols2-palette.qdoc -->
  <title>palette QML Basic Type | Qt Quick Controls 2 5.11</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.11</a></td><td ><a href="qtquickcontrols2-index.html">Qt Quick Controls 2</a></td><td ><a href="qtquick-controls2-qmlmodule.html">QML Types</a></td><td >palette QML Basic Type</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.11.2 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">palette QML Basic Type</h1>
<span class="subtitle"></span>
<!-- $$$palette-description -->
<div class="descr"> <a name="details"></a>
<p>a palette of colors. <a name="qtquickcontrols2-palette"></a> The <code>palette</code> type refers to a palette of colors for various roles.</p>
<p>Available properties:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Property</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td ><b>palette.alternateBase</b> : color</td><td >Used as the alternate background color in item views with alternating row colors.</td></tr>
<tr valign="top" class="even"><td ><b>palette.base</b> : color</td><td >Used mostly as the background color for text editor controls and items views. It is usually white or another light color.</td></tr>
<tr valign="top" class="odd"><td ><b>palette.brightText</b> : color</td><td >A text color that is very different from <code>palette.windowText</code>, and contrasts well with e.g&#x2e; <code>palette.dark</code>. Typically used for text that needs to be drawn where <code>palette.text</code>, <code>palette.windowText</code> or <code>palette.buttonText</code> would give poor contrast, such as on highlighted buttons.</td></tr>
<tr valign="top" class="even"><td ><b>palette.button</b> : color</td><td >The general button background color. This background can be different from <code>palette.window</code> as some styles require a different background color for buttons.</td></tr>
<tr valign="top" class="odd"><td ><b>palette.buttonText</b> : color</td><td >A foreground color used with the <code>palette.button</code> color.</td></tr>
<tr valign="top" class="even"><td ><b>palette.dark</b> : color</td><td >Darker than <code>palette.button</code>.</td></tr>
<tr valign="top" class="odd"><td ><b>palette.highlight</b> : color</td><td >A color to indicate a selected item or the current item.</td></tr>
<tr valign="top" class="even"><td ><b>palette.highlightedText</b> : color</td><td >A text color that contrasts with <code>palette.highlight</code>.</td></tr>
<tr valign="top" class="odd"><td ><b>palette.light</b> : color</td><td >Lighter than <code>palette.button</code>.</td></tr>
<tr valign="top" class="even"><td ><b>palette.link</b> : color</td><td >A text color used for hyperlinks.</td></tr>
<tr valign="top" class="odd"><td ><b>palette.linkVisited</b> : color</td><td >A text color used for already visited hyperlinks.</td></tr>
<tr valign="top" class="even"><td ><b>palette.mid</b> : color</td><td >Between <code>palette.button</code> and <code>palette.dark</code>.</td></tr>
<tr valign="top" class="odd"><td ><b>palette.midlight</b> : color</td><td >Between <code>palette.button</code> and <code>palette.light</code>.</td></tr>
<tr valign="top" class="even"><td ><b>palette.shadow</b> : color</td><td >A very dark color.</td></tr>
<tr valign="top" class="odd"><td ><b>palette.text</b> : color</td><td >The foreground color used with <code>palette.base</code>. This is usually the same as the <code>palette.windowText</code>, in which case it must provide good contrast with <code>palette.window</code> and <code>palette.base</code>.</td></tr>
<tr valign="top" class="even"><td ><b>palette.toolTipBase</b> : color</td><td >Used as the background color for tooltips.</td></tr>
<tr valign="top" class="odd"><td ><b>palette.toolTipText</b> : color</td><td >Used as the foreground color for tooltips.</td></tr>
<tr valign="top" class="even"><td ><b>palette.window</b> : color</td><td >A general background color.</td></tr>
<tr valign="top" class="odd"><td ><b>palette.windowText</b> : color</td><td >A general foreground color.</td></tr>
</table></div>
</div>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#palette-prop">Control::palette</a>, <a href="qml-qtquick-controls2-popup.html#palette-prop">Popup::palette</a>, <a href="qml-qtquick-controls2-applicationwindow.html#palette-prop">ApplicationWindow::palette</a>, and <a href="../qtgui/qpalette.html#ColorRole-enum">QPalette::ColorRole</a>.</p>
<!-- @@@palette -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2018 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    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.<br/>    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. </p>
</div>
</body>
</html>