This file is indexed.

/usr/share/qt5/doc/qtquickcontrols2/qtquickcontrols2-material.html is in qtquickcontrols2-5-doc-html 5.7.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<?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-material.qdoc -->
  <title>Material Style | Qt Quick Controls 2 5.7</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    window.onload = function(){document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");};
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.7</td><td ><a href="qtquickcontrols2-index.html">Qt Quick Controls 2</a></td><td >Material Style</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.7.1 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>
<li class="level1"><a href="#attached-properties">Attached Properties</a></li>
<li class="level1"><a href="#attached-methods">Attached Methods</a></li>
<li class="level1"><a href="#detailed-description">Detailed Description</a></li>
<li class="level2"><a href="#customization">Customization</a></li>
<li class="level2"><a href="#dependency">Dependency</a></li>
<li class="level2"><a href="#pre-defined-material-colors">Pre-defined Material Colors</a></li>
<li class="level2"><a href="#pre-defined-shades">Pre-defined Shades</a></li>
<li class="level1"><a href="#attached-property-documentation">Attached Property Documentation</a></li>
<li class="level1"><a href="#attached-method-documentation">Attached Method Documentation</a></li>
<li class="level1"><a href="#related-information">Related Information</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Material Style</h1>
<span class="subtitle"></span>
<!-- $$$qtquickcontrols2-material.html-description -->
<div class="descr"> <a name="details"></a>
<p>The Material Style is based on the Google Material Design Guidelines. <a href="qtquickcontrols2-material.html#detailed-desc-material">More..&#x2e;</a></p>
<table class="alignedsummary"><tbody><tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQuick.Controls.Material 2.0</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign"> Qt 5.7</td></tr></tbody></table><a name="attached-properties"></a>
<h2 id="attached-properties">Attached Properties</h2>
<ul>
<li><a href="qtquickcontrols2-material.html#material-accent-attached-prop"><b>accent</b></a> : color</li>
<li><a href="qtquickcontrols2-material.html#material-background-attached-prop"><b>background</b></a> : color</li>
<li><a href="qtquickcontrols2-material.html#material-elevation-attached-prop"><b>elevation</b></a> : int</li>
<li><a href="qtquickcontrols2-material.html#material-foreground-attached-prop"><b>foreground</b></a> : color</li>
<li><a href="qtquickcontrols2-material.html#material-primary-attached-prop"><b>primary</b></a> : color</li>
<li><a href="qtquickcontrols2-material.html#material-theme-attached-prop"><b>theme</b></a> : enumeration</li>
</ul>
<a name="attached-methods"></a>
<h2 id="attached-methods">Attached Methods</h2>
<ul>
<li>color <a href="qtquickcontrols2-material.html#material-color-attached-method"><b>color</b></a>(enumeration predefined, enumeration shade)</li>
</ul>
<a name="detailed-description"></a>
<h2 id="detailed-description">Detailed Description</h2>
<a name="detailed-desc-material"></a><p>The Material style is based on the <a href="https://www.google.com/design/spec/material-design/introduction.html">Google Material Design Guidelines</a>. It allows for a unified experience across platforms and device sizes.</p>
<p class="centerAlign"><img src="images/qtquickcontrols2-material.png" alt="" /></p><p class="figCaption">The Material style in light and dark themes</p>
<p>To run an application with the Material style, see <a href="qtquickcontrols2-styles.html#using-styles-in-qt-quick-controls-2">Using Styles in Qt Quick Controls 2</a>.</p>
<p><b>Note: </b>The Material style is not a native Android style. The Material style is a 100% cross-platform Qt Quick Controls 2 style implementation that follows the Google Material Design Guidelines. The style runs on any platform, and looks more or less identical everywhere. Minor differences may occur due to differences in available system fonts and font rendering engines.</p><a name="customization"></a>
<h3 >Customization</h3>
<p>The Material style allows customizing five attributes, <a href="qtquickcontrols2-material.html#material-theme-attached-prop">theme</a>, <a href="qtquickcontrols2-material.html#material-primary-attached-prop">primary</a>, <a href="qtquickcontrols2-material.html#material-accent-attached-prop">accent</a>, <a href="qtquickcontrols2-material.html#material-foreground-attached-prop">foreground</a>, and <a href="qtquickcontrols2-material.html#material-background-attached-prop">background</a>.</p>
<p class="centerAlign"><img src="images/qtquickcontrols2-material-attributes.png" alt="" /></p><p>The following example illustrates how to create a red <i>stop</i> button with light text:</p>
<div class="table"><table class="generic">
 <tr valign="top" class="odd"><td ><pre class="qml">

  import QtQuick 2.0
  import QtQuick.Controls 2.0
  import QtQuick.Controls.Material 2.0

  <span class="type">Button</span> {
      <span class="name">text</span>: <span class="string">&quot;Stop&quot;</span>
      <span class="name">highlighted</span>: <span class="number">true</span>

      <span class="name">Material</span>.accent: <span class="name">Material</span>.<span class="name">Red</span>
      <span class="name">Material</span>.theme: <span class="name">Material</span>.<span class="name">Dark</span>
  }

</pre>
</td><td ><p class="centerAlign"><img src="images/qtquickcontrols2-material-button.png" alt="" /></p></td></tr>
</table></div>
<p>All attributes can be specified for any window or item, and they automatically propagate to children in the same manner as <a href="qml-qtquick-controls2-control.html#font-prop">fonts</a>. In the following example, the window and all three radio buttons appear in the dark theme using a purple accent color:</p>
<div class="table"><table class="generic">
 <tr valign="top" class="odd"><td ><pre class="qml">

  import QtQuick 2.0
  import QtQuick.Controls 2.0
  import QtQuick.Controls.Material 2.0

  <span class="type">ApplicationWindow</span> {
      <span class="name">visible</span>: <span class="number">true</span>

      <span class="name">Material</span>.theme: <span class="name">Material</span>.<span class="name">Dark</span>
      <span class="name">Material</span>.accent: <span class="name">Material</span>.<span class="name">Purple</span>

      <span class="type">Column</span> {
          <span class="name">anchors</span>.centerIn: <span class="name">parent</span>

          <span class="type">RadioButton</span> { <span class="name">text</span>: <span class="name">qsTr</span>(<span class="string">&quot;Small&quot;</span>) }
          <span class="type">RadioButton</span> { <span class="name">text</span>: <span class="name">qsTr</span>(<span class="string">&quot;Medium&quot;</span>);  <span class="name">checked</span>: <span class="number">true</span> }
          <span class="type">RadioButton</span> { <span class="name">text</span>: <span class="name">qsTr</span>(<span class="string">&quot;Large&quot;</span>) }
      }
  }

</pre>
</td><td ><p class="centerAlign"><img src="images/qtquickcontrols2-material-dark.png" alt="" /></p></td></tr>
</table></div>
<p>In addition to specifying the attributes in QML, it is also possible to specify them via environment variables or in a <a href="qtquickcontrols2-styles.html#qtquickcontrols2-conf">configuration file</a>. Attributes specified in QML take precedence over all other methods.</p>
<a name="environment-variables"></a>
<h4 >Environment Variables</h4>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Variable</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td ><code>QT_QUICK_CONTROLS_MATERIAL_THEME</code></td><td >The value can be one of the available <a href="qtquickcontrols2-material.html#material-theme-attached-prop">themes</a>, for example <code>&quot;Dark&quot;</code>.</td></tr>
<tr valign="top" class="even"><td ><code>QT_QUICK_CONTROLS_MATERIAL_ACCENT</code></td><td >The value can be any <a href="../qtquick/qml-color.html#colorbasictypedocs">color</a>, but it is recommended to use one of the <a href="qtquickcontrols2-material.html#pre-defined-material-colors">pre-defined Material colors</a>, for example <code>&quot;Teal&quot;</code>.</td></tr>
<tr valign="top" class="odd"><td ><code>QT_QUICK_CONTROLS_MATERIAL_PRIMARY</code></td><td >The value can be any <a href="../qtquick/qml-color.html#colorbasictypedocs">color</a>, but it is recommended to use one of the <a href="qtquickcontrols2-material.html#pre-defined-material-colors">pre-defined Material colors</a>, for example <code>&quot;BlueGrey&quot;</code>.</td></tr>
<tr valign="top" class="even"><td ><code>QT_QUICK_CONTROLS_MATERIAL_FOREGROUND</code></td><td >The value can be any <a href="../qtquick/qml-color.html#colorbasictypedocs">color</a>, or one of the <a href="qtquickcontrols2-material.html#pre-defined-material-colors">pre-defined Material colors</a>.</td></tr>
<tr valign="top" class="odd"><td ><code>QT_QUICK_CONTROLS_MATERIAL_BACKGROUND</code></td><td >The value can be any <a href="../qtquick/qml-color.html#colorbasictypedocs">color</a>, or one of the <a href="qtquickcontrols2-material.html#pre-defined-material-colors">pre-defined Material colors</a>.</td></tr>
</table></div>
<a name="dependency"></a>
<h3 >Dependency</h3>
<p>The Material style must be separately imported to gain access to the attributes that are specific to the Material style. It should be noted that regardless of the references to the Material style, the same application code runs with any other style. Material-specific attributes only have an effect when the application is run with the Material style.</p>
<p>If the Material style is imported in a QML file that is always loaded, the Material style must be deployed with the application in order to be able to run the application regardless of which style the application is run with. By using <a href="qtquickcontrols2-fileselectors.html">file selectors</a>, style-specific tweaks can be applied without creating a hard dependency to a style.</p>
<a name="pre-defined-material-colors"></a>
<h3 >Pre-defined Material Colors</h3>
<p>Even though primary and accent can be any <a href="../qtquick/qml-color.html#colorbasictypedocs">color</a>, it is recommended to use one of the pre-defined colors that have been designed to work well with the rest of the Material style palette:</p>
<p>Available pre-defined colors:</p>
<div class="table"><table class="valuelist"><tr valign="top" class="even"><th class="tblConst">Constant</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>Material.Red</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#F44336;">#F44336 </div></td></tr>
<tr><td class="topAlign"><code>Material.Pink</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#E91E63;">#E91E63 (default accent)</div></td></tr>
<tr><td class="topAlign"><code>Material.Purple</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#9C27B0;">#9C27B0 </div></td></tr>
<tr><td class="topAlign"><code>Material.DeepPurple</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#673AB7;">#673AB7 </div></td></tr>
<tr><td class="topAlign"><code>Material.Indigo</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#3F51B5;">#3F51B5 (default primary)</div></td></tr>
<tr><td class="topAlign"><code>Material.Blue</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#2196F3;">#2196F3 </div></td></tr>
<tr><td class="topAlign"><code>Material.LightBlue</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#03A9F4;">#03A9F4 </div></td></tr>
<tr><td class="topAlign"><code>Material.Cyan</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#00BCD4;">#00BCD4 </div></td></tr>
<tr><td class="topAlign"><code>Material.Teal</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#009688;">#009688 </div></td></tr>
<tr><td class="topAlign"><code>Material.Green</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#4CAF50;">#4CAF50 </div></td></tr>
<tr><td class="topAlign"><code>Material.LightGreen</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#8BC34A;">#8BC34A </div></td></tr>
<tr><td class="topAlign"><code>Material.Lime</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#CDDC39;">#CDDC39 </div></td></tr>
<tr><td class="topAlign"><code>Material.Yellow</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#FFEB3B;">#FFEB3B </div></td></tr>
<tr><td class="topAlign"><code>Material.Amber</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#FFC107;">#FFC107 </div></td></tr>
<tr><td class="topAlign"><code>Material.Orange</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#FF9800;">#FF9800 </div></td></tr>
<tr><td class="topAlign"><code>Material.DeepOrange</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#FF5722;">#FF5722 </div></td></tr>
<tr><td class="topAlign"><code>Material.Brown</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#795548;">#795548 </div></td></tr>
<tr><td class="topAlign"><code>Material.Grey</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#9E9E9E;">#9E9E9E </div></td></tr>
<tr><td class="topAlign"><code>Material.BlueGrey</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#607D8B;">#607D8B </div></td></tr>
</table></div>
<p>When the dark theme is in use, different <a href="qtquickcontrols2-material.html#pre-defined-shades">shades</a> of the pre-defined colors are used by default:</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>Material.Red</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#EF9A9A;">#EF9A9A </div></td></tr>
<tr><td class="topAlign"><code>Material.Pink</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#F48FB1;">#F48FB1 (default accent)</div></td></tr>
<tr><td class="topAlign"><code>Material.Purple</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#CE93D8;">#CE93D8 </div></td></tr>
<tr><td class="topAlign"><code>Material.DeepPurple</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#B39DDB;">#B39DDB </div></td></tr>
<tr><td class="topAlign"><code>Material.Indigo</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#9FA8DA;">#9FA8DA (default primary)</div></td></tr>
<tr><td class="topAlign"><code>Material.Blue</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#90CAF9;">#90CAF9 </div></td></tr>
<tr><td class="topAlign"><code>Material.LightBlue</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#81D4FA;">#81D4FA </div></td></tr>
<tr><td class="topAlign"><code>Material.Cyan</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#80DEEA;">#80DEEA </div></td></tr>
<tr><td class="topAlign"><code>Material.Teal</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#80CBC4;">#80CBC4 </div></td></tr>
<tr><td class="topAlign"><code>Material.Green</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#A5D6A7;">#A5D6A7 </div></td></tr>
<tr><td class="topAlign"><code>Material.LightGreen</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#C5E1A5;">#C5E1A5 </div></td></tr>
<tr><td class="topAlign"><code>Material.Lime</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#E6EE9C;">#E6EE9C </div></td></tr>
<tr><td class="topAlign"><code>Material.Yellow</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#FFF59D;">#FFF59D </div></td></tr>
<tr><td class="topAlign"><code>Material.Amber</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#FFE082;">#FFE082 </div></td></tr>
<tr><td class="topAlign"><code>Material.Orange</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#FFCC80;">#FFCC80 </div></td></tr>
<tr><td class="topAlign"><code>Material.DeepOrange</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#FFAB91;">#FFAB91 </div></td></tr>
<tr><td class="topAlign"><code>Material.Brown</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#BCAAA4;">#BCAAA4 </div></td></tr>
<tr><td class="topAlign"><code>Material.Grey</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#EEEEEE;">#EEEEEE </div></td></tr>
<tr><td class="topAlign"><code>Material.BlueGrey</code></td><td class="topAlign"><div style="padding:10px;color:#fff;background:#B0BEC5;">#B0BEC5 </div></td></tr>
</table></div>
<a name="pre-defined-shades"></a>
<h3 >Pre-defined Shades</h3>
<p>There are several different <a href="https://material.google.com/style/color.html#color-color-palette">shades</a> of each <a href="qtquickcontrols2-material.html#pre-defined-material-colors">pre-defined color</a> that can be passed to the <a href="qtquickcontrols2-material.html#material-color-attached-method">Material.color()</a> function:</p>
<div class="table"><table class="valuelist"><tr><th class="tblConst">Constant</th><th class="tblVal">Value</th></tr>
<tr><td class="topAlign"><code>Material.Shade50</code></td></tr>
<tr><td class="topAlign"><code>Material.Shade100</code></td></tr>
<tr><td class="topAlign"><code>Material.Shade200</code></td></tr>
<tr><td class="topAlign"><code>Material.Shade300</code></td></tr>
<tr><td class="topAlign"><code>Material.Shade400</code></td></tr>
<tr><td class="topAlign"><code>Material.Shade500</code></td></tr>
<tr><td class="topAlign"><code>Material.Shade600</code></td></tr>
<tr><td class="topAlign"><code>Material.Shade700</code></td></tr>
<tr><td class="topAlign"><code>Material.Shade800</code></td></tr>
<tr><td class="topAlign"><code>Material.Shade900</code></td></tr>
<tr><td class="topAlign"><code>Material.ShadeA100</code></td></tr>
<tr><td class="topAlign"><code>Material.ShadeA200</code></td></tr>
<tr><td class="topAlign"><code>Material.ShadeA400</code></td></tr>
<tr><td class="topAlign"><code>Material.ShadeA700</code></td></tr>
</table></div>
<p><b>See also</b> <a href="qtquickcontrols2-default.html">Default Style</a>, <a href="qtquickcontrols2-universal.html">Universal Style</a></p>
<a name="attached-property-documentation"></a>
<h2 id="attached-property-documentation">Attached Property Documentation</h2>
<div class="qmlproto"><table class="qmlname"><tbody><tr valign="top" class="odd" id="material-accent-attached-prop"><td class="tblQmlPropNode"><p><span class="name">Material.accent</span> : <span class="type">color</span></p></td></tr></tbody></table></div><a name="material-accent-attached-prop"></a><p>This attached property holds the accent color of the theme. The property can be attached to any window or item. The value is propagated to children.</p>
<p>The default value is <code>Material.Pink</code>.</p>
<p><b>Note: </b>Even though the accent can be any <a href="../qtquick/qml-color.html#colorbasictypedocs">color</a>, it is recommended to use one of the <a href="qtquickcontrols2-material.html#pre-defined-material-colors">pre-defined Material colors</a> that have been designed to work well with the rest of the Material style palette.</p><p><br />
</p>
<div class="qmlproto"><table class="qmlname"><tbody><tr valign="top" class="odd" id="material-background-attached-prop"><td class="tblQmlPropNode"><p><span class="name">Material.background</span> : <span class="type">color</span></p></td></tr></tbody></table></div><a name="material-background-attached-prop"></a><p>This attached property holds the background color of the theme. The property can be attached to any window or item. The value is propagated to children.</p>
<p>The default value is theme-specific (light or dark).</p>
<p><br />
</p>
<div class="qmlproto"><table class="qmlname"><tbody><tr valign="top" class="odd" id="material-elevation-attached-prop"><td class="tblQmlPropNode"><p><span class="name">Material.elevation</span> : <span class="type">int</span></p></td></tr></tbody></table></div><a name="material-elevation-attached-prop"></a><p>This attached property holds the elevation of the control. The higher the elevation, the deeper the shadow. The property can be attached to any control, but not all controls visualize elevation.</p>
<p>The default value is control-specific.</p>
<p><br />
</p>
<div class="qmlproto"><table class="qmlname"><tbody><tr valign="top" class="odd" id="material-foreground-attached-prop"><td class="tblQmlPropNode"><p><span class="name">Material.foreground</span> : <span class="type">color</span></p></td></tr></tbody></table></div><a name="material-foreground-attached-prop"></a><p>This attached property holds the foreground color of the theme. The property can be attached to any window or item. The value is propagated to children.</p>
<p>The default value is theme-specific (light or dark).</p>
<p><br />
</p>
<div class="qmlproto"><table class="qmlname"><tbody><tr valign="top" class="odd" id="material-primary-attached-prop"><td class="tblQmlPropNode"><p><span class="name">Material.primary</span> : <span class="type">color</span></p></td></tr></tbody></table></div><a name="material-primary-attached-prop"></a><p>This attached property holds the primary color of the theme. The property can be attached to any window or item. The value is propagated to children.</p>
<p>The default value is <code>Material.Indigo</code>.</p>
<p><b>Note: </b>Even though the primary can be any <a href="../qtquick/qml-color.html#colorbasictypedocs">color</a>, it is recommended to use one of the <a href="qtquickcontrols2-material.html#pre-defined-material-colors">pre-defined Material colors</a> that have been designed to work well with the rest of the Material style palette.</p><p><br />
</p>
<div class="qmlproto"><table class="qmlname"><tbody><tr valign="top" class="odd" id="material-theme-attached-prop"><td class="tblQmlPropNode"><p><span class="name">Material.theme</span> : <span class="type">enumeration</span></p></td></tr></tbody></table></div><a name="material-theme-attached-prop"></a><p>This attached property holds whether the theme is light or dark. The property can be attached to any window or item. The value is propagated to children.</p>
<p>Available themes:</p>
<div class="table"><table class="valuelist"><tr valign="top" class="even"><th class="tblConst">Constant</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>Material.Light</code></td><td class="topAlign">Light theme (default)</td></tr>
<tr><td class="topAlign"><code>Material.Dark</code></td><td class="topAlign">Dark theme</td></tr>
</table></div>
<p><br />
</p>
<a name="attached-method-documentation"></a>
<h2 id="attached-method-documentation">Attached Method Documentation</h2>
<div class="qmlproto"><table class="qmlname"><tbody><tr valign="top" class="odd" id="material-color-attached-method"><td class="tblQmlFuncNode"><p><span class="type">color</span> <span class="name">color</span>(<span class= type>enumeration</span> <i>predefined</i>, <span class= type>enumeration</span> <i>shade</i>)</p></td></tr></tbody></table></div><a name="material-color-attached-method"></a><p>This attached method returns the effective color value of the specified <a href="qtquickcontrols2-material.html#pre-defined-material-colors">pre-defined Material color</a> combined with the given <a href="qtquickcontrols2-material.html#pre-defined-shades">shade</a>. If omitted, the shade argument defaults to <code>Material.Shade500</code>.</p>
<pre class="qml">

  import QtQuick 2.0
  import QtQuick.Controls.Material 2.0

  <span class="type">Rectangle</span> {
      <span class="name">color</span>: <span class="name">Material</span>.<span class="name">color</span>(<span class="name">Material</span>.<span class="name">Red</span>)
  }

</pre>
<p><br />
</p>
<a name="related-information"></a>
<h2 id="related-information">Related Information</h2>
<ul>
<li><a href="qtquickcontrols2-styles.html">Styling Qt Quick Controls 2</a></li>
</ul>
</div>
<!-- @@@qtquickcontrols2-material.html -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2016 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>