Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 5918

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qdeclarativeengine.cpp -->
  <title>Qt 4.8: QML Qt Element</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="qdeclarativeelements.html">QML Elements</a></li>
<li>QML Qt Element</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<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>
</ul>
</div>
<h1 class="title">QML Qt Element</h1>
<span class="subtitle"></span>
<!-- $$$QML:Qt-brief -->
<p>The QML global Qt object provides useful enums and functions from Qt. <a href="#details">More...</a></p>
<!-- @@@QML:Qt -->
<ul>
<li><a href="qml-qt-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qt.html#application-prop">application</a></b></b> : object</li>
</ul>
<a name="methods"></a>
<h2>Methods</h2>
<ul>
<li class="fn"><b><b><a href="qml-qt.html#atob-method">atob</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#btoa-method">btoa</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#createComponent-method">createComponent</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#createQmlObject-method">createQmlObject</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#darker-method">darker</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#fontFamilies-method">fontFamilies</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#formatDate-method">formatDate</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#formatDateTime-method">formatDateTime</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#formatTime-method">formatTime</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#hsla-method">hsla</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#include-method">include</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#isQtObject-method">isQtObject</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#lighter-method">lighter</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#md5-method">md5</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#openUrlExternally-method">openUrlExternally</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#point-method">point</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#quit-method">quit</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#rect-method">rect</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#resolvedUrl-method">resolvedUrl</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#rgba-method">rgba</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#size-method">size</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#tint-method">tint</a></b></b></li>
<li class="fn"><b><b><a href="qml-qt.html#vector3d-method">vector3d</a></b></b></li>
</ul>
<!-- $$$QML:Qt-description -->
<a name="details"></a>
<h2>Detailed Description</h2>
<a name="qmlglobalqtobject"></a><p>The <tt>Qt</tt> 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 <tt>Qt</tt> object directly. For example:</p>
<pre class="qml"> import QtQuick 1.0

 <span class="type"><a href="qml-text.html">Text</a></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>Enums</h2>
<p>The Qt object contains the enums available in the <a href="qt.html#qt-namespace">Qt Namespace</a>. For example, you can access the <a href="qt.html#MouseButton-enum">Qt::LeftButton</a> and <a href="qt.html#MouseButton-enum">Qt::RightButton</a> enum values as <tt>Qt.LeftButton</tt> and <tt>Qt.RightButton</tt>.</p>
<a name="types"></a>
<h2>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><tt>color</tt> - use <a href="qml-qt.html#rgba-method">Qt.rgba()</a>, <a href="qml-qt.html#hsla-method">Qt.hsla()</a>, <a href="qml-qt.html#darker-method">Qt.darker()</a>, <a href="qml-qt.html#lighter-method">Qt.lighter()</a> or <a href="qml-qt.html#tint-method">Qt.tint()</a></li>
<li><tt>rect</tt> - use <a href="qml-qt.html#rect-method">Qt.rect()</a></li>
<li><tt>point</tt> - use <a href="qml-qt.html#point-method">Qt.point()</a></li>
<li><tt>size</tt> - use <a href="qml-qt.html#size-method">Qt.size()</a></li>
<li><tt>vector3d</tt> - use <a href="qml-qt.html#vector3d-method">Qt.vector3d()</a></li>
</ul>
<p>There are also string based constructors for these types. See <a href="qdeclarativebasictypes.html">QML Basic Types</a> for more information.</p>
<a name="date-time-formatters"></a>
<h2>Date/Time Formatters</h2>
<p>The Qt object contains several functions for formatting <a href="qdatetime.html">QDateTime</a>, <a href="qdate.html">QDate</a> and <a href="qtime.html">QTime</a> values.</p>
<ul>
<li><a href="qml-qt.html#formatDateTime-method">string Qt.formatDateTime(datetime date, variant format)</a></li>
<li><a href="qml-qt.html#formatDate-method">string Qt.formatDate(datetime date, variant format)</a></li>
<li><a href="qml-qt.html#formatTime-method">string Qt.formatTime(datetime date, variant format)</a></li>
</ul>
<p>The format specification is described at <a href="qml-qt.html#formatDateTime-method">Qt.formatDateTime</a>.</p>
<a name="dynamic-object-creation"></a>
<h2>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="qdeclarativedynamicobjects.html">Dynamic Object Management in QML</a> for an overview of their use.</p>
<ul>
<li><a href="qml-qt.html#createComponent-method">object Qt.createComponent(url)</a></li>
<li><a href="qml-qt.html#createQmlObject-method">object Qt.createQmlObject(string qml, object parent, string filepath)</a></li>
</ul>
<!-- @@@QML:Qt -->
<h2>Property Documentation</h2>
<!-- $$$application -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlPropNode"><p><a name="application-prop"></a><span class="qmlreadonly">read-only</span><span class="name">application</span> : <span class="type">object</span></p></td></tr></table></div><div class="qmldoc"><p>The <tt>application</tt> object provides access to global application state properties shared by many QML components.</p>
<p>Its properties are:</p>
<table class="generic">
<tr valign="top" class="odd"><td ><tt>application.active</tt></td><td >This read-only property indicates whether the application is the top-most and focused application, and the user is able to interact with the application. The property is false when the application is in the background, the device keylock or screen saver is active, the screen backlight is turned off, or the global system dialog is being displayed on top of the application. It can be used for stopping and pausing animations, timers and active processing of data in order to save device battery power and free device memory and processor load when the application is not active.</td></tr>
<tr valign="top" class="even"><td ><tt>application.layoutDirection</tt></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 <tt>Qt.RightToLeft</tt> in locales where text and graphic elements are read from right to left, and <tt>Qt.LeftToRight</tt> 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>
</table>
<p>The following example uses the <tt>application</tt> object to indicate whether the application is currently active:</p>
<pre class="qml"> import QtQuick 1.1

 <span class="type"><a href="qml-rectangle.html">Rectangle</a></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"><a href="qml-text.html">Text</a></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>This property group was introduced in  QtQuick 1.1.</p>
