<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qquickcontrol.cpp -->
  <title>Control QML 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 >Control QML 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>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#control-layout">Control Layout</a></li>
<li class="level2"><a href="#event-handling">Event Handling</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Control QML Type</h1>
<span class="subtitle"></span>
<!-- $$$Control-brief -->
<p>Abstract base type providing functionality common to all controls. <a href="#details">More...</a></p>
<!-- @@@Control -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQuick.Controls 2.4</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 5.7</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <p><a href="../qtquick/qml-qtquick-item.html">Item</a></p>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qml-qtquick-controls2-abstractbutton.html">AbstractButton</a>, <a href="qml-qtquick-controls2-busyindicator.html">BusyIndicator</a>, <a href="qml-qtquick-controls2-combobox.html">ComboBox</a>, <a href="qml-qtquick-controls2-container.html">Container</a>, <a href="qml-qtquick-controls2-dial.html">Dial</a>, <a href="qml-qtquick-controls2-menuseparator.html">MenuSeparator</a>, <a href="qml-qtquick-controls2-page.html">Page</a>, <a href="qml-qtquick-controls2-pageindicator.html">PageIndicator</a>, <a href="qml-qtquick-controls2-pane.html">Pane</a>, <a href="qml-qtquick-controls2-progressbar.html">ProgressBar</a>, <a href="qml-qtquick-controls2-rangeslider.html">RangeSlider</a>, <a href="qml-qtquick-controls2-scrollbar.html">ScrollBar</a>, <a href="qml-qtquick-controls2-scrollindicator.html">ScrollIndicator</a>, <a href="qml-qtquick-controls2-scrollview.html">ScrollView</a>, <a href="qml-qtquick-controls2-slider.html">Slider</a>, <a href="qml-qtquick-controls2-spinbox.html">SpinBox</a>, <a href="qml-qtquick-controls2-stackview.html">StackView</a>, <a href="qml-qtquick-controls2-toolseparator.html">ToolSeparator</a>, and <a href="qml-qtquick-controls2-tumbler.html">Tumbler</a></p>
</td></tr></table></div><ul>
<li><a href="qml-qtquick-controls2-control-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#availableHeight-prop">availableHeight</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#availableWidth-prop">availableWidth</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#background-prop">background</a></b></b> : Item</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#bottomPadding-prop">bottomPadding</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#contentItem-prop">contentItem</a></b></b> : Item</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#focusPolicy-prop">focusPolicy</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#focusReason-prop">focusReason</a></b></b> : enumeration</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#font-prop">font</a></b></b> : font</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#hoverEnabled-prop">hoverEnabled</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#hovered-prop">hovered</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#leftPadding-prop">leftPadding</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#locale-prop">locale</a></b></b> : Locale</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#mirrored-prop">mirrored</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#padding-prop">padding</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#palette-prop">palette</a></b></b> : palette</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#rightPadding-prop">rightPadding</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#spacing-prop">spacing</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#topPadding-prop">topPadding</a></b></b> : real</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#visualFocus-prop">visualFocus</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtquick-controls2-control.html#wheelEnabled-prop">wheelEnabled</a></b></b> : bool</li>
</ul>
<!-- $$$Control-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p>Control is the base type of user interface controls. It receives input events from the window system, and paints a representation of itself on the screen.</p>
<a name="control-layout"></a>
<h2 id="control-layout">Control Layout</h2>
<p>The following diagram illustrates the layout of a typical control:</p>
<p class="centerAlign"><img src="images/qtquickcontrols2-control.png" alt="" /></p><p>The <a href="../qtquick/qml-qtquick-item.html#implicitWidth-prop">implicitWidth</a> and <a href="../qtquick/qml-qtquick-item.html#implicitHeight-prop">implicitHeight</a> of a control are typically based on the implicit sizes of the background and the content item plus any <a href="qml-qtquick-controls2-control.html#padding-prop">padding</a>. These properties determine how large the control will be when no explicit <a href="../qtquick/qml-qtquick-item.html#width-prop">width</a> or <a href="../qtquick/qml-qtquick-item.html#height-prop">height</a> is specified.</p>
<p>The <a href="qml-qtquick-controls2-control.html#background-prop">background</a> item fills the entire width and height of the control, unless an explicit size has been given for it.</p>
<p>The geometry of the <a href="qml-qtquick-controls2-control.html#contentItem-prop">contentItem</a> is determined by the padding.</p>
<a name="event-handling"></a>
<h2 id="event-handling">Event Handling</h2>
<p>All controls, except non-interactive indicators, do not let clicks and touches through to items below them. For example, if <a href="qml-qtquick-controls2-pane.html">Pane</a> is used as the <a href="qml-qtquick-controls2-applicationwindow.html#header-attached-prop">header</a> or <a href="qml-qtquick-controls2-applicationwindow.html#footer-attached-prop">footer</a> of <a href="qml-qtquick-controls2-applicationwindow.html">ApplicationWindow</a>, items underneath it will not get mouse or touch events.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-applicationwindow.html">ApplicationWindow</a> and <a href="qml-qtquick-controls2-container.html">Container</a>.</p>
<!-- @@@Control -->
<h2>Property Documentation</h2>
<!-- $$$availableHeight -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="availableHeight-prop">
<td class="tblQmlPropNode"><p>
<a name="availableHeight-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">availableHeight</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the height available to the <a href="qml-qtquick-controls2-control.html#contentItem-prop">contentItem</a> after deducting vertical padding from the <a href="../qtquick/qml-qtquick-item.html#height-prop">height</a> of the control.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#control-layout">Control Layout</a>, <a href="qml-qtquick-controls2-control.html#padding-prop">padding</a>, <a href="qml-qtquick-controls2-control.html#topPadding-prop">topPadding</a>, and <a href="qml-qtquick-controls2-control.html#bottomPadding-prop">bottomPadding</a>.</p>
</div></div><!-- @@@availableHeight -->
<br/>
<!-- $$$availableWidth -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="availableWidth-prop">
<td class="tblQmlPropNode"><p>
<a name="availableWidth-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">availableWidth</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the width available to the <a href="qml-qtquick-controls2-control.html#contentItem-prop">contentItem</a> after deducting horizontal padding from the <a href="../qtquick/qml-qtquick-item.html#width-prop">width</a> of the control.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#control-layout">Control Layout</a>, <a href="qml-qtquick-controls2-control.html#padding-prop">padding</a>, <a href="qml-qtquick-controls2-control.html#leftPadding-prop">leftPadding</a>, and <a href="qml-qtquick-controls2-control.html#rightPadding-prop">rightPadding</a>.</p>
</div></div><!-- @@@availableWidth -->
<br/>
<!-- $$$background -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="background-prop">
<td class="tblQmlPropNode"><p>
<a name="background-prop"></a><span class="name">background</span> : <span class="type"><a href="../qtquick/qml-qtquick-item.html">Item</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the background item.</p>
<pre class="cpp">

  Button {
      id: control
      text: qsTr(<span class="string">&quot;Button&quot;</span>)
      background: Rectangle {
          implicitWidth: <span class="number">100</span>
          implicitHeight: <span class="number">40</span>
          opacity: enabled <span class="operator">?</span> <span class="number">1</span> : <span class="number">0.3</span>
          color: control<span class="operator">.</span>down <span class="operator">?</span> <span class="string">&quot;#d0d0d0&quot;</span> : <span class="string">&quot;#e0e0e0&quot;</span>
      }
  }

