Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-release > by-pkgid > 886c2ed147b4d6954d2d9fb23759f3ff > files > 309

qtquickcontrols25-doc-5.6.2-1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qtlabscontrols-material.qdoc -->
  <title>Material Style | Qt Labs Controls 5.6</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.6</td><td ><a href="qtlabscontrols-index.html">Qt Labs Controls</a></td><td >Material Style</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.6.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>
<li class="level1"><a href="#attached-properties">Attached Properties</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="#pre-defined-colors">Pre-defined Colors</a></li>
<li class="level1"><a href="#attached-property-documentation">Attached Property 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>
<!-- $$$qtlabscontrols-material.html-description -->
<div class="descr"> <a name="details"></a>
<p>The Material Style is based on the Google Material Design Guidelines. <a href="qtlabscontrols-universal.html#detailed-description">More..&#x2e;</a></p>
<table class="alignedsummary"><tbody><tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import Qt.labs.controls.material 1.0</td></tr></tbody></table><a name="attached-properties"></a>
<h2 id="attached-properties">Attached Properties</h2>
<ul>
<li><a href="qtlabscontrols-universal.html#accent-attached-prop"><b>accent</b></a> : color</li>
<li><a href="qtlabscontrols-material.html#primary-attached-prop"><b>primary</b></a> : color</li>
<li><a href="qtlabscontrols-universal.html#theme-attached-prop"><b>theme</b></a> : enumeration</li>
</ul>
<a name="detailed-description"></a>
<h2 id="detailed-description">Detailed Description</h2>
<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/qtlabscontrols-material.png" alt="" /></p><p class="figCaption">The Material style in light and dark themes</p>
<p><b>Note: </b>The Material style is not a native Android style. The Material style is a 100% cross-platform Qt Labs Controls 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 three attributes, <a href="qtlabscontrols-universal.html#theme-attached-prop">theme</a>, <a href="qtlabscontrols-material.html#primary-attached-prop">primary</a> and <a href="qtlabscontrols-universal.html#accent-attached-prop">accent</a>. 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 Qt.labs.controls 1.0
  import Qt.labs.controls.material 1.0

  <span class="type"><a href="qml-qt-labs-controls-button.html">Button</a></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/qtlabscontrols-material-button.png" alt="" /></p></td></tr>
</table></div>
<p>Both attributes can be specified for any window or item, and they automatically propagate to children in the same manner as <a href="qml-qt-labs-controls-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 Qt.labs.controls 1.0
  import Qt.labs.controls.material 1.0

  <span class="type"><a href="qml-qt-labs-controls-applicationwindow.html">ApplicationWindow</a></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"><a href="qml-qt-labs-controls-radiobutton.html">RadioButton</a></span> { <span class="name">text</span>: <span class="name">qsTr</span>(<span class="string">&quot;Small&quot;</span>) }
          <span class="type"><a href="qml-qt-labs-controls-radiobutton.html">RadioButton</a></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"><a href="qml-qt-labs-controls-radiobutton.html">RadioButton</a></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/qtlabscontrols-material-dark.png" alt="" /></p></td></tr>
</table></div>
<p><b>Note: </b>The Material style must be separately imported to gain access to these style-specific attributes. It should be noted that regardless of the references to the Material style, the same application code runs with any other style. The Material style-specific attributes only have an effect when the application is run with the Material style. Furthermore, in case of explicit Material style-specific references, the Material style must be deployed with the application.</p><a name="pre-defined-colors"></a>
<h3 >Pre-defined Colors</h3>
<p>Even though primary and accent can be any color, 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">Red (#F44336)</td></tr>
<tr><td class="topAlign"><code>Material.Pink</code></td><td class="topAlign">Pink (#E91E63)</td></tr>
<tr><td class="topAlign"><code>Material.Purple</code></td><td class="topAlign">Purple (#9C27B0)</td></tr>
<tr><td class="topAlign"><code>Material.DeepPurple</code></td><td class="topAlign">Deep Purple (#673AB7)</td></tr>
<tr><td class="topAlign"><code>Material.Indigo</code></td><td class="topAlign">Indigo (#3F51B5)</td></tr>
<tr><td class="topAlign"><code>Material.Blue</code></td><td class="topAlign">Blue (#2196F3)</td></tr>
<tr><td class="topAlign"><code>Material.LightBlue</code></td><td class="topAlign">Light Blue (#03A9F4)</td></tr>
<tr><td class="topAlign"><code>Material.Cyan</code></td><td class="topAlign">Cyan (#00BCD4)</td></tr>
<tr><td class="topAlign"><code>Material.Teal</code></td><td class="topAlign">Teal (#009688)</td></tr>
<tr><td class="topAlign"><code>Material.Green</code></td><td class="topAlign">Green (#4CAF50)</td></tr>
<tr><td class="topAlign"><code>Material.LightGreen</code></td><td class="topAlign">Light Green (#8BC34A)</td></tr>
<tr><td class="topAlign"><code>Material.Lime</code></td><td class="topAlign">Lime (#CDDC39)</td></tr>
<tr><td class="topAlign"><code>Material.Yellow</code></td><td class="topAlign">Yellow (#FFEB3B)</td></tr>
<tr><td class="topAlign"><code>Material.Amber</code></td><td class="topAlign">Amber (#FFC107)</td></tr>
<tr><td class="topAlign"><code>Material.Orange</code></td><td class="topAlign">Orange (#FF9800)</td></tr>
<tr><td class="topAlign"><code>Material.DeepOrange</code></td><td class="topAlign">Deep Orange (#FF5722)</td></tr>
<tr><td class="topAlign"><code>Material.Brown</code></td><td class="topAlign">Brown (#795548)</td></tr>
<tr><td class="topAlign"><code>Material.Grey</code></td><td class="topAlign">Grey (#9E9E9E)</td></tr>
<tr><td class="topAlign"><code>Material.BlueGrey</code></td><td class="topAlign">Blue Grey (#607D8B)</td></tr>
</table></div>
<p><b>Note: </b><i>Types in the Qt.labs module are not guaranteed to remain compatible in future versions.</i></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="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="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.Teal</code>.</p>
<p><b>Note: </b>Even though the accent can be any color, it is recommended to use one of the <a href="qtlabscontrols-material.html#pre-defined-colors">pre-defined 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="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="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.BlueGray</code>.</p>
<p><b>Note: </b>Even though the primary can be any color, it is recommended to use one of the <a href="qtlabscontrols-material.html#pre-defined-colors">pre-defined 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="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="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="odd"><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="related-information"></a>
<h2 id="related-information">Related Information</h2>
<ul>
<li><a href="qtlabscontrols-styles.html">Styling Qt Labs Controls</a></li>
</ul>
</div>
<!-- @@@qtlabscontrols-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>