<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html><head><title>QScriptClassPropertyIterator Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } td.postheader { font-family: sans-serif } tr.address { font-family: sans-serif } body { background: #ffffff; color: black; } </style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QScriptClassPropertyIterator Class Reference<br /><sup><sup>[<a href="qtscript.html">QtScript</a> module]</sup></sup></h1><p>The QScriptClassPropertyIterator class provides an iterator interface for custom Qt Script objects. <a href="#details">More...</a></p> <h3>Methods</h3><ul><li><div class="fn" /><b><a href="qscriptclasspropertyiterator.html#QScriptClassPropertyIterator">__init__</a></b> (<i>self</i>, QScriptValue <i>object</i>)</li><li><div class="fn" />QScriptValue.PropertyFlags <b><a href="qscriptclasspropertyiterator.html#flags">flags</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qscriptclasspropertyiterator.html#hasNext">hasNext</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qscriptclasspropertyiterator.html#hasPrevious">hasPrevious</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qscriptclasspropertyiterator.html#id">id</a></b> (<i>self</i>)</li><li><div class="fn" />QScriptString <b><a href="qscriptclasspropertyiterator.html#name">name</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qscriptclasspropertyiterator.html#next">next</a></b> (<i>self</i>)</li><li><div class="fn" />QScriptValue <b><a href="qscriptclasspropertyiterator.html#object">object</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qscriptclasspropertyiterator.html#previous">previous</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qscriptclasspropertyiterator.html#toBack">toBack</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qscriptclasspropertyiterator.html#toFront">toFront</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QScriptClassPropertyIterator class provides an iterator interface for custom Qt Script objects.</p> <p>This class is only relevant if you have subclassed <a href="qscriptclass.html">QScriptClass</a> and want to provide enumeration of your custom properties (e.g. when objects of your class are used with <a href="qscriptvalueiterator.html">QScriptValueIterator</a>, or with the for-in statement in scripts).</p> <p>The <a href="qscriptclasspropertyiterator.html#object">object</a>() function returns the Qt Script object the iterator is traversing.</p> <p><a href="qscriptclasspropertyiterator.html#toFront">toFront</a>(), <a href="qscriptclasspropertyiterator.html#hasNext">hasNext</a>() and <a href="qscriptclasspropertyiterator.html#next">next</a>() provide forward iteration.</p> <p><a href="qscriptclasspropertyiterator.html#toBack">toBack</a>(), <a href="qscriptclasspropertyiterator.html#hasPrevious">hasPrevious</a>() and <a href="qscriptclasspropertyiterator.html#previous">previous</a>() provide backward iteration.</p> <p><a href="qscriptclasspropertyiterator.html#name">name</a>(), <a href="qscriptclasspropertyiterator.html#id">id</a>() and <a href="qscriptclasspropertyiterator.html#flags">flags</a>() return information about the last property that was jumped over using <a href="qscriptclasspropertyiterator.html#next">next</a>() or <a href="qscriptclasspropertyiterator.html#previous">previous</a>().</p> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QScriptClassPropertyIterator" />QScriptClassPropertyIterator.__init__ (<i>self</i>, <a href="qscriptvalue.html">QScriptValue</a> <i>object</i>)</h3><p>Constructs an iterator for traversing <i>object</i>.</p> <p>Subclasses should ensure that the iterator is set to the front of the sequence of properties (before the first property).</p> <h3 class="fn"><a name="flags" /><a href="qscriptvalue-propertyflags.html">QScriptValue.PropertyFlags</a> QScriptClassPropertyIterator.flags (<i>self</i>)</h3><p>Returns the flags of the last property that was jumped over using <a href="qscriptclasspropertyiterator.html#next">next</a>() or <a href="qscriptclasspropertyiterator.html#previous">previous</a>().</p> <p>The default implementation calls the propertyFlags() function of <a href="qscriptclasspropertyiterator.html#object">object</a>() with argument <a href="qscriptclasspropertyiterator.html#name">name</a>().</p> <h3 class="fn"><a name="hasNext" />bool QScriptClassPropertyIterator.hasNext (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns true if there is at least one item ahead of the iterator (i.e. the iterator is <i>not</i> at the back of the property sequence); otherwise returns false.</p> <p><b>See also</b> <a href="qscriptclasspropertyiterator.html#next">next</a>() and <a href="qscriptclasspropertyiterator.html#hasPrevious">hasPrevious</a>().</p> <h3 class="fn"><a name="hasPrevious" />bool QScriptClassPropertyIterator.hasPrevious (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns true if there is at least one item behind the iterator (i.e. the iterator is <i>not</i> at the front of the property sequence); otherwise returns false.</p> <p><b>See also</b> <a href="qscriptclasspropertyiterator.html#previous">previous</a>() and <a href="qscriptclasspropertyiterator.html#hasNext">hasNext</a>().</p> <h3 class="fn"><a name="id" />int QScriptClassPropertyIterator.id (<i>self</i>)</h3><p>Returns the id of the last property that was jumped over using <a href="qscriptclasspropertyiterator.html#next">next</a>() or <a href="qscriptclasspropertyiterator.html#previous">previous</a>().</p> <p>The default implementation returns 0.</p> <p><b>See also</b> <a href="qscriptclasspropertyiterator.html#name">name</a>().</p> <h3 class="fn"><a name="name" /><a href="qscriptstring.html">QScriptString</a> QScriptClassPropertyIterator.name (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Returns the name of the last property that was jumped over using <a href="qscriptclasspropertyiterator.html#next">next</a>() or <a href="qscriptclasspropertyiterator.html#previous">previous</a>().</p> <p><b>See also</b> <a href="qscriptclasspropertyiterator.html#id">id</a>().</p> <h3 class="fn"><a name="next" />QScriptClassPropertyIterator.next (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Advances the iterator by one position.</p> <p>Calling this function on an iterator located at the back of the container leads to undefined results.</p> <p><b>See also</b> <a href="qscriptclasspropertyiterator.html#hasNext">hasNext</a>(), <a href="qscriptclasspropertyiterator.html#previous">previous</a>(), and <a href="qscriptclasspropertyiterator.html#name">name</a>().</p> <h3 class="fn"><a name="object" /><a href="qscriptvalue.html">QScriptValue</a> QScriptClassPropertyIterator.object (<i>self</i>)</h3><p>Returns the Qt Script object this iterator is traversing.</p> <h3 class="fn"><a name="previous" />QScriptClassPropertyIterator.previous (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Moves the iterator back by one position.</p> <p>Calling this function on an iterator located at the front of the container leads to undefined results.</p> <p><b>See also</b> <a href="qscriptclasspropertyiterator.html#hasPrevious">hasPrevious</a>(), <a href="qscriptclasspropertyiterator.html#next">next</a>(), and <a href="qscriptclasspropertyiterator.html#name">name</a>().</p> <h3 class="fn"><a name="toBack" />QScriptClassPropertyIterator.toBack (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Moves the iterator to the back of the <a href="qscriptvalue.html">QScriptValue</a> (after the last property).</p> <p><b>See also</b> <a href="qscriptclasspropertyiterator.html#toFront">toFront</a>() and <a href="qscriptclasspropertyiterator.html#previous">previous</a>().</p> <h3 class="fn"><a name="toFront" />QScriptClassPropertyIterator.toFront (<i>self</i>)</h3><p>This method is abstract and should be reimplemented in any sub-class.</p><p>Moves the iterator to the front of the <a href="qscriptvalue.html">QScriptValue</a> (before the first property).</p> <p><b>See also</b> <a href="qscriptclasspropertyiterator.html#toBack">toBack</a>() and <a href="qscriptclasspropertyiterator.html#next">next</a>().</p> <address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.10.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.5</td></tr></table></div></address></body></html>