</pre>
<p><b>Note: </b>If the background item has no explicit size specified, it automatically follows the control's size. In most cases, there is no need to specify width or height for a background item.</p><p><b>Note: </b>Most controls use the implicit size of the background item to calculate the implicit size of the control itself. If you replace the background item with a custom one, you should also consider providing a sensible implicit size for it (unless it is an item like <a href="../qtquick/qml-qtquick-image.html">Image</a> which has its own implicit size).</p><p><b>See also </b><a href="qml-qtquick-controls2-control.html#control-layout">Control Layout</a>.</p>
</div></div><!-- @@@background -->
<br/>
<!-- $$$bottomPadding -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="bottomPadding-prop">
<td class="tblQmlPropNode"><p>
<a name="bottomPadding-prop"></a><span class="name">bottomPadding</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the bottom padding.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#control-layout">Control Layout</a>, <a href="qml-qtquick-controls2-control.html#padding-prop">padding</a>, <a href="qml-qtquick-controls2-control.html#topPadding-prop">topPadding</a>, and <a href="qml-qtquick-controls2-control.html#availableHeight-prop">availableHeight</a>.</p>
</div></div><!-- @@@bottomPadding -->
<br/>
<!-- $$$contentItem -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="contentItem-prop">
<td class="tblQmlPropNode"><p>
<a name="contentItem-prop"></a><span class="name">contentItem</span> : <span class="type"><a href="../qtquick/qml-qtquick-item.html">Item</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the visual content item.</p>
<pre class="cpp">

  Button {
      id: control
      text: qsTr(<span class="string">&quot;Button&quot;</span>)
      contentItem: Label {
          text: control<span class="operator">.</span>text
          font: control<span class="operator">.</span>font
          verticalAlignment: Text<span class="operator">.</span>AlignVCenter
      }
  }

