Sophie

Sophie

distrib > Mageia > 6 > i586 > by-pkgid > 2cba8df17162abb32fcb8e6852f3eacc > files > 85

qtdeclarative5-doc-5.9.4-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" />
<!-- qqmlengine.cpp -->
  <title>Qt QML Type | Qt QML 5.9</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 >Qt 5.9</td><td ><a href="qtqml-index.html">Qt QML</a></td><td ><a href="qtqml-qmlmodule.html">QML Types</a></td><td >Qt QML Type</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 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="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#enums">Enums</a></li>
<li class="level2"><a href="#types">Types</a></li>
<li class="level2"><a href="#date-time-formatters">Date/Time Formatters</a></li>
<li class="level2"><a href="#dynamic-object-creation">Dynamic Object Creation</a></li>
<li class="level2"><a href="#other-functions">Other Functions</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Qt QML Type</h1>
<span class="subtitle"></span>
<!-- $$$Qt-brief -->
<p>Provides a global object with useful enums and functions from Qt. <a href="#details">More...</a></p>
<!-- @@@Qt -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQml 2.2</td></tr></table></div><ul>
<li><a href="qml-qtqml-qt-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-qtqml-qt.html#application-prop">application</a></b></b> : object</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#inputMethod-prop">inputMethod</a></b></b> : object</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#platform-prop">platform</a></b></b> : object</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#styleHints-prop">styleHints</a></b></b> : object</li>
</ul>
<a name="methods"></a>
<h2 id="methods">Methods</h2>
<ul>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#atob-method">atob</a></b></b>(<i>data</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#binding-method">binding</a></b></b>(<i>function</i>)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#btoa-method">btoa</a></b></b>(<i>data</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#callLater-method-1">callLater</a></b></b>(<i>function</i>, <i>argument1</i>, <i>argument2</i>, <i>...</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#callLater-method">callLater</a></b></b>(<i>function</i>)</li>
<li class="fn">color <b><b><a href="qml-qtqml-qt.html#colorEqual-method">colorEqual</a></b></b>(color <i>lhs</i>, string <i>rhs</i>)</li>
<li class="fn">object <b><b><a href="qml-qtqml-qt.html#createComponent-method">createComponent</a></b></b>(<i>url</i>, <i>mode</i>, <i>parent</i>)</li>
<li class="fn">object <b><b><a href="qml-qtqml-qt.html#createQmlObject-method">createQmlObject</a></b></b>(string <i>qml</i>, object <i>parent</i>, string <i>filepath</i>)</li>
<li class="fn">color <b><b><a href="qml-qtqml-qt.html#darker-method">darker</a></b></b>(color <i>baseColor</i>, real <i>factor</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#exit-method">exit</a></b></b>(int <i>retCode</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#font-method">font</a></b></b>(object <i>fontSpecifier</i>)</li>
<li class="fn">list&lt;string&gt; <b><b><a href="qml-qtqml-qt.html#fontFamilies-method">fontFamilies</a></b></b>()</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#formatDate-method">formatDate</a></b></b>(datetime <i>date</i>, variant <i>format</i>)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#formatDateTime-method">formatDateTime</a></b></b>(datetime <i>dateTime</i>, variant <i>format</i>)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#formatTime-method">formatTime</a></b></b>(datetime <i>time</i>, variant <i>format</i>)</li>
<li class="fn">color <b><b><a href="qml-qtqml-qt.html#hsla-method">hsla</a></b></b>(real <i>hue</i>, real <i>saturation</i>, real <i>lightness</i>, real <i>alpha</i>)</li>
<li class="fn">color <b><b><a href="qml-qtqml-qt.html#hsva-method">hsva</a></b></b>(real <i>hue</i>, real <i>saturation</i>, real <i>value</i>, real <i>alpha</i>)</li>
<li class="fn">object <b><b><a href="qml-qtqml-qt.html#include-method">include</a></b></b>(string <i>url</i>, jsobject <i>callback</i>)</li>
<li class="fn">bool <b><b><a href="qml-qtqml-qt.html#isQtObject-method">isQtObject</a></b></b>(<i>object</i>)</li>
<li class="fn">color <b><b><a href="qml-qtqml-qt.html#lighter-method">lighter</a></b></b>(color <i>baseColor</i>, real <i>factor</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#locale-method">locale</a></b></b>(<i>name</i>)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#md5-method">md5</a></b></b>(<i>data</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#matrix4x4-method">matrix4x4</a></b></b>(real <i>m11</i>, real <i>m12</i>, real <i>m13</i>, real <i>m14</i>, real <i>m21</i>, real <i>m22</i>, real <i>m23</i>, real <i>m24</i>, real <i>m31</i>, real <i>m32</i>, real <i>m33</i>, real <i>m34</i>, real <i>m41</i>, real <i>m42</i>, real <i>m43</i>, real <i>m44</i>)</li>
<li class="fn">bool <b><b><a href="qml-qtqml-qt.html#openUrlExternally-method">openUrlExternally</a></b></b>(url <i>target</i>)</li>
<li class="fn">point <b><b><a href="qml-qtqml-qt.html#point-method">point</a></b></b>(int <i>x</i>, int <i>y</i>)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#qsTr-method">qsTr</a></b></b>(string <i>sourceText</i>, string <i>disambiguation</i>, int <i>n</i>)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#qsTrId-method">qsTrId</a></b></b>(string <i>id</i>, int <i>n</i>)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#qsTrIdNoOp-method">qsTrIdNoOp</a></b></b>(string <i>id</i>)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#qsTrNoOp-method">qsTrNoOp</a></b></b>(string <i>sourceText</i>, string <i>disambiguation</i>)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#qsTranslate-method">qsTranslate</a></b></b>(string <i>context</i>, string <i>sourceText</i>, string <i>disambiguation</i>, int <i>n</i>)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#qsTranslateNoOp-method">qsTranslateNoOp</a></b></b>(string <i>context</i>, string <i>sourceText</i>, string <i>disambiguation</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#quaternion-method">quaternion</a></b></b>(real <i>scalar</i>, real <i>x</i>, real <i>y</i>, real <i>z</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#quit-method">quit</a></b></b>()</li>
<li class="fn">rect <b><b><a href="qml-qtqml-qt.html#rect-method">rect</a></b></b>(int <i>x</i>, int <i>y</i>, int <i>width</i>, int <i>height</i>)</li>
<li class="fn">url <b><b><a href="qml-qtqml-qt.html#resolvedUrl-method">resolvedUrl</a></b></b>(url <i>url</i>)</li>
<li class="fn">color <b><b><a href="qml-qtqml-qt.html#rgba-method">rgba</a></b></b>(real <i>red</i>, real <i>green</i>, real <i>blue</i>, real <i>alpha</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#size-method">size</a></b></b>(int <i>width</i>, int <i>height</i>)</li>
<li class="fn">color <b><b><a href="qml-qtqml-qt.html#tint-method">tint</a></b></b>(color <i>baseColor</i>, color <i>tintColor</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#vector2d-method">vector2d</a></b></b>(real <i>x</i>, real <i>y</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#vector3d-method">vector3d</a></b></b>(real <i>x</i>, real <i>y</i>, real <i>z</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#vector4d-method">vector4d</a></b></b>(real <i>x</i>, real <i>y</i>, real <i>z</i>, real <i>w</i>)</li>
</ul>
<!-- $$$Qt-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p>The <code>Qt</code> object is a global object with utility functions, properties and enums.</p>
<p>It is not instantiable; to use it, call the members of the global <code>Qt</code> object directly. For example:</p>
<pre class="qml">

  import QtQuick 2.0

  <span class="type">Text</span> {
      <span class="name">color</span>: <span class="name">Qt</span>.<span class="name">rgba</span>(<span class="number">1</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">1</span>)
      <span class="name">text</span>: <span class="name">Qt</span>.<span class="name">md5</span>(<span class="string">&quot;hello, world&quot;</span>)
  }

</pre>
<a name="enums"></a>
<h2 id="enums">Enums</h2>
<p>The Qt object contains the enums available in the <a href="qml-qtqml-qt.html">Qt Namespace</a>. For example, you can access the Qt::LeftButton and Qt::RightButton enumeration values as <code>Qt.LeftButton</code> and <code>Qt.RightButton</code>.</p>
<a name="types"></a>
<h2 id="types">Types</h2>
<p>The Qt object also contains helper functions for creating objects of specific data types. This is primarily useful when setting the properties of an item when the property has one of the following types:</p>
<ul>
<li><code>rect</code> - use <a href="qml-qtqml-qt.html#rect-method">Qt.rect()</a></li>
<li><code>point</code> - use <a href="qml-qtqml-qt.html#point-method">Qt.point()</a></li>
<li><code>size</code> - use <a href="qml-qtqml-qt.html#size-method">Qt.size()</a></li>
</ul>
<p>If the <code>QtQuick</code> module has been imported, the following helper functions for creating objects of specific data types are also available for clients to use:</p>
<ul>
<li><code>color</code> - use <a href="qml-qtqml-qt.html#rgba-method">Qt.rgba()</a>, <a href="qml-qtqml-qt.html#hsla-method">Qt.hsla()</a>, <a href="qml-qtqml-qt.html#darker-method">Qt.darker()</a>, <a href="qml-qtqml-qt.html#lighter-method">Qt.lighter()</a> or <a href="qml-qtqml-qt.html#tint-method">Qt.tint()</a></li>
<li><code>font</code> - use <a href="qml-qtqml-qt.html#font-method">Qt.font()</a></li>
<li><code>vector2d</code> - use <a href="qml-qtqml-qt.html#vector2d-method">Qt.vector2d()</a></li>
<li><code>vector3d</code> - use <a href="qml-qtqml-qt.html#vector3d-method">Qt.vector3d()</a></li>
<li><code>vector4d</code> - use <a href="qml-qtqml-qt.html#vector4d-method">Qt.vector4d()</a></li>
<li><code>quaternion</code> - use <a href="qml-qtqml-qt.html#quaternion-method">Qt.quaternion()</a></li>
<li><code>matrix4x4</code> - use <a href="qml-qtqml-qt.html#matrix4x4-method">Qt.matrix4x4()</a></li>
</ul>
<p>There are also string based constructors for these types. See <a href="qtqml-typesystem-basictypes.html">QML Basic Types</a> for more information.</p>
<a name="date-time-formatters"></a>
<h2 id="date-time-formatters">Date/Time Formatters</h2>
<p>The Qt object contains several functions for formatting QDateTime, QDate and QTime values.</p>
<ul>
<li><a href="qml-qtqml-qt.html#formatDateTime-method">string Qt.formatDateTime(datetime date, variant format)</a></li>
<li><a href="qml-qtqml-qt.html#formatDate-method">string Qt.formatDate(datetime date, variant format)</a></li>
<li><a href="qml-qtqml-qt.html#formatTime-method">string Qt.formatTime(datetime date, variant format)</a></li>
</ul>
<p>The format specification is described at <a href="qml-qtqml-qt.html#formatDateTime-method">Qt.formatDateTime</a>.</p>
<a name="dynamic-object-creation"></a>
<h2 id="dynamic-object-creation">Dynamic Object Creation</h2>
<p>The following functions on the global object allow you to dynamically create QML items from files or strings. See <a href="qtqml-javascript-dynamicobjectcreation.html">Dynamic QML Object Creation from JavaScript</a> for an overview of their use.</p>
<ul>
<li><a href="qml-qtqml-qt.html#createComponent-method">object Qt.createComponent(url)</a></li>
<li><a href="qml-qtqml-qt.html#createQmlObject-method">object Qt.createQmlObject(string qml, object parent, string filepath)</a></li>
</ul>
<a name="other-functions"></a>
<h2 id="other-functions">Other Functions</h2>
<p>The following functions are also on the Qt object.</p>
<ul>
<li><a href="qml-qtqml-qt.html#quit-method">Qt.quit()</a></li>
<li><a href="qml-qtqml-qt.html#md5-method">Qt.md5(string)</a></li>
<li><a href="qml-qtqml-qt.html#btoa-method">string Qt.btoa(string)</a></li>
<li><a href="qml-qtqml-qt.html#atob-method">string Qt.atob(string)</a></li>
<li><a href="qml-qtqml-qt.html#binding-method">object Qt.binding(function)</a></li>
<li><a href="qml-qtqml-qt.html#locale-method">object Qt.locale()</a></li>
<li><a href="qml-qtqml-qt.html#resolvedUrl-method">string Qt.resolvedUrl(string)</a></li>
<li><a href="qml-qtqml-qt.html#openUrlExternally-method">Qt.openUrlExternally(string)</a></li>
<li><a href="qml-qtqml-qt.html#fontFamilies-method">list&lt;string&gt; Qt.fontFamilies()</a></li>
</ul>
<!-- @@@Qt -->
<h2>Property Documentation</h2>
<!-- $$$application -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="application-prop">
<td class="tblQmlPropNode"><p>
<a name="application-prop"></a><span class="name">application</span> : <span class="type">object</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The <code>application</code> object provides access to global application state properties shared by many QML components.</p>
<p>Its properties are:</p>
<div class="table"><table class="generic">
 <tr valign="top" class="odd"><td ><code>application.active</code></td><td >Deprecated, use Qt.application.state == Qt.ApplicationActive instead.</td></tr>
<tr valign="top" class="even"><td ><code>application.state</code></td><td >This read-only property indicates the current state of the application.<p>Possible values are:</p>
<ul>
<li>Qt.ApplicationActive - The application is the top-most and focused application, and the user is able to interact with the application.</li>
<li>Qt.ApplicationInactive - The application is visible or partially visible, but not selected to be in front, the user cannot interact with the application. On desktop platforms, this typically means that the user activated another application. On mobile platforms, it is more common to enter this state when the OS is interrupting the user with for example incoming calls, SMS-messages or dialogs. This is usually a transient state during which the application is paused. The user may return focus to your application, but most of the time it will be the first indication that the application is going to be suspended. While in this state, consider pausing or stopping any activity that should not continue when the user cannot interact with your application, such as a video, a game, animations, or sensors. You should also avoid performing CPU-intensive tasks which might slow down the application in front.</li>
<li>Qt.ApplicationSuspended - The application is suspended and not visible to the user. On mobile platforms, the application typically enters this state when the user returns to the home screen or switches to another application. While in this state, the application should ensure that the user perceives it as always alive and does not lose his progress, saving any persistent data. The application should cease all activities and be prepared for code execution to stop. While suspended, the application can be killed at any time without further warnings (for example when low memory forces the OS to purge suspended applications).</li>
<li>Qt.ApplicationHidden - The application is hidden and runs in the background. This is the normal state for applications that need to do background processing, like playing music, while the user interacts with other applications. The application should free up all graphical resources when entering this state. A Qt Quick application should not usually handle this state at the QML level. Instead, you should unload the entire UI and reload the QML files whenever the application becomes active again.</li>
</ul>
</td></tr>
<tr valign="top" class="odd"><td ><code>application.layoutDirection</code></td><td >This read-only property can be used to query the default layout direction of the application. On system start-up, the default layout direction depends on the application's language. The property has a value of <code>Qt.RightToLeft</code> in locales where text and graphic elements are read from right to left, and <code>Qt.LeftToRight</code> where the reading direction flows from left to right. You can bind to this property to customize your application layouts to support both layout directions.<p>Possible values are:</p>
<ul>
<li>Qt.LeftToRight - Text and graphics elements should be positioned from left to right.</li>
<li>Qt.RightToLeft - Text and graphics elements should be positioned from right to left.</li>
</ul>
</td></tr>
<tr valign="top" class="even"><td ><code>application.font</code></td><td >This read-only property holds the default application font as returned by QGuiApplication::font().</td></tr>
<tr valign="top" class="odd"><td ><code>application.arguments</code></td><td >This is a string list of the arguments the executable was invoked with.</td></tr>
<tr valign="top" class="even"><td ><code>application.name</code></td><td >This is the application name set on the QCoreApplication instance. This property can be written to in order to set the application name.</td></tr>
<tr valign="top" class="odd"><td ><code>application.displayName</code> (since Qt 5.9)</td><td >This is the application display name set on the QGuiApplication instance. This property can be written to in order to set the application display name.</td></tr>
<tr valign="top" class="even"><td ><code>application.version</code></td><td >This is the application version set on the QCoreApplication instance. This property can be written to in order to set the application version.</td></tr>
<tr valign="top" class="odd"><td ><code>application.organization</code></td><td >This is the organization name set on the QCoreApplication instance. This property can be written to in order to set the organization name.</td></tr>
<tr valign="top" class="even"><td ><code>application.domain</code></td><td >This is the organization domain set on the QCoreApplication instance. This property can be written to in order to set the organization domain.</td></tr>
<tr valign="top" class="odd"><td ><code>application.supportsMultipleWindows</code></td><td >This read-only property can be used to determine whether or not the platform supports multiple windows. Some embedded platforms do not support multiple windows, for example.</td></tr>
<tr valign="top" class="even"><td ><code>application.screens</code></td><td >An array containing the descriptions of all connected screens. The elements of the array are objects with the same properties as the Screen attached object. In practice the array corresponds to the screen list returned by QGuiApplication::screens(). In addition to examining properties like name, width, height, etc., the array elements can also be assigned to the screen property of Window items, thus serving as an alternative to the C++ side's QWindow::setScreen(). This property has been added in Qt 5.9&#x2e;</td></tr>
</table></div>
<p>The object also has one signal, aboutToQuit(), which is the same as QCoreApplication::aboutToQuit().</p>
<p>The following example uses the <code>application</code> object to indicate whether the application is currently active:</p>
<pre class="qml">

  import QtQuick 2.0

  <span class="type">Rectangle</span> {
      <span class="name">width</span>: <span class="number">300</span>; <span class="name">height</span>: <span class="number">55</span>
      <span class="name">color</span>: <span class="name">Qt</span>.<span class="name">application</span>.<span class="name">active</span> ? <span class="string">&quot;white&quot;</span> : <span class="string">&quot;lightgray&quot;</span>
      <span class="type">Text</span> {
          <span class="name">text</span>: <span class="string">&quot;Application &quot;</span> <span class="operator">+</span> (<span class="name">Qt</span>.<span class="name">application</span>.<span class="name">active</span> ? <span class="string">&quot;active&quot;</span> : <span class="string">&quot;inactive&quot;</span>)
          <span class="name">opacity</span>: <span class="name">Qt</span>.<span class="name">application</span>.<span class="name">active</span> ? <span class="number">1.0</span> : <span class="number">0.5</span>
          <span class="name">anchors</span>.centerIn: <span class="name">parent</span>
      }
  }

</pre>
<p>Note that when using QML without a QGuiApplication, the following properties will be undefined:</p>
<ul>
<li>application.active</li>
<li>application.state</li>
<li>application.layoutDirection</li>
<li>application.font</li>
</ul>
<p>This QML property was introduced in  Qt 5.1.</p>
<p><b>See also </b>Screen, Window, and Window.screen.</p>
</div></div><!-- @@@application -->
<br/>
<!-- $$$inputMethod -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="inputMethod-prop">
<td class="tblQmlPropNode"><p>
<a name="inputMethod-prop"></a><span class="name">inputMethod</span> : <span class="type">object</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The <code>inputMethod</code> object allows access to application's QInputMethod object and all its properties and slots. See the QInputMethod documentation for further details.</p>
<p>This QML property was introduced in  Qt 5.0.</p>
</div></div><!-- @@@inputMethod -->
<br/>
<!-- $$$platform -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="platform-prop">
<td class="tblQmlPropNode"><p>
<a name="platform-prop"></a><span class="name">platform</span> : <span class="type">object</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The <code>platform</code> object provides info about the underlying platform.</p>
<p>Its properties are:</p>
<div class="table"><table class="generic">
 <tr valign="top" class="odd"><td ><code>platform.os</code></td><td >This read-only property contains the name of the operating system.<p>Possible values are:</p>
<ul>
<li><code>&quot;android&quot;</code> - Android</li>
<li><code>&quot;ios&quot;</code> - iOS</li>
<li><code>&quot;tvos&quot;</code> - tvOS</li>
<li><code>&quot;linux&quot;</code> - Linux</li>
<li><code>&quot;osx&quot;</code> - macOS</li>
<li><code>&quot;qnx&quot;</code> - QNX (since Qt 5.9&#x2e;3)</li>
<li><code>&quot;unix&quot;</code> - Other Unix-based OS</li>
<li><code>&quot;windows&quot;</code> - Windows</li>
<li><code>&quot;winrt&quot;</code> - WinRT / UWP</li>
</ul>
</td></tr>
</table></div>
<p>This QML property was introduced in  Qt 5.1.</p>
</div></div><!-- @@@platform -->
<br/>
<!-- $$$styleHints -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="styleHints-prop">
<td class="tblQmlPropNode"><p>
<a name="styleHints-prop"></a><span class="name">styleHints</span> : <span class="type">object</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The <code>styleHints</code> object provides platform-specific style hints and settings. See the QStyleHints documentation for further details.</p>
<p><b>Note: </b>The <code>styleHints</code> object is only available when using the Qt Quick module.</p><p>The following example uses the <code>styleHints</code> object to determine whether an item should gain focus on mouse press or touch release:</p>
<pre class="cpp">

  import <span class="type">QtQuick</span> <span class="number">2.4</span>

  MouseArea {
      id: button

      onPressed: {
          <span class="keyword">if</span> (<span class="operator">!</span><span class="type"><a href="qml-qtqml-qt.html">Qt</a></span><span class="operator">.</span>styleHints<span class="operator">.</span>setFocusOnTouchRelease)
              button<span class="operator">.</span>forceActiveFocus()
      }
      onReleased: {
          <span class="keyword">if</span> (<span class="type"><a href="qml-qtqml-qt.html">Qt</a></span><span class="operator">.</span>styleHints<span class="operator">.</span>setFocusOnTouchRelease)
              button<span class="operator">.</span>forceActiveFocus()
      }
  }

</pre>
<p>This QML property was introduced in  Qt 5.5.</p>
</div></div><!-- @@@styleHints -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$atob -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="atob-method">
<td class="tblQmlFuncNode"><p>
<a name="atob-method"></a><span class="type">string</span> <span class="name">atob</span>(<i>data</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>ASCII to binary - this function decodes the base64 encoded <i>data</i> string and returns it.</p>
</div></div><!-- @@@atob -->
<br/>
<!-- $$$binding -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="binding-method">
<td class="tblQmlFuncNode"><p>
<a name="binding-method"></a><span class="name">binding</span>(<i>function</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a JavaScript object representing a <a href="qtqml-syntax-propertybinding.html">property binding</a>.</p>
<p>There are two main use-cases for the function: firstly, to apply a property binding imperatively from JavaScript code:</p>
<pre class="qml">

  <span class="type">Item</span> {
      property <span class="type">bool</span> <span class="name">someCondition</span>: <span class="number">true</span>
      property <span class="type">int</span> <span class="name">edgePosition</span>

      <span class="name">Component</span>.onCompleted: {
          <span class="keyword">if</span> (<span class="name">someCondition</span> <span class="operator">==</span> <span class="number">true</span>) {
              <span class="comment">// bind to the result of the binding expression passed to Qt.binding()</span>
              <span class="name">edgePosition</span> <span class="operator">=</span> <span class="name">Qt</span>.<span class="name">binding</span>(<span class="keyword">function</span>() { <span class="keyword">return</span> <span class="name">x</span> <span class="operator">+</span> <span class="name">width</span> })
          }
      }
  }

</pre>
<p>and secondly, to apply a property binding when initializing property values of dynamically constructed objects (via <a href="qml-qtqml-component.html#createObject-method">Component.createObject()</a> or Loader.setSource()).</p>
<p>For example, assuming the existence of a DynamicText component:</p>
<pre class="qml">

  import QtQuick 2.0

  <span class="type">Text</span> {
      <span class="name">id</span>: <span class="name">textElement</span>
      <span class="name">width</span>: <span class="number">200</span>
      <span class="name">height</span>: <span class="number">200</span>
      <span class="name">text</span>: <span class="string">&quot;Default text&quot;</span>
      property <span class="type">string</span> <span class="name">dynamicText</span>: <span class="string">&quot;Dynamic text&quot;</span>
      <span class="name">onTextChanged</span>: <span class="name">console</span>.<span class="name">log</span>(<span class="name">text</span>)
  }

</pre>
<p>the output from:</p>
<pre class="qml">

  <span class="type">Item</span> {
      <span class="name">id</span>: <span class="name">root</span>
      property <span class="type">string</span> <span class="name">dynamicText</span>: <span class="string">&quot;Root text&quot;</span>

      <span class="name">Component</span>.onCompleted: {
          var <span class="name">c</span> = <span class="name">Qt</span>.<span class="name">createComponent</span>(<span class="string">&quot;DynamicText.qml&quot;</span>)

          var <span class="name">obj1</span> = <span class="name">c</span>.<span class="name">createObject</span>(<span class="name">root</span>, { 'text': <span class="name">Qt</span>.<span class="name">binding</span>(<span class="keyword">function</span>() { <span class="keyword">return</span> <span class="name">dynamicText</span> <span class="operator">+</span> <span class="string">' extra text'</span> }) })
          <span class="name">root</span>.<span class="name">dynamicText</span> <span class="operator">=</span> <span class="string">&quot;Modified root text&quot;</span>

          var <span class="name">obj2</span> = <span class="name">c</span>.<span class="name">createObject</span>(<span class="name">root</span>, { 'text': <span class="name">Qt</span>.<span class="name">binding</span>(<span class="keyword">function</span>() { <span class="keyword">return</span> this.<span class="name">dynamicText</span> <span class="operator">+</span> <span class="string">' extra text'</span> }) })
          <span class="name">obj2</span>.<span class="name">dynamicText</span> <span class="operator">=</span> <span class="string">&quot;Modified dynamic text&quot;</span>
      }
  }

</pre>
<p>and from:</p>
<pre class="qml">

  <span class="type">Item</span> {
      <span class="name">id</span>: <span class="name">root</span>
      property <span class="type">string</span> <span class="name">dynamicText</span>: <span class="string">&quot;Root text&quot;</span>

      <span class="type">Loader</span> {
          <span class="name">id</span>: <span class="name">loaderOne</span>
          <span class="name">onLoaded</span>: <span class="name">root</span>.<span class="name">dynamicText</span> <span class="operator">=</span> <span class="string">&quot;Modified root text&quot;</span>
      }

      <span class="type">Loader</span> {
          <span class="name">id</span>: <span class="name">loaderTwo</span>
          <span class="name">onLoaded</span>: <span class="name">item</span>.<span class="name">dynamicText</span> <span class="operator">=</span> <span class="string">&quot;Modified dynamic text&quot;</span>
      }

      <span class="name">Component</span>.onCompleted: {
          <span class="name">loaderOne</span>.<span class="name">setSource</span>(<span class="string">&quot;DynamicText.qml&quot;</span>, { 'text': <span class="name">Qt</span>.<span class="name">binding</span>(<span class="keyword">function</span>() { <span class="keyword">return</span> <span class="name">dynamicText</span> <span class="operator">+</span> <span class="string">' extra text'</span> }) })
          <span class="name">loaderTwo</span>.<span class="name">setSource</span>(<span class="string">&quot;DynamicText.qml&quot;</span>, { 'text': <span class="name">Qt</span>.<span class="name">binding</span>(<span class="keyword">function</span>() { <span class="keyword">return</span> this.<span class="name">dynamicText</span> <span class="operator">+</span> <span class="string">' extra text'</span> }) })
      }
  }

</pre>
<p>should both be:</p>
<pre class="cpp">

  Root text extra text
  Modified root text extra text
  Dynamic text extra text
  Modified dynamic text extra text

</pre>
<p>This function cannot be used in property binding declarations (see the documentation on <a href="qtqml-syntax-propertybinding.html#qml-javascript-assignment">binding declarations and binding assignments</a>) except when the result is stored in an array bound to a var property.</p>
<pre class="qml">

  <span class="type">Item</span> {
      <span class="name">width</span>: <span class="number">50</span>
      property <span class="type">var</span> <span class="name">storedBindings</span>: [ <span class="name">Qt</span>.<span class="name">binding</span>(<span class="keyword">function</span>() { <span class="keyword">return</span> <span class="name">x</span> <span class="operator">+</span> <span class="name">width</span> }) ] <span class="comment">// stored</span>
      property <span class="type">int</span> <span class="name">a</span>: <span class="name">Qt</span>.<span class="name">binding</span>(<span class="keyword">function</span>() { <span class="keyword">return</span> <span class="name">x</span> <span class="operator">+</span> <span class="name">width</span> }) <span class="comment">// error!</span>
      property <span class="type">int</span> <span class="name">b</span>

      <span class="name">Component</span>.onCompleted: {
          <span class="name">b</span> <span class="operator">=</span> <span class="name">storedBindings</span>[<span class="number">0</span>] <span class="comment">// causes binding assignment</span>
      }
  }

</pre>
<p><b>Note: </b>In Qt Quick 1, all function assignments were treated as binding assignments. The Qt.binding() function is new to Qt Quick 2.</p><p>This QML method was introduced in  Qt 5.0.</p>
</div></div><!-- @@@binding -->
<br/>
<!-- $$$btoa -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="btoa-method">
<td class="tblQmlFuncNode"><p>
<a name="btoa-method"></a><span class="type">string</span> <span class="name">btoa</span>(<i>data</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Binary to ASCII - this function returns a base64 encoding of <code>data</code>.</p>
</div></div><!-- @@@btoa -->
<br/>
<!-- $$$callLater -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="callLater-method-1">
<td class="tblQmlFuncNode"><p>
<a name="callLater-method-1"></a><span class="name">callLater</span>(<i>function</i>, <i>argument1</i>, <i>argument2</i>, <i>...</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Use this function to eliminate redundant calls to a function or signal.</p>
<p>The function passed as the first argument to Qt.<a href="qml-qtqml-qt.html#callLater-method">callLater()</a> will be called later, once the QML engine returns to the event loop.</p>
<p>When this function is called multiple times in quick succession with the same function as its first argument, that function will be called only once.</p>
<p>For example:</p>
<pre class="qml">

  import QtQuick 2.0

  <span class="type">Rectangle</span> {
      <span class="name">width</span>: <span class="number">480</span>
      <span class="name">height</span>: <span class="number">320</span>

      property <span class="type">int</span> <span class="name">callsToUpdateMinimumWidth</span>: <span class="number">0</span>
      property <span class="type">bool</span> <span class="name">optimize</span>: <span class="number">true</span>

      property <span class="type">int</span> <span class="name">currentTextModel</span>: <span class="number">0</span>
      property <span class="type">var</span> <span class="name">columnTexts</span>: [
          [<span class="string">&quot;Click on either&quot;</span>, <span class="string">&quot;rectangle above&quot;</span>, <span class="string">&quot;and note how the counter&quot;</span>, <span class="string">&quot;below updates&quot;</span>, <span class="string">&quot;significantly faster using the&quot;</span>, <span class="string">&quot;regular (non-optimized)&quot;</span>, <span class="string">&quot;implementation&quot;</span>],
          [<span class="string">&quot;The width&quot;</span>, <span class="string">&quot;of this column&quot;</span>, <span class="string">&quot;is&quot;</span>, <span class="string">&quot;no wider than the&quot;</span>, <span class="string">&quot;widest item&quot;</span>],
          [<span class="string">&quot;Note how using Qt.callLater()&quot;</span>, <span class="string">&quot;the minimum width is&quot;</span>, <span class="string">&quot;calculated a bare-minimum&quot;</span>, <span class="string">&quot;number&quot;</span>, <span class="string">&quot;of times&quot;</span>]
      ]

      <span class="type">Text</span> {
          <span class="name">x</span>: <span class="number">20</span>; <span class="name">y</span>: <span class="number">280</span>
          <span class="name">text</span>: <span class="string">&quot;Times minimum width has been calculated: &quot;</span> <span class="operator">+</span> <span class="name">callsToUpdateMinimumWidth</span>
      }

      <span class="type">Row</span> {
          <span class="name">y</span>: <span class="number">25</span>; <span class="name">spacing</span>: <span class="number">30</span>; <span class="name">anchors</span>.horizontalCenter: <span class="name">parent</span>.<span class="name">horizontalCenter</span>
          <span class="type">Rectangle</span> {
              <span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>:  <span class="number">50</span>; <span class="name">color</span>: <span class="string">&quot;lightgreen&quot;</span>
              <span class="type">Text</span> { <span class="name">text</span>: <span class="string">&quot;Optimized behavior\nusing Qt.callLater()&quot;</span>; <span class="name">anchors</span>.centerIn: <span class="name">parent</span> }
              <span class="type">MouseArea</span> { <span class="name">anchors</span>.fill: <span class="name">parent</span>; <span class="name">onClicked</span>: { <span class="name">optimize</span> <span class="operator">=</span> <span class="number">true</span>; currentTextModel++ } }
          }
          <span class="type">Rectangle</span> {
              <span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>:  <span class="number">50</span>; <span class="name">color</span>: <span class="string">&quot;lightblue&quot;</span>
              <span class="type">Text</span> { <span class="name">text</span>: <span class="string">&quot;Regular behavior&quot;</span>; <span class="name">anchors</span>.centerIn: <span class="name">parent</span>}
              <span class="type">MouseArea</span> { <span class="name">anchors</span>.fill: <span class="name">parent</span>; <span class="name">onClicked</span>: { <span class="name">optimize</span> <span class="operator">=</span> <span class="number">false</span>; currentTextModel++ } }
          }
      }

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

          <span class="name">onChildrenChanged</span>: <span class="name">optimize</span> ? <span class="name">Qt</span>.<span class="name">callLater</span>(<span class="name">updateMinimumWidth</span>) : <span class="name">updateMinimumWidth</span>()

          property <span class="type">int</span> <span class="name">widestChild</span>
          <span class="keyword">function</span> <span class="name">updateMinimumWidth</span>() {
              callsToUpdateMinimumWidth++
              var <span class="name">w</span> = <span class="number">0</span>;
              <span class="keyword">for</span> (<span class="keyword">var</span> <span class="name">i</span> in <span class="name">children</span>) {
                  var <span class="name">child</span> = <span class="name">children</span>[<span class="name">i</span>];
                  <span class="keyword">if</span> (<span class="name">child</span>.<span class="name">implicitWidth</span> <span class="operator">&gt;</span> <span class="name">w</span>) {
                      <span class="name">w</span> <span class="operator">=</span> <span class="name">child</span>.<span class="name">implicitWidth</span>;
                  }
              }

              <span class="name">widestChild</span> <span class="operator">=</span> <span class="name">w</span>;
          }

          <span class="type">Repeater</span> {
              <span class="name">id</span>: <span class="name">repeater</span>
              <span class="name">model</span>: <span class="name">columnTexts</span>[<span class="name">currentTextModel</span><span class="operator">%</span><span class="number">3</span>]
              <span class="name">delegate</span>: <span class="name">Text</span> {
                  <span class="name">color</span>: <span class="string">&quot;white&quot;</span>
                  <span class="name">text</span>: <span class="name">modelData</span>
                  <span class="name">width</span>: <span class="name">column</span>.<span class="name">widestChild</span>
                  <span class="name">horizontalAlignment</span>: <span class="name">Text</span>.<span class="name">Center</span>
                  <span class="type">Rectangle</span> { <span class="name">anchors</span>.fill: <span class="name">parent</span>; <span class="name">z</span>: -<span class="number">1</span>; <span class="name">color</span>: <span class="name">index</span><span class="operator">%</span><span class="number">2</span> ? <span class="string">&quot;gray&quot;</span> : <span class="string">&quot;darkgray&quot;</span> }
              }
          }
      }
  }

</pre>
<p>Any additional arguments passed to Qt.<a href="qml-qtqml-qt.html#callLater-method">callLater()</a> will be passed on to the function invoked. Note that if redundant calls are eliminated, then only the last set of arguments will be passed to the function.</p>
<p>This QML method was introduced in  Qt 5.8.</p>
</div></div><!-- @@@callLater -->
<br/>
<!-- $$$callLater -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="callLater-method">
<td class="tblQmlFuncNode"><p>
<a name="callLater-method"></a><span class="name">callLater</span>(<i>function</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Use this function to eliminate redundant calls to a function or signal.</p>
<p>The function passed as the first argument to Qt.callLater() will be called later, once the QML engine returns to the event loop.</p>
<p>When this function is called multiple times in quick succession with the same function as its first argument, that function will be called only once.</p>
<p>For example:</p>
<pre class="qml">

  import QtQuick 2.0

  <span class="type">Rectangle</span> {
      <span class="name">width</span>: <span class="number">480</span>
      <span class="name">height</span>: <span class="number">320</span>

      property <span class="type">int</span> <span class="name">callsToUpdateMinimumWidth</span>: <span class="number">0</span>
      property <span class="type">bool</span> <span class="name">optimize</span>: <span class="number">true</span>

      property <span class="type">int</span> <span class="name">currentTextModel</span>: <span class="number">0</span>
      property <span class="type">var</span> <span class="name">columnTexts</span>: [
          [<span class="string">&quot;Click on either&quot;</span>, <span class="string">&quot;rectangle above&quot;</span>, <span class="string">&quot;and note how the counter&quot;</span>, <span class="string">&quot;below updates&quot;</span>, <span class="string">&quot;significantly faster using the&quot;</span>, <span class="string">&quot;regular (non-optimized)&quot;</span>, <span class="string">&quot;implementation&quot;</span>],
          [<span class="string">&quot;The width&quot;</span>, <span class="string">&quot;of this column&quot;</span>, <span class="string">&quot;is&quot;</span>, <span class="string">&quot;no wider than the&quot;</span>, <span class="string">&quot;widest item&quot;</span>],
          [<span class="string">&quot;Note how using Qt.callLater()&quot;</span>, <span class="string">&quot;the minimum width is&quot;</span>, <span class="string">&quot;calculated a bare-minimum&quot;</span>, <span class="string">&quot;number&quot;</span>, <span class="string">&quot;of times&quot;</span>]
      ]

      <span class="type">Text</span> {
          <span class="name">x</span>: <span class="number">20</span>; <span class="name">y</span>: <span class="number">280</span>
          <span class="name">text</span>: <span class="string">&quot;Times minimum width has been calculated: &quot;</span> <span class="operator">+</span> <span class="name">callsToUpdateMinimumWidth</span>
      }

      <span class="type">Row</span> {
          <span class="name">y</span>: <span class="number">25</span>; <span class="name">spacing</span>: <span class="number">30</span>; <span class="name">anchors</span>.horizontalCenter: <span class="name">parent</span>.<span class="name">horizontalCenter</span>
          <span class="type">Rectangle</span> {
              <span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>:  <span class="number">50</span>; <span class="name">color</span>: <span class="string">&quot;lightgreen&quot;</span>
              <span class="type">Text</span> { <span class="name">text</span>: <span class="string">&quot;Optimized behavior\nusing Qt.callLater()&quot;</span>; <span class="name">anchors</span>.centerIn: <span class="name">parent</span> }
              <span class="type">MouseArea</span> { <span class="name">anchors</span>.fill: <span class="name">parent</span>; <span class="name">onClicked</span>: { <span class="name">optimize</span> <span class="operator">=</span> <span class="number">true</span>; currentTextModel++ } }
          }
          <span class="type">Rectangle</span> {
              <span class="name">width</span>: <span class="number">200</span>; <span class="name">height</span>:  <span class="number">50</span>; <span class="name">color</span>: <span class="string">&quot;lightblue&quot;</span>
              <span class="type">Text</span> { <span class="name">text</span>: <span class="string">&quot;Regular behavior&quot;</span>; <span class="name">anchors</span>.centerIn: <span class="name">parent</span>}
              <span class="type">MouseArea</span> { <span class="name">anchors</span>.fill: <span class="name">parent</span>; <span class="name">onClicked</span>: { <span class="name">optimize</span> <span class="operator">=</span> <span class="number">false</span>; currentTextModel++ } }
          }
      }

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

          <span class="name">onChildrenChanged</span>: <span class="name">optimize</span> ? <span class="name">Qt</span>.<span class="name">callLater</span>(<span class="name">updateMinimumWidth</span>) : <span class="name">updateMinimumWidth</span>()

          property <span class="type">int</span> <span class="name">widestChild</span>
          <span class="keyword">function</span> <span class="name">updateMinimumWidth</span>() {
              callsToUpdateMinimumWidth++
              var <span class="name">w</span> = <span class="number">0</span>;
              <span class="keyword">for</span> (<span class="keyword">var</span> <span class="name">i</span> in <span class="name">children</span>) {
                  var <span class="name">child</span> = <span class="name">children</span>[<span class="name">i</span>];
                  <span class="keyword">if</span> (<span class="name">child</span>.<span class="name">implicitWidth</span> <span class="operator">&gt;</span> <span class="name">w</span>) {
                      <span class="name">w</span> <span class="operator">=</span> <span class="name">child</span>.<span class="name">implicitWidth</span>;
                  }
              }

              <span class="name">widestChild</span> <span class="operator">=</span> <span class="name">w</span>;
          }

          <span class="type">Repeater</span> {
              <span class="name">id</span>: <span class="name">repeater</span>
              <span class="name">model</span>: <span class="name">columnTexts</span>[<span class="name">currentTextModel</span><span class="operator">%</span><span class="number">3</span>]
              <span class="name">delegate</span>: <span class="name">Text</span> {
                  <span class="name">color</span>: <span class="string">&quot;white&quot;</span>
                  <span class="name">text</span>: <span class="name">modelData</span>
                  <span class="name">width</span>: <span class="name">column</span>.<span class="name">widestChild</span>
                  <span class="name">horizontalAlignment</span>: <span class="name">Text</span>.<span class="name">Center</span>
                  <span class="type">Rectangle</span> { <span class="name">anchors</span>.fill: <span class="name">parent</span>; <span class="name">z</span>: -<span class="number">1</span>; <span class="name">color</span>: <span class="name">index</span><span class="operator">%</span><span class="number">2</span> ? <span class="string">&quot;gray&quot;</span> : <span class="string">&quot;darkgray&quot;</span> }
              }
          }
      }
  }

</pre>
<p>Any additional arguments passed to Qt.callLater() will be passed on to the function invoked. Note that if redundant calls are eliminated, then only the last set of arguments will be passed to the function.</p>
<p>This QML method was introduced in  Qt 5.8.</p>
</div></div><!-- @@@callLater -->
<br/>
<!-- $$$colorEqual -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="colorEqual-method">
<td class="tblQmlFuncNode"><p>
<a name="colorEqual-method"></a><span class="type">color</span> <span class="name">colorEqual</span>(<span class="type">color</span> <i>lhs</i>, <span class="type">string</span> <i>rhs</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns true if both <code>lhs</code> and <code>rhs</code> yield equal color values. Both arguments may be either color values or string values. If a string value is supplied it must be convertible to a color, as described for the color basic type.</p>
</div></div><!-- @@@colorEqual -->
<br/>
<!-- $$$createComponent -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="createComponent-method">
<td class="tblQmlFuncNode"><p>
<a name="createComponent-method"></a><span class="type">object</span> <span class="name">createComponent</span>(<i>url</i>, <i>mode</i>, <i>parent</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a <a href="qml-qtqml-component.html">Component</a> object created using the QML file at the specified <i>url</i>, or <code>null</code> if an empty string was given.</p>
<p>The returned component's <a href="qml-qtqml-component.html#status-prop">Component::status</a> property indicates whether the component was successfully created. If the status is <code>Component.Error</code>, see <a href="qml-qtqml-component.html#errorString-method">Component::errorString()</a> for an error description.</p>
<p>If the optional <i>mode</i> parameter is set to <code>Component.Asynchronous</code>, the component will be loaded in a background thread. The <a href="qml-qtqml-component.html#status-prop">Component::status</a> property will be <code>Component.Loading</code> while it is loading. The status will change to <code>Component.Ready</code> if the component loads successfully, or <code>Component.Error</code> if loading fails. This parameter defaults to <code>Component.PreferSynchronous</code> if omitted.</p>
<p>If <i>mode</i> is set to <code>Component.PreferSynchronous</code>, Qt will attempt to load the component synchronously, but may end up loading it asynchronously if necessary. Scenarios that may cause asynchronous loading include, but are not limited to, the following:</p>
<ul>
<li>The URL refers to a network resource</li>
<li>The component is being created as a result of another component that is being loaded asynchronously</li>
</ul>
<p>If the optional <i>parent</i> parameter is given, it should refer to the object that will become the parent for the created <a href="qml-qtqml-component.html">Component</a> object. If no mode was passed, this can be the second argument.</p>
<p>Call <a href="qml-qtqml-component.html#createObject-method">Component.createObject()</a> on the returned component to create an object instance of the component.</p>
<p>For example:</p>
<pre class="qml">

  import QtQuick 2.0

  <span class="type">Item</span> {
      <span class="name">id</span>: <span class="name">container</span>
      <span class="name">width</span>: <span class="number">300</span>; <span class="name">height</span>: <span class="number">300</span>

      <span class="keyword">function</span> <span class="name">loadButton</span>() {
          var <span class="name">component</span> = <span class="name">Qt</span>.<span class="name">createComponent</span>(<span class="string">&quot;Button.qml&quot;</span>);
          <span class="keyword">if</span> (<span class="name">component</span>.<span class="name">status</span> <span class="operator">==</span> <span class="name">Component</span>.<span class="name">Ready</span>) {
              var <span class="name">button</span> = <span class="name">component</span>.<span class="name">createObject</span>(<span class="name">container</span>);
              <span class="name">button</span>.<span class="name">color</span> <span class="operator">=</span> <span class="string">&quot;red&quot;</span>;
          }
      }

      <span class="name">Component</span>.onCompleted: <span class="name">loadButton</span>()
  }

</pre>
<p>See <a href="qtqml-javascript-dynamicobjectcreation.html">Dynamic QML Object Creation from JavaScript</a> for more information on using this function.</p>
<p>To create a QML object from an arbitrary string of QML (instead of a file), use <a href="qml-qtqml-qt.html#createQmlObject-method">Qt.createQmlObject()</a>.</p>
</div></div><!-- @@@createComponent -->
<br/>
<!-- $$$createQmlObject -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="createQmlObject-method">
<td class="tblQmlFuncNode"><p>
<a name="createQmlObject-method"></a><span class="type">object</span> <span class="name">createQmlObject</span>(<span class="type">string</span> <i>qml</i>, <span class="type">object</span> <i>parent</i>, <span class="type">string</span> <i>filepath</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a new object created from the given <i>qml</i> string which will have the specified <i>parent</i>, or <code>null</code> if there was an error in creating the object.</p>
<p>If <i>filepath</i> is specified, it will be used for error reporting for the created object.</p>
<p>Example (where <code>parentItem</code> is the id of an existing QML item):</p>
<pre class="qml">

  var <span class="name">newObject</span> = <span class="name">Qt</span>.<span class="name">createQmlObject</span>(<span class="string">'import QtQuick 2.0; Rectangle {color: &quot;red&quot;; width: 20; height: 20}'</span>,
                                     <span class="name">parentItem</span>,
                                     <span class="string">&quot;dynamicSnippet1&quot;</span>);

</pre>
<p>In the case of an error, a Qt Script Error object is thrown. This object has an additional property, <code>qmlErrors</code>, which is an array of the errors encountered. Each object in this array has the members <code>lineNumber</code>, <code>columnNumber</code>, <code>fileName</code> and <code>message</code>. For example, if the above snippet had misspelled color as 'colro' then the array would contain an object like the following: { &quot;lineNumber&quot; : 1, &quot;columnNumber&quot; : 32, &quot;fileName&quot; : &quot;dynamicSnippet1&quot;, &quot;message&quot; : &quot;Cannot assign to non-existent property &quot;colro&quot;&quot;}.</p>
<p>Note that this function returns immediately, and therefore may not work if the <i>qml</i> string loads new components (that is, external QML files that have not yet been loaded). If this is the case, consider using <a href="qml-qtqml-qt.html#createComponent-method">Qt.createComponent()</a> instead.</p>
<p>See <a href="qtqml-javascript-dynamicobjectcreation.html">Dynamic QML Object Creation from JavaScript</a> for more information on using this function.</p>
</div></div><!-- @@@createQmlObject -->
<br/>
<!-- $$$darker -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="darker-method">
<td class="tblQmlFuncNode"><p>
<a name="darker-method"></a><span class="type">color</span> <span class="name">darker</span>(<span class="type">color</span> <i>baseColor</i>, <span class="type">real</span> <i>factor</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a color darker than <code>baseColor</code> by the <code>factor</code> provided.</p>
<p>If the factor is greater than 1.0, this function returns a darker color. Setting factor to 3.0 returns a color that has one-third the brightness. If the factor is less than 1.0, the return color is lighter, but we recommend using the Qt.<a href="qml-qtqml-qt.html#lighter-method">lighter()</a> function for this purpose. If the factor is 0 or negative, the return value is unspecified.</p>
<p>The function converts the current RGB color to HSV, divides the value (V) component by factor and converts the color back to RGB.</p>
<p>If <code>factor</code> is not supplied, returns a color 50% darker than <code>baseColor</code> (factor 2.0).</p>
</div></div><!-- @@@darker -->
<br/>
<!-- $$$exit -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="exit-method">
<td class="tblQmlFuncNode"><p>
<a name="exit-method"></a><span class="name">exit</span>(<span class="type">int</span> <i>retCode</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This function causes the <a href="qqmlengine.html#exit">QQmlEngine::exit</a>(int) signal to be emitted. Within the Prototyping with qmlscene, this causes the launcher application to exit the specified return code. To exit from the event loop with a specified return code when this method is called, a C++ application can connect the <a href="qqmlengine.html#exit">QQmlEngine::exit</a>(int) signal to the QCoreApplication::exit(int) slot.</p>
<p><b>See also </b><a href="qml-qtqml-qt.html#quit-method">quit()</a>.</p>
</div></div><!-- @@@exit -->
<br/>
<!-- $$$font -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="font-method">
<td class="tblQmlFuncNode"><p>
<a name="font-method"></a><span class="name">font</span>(<span class="type">object</span> <i>fontSpecifier</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a Font with the properties specified in the <code>fontSpecifier</code> object or the nearest matching font. The <code>fontSpecifier</code> object should contain key-value pairs where valid keys are the font type's subproperty names, and the values are valid values for each subproperty. Invalid keys will be ignored.</p>
</div></div><!-- @@@font -->
<br/>
<!-- $$$fontFamilies -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="fontFamilies-method">
<td class="tblQmlFuncNode"><p>
<a name="fontFamilies-method"></a><span class="type">list</span>&lt;<span class="type">string</span>&gt; <span class="name">fontFamilies</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a list of the font families available to the application.</p>
</div></div><!-- @@@fontFamilies -->
<br/>
<!-- $$$formatDate -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="formatDate-method">
<td class="tblQmlFuncNode"><p>
<a name="formatDate-method"></a><span class="type">string</span> <span class="name">formatDate</span>(<span class="type">datetime</span> <i>date</i>, <span class="type"><a href="qml-variant.html">variant</a></span> <i>format</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a string representation of <code>date</code>, optionally formatted according to <code>format</code>.</p>
<p>The <i>date</i> parameter may be a JavaScript <code>Date</code> object, a <a href="qml-date.html">date</a> property, a QDate, or QDateTime value. The <i>format</i> parameter may be any of the possible format values as described for <a href="qml-qtqml-qt.html#formatDateTime-method">Qt.formatDateTime()</a>.</p>
<p>If <i>format</i> is not specified, <i>date</i> is formatted using Qt.DefaultLocaleShortDate.</p>
<p><b>See also </b><a href="qml-qtqml-locale.html">Locale</a>.</p>
</div></div><!-- @@@formatDate -->
<br/>
<!-- $$$formatDateTime -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="formatDateTime-method">
<td class="tblQmlFuncNode"><p>
<a name="formatDateTime-method"></a><span class="type">string</span> <span class="name">formatDateTime</span>(<span class="type">datetime</span> <i>dateTime</i>, <span class="type"><a href="qml-variant.html">variant</a></span> <i>format</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a string representation of <code>datetime</code>, optionally formatted according to <code>format</code>.</p>
<p>The <i>date</i> parameter may be a JavaScript <code>Date</code> object, a <a href="qml-date.html">date</a> property, a QDate, QTime, or QDateTime value.</p>
<p>If <i>format</i> is not provided, <i>dateTime</i> is formatted using Qt.DefaultLocaleShortDate. Otherwise, <i>format</i> should be either:</p>
<ul>
<li>One of the Qt::DateFormat enumeration values, such as <code>Qt.DefaultLocaleShortDate</code> or <code>Qt.ISODate</code></li>
<li>A string that specifies the format of the returned string, as detailed below.</li>
</ul>
<p>If <i>format</i> specifies a format string, it should use the following expressions to specify the date:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Expression</th><th >Output</th></tr></thead>
<tr valign="top" class="odd"><td >d</td><td >the day as number without a leading zero (1 to 31)</td></tr>
<tr valign="top" class="even"><td >dd</td><td >the day as number with a leading zero (01 to 31)</td></tr>
<tr valign="top" class="odd"><td >ddd</td><td >the abbreviated localized day name (e.g&#x2e; 'Mon' to 'Sun'). Uses QDate::shortDayName().</td></tr>
<tr valign="top" class="even"><td >dddd</td><td >the long localized day name (e.g&#x2e; 'Monday' to 'Qt::Sunday'). Uses QDate::longDayName().</td></tr>
<tr valign="top" class="odd"><td >M</td><td >the month as number without a leading zero (1-12)</td></tr>
<tr valign="top" class="even"><td >MM</td><td >the month as number with a leading zero (01-12)</td></tr>
<tr valign="top" class="odd"><td >MMM</td><td >the abbreviated localized month name (e.g&#x2e; 'Jan' to 'Dec'). Uses QDate::shortMonthName().</td></tr>
<tr valign="top" class="even"><td >MMMM</td><td >the long localized month name (e.g&#x2e; 'January' to 'December'). Uses QDate::longMonthName().</td></tr>
<tr valign="top" class="odd"><td >yy</td><td >the year as two digit number (00-99)</td></tr>
<tr valign="top" class="even"><td >yyyy</td><td >the year as four digit number</td></tr>
</table></div>
<p>In addition the following expressions can be used to specify the time:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Expression</th><th >Output</th></tr></thead>
<tr valign="top" class="odd"><td >h</td><td >the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display)</td></tr>
<tr valign="top" class="even"><td >hh</td><td >the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display)</td></tr>
<tr valign="top" class="odd"><td >m</td><td >the minute without a leading zero (0 to 59)</td></tr>
<tr valign="top" class="even"><td >mm</td><td >the minute with a leading zero (00 to 59)</td></tr>
<tr valign="top" class="odd"><td >s</td><td >the second without a leading zero (0 to 59)</td></tr>
<tr valign="top" class="even"><td >ss</td><td >the second with a leading zero (00 to 59)</td></tr>
<tr valign="top" class="odd"><td >z</td><td >the milliseconds without leading zeroes (0 to 999)</td></tr>
<tr valign="top" class="even"><td >zzz</td><td >the milliseconds with leading zeroes (000 to 999)</td></tr>
<tr valign="top" class="odd"><td >AP</td><td >use AM/PM display. <i>AP</i> will be replaced by either &quot;AM&quot; or &quot;PM&quot;.</td></tr>
<tr valign="top" class="even"><td >ap</td><td >use am/pm display. <i>ap</i> will be replaced by either &quot;am&quot; or &quot;pm&quot;.</td></tr>
</table></div>
<p>All other input characters will be ignored. Any sequence of characters that are enclosed in single quotes will be treated as text and not be used as an expression. Two consecutive single quotes (&quot;''&quot;) are replaced by a single quote in the output.</p>
<p>For example, if the following date/time value was specified:</p>
<pre class="cpp">

  <span class="comment">// 21 May 2001 14:13:09</span>
  var dateTime <span class="operator">=</span> <span class="keyword">new</span> Date(<span class="number">2001</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span> <span class="number">21</span><span class="operator">,</span> <span class="number">14</span><span class="operator">,</span> <span class="number">13</span><span class="operator">,</span> <span class="number">09</span>)

</pre>
<p>This <i>dateTime</i> value could be passed to <code>Qt.formatDateTime()</code>, <a href="qml-qtqml-qt.html#formatDate-method">Qt.formatDate()</a> or <a href="qml-qtqml-qt.html#formatTime-method">Qt.formatTime()</a> with the <i>format</i> values below to produce the following results:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Format</th><th >Result</th></tr></thead>
<tr valign="top" class="odd"><td >&quot;dd.MM.yyyy&quot;</td><td >21.05.2001</td></tr>
<tr valign="top" class="even"><td >&quot;ddd MMMM d yy&quot;</td><td >Tue May 21 01</td></tr>
<tr valign="top" class="odd"><td >&quot;hh:mm:ss.zzz&quot;</td><td >14:13:09.042</td></tr>
<tr valign="top" class="even"><td >&quot;h:m:s ap&quot;</td><td >2:13:9 pm</td></tr>
</table></div>
<p><b>See also </b><a href="qml-qtqml-locale.html">Locale</a>.</p>
</div></div><!-- @@@formatDateTime -->
<br/>
<!-- $$$formatTime -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="formatTime-method">
<td class="tblQmlFuncNode"><p>
<a name="formatTime-method"></a><span class="type">string</span> <span class="name">formatTime</span>(<span class="type">datetime</span> <i>time</i>, <span class="type"><a href="qml-variant.html">variant</a></span> <i>format</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a string representation of <code>time</code>, optionally formatted according to <code>format</code>.</p>
<p>The <i>time</i> parameter may be a JavaScript <code>Date</code> object, a QTime, or QDateTime value. The <i>format</i> parameter may be any of the possible format values as described for <a href="qml-qtqml-qt.html#formatDateTime-method">Qt.formatDateTime()</a>.</p>
<p>If <i>format</i> is not specified, <i>time</i> is formatted using Qt.DefaultLocaleShortDate.</p>
<p><b>See also </b><a href="qml-qtqml-locale.html">Locale</a>.</p>
</div></div><!-- @@@formatTime -->
<br/>
<!-- $$$hsla -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="hsla-method">
<td class="tblQmlFuncNode"><p>
<a name="hsla-method"></a><span class="type">color</span> <span class="name">hsla</span>(<span class="type">real</span> <i>hue</i>, <span class="type">real</span> <i>saturation</i>, <span class="type">real</span> <i>lightness</i>, <span class="type">real</span> <i>alpha</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a color with the specified <code>hue</code>, <code>saturation</code>, <code>lightness</code> and <code>alpha</code> components. All components should be in the range 0-1 inclusive.</p>
</div></div><!-- @@@hsla -->
<br/>
<!-- $$$hsva -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="hsva-method">
<td class="tblQmlFuncNode"><p>
<a name="hsva-method"></a><span class="type">color</span> <span class="name">hsva</span>(<span class="type">real</span> <i>hue</i>, <span class="type">real</span> <i>saturation</i>, <span class="type">real</span> <i>value</i>, <span class="type">real</span> <i>alpha</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a color with the specified <code>hue</code>, <code>saturation</code>, <code>value</code> and <code>alpha</code> components. All components should be in the range 0-1 inclusive.</p>
<p>This QML method was introduced in  Qt 5.5.</p>
</div></div><!-- @@@hsva -->
<br/>
<!-- $$$include -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="include-method">
<td class="tblQmlFuncNode"><p>
<a name="include-method"></a><span class="type">object</span> <span class="name">include</span>(<span class="type">string</span> <i>url</i>, <span class="type">jsobject</span> <i>callback</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Includes another JavaScript file. This method can only be used from within JavaScript files, and not regular QML files.</p>
<p>This imports all functions from <i>url</i> into the current script's namespace.</p>
<p>Qt.include() returns an object that describes the status of the operation. The object has a single property, <code>status</code>, that is set to one of the following values:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Symbol</th><th >Value</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td >result.OK</td><td >0</td><td >The include completed successfully.</td></tr>
<tr valign="top" class="even"><td >result.LOADING</td><td >1</td><td >Data is being loaded from the network.</td></tr>
<tr valign="top" class="odd"><td >result.NETWORK_ERROR</td><td >2</td><td >A network error occurred while fetching the url.</td></tr>
<tr valign="top" class="even"><td >result.EXCEPTION</td><td >3</td><td >A JavaScript exception occurred while executing the included code. An additional <code>exception</code> property will be set in this case.</td></tr>
</table></div>
<p>The <code>status</code> property will be updated as the operation progresses.</p>
<p>If provided, <i>callback</i> is invoked when the operation completes. The callback is passed the same object as is returned from the Qt.include() call.</p>
</div></div><!-- @@@include -->
<br/>
<!-- $$$isQtObject -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="isQtObject-method">
<td class="tblQmlFuncNode"><p>
<a name="isQtObject-method"></a><span class="type">bool</span> <span class="name">isQtObject</span>(<i>object</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns true if <code>object</code> is a valid reference to a Qt or QML object, otherwise false.</p>
</div></div><!-- @@@isQtObject -->
<br/>
<!-- $$$lighter -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="lighter-method">
<td class="tblQmlFuncNode"><p>
<a name="lighter-method"></a><span class="type">color</span> <span class="name">lighter</span>(<span class="type">color</span> <i>baseColor</i>, <span class="type">real</span> <i>factor</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a color lighter than <code>baseColor</code> by the <code>factor</code> provided.</p>
<p>If the factor is greater than 1.0, this functions returns a lighter color. Setting factor to 1.5 returns a color that is 50% brighter. If the factor is less than 1.0, the return color is darker, but we recommend using the Qt.<a href="qml-qtqml-qt.html#darker-method">darker()</a> function for this purpose. If the factor is 0 or negative, the return value is unspecified.</p>
<p>The function converts the current RGB color to HSV, multiplies the value (V) component by factor and converts the color back to RGB.</p>
<p>If <code>factor</code> is not supplied, returns a color 50% lighter than <code>baseColor</code> (factor 1.5).</p>
</div></div><!-- @@@lighter -->
<br/>
<!-- $$$locale -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="locale-method">
<td class="tblQmlFuncNode"><p>
<a name="locale-method"></a><span class="name">locale</span>(<i>name</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a JS object representing the locale with the specified name, which has the format &quot;language[_territory][.codeset][@modifier]&quot; or &quot;C&quot;, where:</p>
<ul>
<li>language is a lowercase, two-letter, ISO 639 language code,</li>
<li>territory is an uppercase, two-letter, ISO 3166 country code,</li>
<li>and codeset and modifier are ignored.</li>
</ul>
<p>If the string violates the locale format, or language is not a valid ISO 369 code, the &quot;C&quot; locale is used instead. If country is not present, or is not a valid ISO 3166 code, the most appropriate country is chosen for the specified language.</p>
<p><b>See also </b><a href="qml-qtqml-locale.html">Locale</a>.</p>
</div></div><!-- @@@locale -->
<br/>
<!-- $$$md5 -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="md5-method">
<td class="tblQmlFuncNode"><p>
<a name="md5-method"></a><span class="type">string</span> <span class="name">md5</span>(<i>data</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a hex string of the md5 hash of <code>data</code>.</p>
</div></div><!-- @@@md5 -->
<br/>
<!-- $$$matrix4x4 -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="matrix4x4-method">
<td class="tblQmlFuncNode"><p>
<a name="matrix4x4-method"></a><span class="name">matrix4x4</span>(<span class="type">real</span> <i>m11</i>, <span class="type">real</span> <i>m12</i>, <span class="type">real</span> <i>m13</i>, <span class="type">real</span> <i>m14</i>, <span class="type">real</span> <i>m21</i>, <span class="type">real</span> <i>m22</i>, <span class="type">real</span> <i>m23</i>, <span class="type">real</span> <i>m24</i>, <span class="type">real</span> <i>m31</i>, <span class="type">real</span> <i>m32</i>, <span class="type">real</span> <i>m33</i>, <span class="type">real</span> <i>m34</i>, <span class="type">real</span> <i>m41</i>, <span class="type">real</span> <i>m42</i>, <span class="type">real</span> <i>m43</i>, <span class="type">real</span> <i>m44</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a Matrix4x4 with the specified values. Alternatively, the function may be called with a single argument where that argument is a JavaScript array which contains the sixteen matrix values. Finally, the function may be called with no arguments and the resulting matrix will be the identity matrix.</p>
</div></div><!-- @@@matrix4x4 -->
<br/>
<!-- $$$openUrlExternally -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="openUrlExternally-method">
<td class="tblQmlFuncNode"><p>
<a name="openUrlExternally-method"></a><span class="type">bool</span> <span class="name">openUrlExternally</span>(<span class="type"><a href="qml-url.html">url</a></span> <i>target</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Attempts to open the specified <code>target</code> url in an external application, based on the user's desktop preferences. Returns true if it succeeds, and false otherwise.</p>
<p><b>Warning:</b> A return value of <code>true</code> indicates that the application has successfully requested the operating system to open the URL in an external application. The external application may still fail to launch or fail to open the requested URL. This result will not be reported back to the application.</p>
</div></div><!-- @@@openUrlExternally -->
<br/>
<!-- $$$point -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="point-method">
<td class="tblQmlFuncNode"><p>
<a name="point-method"></a><span class="type"><a href="qml-qtqml-qt.html#point-method">point</a></span> <span class="name">point</span>(<span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a Point with the specified <code>x</code> and <code>y</code> coordinates.</p>
</div></div><!-- @@@point -->
<br/>
<!-- $$$qsTr -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="qsTr-method">
<td class="tblQmlFuncNode"><p>
<a name="qsTr-method"></a><span class="type">string</span> <span class="name">qsTr</span>(<span class="type">string</span> <i>sourceText</i>, <span class="type">string</span> <i>disambiguation</i>, <span class="type">int</span> <i>n</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a translated version of <i>sourceText</i>, optionally based on a <i>disambiguation</i> string and value of <i>n</i> for strings containing plurals; otherwise returns <i>sourceText</i> itself if no appropriate translated string is available.</p>
<p>If the same <i>sourceText</i> is used in different roles within the same translation context, an additional identifying string may be passed in for <i>disambiguation</i>.</p>
<p>Example:</p>
<pre class="qml">

  <span class="type">Text</span> { <span class="name">text</span>: <span class="name">qsTr</span>(<span class="string">&quot;hello&quot;</span>) }

</pre>
<p><b>See also </b>Internationalization and Localization with Qt Quick.</p>
</div></div><!-- @@@qsTr -->
<br/>
<!-- $$$qsTrId -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="qsTrId-method">
<td class="tblQmlFuncNode"><p>
<a name="qsTrId-method"></a><span class="type">string</span> <span class="name">qsTrId</span>(<span class="type">string</span> <i>id</i>, <span class="type">int</span> <i>n</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a translated string identified by <i>id</i>. If no matching string is found, the id itself is returned. This should not happen under normal conditions.</p>
<p>If <i>n</i> &gt;= 0, all occurrences of <code>%n</code> in the resulting string are replaced with a decimal representation of <i>n</i>. In addition, depending on <i>n</i>'s value, the translation text may vary.</p>
<p>Example:</p>
<pre class="qml">

  <span class="type">Text</span> { <span class="name">text</span>: <span class="name">qsTrId</span>(<span class="string">&quot;hello_id&quot;</span>) }

</pre>
<p>It is possible to supply a source string template like:</p>
<p><code>//% &lt;string&gt;</code></p>
<p>or</p>
<p><code>\begincomment% &lt;string&gt; \endcomment</code></p>
<p>Example:</p>
<pre class="qml">

  <span class="type">Text</span> {
      <span class="comment">//% &quot;hello&quot;</span>
      <span class="name">text</span>: <span class="name">qsTrId</span>(<span class="string">&quot;hello_id&quot;</span>)
  }

</pre>
<p>Creating binary translation (QM) files suitable for use with this function requires passing the <code>-idbased</code> option to the <code>lrelease</code> tool.</p>
<p><b>See also </b>QT_TRID_NOOP() and Internationalization and Localization with Qt Quick.</p>
</div></div><!-- @@@qsTrId -->
<br/>
<!-- $$$qsTrIdNoOp -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="qsTrIdNoOp-method">
<td class="tblQmlFuncNode"><p>
<a name="qsTrIdNoOp-method"></a><span class="type">string</span> <span class="name">qsTrIdNoOp</span>(<span class="type">string</span> <i>id</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Marks <i>id</i> for dynamic translation.</p>
<p>Returns the <i>id</i>.</p>
<p>QT_TRID_NOOP is used in conjunction with the dynamic translation function <a href="qml-qtqml-qt.html#qsTrId-method">qsTrId()</a>. It identifies a string as requiring translation (so it can be identified by <code>lupdate</code>), but leaves the actual translation to <a href="qml-qtqml-qt.html#qsTrId-method">qsTrId()</a>.</p>
<p>Example:</p>
<pre class="qml">

  <span class="type">Item</span> {
      property <span class="type">string</span> <span class="name">greetingId</span>: <span class="name">QT_TRID_NOOP</span>(<span class="string">&quot;hello_id&quot;</span>)

      <span class="type">Text</span> { <span class="name">text</span>: <span class="name">qsTrId</span>(<span class="name">greetingId</span>) }
  }

</pre>
<p><b>See also </b><a href="qml-qtqml-qt.html#qsTrId-method">qsTrId()</a> and Internationalization and Localization with Qt Quick.</p>
</div></div><!-- @@@qsTrIdNoOp -->
<br/>
<!-- $$$qsTrNoOp -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="qsTrNoOp-method">
<td class="tblQmlFuncNode"><p>
<a name="qsTrNoOp-method"></a><span class="type">string</span> <span class="name">qsTrNoOp</span>(<span class="type">string</span> <i>sourceText</i>, <span class="type">string</span> <i>disambiguation</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Marks <i>sourceText</i> for dynamic translation; i.e, the stored <i>sourceText</i> will not be altered.</p>
<p>If the same <i>sourceText</i> is used in different roles within the same translation context, an additional identifying string may be passed in for <i>disambiguation</i>.</p>
<p>Returns the <i>sourceText</i>.</p>
<p>QT_TR_NOOP is used in conjunction with the dynamic translation functions <a href="qml-qtqml-qt.html#qsTr-method">qsTr()</a> and <a href="qml-qtqml-qt.html#qsTranslate-method">qsTranslate()</a>. It identifies a string as requiring translation (so it can be identified by <code>lupdate</code>), but leaves the actual translation to the dynamic functions.</p>
<p>Example:</p>
<pre class="qml">

  <span class="type">Item</span> {
      property <span class="type">string</span> <span class="name">greeting</span>: <span class="name">QT_TR_NOOP</span>(<span class="string">&quot;hello&quot;</span>)

      <span class="type">Text</span> { <span class="name">text</span>: <span class="name">qsTr</span>(<span class="name">greeting</span>) }
  }

</pre>
<p><b>See also </b>Internationalization and Localization with Qt Quick.</p>
</div></div><!-- @@@qsTrNoOp -->
<br/>
<!-- $$$qsTranslate -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="qsTranslate-method">
<td class="tblQmlFuncNode"><p>
<a name="qsTranslate-method"></a><span class="type">string</span> <span class="name">qsTranslate</span>(<span class="type">string</span> <i>context</i>, <span class="type">string</span> <i>sourceText</i>, <span class="type">string</span> <i>disambiguation</i>, <span class="type">int</span> <i>n</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a translated version of <i>sourceText</i> within the given <i>context</i>, optionally based on a <i>disambiguation</i> string and value of <i>n</i> for strings containing plurals; otherwise returns <i>sourceText</i> itself if no appropriate translated string is available.</p>
<p>If the same <i>sourceText</i> is used in different roles within the same translation <i>context</i>, an additional identifying string may be passed in for <i>disambiguation</i>.</p>
<p>Example:</p>
<pre class="qml">

  <span class="type">Text</span> { <span class="name">text</span>: <span class="name">qsTranslate</span>(<span class="string">&quot;CustomContext&quot;</span>, <span class="string">&quot;hello&quot;</span>) }

</pre>
<p><b>See also </b>Internationalization and Localization with Qt Quick.</p>
</div></div><!-- @@@qsTranslate -->
<br/>
<!-- $$$qsTranslateNoOp -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="qsTranslateNoOp-method">
<td class="tblQmlFuncNode"><p>
<a name="qsTranslateNoOp-method"></a><span class="type">string</span> <span class="name">qsTranslateNoOp</span>(<span class="type">string</span> <i>context</i>, <span class="type">string</span> <i>sourceText</i>, <span class="type">string</span> <i>disambiguation</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Marks <i>sourceText</i> for dynamic translation in the given <i>context</i>; i.e, the stored <i>sourceText</i> will not be altered.</p>
<p>If the same <i>sourceText</i> is used in different roles within the same translation context, an additional identifying string may be passed in for <i>disambiguation</i>.</p>
<p>Returns the <i>sourceText</i>.</p>
<p>QT_TRANSLATE_NOOP is used in conjunction with the dynamic translation functions <a href="qml-qtqml-qt.html#qsTr-method">qsTr()</a> and <a href="qml-qtqml-qt.html#qsTranslate-method">qsTranslate()</a>. It identifies a string as requiring translation (so it can be identified by <code>lupdate</code>), but leaves the actual translation to the dynamic functions.</p>
<p>Example:</p>
<pre class="qml">

  <span class="type">Item</span> {
      property <span class="type">string</span> <span class="name">greeting</span>: <span class="name">QT_TRANSLATE_NOOP</span>(<span class="string">&quot;CustomContext&quot;</span>, <span class="string">&quot;hello&quot;</span>)

      <span class="type">Text</span> { <span class="name">text</span>: <span class="name">qsTranslate</span>(<span class="string">&quot;CustomContext&quot;</span>, <span class="name">greeting</span>) }
  }

</pre>
<p><b>See also </b>Internationalization and Localization with Qt Quick.</p>
</div></div><!-- @@@qsTranslateNoOp -->
<br/>
<!-- $$$quaternion -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="quaternion-method">
<td class="tblQmlFuncNode"><p>
<a name="quaternion-method"></a><span class="name">quaternion</span>(<span class="type">real</span> <i>scalar</i>, <span class="type">real</span> <i>x</i>, <span class="type">real</span> <i>y</i>, <span class="type">real</span> <i>z</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a Quaternion with the specified <code>scalar</code>, <code>x</code>, <code>y</code>, and <code>z</code>.</p>
</div></div><!-- @@@quaternion -->
<br/>
<!-- $$$quit -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="quit-method">
<td class="tblQmlFuncNode"><p>
<a name="quit-method"></a><span class="name">quit</span>()</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This function causes the <a href="qqmlengine.html#quit">QQmlEngine::quit()</a> signal to be emitted. Within the Prototyping with qmlscene, this causes the launcher application to exit; to quit a C++ application when this method is called, connect the <a href="qqmlengine.html#quit">QQmlEngine::quit()</a> signal to the QCoreApplication::quit() slot.</p>
<p><b>See also </b><a href="qml-qtqml-qt.html#exit-method">exit()</a>.</p>
</div></div><!-- @@@quit -->
<br/>
<!-- $$$rect -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="rect-method">
<td class="tblQmlFuncNode"><p>
<a name="rect-method"></a><span class="type"><a href="qml-qtqml-qt.html#rect-method">rect</a></span> <span class="name">rect</span>(<span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</i>, <span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a <code>rect</code> with the top-left corner at <code>x</code>, <code>y</code> and the specified <code>width</code> and <code>height</code>.</p>
<p>The returned object has <code>x</code>, <code>y</code>, <code>width</code> and <code>height</code> attributes with the given values.</p>
</div></div><!-- @@@rect -->
<br/>
<!-- $$$resolvedUrl -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="resolvedUrl-method">
<td class="tblQmlFuncNode"><p>
<a name="resolvedUrl-method"></a><span class="type"><a href="qml-url.html">url</a></span> <span class="name">resolvedUrl</span>(<span class="type"><a href="qml-url.html">url</a></span> <i>url</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns <i>url</i> resolved relative to the URL of the caller.</p>
</div></div><!-- @@@resolvedUrl -->
<br/>
<!-- $$$rgba -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="rgba-method">
<td class="tblQmlFuncNode"><p>
<a name="rgba-method"></a><span class="type">color</span> <span class="name">rgba</span>(<span class="type">real</span> <i>red</i>, <span class="type">real</span> <i>green</i>, <span class="type">real</span> <i>blue</i>, <span class="type">real</span> <i>alpha</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a color with the specified <code>red</code>, <code>green</code>, <code>blue</code> and <code>alpha</code> components. All components should be in the range 0-1 inclusive.</p>
</div></div><!-- @@@rgba -->
<br/>
<!-- $$$size -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="size-method">
<td class="tblQmlFuncNode"><p>
<a name="size-method"></a><span class="name">size</span>(<span class="type">int</span> <i>width</i>, <span class="type">int</span> <i>height</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a Size with the specified <code>width</code> and <code>height</code>.</p>
</div></div><!-- @@@size -->
<br/>
<!-- $$$tint -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="tint-method">
<td class="tblQmlFuncNode"><p>
<a name="tint-method"></a><span class="type">color</span> <span class="name">tint</span>(<span class="type">color</span> <i>baseColor</i>, <span class="type">color</span> <i>tintColor</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This function allows tinting one color with another.</p>
<p>The tint color should usually be mostly transparent, or you will not be able to see the underlying color. The below example provides a slight red tint by having the tint color be pure red which is only 1/16th opaque.</p>
<pre class="qml">

  <span class="type">Item</span> {
      <span class="type">Rectangle</span> {
          <span class="name">x</span>: <span class="number">0</span>; <span class="name">width</span>: <span class="number">80</span>; <span class="name">height</span>: <span class="number">80</span>
          <span class="name">color</span>: <span class="string">&quot;lightsteelblue&quot;</span>
      }
      <span class="type">Rectangle</span> {
          <span class="name">x</span>: <span class="number">100</span>; <span class="name">width</span>: <span class="number">80</span>; <span class="name">height</span>: <span class="number">80</span>
          <span class="name">color</span>: <span class="name">Qt</span>.<span class="name">tint</span>(<span class="string">&quot;lightsteelblue&quot;</span>, <span class="string">&quot;#10FF0000&quot;</span>)
      }
  }

</pre>
<p class="centerAlign"><img src="images/declarative-rect_tint.png" alt="" /></p><p>Tint is most useful when a subtle change is intended to be conveyed due to some event; you can then use tinting to more effectively tune the visible color.</p>
</div></div><!-- @@@tint -->
<br/>
<!-- $$$vector2d -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="vector2d-method">
<td class="tblQmlFuncNode"><p>
<a name="vector2d-method"></a><span class="name">vector2d</span>(<span class="type">real</span> <i>x</i>, <span class="type">real</span> <i>y</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a Vector2D with the specified <code>x</code> and <code>y</code>.</p>
</div></div><!-- @@@vector2d -->
<br/>
<!-- $$$vector3d -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="vector3d-method">
<td class="tblQmlFuncNode"><p>
<a name="vector3d-method"></a><span class="name">vector3d</span>(<span class="type">real</span> <i>x</i>, <span class="type">real</span> <i>y</i>, <span class="type">real</span> <i>z</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a Vector3D with the specified <code>x</code>, <code>y</code> and <code>z</code>.</p>
</div></div><!-- @@@vector3d -->
<br/>
<!-- $$$vector4d -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="vector4d-method">
<td class="tblQmlFuncNode"><p>
<a name="vector4d-method"></a><span class="name">vector4d</span>(<span class="type">real</span> <i>x</i>, <span class="type">real</span> <i>y</i>, <span class="type">real</span> <i>z</i>, <span class="type">real</span> <i>w</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a Vector4D with the specified <code>x</code>, <code>y</code>, <code>z</code> and <code>w</code>.</p>
</div></div><!-- @@@vector4d -->
<br/>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 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>