</div></div><!-- @@@application -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$atob -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="atob-method"></a><span class="type"><a href="qml-string.html">string</a></span> Qt::<span class="name">atob</span> ( <span class="type">data</span> )</p></td></tr></table></div><div class="qmldoc"><p>ASCII to binary - this function returns a base64 decoding of <tt>data</tt>.</p>
</div></div><!-- @@@atob -->
<br/>
<!-- $$$btoa -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="btoa-method"></a><span class="type"><a href="qml-string.html">string</a></span> Qt::<span class="name">btoa</span> ( <span class="type">data</span> )</p></td></tr></table></div><div class="qmldoc"><p>Binary to ASCII - this function returns a base64 encoding of <tt>data</tt>.</p>
</div></div><!-- @@@btoa -->
<br/>
<!-- $$$createComponent -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="createComponent-method"></a><span class="type">object</span> Qt::<span class="name">createComponent</span> ( <span class="type"><a href="qml-url.html">url</a></span> )</p></td></tr></table></div><div class="qmldoc"><p>Returns a <a href="qml-component.html">Component</a> object created using the QML file at the specified <i>url</i>, or <tt>null</tt> if an empty string was given.</p>
<p>The returned component's <a href="qml-component.html#status-prop">Component::status</a> property indicates whether the component was successfully created. If the status is <tt>Component.Error</tt>, see <a href="qml-component.html#errorString-method">Component::errorString()</a> for an error description.</p>
<p>Call <a href="qml-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 1.0

 <span class="type"><a href="qml-item.html">Item</a></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="qdeclarativedynamicobjects.html">Dynamic Object Management in QML</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-qt.html#createQmlObject-method">Qt.createQmlObject()</a>.</p>