</pre>
<p><b>Note: </b>The content item is automatically resized to fit within the <a href="qml-qtquick-controls2-control.html#padding-prop">padding</a> of the control.</p><p><b>Note: </b>Most controls use the implicit size of the content item to calculate the implicit size of the control itself. If you replace the content item with a custom one, you should also consider providing a sensible implicit size for it (unless it is an item like <a href="../qtdoc/whatsnew50.html#text">Text</a> which has its own implicit size).</p><p><b>See also </b><a href="qml-qtquick-controls2-control.html#control-layout">Control Layout</a> and <a href="qml-qtquick-controls2-control.html#padding-prop">padding</a>.</p>
</div></div><!-- @@@contentItem -->
<br/>
<!-- $$$focusPolicy -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="focusPolicy-prop">
<td class="tblQmlPropNode"><p>
<a name="focusPolicy-prop"></a><span class="name">focusPolicy</span> : <span class="type"><a href="../qtqml/qml-enumeration.html">enumeration</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property determines the way the control accepts focus.</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>Qt.TabFocus</code></td><td class="topAlign">The control accepts focus by tabbing.</td></tr>
<tr><td class="topAlign"><code>Qt.ClickFocus</code></td><td class="topAlign">The control accepts focus by clicking.</td></tr>
<tr><td class="topAlign"><code>Qt.StrongFocus</code></td><td class="topAlign">The control accepts focus by both tabbing and clicking.</td></tr>
<tr><td class="topAlign"><code>Qt.WheelFocus</code></td><td class="topAlign">The control accepts focus by tabbing, clicking, and using the mouse wheel.</td></tr>
<tr><td class="topAlign"><code>Qt.NoFocus</code></td><td class="topAlign">The control does not accept focus.</td></tr>
</table></div>
</div></div><!-- @@@focusPolicy -->
<br/>
<!-- $$$focusReason -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="focusReason-prop">
<td class="tblQmlPropNode"><p>
<a name="focusReason-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">focusReason</span> : <span class="type"><a href="../qtqml/qml-enumeration.html">enumeration</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the reason of the last focus change.</p>
<p><b>Note: </b>This property does not indicate whether the control has <a href="../qtquick/qml-qtquick-item.html#activeFocus-prop">active focus</a>, but the reason why the control either gained or lost focus.</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>Qt.MouseFocusReason</code></td><td class="topAlign">A mouse action occurred.</td></tr>
<tr><td class="topAlign"><code>Qt.TabFocusReason</code></td><td class="topAlign">The Tab key was pressed.</td></tr>
<tr><td class="topAlign"><code>Qt.BacktabFocusReason</code></td><td class="topAlign">A Backtab occurred. The input for this may include the Shift or Control keys; e.g&#x2e; Shift+Tab.</td></tr>
<tr><td class="topAlign"><code>Qt.ActiveWindowFocusReason</code></td><td class="topAlign">The window system made this window either active or inactive.</td></tr>
<tr><td class="topAlign"><code>Qt.PopupFocusReason</code></td><td class="topAlign">The application opened/closed a pop-up that grabbed/released the keyboard focus.</td></tr>
<tr><td class="topAlign"><code>Qt.ShortcutFocusReason</code></td><td class="topAlign">The user typed a label's buddy shortcut</td></tr>
<tr><td class="topAlign"><code>Qt.MenuBarFocusReason</code></td><td class="topAlign">The menu bar took focus.</td></tr>
<tr><td class="topAlign"><code>Qt.OtherFocusReason</code></td><td class="topAlign">Another reason, usually application-specific.</td></tr>
</table></div>
<p><b>See also </b><a href="../qtquick/qml-qtquick-item.html#activeFocus-prop">Item::activeFocus</a> and <a href="qml-qtquick-controls2-control.html#visualFocus-prop">visualFocus</a>.</p>
</div></div><!-- @@@focusReason -->
<br/>
<!-- $$$font -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="font-prop">
<td class="tblQmlPropNode"><p>
<a name="font-prop"></a><span class="name">font</span> : <span class="type"><a href="../qtquick/qml-font.html">font</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the font currently set for the control.</p>
<p>This property describes the control's requested font. The font is used by the control's style when rendering standard components, and is available as a means to ensure that custom controls can maintain consistency with the native platform's native look and feel. It's common that different platforms, or different styles, define different fonts for an application.</p>
<p>The default font depends on the system environment. <a href="qml-qtquick-controls2-applicationwindow.html">ApplicationWindow</a> maintains a system/theme font which serves as a default for all controls. There may also be special font defaults for certain types of controls. You can also set the default font for controls by either:</p>
<ul>
<li>passing a custom font to <a href="../qtgui/qguiapplication.html#setFont">QGuiApplication::setFont()</a>, before loading the QML; or</li>
<li>specifying the fonts in the <a href="qtquickcontrols2-configuration.html">qtquickcontrols2.conf file</a>.</li>
</ul>
<p>Finally, the font is matched against Qt's font database to find the best match.</p>
<p>Control propagates explicit font properties from parent to children. If you change a specific property on a control's font, that property propagates to all of the control's children, overriding any system defaults for that property.</p>
<pre class="cpp">

  Page {
      font<span class="operator">.</span>family: <span class="string">&quot;Courier&quot;</span>

      Column {
          Label {
              text: qsTr(<span class="string">&quot;This will use Courier...&quot;</span>)
          }

          Switch {
              text: qsTr(<span class="string">&quot;... and so will this&quot;</span>)
          }
      }
  }

