Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 5072

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" />
<!-- qdeclarativecomponent.cpp -->
  <title>Qt 4.8: QDeclarativeComponent 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>QDeclarativeComponent</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="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#network-components">Network Components</a></li>
</ul>
</div>
<h1 class="title">QDeclarativeComponent Class Reference</h1>
<!-- $$$QDeclarativeComponent-brief -->
<p>The QDeclarativeComponent class encapsulates a QML component definition. <a href="#details">More...</a></p>
<!-- @@@QDeclarativeComponent -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QDeclarativeComponent&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="qdeclarativecomponent-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="qdeclarativecomponent.html#Status-enum">Status</a></b> { Null, Ready, Loading, Error }</td></tr>
</table>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qdeclarativecomponent.html#progress-prop">progress</a></b> : const qreal</li>
<li class="fn"><b><a href="qdeclarativecomponent.html#status-prop">status</a></b> : const Status</li>
<li class="fn"><b><a href="qdeclarativecomponent.html#url-prop">url</a></b> : const QUrl</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="qdeclarativecomponent.html#QDeclarativeComponent">QDeclarativeComponent</a></b> ( QDeclarativeEngine * <i>engine</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#QDeclarativeComponent-3">QDeclarativeComponent</a></b> ( QDeclarativeEngine * <i>engine</i>, const QString &amp; <i>fileName</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#QDeclarativeComponent-4">QDeclarativeComponent</a></b> ( QDeclarativeEngine * <i>engine</i>, const QUrl &amp; <i>url</i>, QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#dtor.QDeclarativeComponent">~QDeclarativeComponent</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QObject * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#beginCreate">beginCreate</a></b> ( QDeclarativeContext * <i>context</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#completeCreate">completeCreate</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QObject * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#create">create</a></b> ( QDeclarativeContext * <i>context</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDeclarativeContext * </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#creationContext">creationContext</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QDeclarativeError&gt; </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#errors">errors</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#isError">isError</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#isLoading">isLoading</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#isReady">isReady</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#loadUrl">loadUrl</a></b> ( const QUrl &amp; <i>url</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#progress-prop">progress</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#setData">setData</a></b> ( const QByteArray &amp; <i>data</i>, const QUrl &amp; <i>url</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Status </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#status-prop">status</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QUrl </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#url-prop">url</a></b> () const</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="qdeclarativecomponent.html#progressChanged">progressChanged</a></b> ( qreal <i>progress</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#statusChanged">statusChanged</a></b> ( QDeclarativeComponent::Status <i>status</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qdeclarativecomponent.html#Q_REVISION">Q_REVISION</a></b> ()</td></tr>
</table>
<ul>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<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">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QDeclarativeComponent-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QDeclarativeComponent class encapsulates a QML component definition.</p>
<p>Components are reusable, encapsulated QML elements with well-defined interfaces. They are often defined in <a href="qdeclarativedocuments.html">Component Files</a>.</p>
<p>A QDeclarativeComponent instance can be created from a QML file. For example, if there is a <tt>main.qml</tt> file like this:</p>
<pre class="qml"> import QtQuick 1.0

 <span class="type"><a href="qml-item.html">Item</a></span> {
     <span class="name">width</span>: <span class="number">200</span>
     <span class="name">height</span>: <span class="number">200</span>
 }</pre>
<p>The following code loads this QML file as a component, creates an instance of this component using <a href="qdeclarativecomponent.html#create">create</a>(), and then queries the <a href="qml-item.html">Item</a>'s <a href="qml-item.html#width-prop">width</a> value:</p>
<pre class="cpp"> <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> <span class="operator">*</span>engine <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span>;
 <span class="type">QDeclarativeComponent</span> component(engine<span class="operator">,</span> <span class="type"><a href="qurl.html">QUrl</a></span><span class="operator">::</span>fromLocalFile(<span class="string">&quot;main.qml&quot;</span>));

 <span class="type"><a href="qobject.html">QObject</a></span> <span class="operator">*</span>myObject <span class="operator">=</span> component<span class="operator">.</span><a href="qdeclarativecomponent.html#create">create</a>();
 <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>(myObject);
 <span class="type">int</span> width <span class="operator">=</span> item<span class="operator">-</span><span class="operator">&gt;</span>width();  <span class="comment">// width = 200</span></pre>
<a name="network-components"></a>
<h4>Network Components</h4>
<p>If the URL passed to QDeclarativeComponent is a network resource, or if the QML document references a network resource, the QDeclarativeComponent has to fetch the network data before it is able to create objects. In this case, the QDeclarativeComponent will have a <a href="qdeclarativecomponent.html#Status-enum">Loading</a> <a href="qdeclarativecomponent.html#status-prop">status</a>. An application will have to wait until the component is <a href="qdeclarativecomponent.html#Status-enum">Ready</a> before calling <a href="qdeclarativecomponent.html#create">QDeclarativeComponent::create</a>().</p>
<p>The following example shows how to load a QML file from a network resource. After creating the QDeclarativeComponent, it tests whether the component is loading. If it is, it connects to the <a href="qdeclarativecomponent.html#statusChanged">QDeclarativeComponent::statusChanged</a>() signal and otherwise calls the <tt>continueLoading()</tt> method directly. Note that <a href="qdeclarativecomponent.html#isLoading">QDeclarativeComponent::isLoading</a>() may be false for a network component if the component has been cached and is ready immediately.</p>
<pre class="cpp"> MyApplication<span class="operator">::</span>MyApplication()
 {
     <span class="comment">// ...</span>
     component <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QDeclarativeComponent</span>(engine<span class="operator">,</span> <span class="type"><a href="qurl.html">QUrl</a></span>(<span class="string">&quot;http://www.example.com/main.qml&quot;</span>));
     <span class="keyword">if</span> (component<span class="operator">-</span><span class="operator">&gt;</span>isLoading())
         <span class="type"><a href="qobject.html">QObject</a></span><span class="operator">::</span>connect(component<span class="operator">,</span> SIGNAL(statusChanged(<span class="type">QDeclarativeComponent</span><span class="operator">::</span>Status))<span class="operator">,</span>
                          <span class="keyword">this</span><span class="operator">,</span> SLOT(continueLoading()));
     <span class="keyword">else</span>
         continueLoading();
 }

 <span class="type">void</span> MyApplication<span class="operator">::</span>continueLoading()
 {
     <span class="keyword">if</span> (component<span class="operator">-</span><span class="operator">&gt;</span>isError()) {
         <a href="qtglobal.html#qWarning">qWarning</a>() <span class="operator">&lt;</span><span class="operator">&lt;</span> component<span class="operator">-</span><span class="operator">&gt;</span>errors();
     } <span class="keyword">else</span> {
         <span class="type"><a href="qobject.html">QObject</a></span> <span class="operator">*</span>myObject <span class="operator">=</span> component<span class="operator">-</span><span class="operator">&gt;</span>create();
     }
 }</pre>
</div>
<p><b>See also </b><a href="qtbinding.html">Using QML Bindings in C++ Applications</a> and <a href="qml-integration.html">Integrating QML Code with Existing Qt UI Code</a>.</p>
<!-- @@@QDeclarativeComponent -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Status$$$Null$$$Ready$$$Loading$$$Error -->
<h3 class="fn"><a name="Status-enum"></a>enum QDeclarativeComponent::<span class="name">Status</span></h3>
<p>Specifies the loading status of the <a href="qdeclarativecomponent.html">QDeclarativeComponent</a>.</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>QDeclarativeComponent::Null</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">This <a href="qdeclarativecomponent.html">QDeclarativeComponent</a> has no data. Call <a href="qdeclarativecomponent.html#loadUrl">loadUrl</a>() or <a href="qdeclarativecomponent.html#setData">setData</a>() to add QML content.</td></tr>
<tr><td class="topAlign"><tt>QDeclarativeComponent::Ready</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">This <a href="qdeclarativecomponent.html">QDeclarativeComponent</a> is ready and <a href="qdeclarativecomponent.html#create">create</a>() may be called.</td></tr>
<tr><td class="topAlign"><tt>QDeclarativeComponent::Loading</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">This <a href="qdeclarativecomponent.html">QDeclarativeComponent</a> is loading network data.</td></tr>
<tr><td class="topAlign"><tt>QDeclarativeComponent::Error</tt></td><td class="topAlign"><tt>3</tt></td><td class="topAlign">An error has occurred. Call <a href="qdeclarativecomponent.html#errors">errors</a>() to retrieve a list of {<a href="qdeclarativeerror.html">QDeclarativeError</a>}{errors}.</td></tr>
</table>
<!-- @@@Status -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$progress-prop$$$progress$$$progressChangedqreal -->
<h3 class="fn"><a name="progress-prop"></a><span class="name">progress</span> : const <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span></h3>
<p>The progress of loading the component, from 0.0 (nothing loaded) to 1.0 (finished).</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>progress</b></span> () const</td></tr>
</table>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qdeclarativecomponent.html#progressChanged">progressChanged</a></b></span> ( qreal <i>progress</i> )</td></tr>
</table>
<!-- @@@progress -->
<!-- $$$status-prop$$$status$$$statusChangedQDeclarativeComponent::Status -->
<h3 class="fn"><a name="status-prop"></a><span class="name">status</span> : const <span class="type"><a href="qdeclarativecomponent.html#Status-enum">Status</a></span></h3>
<p>The component's current <a href="qdeclarativecomponent.html#Status-enum">status</a>.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> Status </td><td class="memItemRight bottomAlign"><span class="name"><b>status</b></span> () const</td></tr>
</table>
<p><b>Notifier signal:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qdeclarativecomponent.html#statusChanged">statusChanged</a></b></span> ( QDeclarativeComponent::Status <i>status</i> )</td></tr>
</table>
<!-- @@@status -->
<!-- $$$url-prop$$$url -->
<h3 class="fn"><a name="url-prop"></a><span class="name">url</span> : const <span class="type"><a href="qurl.html">QUrl</a></span></h3>
<p>The component URL. This is the URL passed to either the constructor, or the <a href="qdeclarativecomponent.html#loadUrl">loadUrl</a>() or <a href="qdeclarativecomponent.html#setData">setData</a>() methods.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QUrl </td><td class="memItemRight bottomAlign"><span class="name"><b>url</b></span> () const</td></tr>
</table>
<!-- @@@url -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QDeclarativeComponent[overload1]$$$QDeclarativeComponentQDeclarativeEngine*QObject* -->
<h3 class="fn"><a name="QDeclarativeComponent"></a>QDeclarativeComponent::<span class="name">QDeclarativeComponent</span> ( <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> * <i>engine</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Create a <a href="qdeclarativecomponent.html">QDeclarativeComponent</a> with no data and give it the specified <i>engine</i> and <i>parent</i>. Set the data with <a href="qdeclarativecomponent.html#setData">setData</a>().</p>
<!-- @@@QDeclarativeComponent -->
<!-- $$$QDeclarativeComponent$$$QDeclarativeComponentQDeclarativeEngine*constQString&QObject* -->
<h3 class="fn"><a name="QDeclarativeComponent-3"></a>QDeclarativeComponent::<span class="name">QDeclarativeComponent</span> ( <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> * <i>engine</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>fileName</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Create a <a href="qdeclarativecomponent.html">QDeclarativeComponent</a> from the given <i>fileName</i> and give it the specified <i>parent</i> and <i>engine</i>.</p>
<p><b>See also </b><a href="qdeclarativecomponent.html#loadUrl">loadUrl</a>().</p>
<!-- @@@QDeclarativeComponent -->
<!-- $$$QDeclarativeComponent$$$QDeclarativeComponentQDeclarativeEngine*constQUrl&QObject* -->
<h3 class="fn"><a name="QDeclarativeComponent-4"></a>QDeclarativeComponent::<span class="name">QDeclarativeComponent</span> ( <span class="type"><a href="qdeclarativeengine.html">QDeclarativeEngine</a></span> * <i>engine</i>, const <span class="type"><a href="qurl.html">QUrl</a></span> &amp; <i>url</i>, <span class="type"><a href="qobject.html">QObject</a></span> * <i>parent</i> = 0 )</h3>
<p>Create a <a href="qdeclarativecomponent.html">QDeclarativeComponent</a> from the given <i>url</i> and give it the specified <i>parent</i> and <i>engine</i>.</p>
<p>Ensure that the URL provided is full and correct, in particular, use <a href="qurl.html#fromLocalFile">QUrl::fromLocalFile</a>() when loading a file from the local filesystem.</p>
<p><b>See also </b><a href="qdeclarativecomponent.html#loadUrl">loadUrl</a>().</p>
<!-- @@@QDeclarativeComponent -->
<!-- $$$~QDeclarativeComponent[overload1]$$$~QDeclarativeComponent -->
<h3 class="fn"><a name="dtor.QDeclarativeComponent"></a>QDeclarativeComponent::<span class="name">~QDeclarativeComponent</span> ()<tt> [virtual]</tt></h3>
<p>Destruct the <a href="qdeclarativecomponent.html">QDeclarativeComponent</a>.</p>
<!-- @@@~QDeclarativeComponent -->
<!-- $$$Q_REVISION[overload1]$$$Q_REVISION -->
<h3 class="fn"><a name="Q_REVISION"></a>QDeclarativeComponent::<span class="name">Q_REVISION</span> ()<tt> [protected]</tt></h3>
<!-- @@@Q_REVISION -->
<!-- $$$beginCreate[overload1]$$$beginCreateQDeclarativeContext* -->
<h3 class="fn"><a name="beginCreate"></a><span class="type"><a href="qobject.html">QObject</a></span> * QDeclarativeComponent::<span class="name">beginCreate</span> ( <span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * <i>context</i> )<tt> [virtual]</tt></h3>
<p>This method provides more advanced control over component instance creation. In general, programmers should use <a href="qdeclarativecomponent.html#create">QDeclarativeComponent::create</a>() to create a component.</p>
<p>Create an object instance from this component. Returns 0 if creation failed. <i>context</i> specifies the context within which to create the object instance.</p>
<p>When <a href="qdeclarativecomponent.html">QDeclarativeComponent</a> constructs an instance, it occurs in three steps:</p>
<ol class="1">
<li>The object hierarchy is created, and constant values are assigned.</li>
<li>Property bindings are evaluated for the the first time.</li>
<li>If applicable, <a href="qdeclarativeparserstatus.html#componentComplete">QDeclarativeParserStatus::componentComplete</a>() is called on objects.</li>
</ol>
<p>QDeclarativeComponent::beginCreate() differs from <a href="qdeclarativecomponent.html#create">QDeclarativeComponent::create</a>() in that it only performs step 1. <a href="qdeclarativecomponent.html#completeCreate">QDeclarativeComponent::completeCreate</a>() must be called to complete steps 2 and 3.</p>
<p>This breaking point is sometimes useful when using attached properties to communicate information to an instantiated component, as it allows their initial values to be configured before property bindings take effect.</p>
<!-- @@@beginCreate -->
<!-- $$$completeCreate[overload1]$$$completeCreate -->
<h3 class="fn"><a name="completeCreate"></a><span class="type">void</span> QDeclarativeComponent::<span class="name">completeCreate</span> ()<tt> [virtual]</tt></h3>
<p>This method provides more advanced control over component instance creation. In general, programmers should use <a href="qdeclarativecomponent.html#create">QDeclarativeComponent::create</a>() to create a component.</p>
<p>Complete a component creation begin with <a href="qdeclarativecomponent.html#beginCreate">QDeclarativeComponent::beginCreate</a>().</p>
<!-- @@@completeCreate -->
<!-- $$$create[overload1]$$$createQDeclarativeContext* -->
<h3 class="fn"><a name="create"></a><span class="type"><a href="qobject.html">QObject</a></span> * QDeclarativeComponent::<span class="name">create</span> ( <span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * <i>context</i> = 0 )<tt> [virtual]</tt></h3>
<p>Create an object instance from this component. Returns 0 if creation failed. <i>context</i> specifies the context within which to create the object instance.</p>
<p>If <i>context</i> is 0 (the default), it will create the instance in the engine' s <a href="qdeclarativeengine.html#rootContext">root context</a>.</p>
<!-- @@@create -->
<!-- $$$creationContext[overload1]$$$creationContext -->
<h3 class="fn"><a name="creationContext"></a><span class="type"><a href="qdeclarativecontext.html">QDeclarativeContext</a></span> * QDeclarativeComponent::<span class="name">creationContext</span> () const</h3>
<p>Returns the <a href="qdeclarativecontext.html">QDeclarativeContext</a> the component was created in. This is only valid for components created directly from QML.</p>
<!-- @@@creationContext -->
<!-- $$$errors[overload1]$$$errors -->
<h3 class="fn"><a name="errors"></a><span class="type"><a href="qlist.html">QList</a></span>&lt;<span class="type"><a href="qdeclarativeerror.html">QDeclarativeError</a></span>&gt; QDeclarativeComponent::<span class="name">errors</span> () const</h3>
<p>Return the list of errors that occurred during the last compile or create operation. An empty list is returned if <a href="qdeclarativecomponent.html#isError">isError</a>() is not set.</p>
<!-- @@@errors -->
<!-- $$$isError[overload1]$$$isError -->
<h3 class="fn"><a name="isError"></a><span class="type">bool</span> QDeclarativeComponent::<span class="name">isError</span> () const</h3>
<p>Returns true if <a href="qdeclarativecomponent.html#status-prop">status</a>() == <a href="qdeclarativecomponent.html#Status-enum">QDeclarativeComponent::Error</a>.</p>
<!-- @@@isError -->
<!-- $$$isLoading[overload1]$$$isLoading -->
<h3 class="fn"><a name="isLoading"></a><span class="type">bool</span> QDeclarativeComponent::<span class="name">isLoading</span> () const</h3>
<p>Returns true if <a href="qdeclarativecomponent.html#status-prop">status</a>() == <a href="qdeclarativecomponent.html#Status-enum">QDeclarativeComponent::Loading</a>.</p>
<!-- @@@isLoading -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QDeclarativeComponent::<span class="name">isNull</span> () const</h3>
<p>Returns true if <a href="qdeclarativecomponent.html#status-prop">status</a>() == <a href="qdeclarativecomponent.html#Status-enum">QDeclarativeComponent::Null</a>.</p>
<!-- @@@isNull -->
<!-- $$$isReady[overload1]$$$isReady -->
<h3 class="fn"><a name="isReady"></a><span class="type">bool</span> QDeclarativeComponent::<span class="name">isReady</span> () const</h3>
<p>Returns true if <a href="qdeclarativecomponent.html#status-prop">status</a>() == <a href="qdeclarativecomponent.html#Status-enum">QDeclarativeComponent::Ready</a>.</p>
<!-- @@@isReady -->
<!-- $$$loadUrl[overload1]$$$loadUrlconstQUrl& -->
<h3 class="fn"><a name="loadUrl"></a><span class="type">void</span> QDeclarativeComponent::<span class="name">loadUrl</span> ( const <span class="type"><a href="qurl.html">QUrl</a></span> &amp; <i>url</i> )</h3>
<p>Load the <a href="qdeclarativecomponent.html">QDeclarativeComponent</a> from the provided <i>url</i>.</p>
<p>Ensure that the URL provided is full and correct, in particular, use <a href="qurl.html#fromLocalFile">QUrl::fromLocalFile</a>() when loading a file from the local filesystem.</p>
<!-- @@@loadUrl -->
<!-- $$$progressChanged[overload1]$$$progressChangedqreal -->
<h3 class="fn"><a name="progressChanged"></a><span class="type">void</span> QDeclarativeComponent::<span class="name">progressChanged</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>progress</i> )<tt> [signal]</tt></h3>
<p>Emitted whenever the component's loading progress changes. <i>progress</i> will be the current progress between 0.0 (nothing loaded) and 1.0 (finished).</p>
<!-- @@@progressChanged -->
<!-- $$$setData[overload1]$$$setDataconstQByteArray&constQUrl& -->
<h3 class="fn"><a name="setData"></a><span class="type">void</span> QDeclarativeComponent::<span class="name">setData</span> ( const <span class="type"><a href="qbytearray.html">QByteArray</a></span> &amp; <i>data</i>, const <span class="type"><a href="qurl.html">QUrl</a></span> &amp; <i>url</i> )</h3>
<p>Sets the <a href="qdeclarativecomponent.html">QDeclarativeComponent</a> to use the given QML <i>data</i>. If <i>url</i> is provided, it is used to set the component name and to provide a base path for items resolved by this component.</p>
<!-- @@@setData -->
<!-- $$$statusChanged[overload1]$$$statusChangedQDeclarativeComponent::Status -->
<h3 class="fn"><a name="statusChanged"></a><span class="type">void</span> QDeclarativeComponent::<span class="name">statusChanged</span> ( <span class="type"><a href="qdeclarativecomponent.html#Status-enum">QDeclarativeComponent::Status</a></span> <i>status</i> )<tt> [signal]</tt></h3>
<p>Emitted whenever the component's status changes. <i>status</i> will be the new status.</p>
<!-- @@@statusChanged -->
</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>