File: qtreewidgetitemiterator.html

package info (click to toggle)
python-qt4 4.9.3-4
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 34,432 kB
  • sloc: python: 34,126; cpp: 11,938; xml: 290; makefile: 223; php: 27
file content (160 lines) | stat: -rw-r--r-- 9,933 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<?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">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <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&#160;<i>it</i>)</li><li><div class="fn" /><b><a href="qtreewidgetitemiterator.html#QTreeWidgetItemIterator-2">__init__</a></b> (<i>self</i>, QTreeWidget&#160;<i>widget</i>, IteratorFlags&#160;<i>flags</i>&#160;=&#160;QTreeWidgetItemIterator.All)</li><li><div class="fn" /><b><a href="qtreewidgetitemiterator.html#QTreeWidgetItemIterator-3">__init__</a></b> (<i>self</i>, QTreeWidgetItem&#160;<i>item</i>, IteratorFlags&#160;<i>flags</i>&#160;=&#160;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&#160;<i>n</i>)</li><li><div class="fn" />QTreeWidgetItemIterator <b><a href="qtreewidgetitemiterator.html#__isub__">__isub__</a></b> (<i>self</i>, int&#160;<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">&gt;</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">&gt;</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>&lt;IteratorFlag&gt;. 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>&#160;<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>&#160;<i>widget</i>, <a href="qtreewidgetitemiterator-iteratorflags.html">IteratorFlags</a>&#160;<i>flags</i>&#160;=&#160;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>&#160;<i>item</i>, <a href="qtreewidgetitemiterator-iteratorflags.html">IteratorFlags</a>&#160;<i>flags</i>&#160;=&#160;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&#160;<i>n</i>)</h3><h3 class="fn"><a name="__isub__" /><a href="qtreewidgetitemiterator.html">QTreeWidgetItemIterator</a> QTreeWidgetItemIterator.__isub__ (<i>self</i>, int&#160;<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&#160;4.9.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.2</td></tr></table></div></address></body></html>