</pre>
<p>For the full list of available font properties, see the <a href="../qtquick/qml-font.html">font QML Basic Type</a> documentation.</p>
</div></div><!-- @@@font -->
<br/>
<!-- $$$hoverEnabled -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="hoverEnabled-prop">
<td class="tblQmlPropNode"><p>
<a name="hoverEnabled-prop"></a><span class="name">hoverEnabled</span> : <span class="type"><a href="../qtqml/qml-bool.html">bool</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property determines whether the control accepts hover events. The default value is <code>Qt.styleHints.useHoverEffects</code>.</p>
<p>Setting this property propagates the value to all child controls that do not have <code>hoverEnabled</code> explicitly set.</p>
<p>You can also enable or disable hover effects for all Qt Quick Controls 2 applications by setting the <code>QT_QUICK_CONTROLS_HOVER_ENABLED</code> <a href="qtquickcontrols2-environment.html">environment variable</a>.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#hovered-prop">hovered</a>.</p>
</div></div><!-- @@@hoverEnabled -->
<br/>
<!-- $$$hovered -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="hovered-prop">
<td class="tblQmlPropNode"><p>
<a name="hovered-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">hovered</span> : <span class="type"><a href="../qtqml/qml-bool.html">bool</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds whether the control is hovered.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#hoverEnabled-prop">hoverEnabled</a>.</p>
</div></div><!-- @@@hovered -->
<br/>
<!-- $$$leftPadding -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="leftPadding-prop">
<td class="tblQmlPropNode"><p>
<a name="leftPadding-prop"></a><span class="name">leftPadding</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the left padding.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#control-layout">Control Layout</a>, <a href="qml-qtquick-controls2-control.html#padding-prop">padding</a>, <a href="qml-qtquick-controls2-control.html#rightPadding-prop">rightPadding</a>, and <a href="qml-qtquick-controls2-control.html#availableWidth-prop">availableWidth</a>.</p>
</div></div><!-- @@@leftPadding -->
<br/>
<!-- $$$locale -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="locale-prop">
<td class="tblQmlPropNode"><p>
<a name="locale-prop"></a><span class="name">locale</span> : <span class="type"><a href="../qtqml/qml-qtqml-locale.html">Locale</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the locale of the control.</p>
<p>It contains locale specific properties for formatting data and numbers. Unless a special locale has been set, this is either the parent's locale or the default locale.</p>
<p>Control propagates the locale from parent to children. If you change the control's locale, that locale propagates to all of the control's children, overriding the system default locale.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#mirrored-prop">mirrored</a> and <a href="../qtquick/qml-qtquick-layoutmirroring.html">LayoutMirroring</a>.</p>
</div></div><!-- @@@locale -->
<br/>
<!-- $$$mirrored -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="mirrored-prop">
<td class="tblQmlPropNode"><p>
<a name="mirrored-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">mirrored</span> : <span class="type"><a href="../qtqml/qml-bool.html">bool</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds whether the control is mirrored.</p>
<p>This property is provided for convenience. A control is considered mirrored when its visual layout direction is right-to-left; that is, when using a right-to-left locale or when <a href="../qtquick/qml-qtquick-layoutmirroring.html#enabled-prop">LayoutMirroring.enabled</a> is <code>true</code>.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#locale-prop">locale</a>, <a href="../qtquick/qml-qtquick-layoutmirroring.html">LayoutMirroring</a>, and <a href="../qtquick/qtquick-positioning-righttoleft.html">Right-to-left User Interfaces</a>.</p>
</div></div><!-- @@@mirrored -->
<br/>
<!-- $$$padding -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="padding-prop">
<td class="tblQmlPropNode"><p>
<a name="padding-prop"></a><span class="name">padding</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the default padding.</p>
<p>Padding adds a space between each edge of the content item and the background item, effectively controlling the size of the content item. To specify a padding value for a specific edge of the control, set its relevant property:</p>
<ul>
<li><a href="qml-qtquick-controls2-control.html#leftPadding-prop">leftPadding</a></li>
<li><a href="qml-qtquick-controls2-control.html#rightPadding-prop">rightPadding</a></li>
<li><a href="qml-qtquick-controls2-control.html#topPadding-prop">topPadding</a></li>
<li><a href="qml-qtquick-controls2-control.html#bottomPadding-prop">bottomPadding</a></li>
</ul>
<p><b>Note: </b>Different styles may specify the default padding for certain controls in different ways, and these ways may change over time as the design guidelines that the style is based on evolve. To ensure that these changes don't affect the padding values you have specified, it is best to use the most specific properties available. For example, rather than setting the padding property:</p><pre class="cpp">

  padding: <span class="number">0</span>