</div></div><!-- @@@createComponent -->
<br/>
<!-- $$$createQmlObject -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="createQmlObject-method"></a><span class="type">object</span> Qt::<span class="name">createQmlObject</span> ( <span class="type"><a href="qml-string.html">string</a></span> <i>qml</i>, <span class="type">object</span> <i>parent</i>, <span class="type"><a href="qml-string.html">string</a></span> <i>filepath</i> )</p></td></tr></table></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 <tt>null</tt> 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 <tt>parentItem</tt> 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 1.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 <a href="qtscript.html">QtScript</a> Error object is thrown. This object has an additional property, <tt>qmlErrors</tt>, which is an array of the errors encountered. Each object in this array has the members <tt>lineNumber</tt>, <tt>columnNumber</tt>, <tt>fileName</tt> and <tt>message</tt>. 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-qt.html#createComponent-method">Qt.createComponent()</a> instead.</p>
<p>See <a href="qdeclarativedynamicobjects.html">Dynamic Object Management in QML</a> for more information on using this function.</p>
</div></div><!-- @@@createQmlObject -->
<br/>
<!-- $$$darker -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="darker-method"></a><span class="type"><a href="qml-color.html">color</a></span> Qt::<span class="name">darker</span> ( <span class="type"><a href="qml-color.html">color</a></span> <i>baseColor</i>, <span class="type"><a href="qml-real.html">real</a></span> <i>factor</i> )</p></td></tr></table></div><div class="qmldoc"><p>Returns a color darker than <tt>baseColor</tt> by the <tt>factor</tt> 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-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 <tt>factor</tt> is not supplied, returns a color 50% darker than <tt>baseColor</tt> (factor 2.0).</p>
</div></div><!-- @@@darker -->
<br/>
<!-- $$$fontFamilies -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="fontFamilies-method"></a><span class="type"><a href="qml-list.html">list</a></span>&lt;<span class="type"><a href="qml-string.html">string</a></span>&gt; Qt::<span class="name">fontFamilies</span> ()</p></td></tr></table></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"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="formatDate-method"></a><span class="type"><a href="qml-string.html">string</a></span> Qt::<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 class="qmldoc"><p>Returns a string representation of <tt>date</tt>, optionally formatted according to <tt>format</tt>.</p>
<p>The <i>date</i> parameter may be a JavaScript <tt>Date</tt> object, a <a href="qml-date.html">date</a> property, a <a href="qdate.html">QDate</a>, or <a href="qdatetime.html">QDateTime</a> value. The <i>format</i> parameter may be any of the possible format values as described for <a href="qml-qt.html#formatDateTime-method">Qt.formatDateTime()</a>.</p>
<p>If <i>format</i> is not specified, <i>date</i> is formatted using <a href="qt.html#DateFormat-enum">Qt.DefaultLocaleShortDate</a>.</p>
</div></div><!-- @@@formatDate -->
<br/>
<!-- $$$formatDateTime -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="formatDateTime-method"></a><span class="type"><a href="qml-string.html">string</a></span> Qt::<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 class="qmldoc"><p>Returns a string representation of <tt>datetime</tt>, optionally formatted according to <tt>format</tt>.</p>
<p>The <i>date</i> parameter may be a JavaScript <tt>Date</tt> object, a <a href="qml-date.html">date</a> property, a <a href="qdate.html">QDate</a>, <a href="qtime.html">QTime</a>, or <a href="qdatetime.html">QDateTime</a> value.</p>
<p>If <i>format</i> is not provided, <i>dateTime</i> is formatted using <a href="qt.html#DateFormat-enum">Qt.DefaultLocaleShortDate</a>. Otherwise, <i>format</i> should be either.</p>
<ul>
<li>One of the <a href="qt.html#DateFormat-enum">Qt::DateFormat</a> enumeration values, such as <tt>Qt.DefaultLocaleShortDate</tt> or <tt>Qt.ISODate</tt></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>
<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 <a href="qdate.html#shortDayName">QDate::shortDayName()</a>.</td></tr>
<tr valign="top" class="even"><td >dddd</td><td >the long localized day name (e.g&#x2e; 'Monday' to '<a href="qt.html#DayOfWeek-enum">Qt::Sunday</a>'). Uses <a href="qdate.html#longDayName">QDate::longDayName()</a>.</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 <a href="qdate.html#shortMonthName">QDate::shortMonthName()</a>.</td></tr>
<tr valign="top" class="even"><td >MMMM</td><td >the long localized month name (e.g&#x2e; 'January' to 'December'). Uses <a href="qdate.html#longMonthName">QDate::longMonthName()</a>.</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>
<p>In addition the following expressions can be used to specify the time:</p>
<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>
<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 <tt>Qt.formatDateTime()</tt>, <a href="qml-qt.html#formatDate-method">Qt.formatDate()</a> or <a href="qml-qt.html#formatTime-method">Qt.formatTime()</a> with the <i>format</i> values below to produce the following results:</p>
<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></div><!-- @@@formatDateTime -->
<br/>
<!-- $$$formatTime -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="formatTime-method"></a><span class="type"><a href="qml-string.html">string</a></span> Qt::<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 class="qmldoc"><p>Returns a string representation of <tt>time</tt>, optionally formatted according to <tt>format</tt>.</p>
<p>The <i>time</i> parameter may be a JavaScript <tt>Date</tt> object, a <a href="qtime.html">QTime</a>, or <a href="qdatetime.html">QDateTime</a> value. The <i>format</i> parameter may be any of the possible format values as described for <a href="qml-qt.html#formatDateTime-method">Qt.formatDateTime()</a>.</p>
<p>If <i>format</i> is not specified, <i>time</i> is formatted using <a href="qt.html#DateFormat-enum">Qt.DefaultLocaleShortDate</a>.</p>
</div></div><!-- @@@formatTime -->
<br/>
<!-- $$$hsla -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="hsla-method"></a><span class="type"><a href="qml-color.html">color</a></span> Qt::<span class="name">hsla</span> ( <span class="type"><a href="qml-real.html">real</a></span> <i>hue</i>, <span class="type"><a href="qml-real.html">real</a></span> <i>saturation</i>, <span class="type"><a href="qml-real.html">real</a></span> <i>lightness</i>, <span class="type"><a href="qml-real.html">real</a></span> <i>alpha</i> )</p></td></tr></table></div><div class="qmldoc"><p>Returns a color with the specified <tt>hue</tt>, <tt>saturation</tt>, <tt>lightness</tt> and <tt>alpha</tt> components. All components should be in the range 0-1 inclusive.</p>
</div></div><!-- @@@hsla -->
<br/>
<!-- $$$include -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="include-method"></a><span class="type">object</span> Qt::<span class="name">include</span> ( <span class="type"><a href="qml-string.html">string</a></span> <i>url</i>, <span class="type">jsobject</span> <i>callback</i> )</p></td></tr></table></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, <tt>status</tt>, that is set to one of the following values:</p>
<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 <tt>exception</tt> property will be set in this case.</td></tr>
</table>
<p>The <tt>status</tt> 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"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="isQtObject-method"></a><span class="type"><a href="qml-bool.html">bool</a></span> Qt::<span class="name">isQtObject</span> ( <span class="type">object</span> )</p></td></tr></table></div><div class="qmldoc"><p>Returns true if <tt>object</tt> is a valid reference to a Qt or QML object, otherwise false.</p>
</div></div><!-- @@@isQtObject -->
<br/>
<!-- $$$lighter -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="lighter-method"></a><span class="type"><a href="qml-color.html">color</a></span> Qt::<span class="name">lighter</span> ( <span class="type"><a href="qml-color.html">color</a></span> <i>baseColor</i>, <span class="type"><a href="qml-real.html">real</a></span> <i>factor</i> )</p></td></tr></table></div><div class="qmldoc"><p>Returns a color lighter than <tt>baseColor</tt> by the <tt>factor</tt> 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-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 <tt>factor</tt> is not supplied, returns a color 50% lighter than <tt>baseColor</tt> (factor 1.5).</p>
</div></div><!-- @@@lighter -->
<br/>
<!-- $$$md5 -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="md5-method"></a><span class="type"><a href="qml-string.html">string</a></span> Qt::<span class="name">md5</span> ( <span class="type">data</span> )</p></td></tr></table></div><div class="qmldoc"><p>Returns a hex string of the md5 hash of <tt>data</tt>.</p>
</div></div><!-- @@@md5 -->
<br/>
<!-- $$$openUrlExternally -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="openUrlExternally-method"></a><span class="type"><a href="qml-bool.html">bool</a></span> Qt::<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 class="qmldoc"><p>Attempts to open the specified <tt>target</tt> url in an external application, based on the user's desktop preferences. Returns true if it succeeds, and false otherwise.</p>
</div></div><!-- @@@openUrlExternally -->
<br/>
<!-- $$$point -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="point-method"></a><span class="type"><a href="qml-qt.html#point-method">point</a></span> Qt::<span class="name">point</span> ( <span class="type"><a href="qml-int.html">int</a></span> <i>x</i>, <span class="type"><a href="qml-int.html">int</a></span> <i>y</i> )</p></td></tr></table></div><div class="qmldoc"><p>Returns a Point with the specified <tt>x</tt> and <tt>y</tt> coordinates.</p>
</div></div><!-- @@@point -->
<br/>
<!-- $$$quit -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="quit-method"></a>Qt::<span class="name">quit</span> ()</p></td></tr></table></div><div class="qmldoc"><p>This function causes the <a href="qdeclarativeengine.html#quit">QDeclarativeEngine::quit()</a> signal to be emitted. Within the <a href="qmlviewer.html">QML Viewer</a>, this causes the launcher application to exit; to quit a C++ application when this method is called, connect the <a href="qdeclarativeengine.html#quit">QDeclarativeEngine::quit()</a> signal to the <a href="qcoreapplication.html#quit">QCoreApplication::quit()</a> slot.</p>
</div></div><!-- @@@quit -->
<br/>
<!-- $$$rect -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="rect-method"></a><span class="type"><a href="qml-qt.html#rect-method">rect</a></span> Qt::<span class="name">rect</span> ( <span class="type"><a href="qml-int.html">int</a></span> <i>x</i>, <span class="type"><a href="qml-int.html">int</a></span> <i>y</i>, <span class="type"><a href="qml-int.html">int</a></span> <i>width</i>, <span class="type"><a href="qml-int.html">int</a></span> <i>height</i> )</p></td></tr></table></div><div class="qmldoc"><p>Returns a <tt>rect</tt> with the top-left corner at <tt>x</tt>, <tt>y</tt> and the specified <tt>width</tt> and <tt>height</tt>.</p>
<p>The returned object has <tt>x</tt>, <tt>y</tt>, <tt>width</tt> and <tt>height</tt> attributes with the given values.</p>
</div></div><!-- @@@rect -->
<br/>
<!-- $$$resolvedUrl -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="resolvedUrl-method"></a><span class="type"><a href="qml-url.html">url</a></span> Qt::<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 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"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="rgba-method"></a><span class="type"><a href="qml-color.html">color</a></span> Qt::<span class="name">rgba</span> ( <span class="type"><a href="qml-real.html">real</a></span> <i>red</i>, <span class="type"><a href="qml-real.html">real</a></span> <i>green</i>, <span class="type"><a href="qml-real.html">real</a></span> <i>blue</i>, <span class="type"><a href="qml-real.html">real</a></span> <i>alpha</i> )</p></td></tr></table></div><div class="qmldoc"><p>Returns a color with the specified <tt>red</tt>, <tt>green</tt>, <tt>blue</tt> and <tt>alpha</tt> components. All components should be in the range 0-1 inclusive.</p>
</div></div><!-- @@@rgba -->
<br/>
<!-- $$$size -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="size-method"></a>Qt::<span class="name">size</span> ( <span class="type"><a href="qml-int.html">int</a></span> <i>width</i>, <span class="type"><a href="qml-int.html">int</a></span> <i>height</i> )</p></td></tr></table></div><div class="qmldoc"><p>Returns a Size with the specified <tt>width</tt> and <tt>height</tt>.</p>
</div></div><!-- @@@size -->
<br/>
<!-- $$$tint -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="tint-method"></a><span class="type"><a href="qml-color.html">color</a></span> Qt::<span class="name">tint</span> ( <span class="type"><a href="qml-color.html">color</a></span> <i>baseColor</i>, <span class="type"><a href="qml-color.html">color</a></span> <i>tintColor</i> )</p></td></tr></table></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"><a href="qml-item.html">Item</a></span> {
     <span class="type"><a href="qml-rectangle.html">Rectangle</a></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"><a href="qml-rectangle.html">Rectangle</a></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/>
<!-- $$$vector3d -->
<div class="qmlitem"><div class="qmlproto"><table class="qmlname"><tr valign="top" class="odd"><td class="tblQmlFuncNode"><p><a name="vector3d-method"></a>Qt::<span class="name">vector3d</span> ( <span class="type"><a href="qml-real.html">real</a></span> <i>x</i>, <span class="type"><a href="qml-real.html">real</a></span> <i>y</i>, <span class="type"><a href="qml-real.html">real</a></span> <i>z</i> )</p></td></tr></table></div><div class="qmldoc"><p>Returns a <a href="qml-vector3d.html">Vector3D</a> with the specified <tt>x</tt>, <tt>y</tt> and <tt>z</tt>.</p>
</div></div><!-- @@@vector3d -->
<br/>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      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.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>