Sophie

Sophie

distrib > Mageia > 6 > x86_64 > by-pkgid > 2cba8df17162abb32fcb8e6852f3eacc > files > 65

qtdeclarative5-doc-5.9.4-1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qqmlinstantiator.cpp -->
  <title>Instantiator QML Type | Qt QML 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.9</td><td ><a href="qtqml-index.html">Qt QML</a></td><td ><a href="qtqml-qmlmodule.html">QML Types</a></td><td >Instantiator QML Type</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#methods">Methods</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Instantiator QML Type</h1>
<span class="subtitle"></span>
<!-- $$$Instantiator-brief -->
<p>Dynamically creates objects <a href="#details">More...</a></p>
<!-- @@@Instantiator -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import QtQml 2.2</td></tr></table></div><ul>
<li><a href="qml-qtqml-instantiator-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtqml-instantiator.html#active-prop">active</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtqml-instantiator.html#asynchronous-prop">asynchronous</a></b></b> : bool</li>
<li class="fn"><b><b><a href="qml-qtqml-instantiator.html#count-prop">count</a></b></b> : int</li>
<li class="fn"><b><b><a href="qml-qtqml-instantiator.html#delegate-prop">delegate</a></b></b> : QtQml::Component</li>
<li class="fn"><b><b><a href="qml-qtqml-instantiator.html#model-prop">model</a></b></b> : variant</li>
<li class="fn"><b><b><a href="qml-qtqml-instantiator.html#object-prop">object</a></b></b> : QtObject</li>
</ul>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<ul>
<li class="fn"><b><b><a href="qml-qtqml-instantiator.html#objectAdded-signal">objectAdded</a></b></b>(int <i>index</i>, QtObject <i>object</i>)</li>
<li class="fn"><b><b><a href="qml-qtqml-instantiator.html#objectRemoved-signal">objectRemoved</a></b></b>(int <i>index</i>, QtObject <i>object</i>)</li>
</ul>
<a name="methods"></a>
<h2 id="methods">Methods</h2>
<ul>
<li class="fn">QtObject <b><b><a href="qml-qtqml-instantiator.html#objectAt-method">objectAt</a></b></b>(int <i>index</i>)</li>
</ul>
<!-- $$$Instantiator-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p>A Instantiator can be used to control the dynamic creation of objects, or to dynamically create multiple objects from a template.</p>
<p>The Instantiator element will manage the objects it creates. Those objects are parented to the Instantiator and can also be deleted by the Instantiator if the Instantiator's properties change. Objects can also be destroyed dynamically through other means, and the Instantiator will not recreate them unless the properties of the Instantiator change.</p>
<!-- @@@Instantiator -->
<h2>Property Documentation</h2>
<!-- $$$active -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="active-prop">
<td class="tblQmlPropNode"><p>
<a name="active-prop"></a><span class="name">active</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>When active is true, and the delegate component is ready, the Instantiator will create objects according to the model. When active is false, no objects will be created and any previously created objects will be destroyed.</p>
<p>Default is true.</p>
</div></div><!-- @@@active -->
<br/>
<!-- $$$asynchronous -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="asynchronous-prop">
<td class="tblQmlPropNode"><p>
<a name="asynchronous-prop"></a><span class="name">asynchronous</span> : <span class="type">bool</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>When asynchronous is true the Instantiator will attempt to create objects asynchronously. This means that objects may not be available immediately, even if active is set to true.</p>
<p>You can use the <a href="qml-qtqml-instantiator.html#objectAdded-signal">objectAdded</a> signal to respond to items being created.</p>
<p>Default is false.</p>
</div></div><!-- @@@asynchronous -->
<br/>
<!-- $$$count -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="count-prop">
<td class="tblQmlPropNode"><p>
<a name="count-prop"></a><span class="name">count</span> : <span class="type">int</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The number of objects the Instantiator is currently managing.</p>
</div></div><!-- @@@count -->
<br/>
<!-- $$$delegate -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="delegate-prop">
<td class="tblQmlPropNode"><p>
<a name="delegate-prop"></a><span class="qmldefault">[default] </span><span class="name">delegate</span> : <span class="type"><a href="qml-qtqml-component.html">QtQml::Component</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The component used to create all objects.</p>
<p>Note that an extra variable, index, will be available inside instances of the delegate. This variable refers to the index of the instance inside the Instantiator, and can be used to obtain the object through the <a href="qml-qtqml-instantiator.html#objectAt-method">objectAt</a> method of the Instantiator.</p>
<p>If this property is changed, all instances using the old delegate will be destroyed and new instances will be created using the new delegate.</p>
</div></div><!-- @@@delegate -->
<br/>
<!-- $$$model -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="model-prop">
<td class="tblQmlPropNode"><p>
<a name="model-prop"></a><span class="name">model</span> : <span class="type"><a href="qml-variant.html">variant</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This property can be set to any of the supported data models:</p>
<ul>
<li>A number that indicates the number of delegates to be created by the repeater</li>
<li>A model (e.g&#x2e; a <a href="qml-qtqml-models-listmodel.html">ListModel</a> item, or a QAbstractItemModel subclass)</li>
<li>A string list</li>
<li>An object list</li>
</ul>
<p>The type of model affects the properties that are exposed to the <a href="qml-qtqml-instantiator.html#delegate-prop">delegate</a>.</p>
<p>Default value is 1, which creates a single delegate instance.</p>
<p><b>See also </b>Data Models.</p>
</div></div><!-- @@@model -->
<br/>
<!-- $$$object -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="object-prop">
<td class="tblQmlPropNode"><p>
<a name="object-prop"></a><span class="name">object</span> : <span class="type"><a href="qml-qtqml-qtobject.html">QtObject</a></span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This is a reference to the first created object, intended as a convenience for the case where only one object has been created.</p>
</div></div><!-- @@@object -->
<br/>
<h2>Signal Documentation</h2>
<!-- $$$objectAdded -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="objectAdded-signal">
<td class="tblQmlFuncNode"><p>
<a name="objectAdded-signal"></a><span class="name">objectAdded</span>(<span class="type">int</span> <i>index</i>, <span class="type"><a href="qml-qtqml-qtobject.html">QtObject</a></span> <i>object</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This signal is emitted when an object is added to the Instantiator. The <i>index</i> parameter holds the index which the object has been given, and the <i>object</i> parameter holds the <a href="qml-qtqml-qtobject.html">QtObject</a> that has been added.</p>
<p>The corresponding handler is <code>onObjectAdded</code>.</p>
</div></div><!-- @@@objectAdded -->
<br/>
<!-- $$$objectRemoved -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="objectRemoved-signal">
<td class="tblQmlFuncNode"><p>
<a name="objectRemoved-signal"></a><span class="name">objectRemoved</span>(<span class="type">int</span> <i>index</i>, <span class="type"><a href="qml-qtqml-qtobject.html">QtObject</a></span> <i>object</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>This signal is emitted when an object is removed from the Instantiator. The <i>index</i> parameter holds the index which the object had been given, and the <i>object</i> parameter holds the <a href="qml-qtqml-qtobject.html">QtObject</a> that has been removed.</p>
<p>Do not keep a reference to <i>object</i> if it was created by this Instantiator, as in these cases it will be deleted shortly after the signal is handled.</p>
<p>The corresponding handler is <code>onObjectRemoved</code>.</p>
</div></div><!-- @@@objectRemoved -->
<br/>
<h2>Method Documentation</h2>
<!-- $$$objectAt -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="objectAt-method">
<td class="tblQmlFuncNode"><p>
<a name="objectAt-method"></a><span class="type"><a href="qml-qtqml-qtobject.html">QtObject</a></span> <span class="name">objectAt</span>(<span class="type">int</span> <i>index</i>)</p></td></tr>
</table></div>
</div><div class="qmldoc"><p>Returns a reference to the object with the given <i>index</i>.</p>
</div></div><!-- @@@objectAt -->
<br/>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>