Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 5080

qt4-doc-4.8.7-26.2.mga7.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: QDeclarativeEngine Class Reference</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="modules.html">Modules</a></li>
<li><a href="qtdeclarative.html">QtDeclarative</a></li>
<li>QDeclarativeEngine</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="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#macros">Macros</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QDeclarativeEngine Class Reference</h1>
<!-- $$$QDeclarativeEngine-brief -->
<p>The QDeclarativeEngine class provides an environment for instantiating QML components. <a href="#details">More...</a></p>
<!-- @@@QDeclarativeEngine -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QDeclarativeEngine&gt;</span></pre><p><b>Inherits: </b><a href="qobject.html">QObject</a>.</p>
<p>This class was introduced in Qt 4.7.</p>
<ul>
<li><a href="qdeclarativeengine-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#ObjectOwnership-enum">ObjectOwnership</a></b> { CppOwnership, JavaScriptOwnership }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qdeclarativeengine.html#offlineStoragePath-prop">offlineStoragePath</a></b> : QString</li>
</ul>
<ul>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#QDeclarativeEngine">QDeclarativeEngine</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#dtor.QDeclarativeEngine">~QDeclarativeEngine</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#addImageProvider">addImageProvider</a></b> ( const QString &amp; <i>providerId</i>, QDeclarativeImageProvider * <i>provider</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#addImportPath">addImportPath</a></b> ( const QString &amp; <i>path</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#addPluginPath">addPluginPath</a></b> ( const QString &amp; <i>path</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#baseUrl">baseUrl</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#clearComponentCache">clearComponentCache</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeImageProvider * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#imageProvider">imageProvider</a></b> ( const QString &amp; <i>providerId</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#importPathList">importPathList</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#importPlugin">importPlugin</a></b> ( const QString &amp; <i>filePath</i>, const QString &amp; <i>uri</i>, QString * <i>errorString</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkAccessManager * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#networkAccessManager">networkAccessManager</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeNetworkAccessManagerFactory * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#networkAccessManagerFactory">networkAccessManagerFactory</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#offlineStoragePath-prop">offlineStoragePath</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#outputWarningsToStandardError">outputWarningsToStandardError</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#pluginPathList">pluginPathList</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#removeImageProvider">removeImageProvider</a></b> ( const QString &amp; <i>providerId</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeContext * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#rootContext">rootContext</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#setBaseUrl">setBaseUrl</a></b> ( const QUrl &amp; <i>url</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#setImportPathList">setImportPathList</a></b> ( const QStringList &amp; <i>paths</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#setNetworkAccessManagerFactory">setNetworkAccessManagerFactory</a></b> ( QDeclarativeNetworkAccessManagerFactory * <i>factory</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#offlineStoragePath-prop">setOfflineStoragePath</a></b> ( const QString &amp; <i>dir</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#setOutputWarningsToStandardError">setOutputWarningsToStandardError</a></b> ( bool <i>enabled</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#setPluginPathList">setPluginPathList</a></b> ( const QStringList &amp; <i>paths</i> )</td></tr>
</table>
<ul>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#quit">quit</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#warnings">warnings</a></b> ( const QList&lt;QDeclarativeError&gt; &amp; <i>warnings</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeContext * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#contextForObject">contextForObject</a></b> ( const QObject * <i>object</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> ObjectOwnership </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#objectOwnership">objectOwnership</a></b> ( QObject * <i>object</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#setContextForObject">setContextForObject</a></b> ( QObject * <i>object</i>, QDeclarativeContext * <i>context</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#setObjectOwnership">setObjectOwnership</a></b> ( QObject * <i>object</i>, ObjectOwnership <i>ownership</i> )</td></tr>
</table>
<ul>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeInfo </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#qmlInfo">qmlInfo</a></b> ( const QObject * <i>object</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#qmlRegisterInterface">qmlRegisterInterface</a></b> ( const char * <i>typeName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#qmlRegisterType">qmlRegisterType</a></b> ( const char * <i>uri</i>, int <i>versionMajor</i>, int <i>versionMinor</i>, const char * <i>qmlName</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#qmlRegisterType-3">qmlRegisterType</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#qmlRegisterTypeNotAvailable">qmlRegisterTypeNotAvailable</a></b> ( const char * <i>uri</i>, int <i>versionMajor</i>, int <i>versionMinor</i>, const char * <i>qmlName</i>, const QString &amp; <i>message</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#qmlRegisterUncreatableType">qmlRegisterUncreatableType</a></b> ( const char * <i>uri</i>, int <i>versionMajor</i>, int <i>versionMinor</i>, const char * <i>qmlName</i>, const QString &amp; <i>message</i> )</td></tr>
</table>
<a name="macros"></a>
<h2>Macros</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#QML_DECLARE_TYPE">QML_DECLARE_TYPE</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativeengine.html#QML_DECLARE_TYPEINFO">QML_DECLARE_TYPEINFO</a></b> (  <i>Type</i>,  <i>Flags</i> )</td></tr>
</table>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QDeclarativeEngine-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QDeclarativeEngine class provides an environment for instantiating QML components.</p>
<p>Each QML component is instantiated in a <a href="qdeclarativecontext.html">QDeclarativeContext</a>. <a href="qdeclarativecontext.html">QDeclarativeContext</a>'s are essential for passing data to QML components. In QML, contexts are arranged hierarchically and this hierarchy is managed by the QDeclarativeEngine.</p>
<p>Prior to creating any QML components, an application must have created a QDeclarativeEngine to gain access to a QML context. The following example shows how to create a simple Text item.</p>
<pre class="cpp"> <span class="type">QDeclarativeEngine</span> engine;
 <span class="type"><a href="qdeclarativecomponent.html">QDeclarativeComponent</a></span> component(<span class="operator">&amp;</span>engine);
 component<span class="operator">.</span>setData(<span class="string">&quot;import QtQuick 1.0\nText { text: \&quot;Hello world!\&quot; }&quot;</span><span class="operator">,</span> <span class="type"><a href="qurl.html">QUrl</a></span>());
 <span class="type"><a href="qdeclarativeitem.html">QDeclarativeItem</a></span> <span class="operator">*</span>item <span class="operator">=</span> qobject_cast<span class="operator">&lt;</span><span class="type"><a href="qdeclarativeitem.html">QDeclarativeItem</a></span> <span class="operator">*</span><span class="operator">&gt;</span>(component<span class="operator">.</span>create());

 <span class="comment">//add item to view, etc</span>
 <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span></pre>