</pre>
<p>set each specific property instead:</p>
<pre class="cpp">

  leftPadding: <span class="number">0</span>
  rightPadding: <span class="number">0</span>
  topPadding: <span class="number">0</span>
  bottomPadding: <span class="number">0</span>

</pre>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#control-layout">Control Layout</a>, <a href="qml-qtquick-controls2-control.html#availableWidth-prop">availableWidth</a>, <a href="qml-qtquick-controls2-control.html#availableHeight-prop">availableHeight</a>, <a href="qml-qtquick-controls2-control.html#topPadding-prop">topPadding</a>, <a href="qml-qtquick-controls2-control.html#leftPadding-prop">leftPadding</a>, <a href="qml-qtquick-controls2-control.html#rightPadding-prop">rightPadding</a>, and <a href="qml-qtquick-controls2-control.html#bottomPadding-prop">bottomPadding</a>.</p>
</div></div><!-- @@@padding -->
<br/>
<!-- $$$palette -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="palette-prop">
<td class="tblQmlPropNode"><p>
<a name="palette-prop"></a><span class="name">palette</span> : <span class="type"><a href="qml-palette.html">palette</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the palette currently set for the control.</p>
<p>This property describes the control's requested palette. The palette is used by the control's style when rendering standard components, and is available as a means to ensure that custom controls can maintain consistency with the native platform's native look and feel. It's common that different platforms, or different styles, define different palettes for an application.</p>
<p>The default palette depends on the system environment. <a href="qml-qtquick-controls2-applicationwindow.html">ApplicationWindow</a> maintains a system/theme palette which serves as a default for all controls. There may also be special palette defaults for certain types of controls. You can also set the default palette for controls by either:</p>
<ul>
<li>passing a custom palette to <a href="../qtgui/qguiapplication.html#setPalette">QGuiApplication::setPalette()</a>, before loading any QML; or</li>
<li>specifying the colors in the <a href="qtquickcontrols2-configuration.html">qtquickcontrols2.conf file</a>.</li>
</ul>
<p>Control propagates explicit palette properties from parent to children. If you change a specific property on a control's palette, that property propagates to all of the control's children, overriding any system defaults for that property.</p>
<pre class="cpp">

  Page {
      palette<span class="operator">.</span>text: <span class="string">&quot;red&quot;</span>

      Column {
          Label {
              text: qsTr(<span class="string">&quot;This will use red color...&quot;</span>)
          }

          Switch {
              text: qsTr(<span class="string">&quot;... and so will this&quot;</span>)
          }
      }
  }

