/usr/share/qt5/doc/qtqml/qml-qtqml-qt.html is in qtdeclarative5-doc-html 5.5.1-2ubuntu6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 | <?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.5</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul>
<li>Qt 5.5</li>
<li><a href="qtqml-index.html">Qt QML</a></li>
<li><a href="qtqml-qmlmodule.html">QML Types</a></li>
<li>Qt QML Type</li>
<li id="buildversion">Qt 5.5.1 Reference Documentation</li>
</ul>
</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>
<a name="qmlglobalqtobject"></a><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>(data)</li>
<li class="fn"><b><b><a href="qml-qtqml-qt.html#binding-method">binding</a></b></b>(function)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#btoa-method">btoa</a></b></b>(data)</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>(url, mode, parent)</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#font-method">font</a></b></b>(object <i> fontSpecifier</i>)</li>
<li class="fn">list<string> <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>(object)</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>(name)</li>
<li class="fn">string <b><b><a href="qml-qtqml-qt.html#md5-method">md5</a></b></b>(data)</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>
<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">"hello, world"</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<string> 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.arguments</code></td><td >This is a string list of the arguments the executable was invoked with.</td></tr>
<tr valign="top" class="odd"><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="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>
</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">"white"</span> : <span class="string">"lightgray"</span>
<span class="type">Text</span> {
<span class="name">text</span>: <span class="string">"Application "</span> <span class="operator">+</span> (<span class="name">Qt</span>.<span class="name">application</span>.<span class="name">active</span> ? <span class="string">"active"</span> : <span class="string">"inactive"</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>
</ul>
<p>This QML property was introduced in Qt 5.1.</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>"android"</code> - Android</li>
<li><code>"blackberry"</code> - BlackBerry OS</li>
<li><code>"ios"</code> - iOS</li>
<li><code>"linux"</code> - Linux</li>
<li><code>"osx"</code> - OS X</li>
<li><code>"unix"</code> - Other Unix-based OS</li>
<li><code>"windows"</code> - Windows</li>
<li><code>"wince"</code> - Windows CE</li>
<li><code>"winrt"</code> - Windows RT</li>
<li><code>"winphone"</code> - Windows Phone</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>(<span class="type">data</span>)</p></td></tr></table></div></div><div class="qmldoc"><p>ASCII to binary - this function returns a base64 decoding of <code>data</code>.</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>(<span class="type">function</span>)</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">"Default text"</span>
property <span class="type">string</span> <span class="name">dynamicText</span>: <span class="string">"Dynamic text"</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">"Root text"</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">"DynamicText.qml"</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">"Modified root text"</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">"Modified text element text"</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">"Root text"</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">"Modified root text"</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">"Modified dynamic text"</span>
}
<span class="name">Component</span>.onCompleted: {
<span class="name">loaderOne</span>.<span class="name">setSource</span>(<span class="string">"DynamicText.qml"</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">"DynamicText.qml"</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>(<span class="type">data</span>)</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/>
<!-- $$$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>(<span class="type"><a href="qml-url.html">url</a></span>, <span class="type">mode</span>, <span class="type">parent</span>)</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.</p>
<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.</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">"Button.qml"</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">"red"</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>string</i> of QML 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: "red"; width: 20; height: 20}'</span>,
<span class="name">parentItem</span>,
<span class="string">"dynamicSnippet1"</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: { "lineNumber" : 1, "columnNumber" : 32, "fileName" : "dynamicSnippet1", "message" : "Cannot assign to non-existent property "colro""}.</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/>
<!-- $$$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><<span class="type">string</span>> <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. 'Mon' to 'Sun'). Uses QDate::shortDayName().</td></tr>
<tr valign="top" class="even"><td >dddd</td><td >the long localized day name (e.g. '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. 'Jan' to 'Dec'). Uses QDate::shortMonthName().</td></tr>
<tr valign="top" class="even"><td >MMMM</td><td >the long localized month name (e.g. '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 "AM" or "PM".</td></tr>
<tr valign="top" class="even"><td >ap</td><td >use am/pm display. <i>ap</i> will be replaced by either "am" or "pm".</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 ("''") 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 >"dd.MM.yyyy"</td><td >21.05.2001</td></tr>
<tr valign="top" class="even"><td >"ddd MMMM d yy"</td><td >Tue May 21 01</td></tr>
<tr valign="top" class="odd"><td >"hh:mm:ss.zzz"</td><td >14:13:09.042</td></tr>
<tr valign="top" class="even"><td >"h:m:s ap"</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>(<span class="type">object</span>)</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>(<span class="type">name</span>)</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 "language[_territory][.codeset][@modifier]" or "C", 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 "C" 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>(<span class="type">data</span>)</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.</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">"hello"</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> >= 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">"hello_id"</span>) }</pre>
<p>It is possible to supply a source string template like:</p>
<p><code>//% <string></code></p>
<p>or</p>
<p><code>\begincomment% <string> \endcomment</code></p>
<p>Example:</p>
<pre class="qml"><span class="type">Text</span> {
<span class="comment">//% "hello"</span>
<span class="name">text</span>: <span class="name">qsTrId</span>(<span class="string">"hello_id"</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">"hello_id"</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">"hello"</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">"CustomContext"</span>, <span class="string">"hello"</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">"CustomContext"</span>, <span class="string">"hello"</span>)
<span class="type">Text</span> { <span class="name">text</span>: <span class="name">qsTranslate</span>(<span class="string">"CustomContext"</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>
</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">"lightsteelblue"</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">"lightsteelblue"</span>, <span class="string">"#10FF0000"</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">©</acronym> 2015 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>
|