<?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>QTreeWidgetItemIterator 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">QTreeWidgetItemIterator Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QTreeWidgetItemIterator class provides a way to iterate over the items in a <a href="qtreewidget.html">QTreeWidget</a> instance. <a href="#details">More...</a></p> <h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qtreewidgetitemiterator.html#IteratorFlag-enum">IteratorFlag</a></b> { All, Hidden, NotHidden, Selected, ..., UserFlag }</li><li><div class="fn" />class <b><a href="qtreewidgetitemiterator-iteratorflags.html">IteratorFlags</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtreewidgetitemiterator.html#QTreeWidgetItemIterator">__init__</a></b> (<i>self</i>, QTreeWidgetItemIterator <i>it</i>)</li><li><div class="fn" /><b><a href="qtreewidgetitemiterator.html#QTreeWidgetItemIterator-2">__init__</a></b> (<i>self</i>, QTreeWidget <i>widget</i>, IteratorFlags <i>flags</i> = QTreeWidgetItemIterator.All)</li><li><div class="fn" /><b><a href="qtreewidgetitemiterator.html#QTreeWidgetItemIterator-3">__init__</a></b> (<i>self</i>, QTreeWidgetItem <i>item</i>, IteratorFlags <i>flags</i> = QTreeWidgetItemIterator.All)</li><li><div class="fn" />QTreeWidgetItem <b><a href="qtreewidgetitemiterator.html#value">value</a></b> (<i>self</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />QTreeWidgetItemIterator <b><a href="qtreewidgetitemiterator.html#__iadd__">__iadd__</a></b> (<i>self</i>, int <i>n</i>)</li><li><div class="fn" />QTreeWidgetItemIterator <b><a href="qtreewidgetitemiterator.html#__isub__">__isub__</a></b> (<i>self</i>, int <i>n</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QTreeWidgetItemIterator class provides a way to iterate over the items in a <a href="qtreewidget.html">QTreeWidget</a> instance.</p> <p>The iterator will walk the items in a pre-order traversal order, thus visiting the parent node <i>before</i> it continues to the child nodes.</p> <p>For example, the following code examples each item in a tree, checking the text in the first column against a user-specified search string:</p> <pre class="cpp"> <span class="type">QTreeWidgetItemIterator</span> it(treeWidget); <span class="keyword">while</span> (<span class="operator">*</span>it) { <span class="keyword">if</span> ((<span class="operator">*</span>it)<span class="operator">-</span><span class="operator">></span>text(<span class="number">0</span>) <span class="operator">=</span><span class="operator">=</span> itemText) (<span class="operator">*</span>it)<span class="operator">-</span><span class="operator">></span>setSelected(<span class="keyword">true</span>); <span class="operator">+</span><span class="operator">+</span>it; } </pre> <p>It is also possible to filter out certain types of node by passing certain <a href="qtreewidgetitemiterator.html#IteratorFlag-enum">flags</a> to the constructor of QTreeWidgetItemIterator.</p> <hr /><h2>Type Documentation</h2><h3 class="fn"><a name="IteratorFlag-enum" />QTreeWidgetItemIterator.IteratorFlag</h3><p>These flags can be passed to a <a href="qtreewidgetitemiterator.html">QTreeWidgetItemIterator</a> constructor (OR-ed together if more than one is used), so that the iterator will only iterate over items that match the given flags.</p> <table class="valuelist"> <tr> <th class="tblConst">Constant</th> <th class="tblVal">Value</th> </tr> <tr> <td class="topAlign"><tt>QTreeWidgetItemIterator.All</tt></td> <td class="topAlign"><tt>0x00000000</tt></td> </tr> <tr> <td class="topAlign"><tt>QTreeWidgetItemIterator.Hidden</tt></td> <td class="topAlign"><tt>0x00000001</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.NotHidden</tt></td> <td class="topAlign"><tt>0x00000002</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.Selected</tt></td> <td class="topAlign"><tt>0x00000004</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.Unselected</tt></td> <td class="topAlign"><tt>0x00000008</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.Selectable</tt></td> <td class="topAlign"><tt>0x00000010</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.NotSelectable</tt></td> <td class="topAlign"><tt>0x00000020</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.DragEnabled</tt></td> <td class="topAlign"><tt>0x00000040</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.DragDisabled</tt></td> <td class="topAlign"><tt>0x00000080</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.DropEnabled</tt></td> <td class="topAlign"><tt>0x00000100</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.DropDisabled</tt></td> <td class="topAlign"><tt>0x00000200</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.HasChildren</tt></td> <td class="topAlign"><tt>0x00000400</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.NoChildren</tt></td> <td class="topAlign"><tt>0x00000800</tt></td> </tr> <tr> <td class="topAlign"><tt>QTreeWidgetItemIterator.Checked</tt></td> <td class="topAlign"><tt>0x00001000</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.NotChecked</tt></td> <td class="topAlign"><tt>0x00002000</tt></td> </tr> <tr> <td class="topAlign"><tt>QTreeWidgetItemIterator.Enabled</tt></td> <td class="topAlign"><tt>0x00004000</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.Disabled</tt></td> <td class="topAlign"><tt>0x00008000</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.Editable</tt></td> <td class="topAlign"><tt>0x00010000</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.NotEditable</tt></td> <td class="topAlign"><tt>0x00020000</tt></td> </tr> <tr> <td class="topAlign"> <tt>QTreeWidgetItemIterator.UserFlag</tt></td> <td class="topAlign"><tt>0x01000000</tt></td> </tr> </table> <p>The IteratorFlags type is a typedef for <a href="qflags.html">QFlags</a><IteratorFlag>. It stores an OR combination of IteratorFlag values.</p> <hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QTreeWidgetItemIterator" />QTreeWidgetItemIterator.__init__ (<i>self</i>, <a href="qtreewidgetitemiterator.html">QTreeWidgetItemIterator</a> <i>it</i>)</h3><p>Constructs an iterator for the same <a href="qtreewidget.html">QTreeWidget</a> as <i>it</i>. The current iterator item is set to point on the current item of <i>it</i>.</p> <h3 class="fn"><a name="QTreeWidgetItemIterator-2" />QTreeWidgetItemIterator.__init__ (<i>self</i>, <a href="qtreewidget.html">QTreeWidget</a> <i>widget</i>, <a href="qtreewidgetitemiterator-iteratorflags.html">IteratorFlags</a> <i>flags</i> = QTreeWidgetItemIterator.All)</h3><p>Constructs an iterator for the given <i>widget</i> that uses the specified <i>flags</i> to determine which items are found during iteration. The iterator is set to point to the first top-level item contained in the widget, or the next matching item if the top-level item doesn't match the flags.</p> <p><b>See also</b> <a href="qtreewidgetitemiterator.html#IteratorFlag-enum">QTreeWidgetItemIterator.IteratorFlag</a>.</p> <h3 class="fn"><a name="QTreeWidgetItemIterator-3" />QTreeWidgetItemIterator.__init__ (<i>self</i>, <a href="qtreewidgetitem.html">QTreeWidgetItem</a> <i>item</i>, <a href="qtreewidgetitemiterator-iteratorflags.html">IteratorFlags</a> <i>flags</i> = QTreeWidgetItemIterator.All)</h3><p>Constructs an iterator for the given <i>item</i> that uses the specified <i>flags</i> to determine which items are found during iteration. The iterator is set to point to <i>item</i>, or the next matching item if <i>item</i> doesn't match the flags.</p> <p><b>See also</b> <a href="qtreewidgetitemiterator.html#IteratorFlag-enum">QTreeWidgetItemIterator.IteratorFlag</a>.</p> <h3 class="fn"><a name="value" /><a href="qtreewidgetitem.html">QTreeWidgetItem</a> QTreeWidgetItemIterator.value (<i>self</i>)</h3><h3 class="fn"><a name="__iadd__" /><a href="qtreewidgetitemiterator.html">QTreeWidgetItemIterator</a> QTreeWidgetItemIterator.__iadd__ (<i>self</i>, int <i>n</i>)</h3><h3 class="fn"><a name="__isub__" /><a href="qtreewidgetitemiterator.html">QTreeWidgetItemIterator</a> QTreeWidgetItemIterator.__isub__ (<i>self</i>, int <i>n</i>)</h3><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>