</pre>
<p>For the full list of available palette colors, see the <a href="qml-palette.html#qtquickcontrols2-palette">palette QML Basic Type</a> documentation.</p>
<p>This property was introduced in  QtQuick.Controls 2.3 (Qt 5.10).</p>
<p><b>See also </b><a href="qml-qtquick-controls2-applicationwindow.html#palette-prop">ApplicationWindow::palette</a> and <a href="qml-qtquick-controls2-popup.html#palette-prop">Popup::palette</a>.</p>
</div></div><!-- @@@palette -->
<br/>
<!-- $$$rightPadding -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="rightPadding-prop">
<td class="tblQmlPropNode"><p>
<a name="rightPadding-prop"></a><span class="name">rightPadding</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the right padding.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#control-layout">Control Layout</a>, <a href="qml-qtquick-controls2-control.html#padding-prop">padding</a>, <a href="qml-qtquick-controls2-control.html#leftPadding-prop">leftPadding</a>, and <a href="qml-qtquick-controls2-control.html#availableWidth-prop">availableWidth</a>.</p>
</div></div><!-- @@@rightPadding -->
<br/>
<!-- $$$spacing -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="spacing-prop">
<td class="tblQmlPropNode"><p>
<a name="spacing-prop"></a><span class="name">spacing</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the spacing.</p>
<p>Spacing is useful for controls that have multiple or repetitive building blocks. For example, some styles use spacing to determine the distance between the text and indicator of <a href="qml-qtquick-controls2-checkbox.html">CheckBox</a>. Spacing is not enforced by Control, so each style may interpret it differently, and some may ignore it altogether.</p>
</div></div><!-- @@@spacing -->
<br/>
<!-- $$$topPadding -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="topPadding-prop">
<td class="tblQmlPropNode"><p>
<a name="topPadding-prop"></a><span class="name">topPadding</span> : <span class="type"><a href="../qtqml/qml-real.html">real</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds the top padding.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#control-layout">Control Layout</a>, <a href="qml-qtquick-controls2-control.html#padding-prop">padding</a>, <a href="qml-qtquick-controls2-control.html#bottomPadding-prop">bottomPadding</a>, and <a href="qml-qtquick-controls2-control.html#availableHeight-prop">availableHeight</a>.</p>
</div></div><!-- @@@topPadding -->
<br/>
<!-- $$$visualFocus -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="visualFocus-prop">
<td class="tblQmlPropNode"><p>
<a name="visualFocus-prop"></a><span class="qmlreadonly">[read-only] </span><span class="name">visualFocus</span> : <span class="type"><a href="../qtqml/qml-bool.html">bool</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property holds whether the control has visual focus. This property is <code>true</code> when the control has active focus and the focus reason is either <code>Qt.TabFocusReason</code>, <code>Qt.BacktabFocusReason</code>, or <code>Qt.ShortcutFocusReason</code>.</p>
<p>In general, for visualizing key focus, this property is preferred over <a href="../qtquick/qml-qtquick-item.html#activeFocus-prop">Item::activeFocus</a>. This ensures that key focus is only visualized when interacting with keys - not when interacting via touch or mouse.</p>
<p><b>See also </b><a href="qml-qtquick-controls2-control.html#focusReason-prop">focusReason</a> and <a href="../qtquick/qml-qtquick-item.html#activeFocus-prop">Item::activeFocus</a>.</p>
</div></div><!-- @@@visualFocus -->
<br/>
<!-- $$$wheelEnabled -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="wheelEnabled-prop">
<td class="tblQmlPropNode"><p>
<a name="wheelEnabled-prop"></a><span class="name">wheelEnabled</span> : <span class="type"><a href="../qtqml/qml-bool.html">bool</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property determines whether the control handles wheel events. The default value is <code>false</code>.</p>
<p><b>Note: </b>Care must be taken when enabling wheel events for controls within scrollable items such as <a href="../qtquick/qml-qtquick-flickable.html">Flickable</a>, as the control will consume the events and hence interrupt scrolling of the Flickable.</p></div></div><!-- @@@wheelEnabled -->
<br/>
        </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>