<p>In this case, the Text item will be created in the engine's <a href="qdeclarativeengine.html#rootContext">root context</a>.</p>
</div>
<p><b>See also </b><a href="qdeclarativecomponent.html">QDeclarativeComponent</a> and <a href="qdeclarativecontext.html">QDeclarativeContext</a>.</p>
<!-- @@@QDeclarativeEngine -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$ObjectOwnership$$$CppOwnership$$$JavaScriptOwnership -->
<h3 class="fn"><a name="ObjectOwnership-enum"></a>enum QDeclarativeEngine::<span class="name">ObjectOwnership</span></h3>
<p>Ownership controls whether or not QML automatically destroys the <a href="qobject.html">QObject</a> when the object is garbage collected by the JavaScript engine. The two ownership options are:</p>
<table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><tt>QDeclarativeEngine::CppOwnership</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The object is owned by C++ code, and will never be deleted by QML. The JavaScript destroy() method cannot be used on objects with CppOwnership. This option is similar to <a href="qscriptengine.html#ValueOwnership-enum">QScriptEngine::QtOwnership</a>.</td></tr>
<tr><td class="topAlign"><tt>QDeclarativeEngine::JavaScriptOwnership</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">The object is owned by JavaScript. When the object is returned to QML as the return value of a method call or property access, QML will delete the object if there are no remaining JavaScript references to it and it has no <a href="qobject.html#parent">QObject::parent</a>(). This option is similar to <a href="qscriptengine.html#ValueOwnership-enum">QScriptEngine::ScriptOwnership</a>.</td></tr>
</table>
<p>Generally an application doesn't need to set an object's ownership explicitly. QML uses a heuristic to set the default object ownership. By default, an object that is created by QML has JavaScriptOwnership. The exception to this are the root objects created by calling QDeclarativeCompnent::create() or <a href="qdeclarativecomponent.html#beginCreate">QDeclarativeComponent::beginCreate</a>() which have CppOwnership by default. The ownership of these root-level objects is considered to have been transferred to the C++ caller.</p>
<p>Objects not-created by QML have CppOwnership by default. The exception to this is objects returned from a C++ method call. The ownership of these objects is passed to JavaScript.</p>
<p>Calling <a href="qdeclarativeengine.html#setObjectOwnership">setObjectOwnership</a>() overrides the default ownership heuristic used by QML.</p>
<!-- @@@ObjectOwnership -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$offlineStoragePath-prop$$$offlineStoragePath$$$setOfflineStoragePathconstQString& -->
<h3 class="fn"><a name="offlineStoragePath-prop"></a><span class="name">offlineStoragePath</span> : <span class="type"><a href="qstring.html">QString</a></span></h3>
<p>This property holds the directory for storing offline user data.</p>
<p>Returns the directory where SQL and other offline storage is placed.</p>
<p>QDeclarativeWebView and the SQL databases created with openDatabase() are stored here.</p>
<p>The default is QML/OfflineStorage in the platform-standard user application data directory.</p>
<p>Note that the path may not currently exist on the filesystem, so callers wanting to <i>create</i> new files at this location should create it first - see <a href="qdir.html#mkpath">QDir::mkpath</a>().</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>offlineStoragePath</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setOfflineStoragePath</b></span> ( const QString &amp; <i>dir</i> )</td></tr>
</table>
<!-- @@@offlineStoragePath -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDeclarativeEngine[overload1]$$$QDeclarativeEngineQObject* -->
<h3 class="fn"><a name="QDeclarativeEngine"></a>QDeclarativeEngine::<span class="name">QDeclarativeEngine</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Create a new <a href="qdeclarativeengine.html">QDeclarativeEngine</a> with the given <i>parent</i>.</p>
<!-- @@@QDeclarativeEngine -->
<!-- $$$~QDeclarativeEngine[overload1]$$$~QDeclarativeEngine -->
<h3 class="fn"><a name="dtor.QDeclarativeEngine"></a>QDeclarativeEngine::<span class="name">~QDeclarativeEngine</span> ()<tt> [virtual]</tt></h3>
<p>Destroys the <a href="qdeclarativeengine.html">QDeclarativeEngine</a>.</p>
<p>Any <a href="qdeclarativecontext.html">QDeclarativeContext</a>'s created on this engine will be invalidated, but not destroyed (unless they are parented to the <a href="qdeclarativeengine.html">QDeclarativeEngine</a> object).</p>
<!-- @@@~QDeclarativeEngine -->
<!-- $$$addImageProvider[overload1]$$$addImageProviderconstQString&QDeclarativeImageProvider* -->
<h3 class="fn"><a name="addImageProvider"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">addImageProvider</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>providerId</i>, <span class="type"><a href="qdeclarativeimageprovider.html">QDeclarativeImageProvider</a></span> * <i>provider</i> )</h3>
<p>Sets the <i>provider</i> to use for images requested via the <i>image</i>: url scheme, with host <i>providerId</i>. The <a href="qdeclarativeengine.html">QDeclarativeEngine</a> takes ownership of <i>provider</i>.</p>
<p>Image providers enable support for pixmap and threaded image requests. See the <a href="qdeclarativeimageprovider.html">QDeclarativeImageProvider</a> documentation for details on implementing and using image providers.</p>
<p>All required image providers should be added to the engine before any QML sources files are loaded.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#removeImageProvider">removeImageProvider</a>().</p>
<!-- @@@addImageProvider -->
<!-- $$$addImportPath[overload1]$$$addImportPathconstQString& -->
<h3 class="fn"><a name="addImportPath"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">addImportPath</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>path</i> )</h3>
<p>Adds <i>path</i> as a directory where the engine searches for installed modules in a URL-based directory structure. The <i>path</i> may be a local filesystem directory or a URL.</p>
<p>The newly added <i>path</i> will be first in the <a href="qdeclarativeengine.html#importPathList">importPathList</a>().</p>
<p><b>See also </b><a href="qdeclarativeengine.html#setImportPathList">setImportPathList</a>() and <a href="qdeclarativemodules.html#qml-modules">QML Modules</a>.</p>
<!-- @@@addImportPath -->
<!-- $$$addPluginPath[overload1]$$$addPluginPathconstQString& -->
<h3 class="fn"><a name="addPluginPath"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">addPluginPath</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>path</i> )</h3>
<p>Adds <i>path</i> as a directory where the engine searches for native plugins for imported modules (referenced in the <tt>qmldir</tt> file).</p>
<p>By default, the list contains only <tt>.</tt>, i.e&#x2e; the engine searches in the directory of the <tt>qmldir</tt> file itself.</p>
<p>The newly added <i>path</i> will be first in the <a href="qdeclarativeengine.html#pluginPathList">pluginPathList</a>().</p>
<p><b>See also </b><a href="qdeclarativeengine.html#setPluginPathList">setPluginPathList</a>().</p>
<!-- @@@addPluginPath -->
<!-- $$$baseUrl[overload1]$$$baseUrl -->
<h3 class="fn"><a name="baseUrl"></a><span class="type"><a href="qurl.html">QUrl</a></span> QDeclarativeEngine::<span class="name">baseUrl</span> () const</h3>
<p>Return the base URL for this engine. The base URL is only used to resolve components when a relative URL is passed to the <a href="qdeclarativecomponent.html">QDeclarativeComponent</a> constructor.</p>
<p>If a base URL has not been explicitly set, this method returns the application's current working directory.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#setBaseUrl">setBaseUrl</a>().</p>
<!-- @@@baseUrl -->
<!-- $$$clearComponentCache[overload1]$$$clearComponentCache -->
<h3 class="fn"><a name="clearComponentCache"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">clearComponentCache</span> ()</h3>
<p>Clears the engine's internal component cache.</p>
<p>Normally the <a href="qdeclarativeengine.html">QDeclarativeEngine</a> caches components loaded from qml files. This method clears this cache and forces the component to be reloaded.</p>
<!-- @@@clearComponentCache -->
<!-- $$$contextForObject[overload1]$$$contextForObjectconstQObject* -->
<h3 class="fn"><a name="contextForObject"></a><span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * QDeclarativeEngine::<span class="name">contextForObject</span> ( const <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i> )<tt> [static]</tt></h3>
<p>Returns the <a href="qdeclarativecontext.html">QDeclarativeContext</a> for the <i>object</i>, or 0 if no context has been set.</p>
<p>When the <a href="qdeclarativeengine.html">QDeclarativeEngine</a> instantiates a <a href="qobject.html">QObject</a>, the context is set automatically.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#setContextForObject">setContextForObject</a>().</p>
<!-- @@@contextForObject -->
<!-- $$$imageProvider[overload1]$$$imageProviderconstQString& -->
<h3 class="fn"><a name="imageProvider"></a><span class="type"><a href="qdeclarativeimageprovider.html">QDeclarativeImageProvider</a></span> * QDeclarativeEngine::<span class="name">imageProvider</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>providerId</i> ) const</h3>
<p>Returns the <a href="qdeclarativeimageprovider.html">QDeclarativeImageProvider</a> set for <i>providerId</i>.</p>
<!-- @@@imageProvider -->
<!-- $$$importPathList[overload1]$$$importPathList -->
<h3 class="fn"><a name="importPathList"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QDeclarativeEngine::<span class="name">importPathList</span> () const</h3>
<p>Returns the list of directories where the engine searches for installed modules in a URL-based directory structure.</p>
<p>For example, if <tt>/opt/MyApp/lib/imports</tt> is in the path, then QML that imports <tt>com.mycompany.Feature</tt> will cause the <a href="qdeclarativeengine.html">QDeclarativeEngine</a> to look in <tt>/opt/MyApp/lib/imports/com/mycompany/Feature/</tt> for the components provided by that module. A <tt>qmldir</tt> file is required for defining the type version mapping and possibly declarative extensions plugins.</p>
<p>By default, the list contains the directory of the application executable, paths specified in the <tt>QML_IMPORT_PATH</tt> environment variable, and the builtin <tt>ImportsPath</tt> from <a href="qlibraryinfo.html">QLibraryInfo</a>.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#addImportPath">addImportPath</a>() and <a href="qdeclarativeengine.html#setImportPathList">setImportPathList</a>().</p>
<!-- @@@importPathList -->
<!-- $$$importPlugin[overload1]$$$importPluginconstQString&constQString&QString* -->
<h3 class="fn"><a name="importPlugin"></a><span class="type">bool</span> QDeclarativeEngine::<span class="name">importPlugin</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>filePath</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>uri</i>, <span class="type"><a href="qstring.html">QString</a></span> * <i>errorString</i> )</h3>
<p>Imports the plugin named <i>filePath</i> with the <i>uri</i> provided. Returns true if the plugin was successfully imported; otherwise returns false.</p>
<p>On failure and if non-null, *<i>errorString</i> will be set to a message describing the failure.</p>
<p>The plugin has to be a Qt plugin which implements the <a href="qdeclarativeextensionplugin.html">QDeclarativeExtensionPlugin</a> interface.</p>
<!-- @@@importPlugin -->
<!-- $$$networkAccessManager[overload1]$$$networkAccessManager -->
<h3 class="fn"><a name="networkAccessManager"></a><span class="type"><a href="qnetworkaccessmanager.html">QNetworkAccessManager</a></span> * QDeclarativeEngine::<span class="name">networkAccessManager</span> () const</h3>
<p>Returns a common <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> which can be used by any QML element instantiated by this engine.</p>
<p>If a <a href="qdeclarativenetworkaccessmanagerfactory.html">QDeclarativeNetworkAccessManagerFactory</a> has been set and a <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> has not yet been created, the <a href="qdeclarativenetworkaccessmanagerfactory.html">QDeclarativeNetworkAccessManagerFactory</a> will be used to create the <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>; otherwise the returned <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> will have no proxy or cache set.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#setNetworkAccessManagerFactory">setNetworkAccessManagerFactory</a>().</p>
<!-- @@@networkAccessManager -->
<!-- $$$networkAccessManagerFactory[overload1]$$$networkAccessManagerFactory -->
<h3 class="fn"><a name="networkAccessManagerFactory"></a><span class="type"><a href="qdeclarativenetworkaccessmanagerfactory.html">QDeclarativeNetworkAccessManagerFactory</a></span> * QDeclarativeEngine::<span class="name">networkAccessManagerFactory</span> () const</h3>
<p>Returns the current <a href="qdeclarativenetworkaccessmanagerfactory.html">QDeclarativeNetworkAccessManagerFactory</a>.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#setNetworkAccessManagerFactory">setNetworkAccessManagerFactory</a>().</p>
<!-- @@@networkAccessManagerFactory -->
<!-- $$$objectOwnership[overload1]$$$objectOwnershipQObject* -->
<h3 class="fn"><a name="objectOwnership"></a><span class="type"><a href="qdeclarativeengine.html#ObjectOwnership-enum">ObjectOwnership</a></span> QDeclarativeEngine::<span class="name">objectOwnership</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i> )<tt> [static]</tt></h3>
<p>Returns the ownership of <i>object</i>.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#setObjectOwnership">setObjectOwnership</a>().</p>
<!-- @@@objectOwnership -->
<!-- $$$outputWarningsToStandardError[overload1]$$$outputWarningsToStandardError -->
<h3 class="fn"><a name="outputWarningsToStandardError"></a><span class="type">bool</span> QDeclarativeEngine::<span class="name">outputWarningsToStandardError</span> () const</h3>
<p>Returns true if warning messages will be output to stderr in addition to being emitted by the <a href="qdeclarativeengine.html#warnings">warnings</a>() signal, otherwise false.</p>
<p>The default value is true.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#setOutputWarningsToStandardError">setOutputWarningsToStandardError</a>().</p>
<!-- @@@outputWarningsToStandardError -->
<!-- $$$pluginPathList[overload1]$$$pluginPathList -->
<h3 class="fn"><a name="pluginPathList"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> QDeclarativeEngine::<span class="name">pluginPathList</span> () const</h3>
<p>Returns the list of directories where the engine searches for native plugins for imported modules (referenced in the <tt>qmldir</tt> file).</p>
<p>By default, the list contains only <tt>.</tt>, i.e&#x2e; the engine searches in the directory of the <tt>qmldir</tt> file itself.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#addPluginPath">addPluginPath</a>() and <a href="qdeclarativeengine.html#setPluginPathList">setPluginPathList</a>().</p>
<!-- @@@pluginPathList -->
<!-- $$$quit[overload1]$$$quit -->
<h3 class="fn"><a name="quit"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">quit</span> ()<tt> [signal]</tt></h3>
<p>This signal is emitted when the QML loaded by the engine would like to quit.</p>
<!-- @@@quit -->
<!-- $$$removeImageProvider[overload1]$$$removeImageProviderconstQString& -->
<h3 class="fn"><a name="removeImageProvider"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">removeImageProvider</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>providerId</i> )</h3>
<p>Removes the <a href="qdeclarativeimageprovider.html">QDeclarativeImageProvider</a> for <i>providerId</i>.</p>
<p>Returns the provider if it was found; otherwise returns 0.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#addImageProvider">addImageProvider</a>().</p>
<!-- @@@removeImageProvider -->
<!-- $$$rootContext[overload1]$$$rootContext -->
<h3 class="fn"><a name="rootContext"></a><span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * QDeclarativeEngine::<span class="name">rootContext</span> () const</h3>
<p>Returns the engine's root context.</p>
<p>The root context is automatically created by the <a href="qdeclarativeengine.html">QDeclarativeEngine</a>. Data that should be available to all QML component instances instantiated by the engine should be put in the root context.</p>
<p>Additional data that should only be available to a subset of component instances should be added to sub-contexts parented to the root context.</p>
<!-- @@@rootContext -->
<!-- $$$setBaseUrl[overload1]$$$setBaseUrlconstQUrl& -->
<h3 class="fn"><a name="setBaseUrl"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">setBaseUrl</span> ( const <span class="type"><a href="qurl.html">QUrl</a></span> &amp; <i>url</i> )</h3>
<p>Set the base URL for this engine to <i>url</i>.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#baseUrl">baseUrl</a>().</p>
<!-- @@@setBaseUrl -->
<!-- $$$setContextForObject[overload1]$$$setContextForObjectQObject*QDeclarativeContext* -->
<h3 class="fn"><a name="setContextForObject"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">setContextForObject</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i>, <span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * <i>context</i> )<tt> [static]</tt></h3>
<p>Sets the <a href="qdeclarativecontext.html">QDeclarativeContext</a> for the <i>object</i> to <i>context</i>. If the <i>object</i> already has a context, a warning is output, but the context is not changed.</p>
<p>When the <a href="qdeclarativeengine.html">QDeclarativeEngine</a> instantiates a <a href="qobject.html">QObject</a>, the context is set automatically.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#contextForObject">contextForObject</a>().</p>
<!-- @@@setContextForObject -->
<!-- $$$setImportPathList[overload1]$$$setImportPathListconstQStringList& -->
<h3 class="fn"><a name="setImportPathList"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">setImportPathList</span> ( const <span class="type"><a href="qstringlist.html">QStringList</a></span> &amp; <i>paths</i> )</h3>
<p>Sets <i>paths</i> as the list of directories where the engine searches for installed modules in a URL-based directory structure.</p>
<p>By default, the list contains the directory of the application executable, paths specified in the <tt>QML_IMPORT_PATH</tt> environment variable, and the builtin <tt>ImportsPath</tt> from <a href="qlibraryinfo.html">QLibraryInfo</a>.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#importPathList">importPathList</a>() and <a href="qdeclarativeengine.html#addImportPath">addImportPath</a>().</p>
<!-- @@@setImportPathList -->
<!-- $$$setNetworkAccessManagerFactory[overload1]$$$setNetworkAccessManagerFactoryQDeclarativeNetworkAccessManagerFactory* -->
<h3 class="fn"><a name="setNetworkAccessManagerFactory"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">setNetworkAccessManagerFactory</span> ( <span class="type"><a href="qdeclarativenetworkaccessmanagerfactory.html">QDeclarativeNetworkAccessManagerFactory</a></span> * <i>factory</i> )</h3>
<p>Sets the <i>factory</i> to use for creating <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a>(s).</p>
<p><a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> is used for all network access by QML. By implementing a factory it is possible to create custom <a href="qnetworkaccessmanager.html">QNetworkAccessManager</a> with specialized caching, proxy and cookie support.</p>
<p>The factory must be set before executing the engine.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#networkAccessManagerFactory">networkAccessManagerFactory</a>().</p>
<!-- @@@setNetworkAccessManagerFactory -->
<!-- $$$setObjectOwnership[overload1]$$$setObjectOwnershipQObject*ObjectOwnership -->
<h3 class="fn"><a name="setObjectOwnership"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">setObjectOwnership</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i>, <span class="type"><a href="qdeclarativeengine.html#ObjectOwnership-enum">ObjectOwnership</a></span> <i>ownership</i> )<tt> [static]</tt></h3>
<p>Sets the <i>ownership</i> of <i>object</i>.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#objectOwnership">objectOwnership</a>().</p>
<!-- @@@setObjectOwnership -->
<!-- $$$setOutputWarningsToStandardError[overload1]$$$setOutputWarningsToStandardErrorbool -->
<h3 class="fn"><a name="setOutputWarningsToStandardError"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">setOutputWarningsToStandardError</span> ( <span class="type">bool</span> <i>enabled</i> )</h3>
<p>Set whether warning messages will be output to stderr to <i>enabled</i>.</p>
<p>If <i>enabled</i> is true, any warning messages generated by QML will be output to stderr and emitted by the <a href="qdeclarativeengine.html#warnings">warnings</a>() signal. If <i>enabled</i> is false, on the <a href="qdeclarativeengine.html#warnings">warnings</a>() signal will be emitted. This allows applications to handle warning output themselves.</p>
<p>The default value is true.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#outputWarningsToStandardError">outputWarningsToStandardError</a>().</p>
<!-- @@@setOutputWarningsToStandardError -->
<!-- $$$setPluginPathList[overload1]$$$setPluginPathListconstQStringList& -->
<h3 class="fn"><a name="setPluginPathList"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">setPluginPathList</span> ( const <span class="type"><a href="qstringlist.html">QStringList</a></span> &amp; <i>paths</i> )</h3>
<p>Sets the list of directories where the engine searches for native plugins for imported modules (referenced in the <tt>qmldir</tt> file) to <i>paths</i>.</p>
<p>By default, the list contains only <tt>.</tt>, i.e&#x2e; the engine searches in the directory of the <tt>qmldir</tt> file itself.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#pluginPathList">pluginPathList</a>() and <a href="qdeclarativeengine.html#addPluginPath">addPluginPath</a>().</p>
<!-- @@@setPluginPathList -->
<!-- $$$warnings[overload1]$$$warningsconstQList<QDeclarativeError>& -->
<h3 class="fn"><a name="warnings"></a><span class="type">void</span> QDeclarativeEngine::<span class="name">warnings</span> ( const <span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qdeclarativeerror.html">QDeclarativeError</a></span>&gt; &amp; <i>warnings</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when <i>warnings</i> messages are generated by QML.</p>
<!-- @@@warnings -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$qmlInfo[overload1]$$$qmlInfoconstQObject* -->
<h3 class="fn"><a name="qmlInfo"></a><span class="type">QDeclarativeInfo</span> <span class="name">qmlInfo</span> ( const <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i> )</h3>
<p>Prints warning messages that include the file and line number for the specified QML <i>object</i>.</p>
<p>When QML types display warning messages, it improves traceability if they include the QML file and line number on which the particular instance was instantiated.</p>
<p>To include the file and line number, an object must be passed. If the file and line number is not available for that instance (either it was not instantiated by the QML engine or location information is disabled), &quot;unknown location&quot; will be used instead.</p>
<p>For example,</p>
<pre class="cpp"> qmlInfo(object) <span class="operator">&lt;</span><span class="operator">&lt;</span> tr(<span class="string">&quot;component property is a write-once property&quot;</span>);</pre>
<p>prints</p>
<pre class="cpp"> QML MyCustomType (unknown location): component property is a write<span class="operator">-</span>once property</pre>
<!-- @@@qmlInfo -->
<!-- $$$qmlRegisterInterface[overload1]$$$qmlRegisterInterfaceconstchar* -->
<h3 class="fn"><a name="qmlRegisterInterface"></a><span class="type">int</span> <span class="name">qmlRegisterInterface</span> ( const <span class="type">char</span> * <i>typeName</i> )</h3>
<p>This template function registers the C++ type in the QML system under the name <i>typeName</i>.</p>
<p>#include &lt;<a href="qtdeclarative.html">QtDeclarative</a>&gt; to use this function.</p>
<p>Returns the QML type id.</p>
<!-- @@@qmlRegisterInterface -->
<!-- $$$qmlRegisterType[overload1]$$$qmlRegisterTypeconstchar*intintconstchar* -->
<h3 class="fn"><a name="qmlRegisterType"></a><span class="type">int</span> <span class="name">qmlRegisterType</span> ( const <span class="type">char</span> * <i>uri</i>, <span class="type">int</span> <i>versionMajor</i>, <span class="type">int</span> <i>versionMinor</i>, const <span class="type">char</span> * <i>qmlName</i> )</h3>
<p>This template function registers the C++ type in the QML system with the name <i>qmlName</i>, in the library imported from <i>uri</i> having the version number composed from <i>versionMajor</i> and <i>versionMinor</i>.</p>
<p>Returns the QML type id.</p>
<p>There are two forms of this template function:</p>
<pre class="cpp"> <span class="keyword">template</span><span class="operator">&lt;</span><span class="keyword">typename</span> T<span class="operator">&gt;</span>
 <span class="type">int</span> qmlRegisterType(<span class="keyword">const</span> <span class="type">char</span> <span class="operator">*</span>uri<span class="operator">,</span> <span class="type">int</span> versionMajor<span class="operator">,</span> <span class="type">int</span> versionMinor<span class="operator">,</span> <span class="keyword">const</span> <span class="type">char</span> <span class="operator">*</span>qmlName);

 <span class="keyword">template</span><span class="operator">&lt;</span><span class="keyword">typename</span> T<span class="operator">,</span> <span class="type">int</span> metaObjectRevision<span class="operator">&gt;</span>
 <span class="type">int</span> qmlRegisterType(<span class="keyword">const</span> <span class="type">char</span> <span class="operator">*</span>uri<span class="operator">,</span> <span class="type">int</span> versionMajor<span class="operator">,</span> <span class="type">int</span> versionMinor<span class="operator">,</span> <span class="keyword">const</span> <span class="type">char</span> <span class="operator">*</span>qmlName);</pre>
<p>The former is the standard form which registers the type <i>T</i> as a new type. The latter allows a particular revision of a class to be registered in a specified version (see <a href="qml-extending.html#qml-type-versioning">QML Type Versioning</a>).</p>
<p>For example, this registers a C++ class <tt>MySliderItem</tt> as a QML type named <tt>Slider</tt> for version 1.0 of a <a href="qdeclarativemodules.html#qml-modules">module</a> called &quot;com.mycompany.qmlcomponents&quot;:</p>
<pre class="cpp"> <span class="preprocessor">#include &lt;QtDeclarative&gt;</span>

 <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>

 qmlRegisterType<span class="operator">&lt;</span>MySliderItem<span class="operator">&gt;</span>(<span class="string">&quot;com.mycompany.qmlcomponents&quot;</span><span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="string">&quot;Slider&quot;</span>);</pre>
<p>Once this is registered, the type can be used in QML by importing the specified module name and version number:</p>
<pre class="qml"> import com.mycompany.qmlcomponents 1.0

 <span class="type">Slider</span> {
     <span class="comment">// ...</span>
 }</pre>
<p>Note that it's perfectly reasonable for a library to register types to older versions than the actual version of the library. Indeed, it is normal for the new library to allow QML written to previous versions to continue to work, even if more advanced versions of some of its types are available.</p>
<!-- @@@qmlRegisterType -->
<!-- $$$qmlRegisterType$$$qmlRegisterType -->
<h3 class="fn"><a name="qmlRegisterType-3"></a><span class="type">int</span> <span class="name">qmlRegisterType</span> ()</h3>
<p>This is an overloaded function.</p>
<p>This template function registers the C++ type in the QML system. Instances of this type cannot be created from the QML system.</p>
<p>#include &lt;<a href="qtdeclarative.html">QtDeclarative</a>&gt; to use this function.</p>
<p>Returns the QML type id.</p>
<!-- @@@qmlRegisterType -->
<!-- $$$qmlRegisterTypeNotAvailable[overload1]$$$qmlRegisterTypeNotAvailableconstchar*intintconstchar*constQString& -->
<h3 class="fn"><a name="qmlRegisterTypeNotAvailable"></a><span class="type">int</span> <span class="name">qmlRegisterTypeNotAvailable</span> ( const <span class="type">char</span> * <i>uri</i>, <span class="type">int</span> <i>versionMajor</i>, <span class="type">int</span> <i>versionMinor</i>, const <span class="type">char</span> * <i>qmlName</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>message</i> )</h3>
<p>This function registers a type in the QML system with the name <i>qmlName</i>, in the library imported from <i>uri</i> having the version number composed from <i>versionMajor</i> and <i>versionMinor</i>, but any attempt to instantiate the type will produce the given error <i>message</i>.</p>
<p>Normally, the types exported by a module should be fixed. However, if a C++ type is not available, you should at least &quot;reserve&quot; the QML type name, and give the user of your module a meaningful error message.</p>
<p>Returns the QML type id.</p>
<p>Example:</p>
<pre class="cpp"> <span class="preprocessor">#ifdef NO_GAMES_ALLOWED</span>
 qmlRegisterTypeNotAvailable(<span class="string">&quot;MinehuntCore&quot;</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="string">&quot;Game&quot;</span><span class="operator">,</span> <span class="string">&quot;Get back to work, slacker!&quot;</span>);
 <span class="preprocessor">#else</span>
 qmlRegisterType<span class="operator">&lt;</span>MinehuntGame<span class="operator">&gt;</span>(<span class="string">&quot;MinehuntCore&quot;</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="string">&quot;Game&quot;</span>);
 <span class="preprocessor">#endif</span></pre>
<p>This will cause any QML which uses this module and attempts to use the type to produce an error message:</p>
<pre class="cpp"> fun<span class="operator">.</span>qml: Get back to work<span class="operator">,</span> slacker<span class="operator">!</span>
    Game {
    <span class="operator">^</span></pre>
<p>Without this, a generic &quot;Game is not a type&quot; message would be given.</p>
<p>#include &lt;<a href="qtdeclarative.html">QtDeclarative</a>&gt; to use this function.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#qmlRegisterUncreatableType">qmlRegisterUncreatableType</a>().</p>
<!-- @@@qmlRegisterTypeNotAvailable -->
<!-- $$$qmlRegisterUncreatableType[overload1]$$$qmlRegisterUncreatableTypeconstchar*intintconstchar*constQString& -->
<h3 class="fn"><a name="qmlRegisterUncreatableType"></a><span class="type">int</span> <span class="name">qmlRegisterUncreatableType</span> ( const <span class="type">char</span> * <i>uri</i>, <span class="type">int</span> <i>versionMajor</i>, <span class="type">int</span> <i>versionMinor</i>, const <span class="type">char</span> * <i>qmlName</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>message</i> )</h3>
<p>This template function registers the C++ type in the QML system with the name <i>qmlName</i>, in the library imported from <i>uri</i> having the version number composed from <i>versionMajor</i> and <i>versionMinor</i>.</p>
<p>While the type has a name and a type, it cannot be created, and the given error <i>message</i> will result if creation is attempted.</p>
<p>This is useful where the type is only intended for providing attached properties or enum values.</p>
<p>Returns the QML type id.</p>
<p>#include &lt;<a href="qtdeclarative.html">QtDeclarative</a>&gt; to use this function.</p>
<p><b>See also </b><a href="qdeclarativeengine.html#qmlRegisterTypeNotAvailable">qmlRegisterTypeNotAvailable</a>().</p>
<!-- @@@qmlRegisterUncreatableType -->
</div>
<div class="macros">
<h2>Macro Documentation</h2>
<!-- $$$QML_DECLARE_TYPE[overload1]$$$QML_DECLARE_TYPE -->
<h3 class="fn"><a name="QML_DECLARE_TYPE"></a><span class="name">QML_DECLARE_TYPE</span> ()</h3>
<p>Equivalent to <tt>Q_DECLARE_METATYPE(TYPE *)</tt> and <tt>Q_DECLARE_METATYPE(QDeclarativeListProperty&lt;TYPE&gt;)</tt></p>
<p>#include &lt;<a href="qtdeclarative.html">QtDeclarative</a>&gt; to use this macro.</p>
<!-- @@@QML_DECLARE_TYPE -->
<!-- $$$QML_DECLARE_TYPEINFO[overload1]$$$QML_DECLARE_TYPEINFO -->
<h3 class="fn"><a name="QML_DECLARE_TYPEINFO"></a><span class="name">QML_DECLARE_TYPEINFO</span> (  <i>Type</i>,  <i>Flags</i> )</h3>
<p>Declares additional properties of the given <i>Type</i> as described by the specified <i>Flags</i>.</p>
<p>Current the only supported type info is <tt>QML_HAS_ATTACHED_PROPERTIES</tt> which declares that the <i>Type</i> supports <a href="propertybinding.html#attached-properties">Attached Properties</a>.</p>
<p>#include &lt;<a href="qtdeclarative.html">QtDeclarative</a>&gt; to use this macro.</p>
<!-- @@@QML_DECLARE_TYPEINFO -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      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>
      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. <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>