|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.EricWidgets.EricTreeWidget</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.EricWidgets.EricTreeWidget</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing specialized tree views. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#EricTreeWidget">EricTreeWidget</a></td> |
|
39 <td>Class implementing an extended tree widget.</td> |
|
40 </tr> |
|
41 <tr> |
|
42 <td><a href="#EricTreeWidgetItemsState">EricTreeWidgetItemsState</a></td> |
|
43 <td>Class defining the items expansion state.</td> |
|
44 </tr> |
|
45 </table> |
|
46 <h3>Functions</h3> |
|
47 |
|
48 <table> |
|
49 <tr><td>None</td></tr> |
|
50 </table> |
|
51 <hr /> |
|
52 <hr /> |
|
53 <a NAME="EricTreeWidget" ID="EricTreeWidget"></a> |
|
54 <h2>EricTreeWidget</h2> |
|
55 |
|
56 <p> |
|
57 Class implementing an extended tree widget. |
|
58 </p> |
|
59 <h3>Signals</h3> |
|
60 <dl> |
|
61 |
|
62 <dt>itemControlClicked(QTreeWidgetItem)</dt> |
|
63 <dd> |
|
64 emitted after a Ctrl-Click |
|
65 on an item |
|
66 </dd> |
|
67 <dt>itemMiddleButtonClicked(QTreeWidgetItem)</dt> |
|
68 <dd> |
|
69 emitted after a click |
|
70 of the middle button on an item |
|
71 </dd> |
|
72 </dl> |
|
73 <h3>Derived from</h3> |
|
74 QTreeWidget |
|
75 <h3>Class Attributes</h3> |
|
76 |
|
77 <table> |
|
78 <tr><td>None</td></tr> |
|
79 </table> |
|
80 <h3>Class Methods</h3> |
|
81 |
|
82 <table> |
|
83 <tr><td>None</td></tr> |
|
84 </table> |
|
85 <h3>Methods</h3> |
|
86 |
|
87 <table> |
|
88 |
|
89 <tr> |
|
90 <td><a href="#EricTreeWidget.__init__">EricTreeWidget</a></td> |
|
91 <td>Constructor</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#EricTreeWidget.__iterateAllItems">__iterateAllItems</a></td> |
|
95 <td>Private method to iterate over the child items of the parent.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#EricTreeWidget.__scheduleRefresh">__scheduleRefresh</a></td> |
|
99 <td>Private slot to schedule a refresh of the tree.</td> |
|
100 </tr> |
|
101 <tr> |
|
102 <td><a href="#EricTreeWidget.addTopLevelItem">addTopLevelItem</a></td> |
|
103 <td>Public method to add a top level item.</td> |
|
104 </tr> |
|
105 <tr> |
|
106 <td><a href="#EricTreeWidget.addTopLevelItems">addTopLevelItems</a></td> |
|
107 <td>Public method to add a list of top level items.</td> |
|
108 </tr> |
|
109 <tr> |
|
110 <td><a href="#EricTreeWidget.allItems">allItems</a></td> |
|
111 <td>Public method to get a list of all items.</td> |
|
112 </tr> |
|
113 <tr> |
|
114 <td><a href="#EricTreeWidget.appendToParentItem">appendToParentItem</a></td> |
|
115 <td>Public method to append an item to a parent item.</td> |
|
116 </tr> |
|
117 <tr> |
|
118 <td><a href="#EricTreeWidget.clear">clear</a></td> |
|
119 <td>Public slot to clear the tree.</td> |
|
120 </tr> |
|
121 <tr> |
|
122 <td><a href="#EricTreeWidget.deleteItem">deleteItem</a></td> |
|
123 <td>Public method to delete an item.</td> |
|
124 </tr> |
|
125 <tr> |
|
126 <td><a href="#EricTreeWidget.deleteItems">deleteItems</a></td> |
|
127 <td>Public method to delete a list of items.</td> |
|
128 </tr> |
|
129 <tr> |
|
130 <td><a href="#EricTreeWidget.filterString">filterString</a></td> |
|
131 <td>Public slot to set a new filter.</td> |
|
132 </tr> |
|
133 <tr> |
|
134 <td><a href="#EricTreeWidget.insertTopLevelItem">insertTopLevelItem</a></td> |
|
135 <td>Public method to insert a top level item.</td> |
|
136 </tr> |
|
137 <tr> |
|
138 <td><a href="#EricTreeWidget.insertTopLevelItems">insertTopLevelItems</a></td> |
|
139 <td>Public method to insert a list of top level items.</td> |
|
140 </tr> |
|
141 <tr> |
|
142 <td><a href="#EricTreeWidget.mousePressEvent">mousePressEvent</a></td> |
|
143 <td>Protected method handling mouse press events.</td> |
|
144 </tr> |
|
145 <tr> |
|
146 <td><a href="#EricTreeWidget.prependToParentItem">prependToParentItem</a></td> |
|
147 <td>Public method to prepend an item to a parent item.</td> |
|
148 </tr> |
|
149 <tr> |
|
150 <td><a href="#EricTreeWidget.setDefaultItemShowMode">setDefaultItemShowMode</a></td> |
|
151 <td>Public method to set the default item show mode.</td> |
|
152 </tr> |
|
153 </table> |
|
154 <h3>Static Methods</h3> |
|
155 |
|
156 <table> |
|
157 <tr><td>None</td></tr> |
|
158 </table> |
|
159 |
|
160 <a NAME="EricTreeWidget.__init__" ID="EricTreeWidget.__init__"></a> |
|
161 <h4>EricTreeWidget (Constructor)</h4> |
|
162 <b>EricTreeWidget</b>(<i>parent=None</i>) |
|
163 |
|
164 <p> |
|
165 Constructor |
|
166 </p> |
|
167 <dl> |
|
168 |
|
169 <dt><i>parent</i></dt> |
|
170 <dd> |
|
171 reference to the parent widget (QWidget) |
|
172 </dd> |
|
173 </dl> |
|
174 <a NAME="EricTreeWidget.__iterateAllItems" ID="EricTreeWidget.__iterateAllItems"></a> |
|
175 <h4>EricTreeWidget.__iterateAllItems</h4> |
|
176 <b>__iterateAllItems</b>(<i>parent</i>) |
|
177 |
|
178 <p> |
|
179 Private method to iterate over the child items of the parent. |
|
180 </p> |
|
181 <dl> |
|
182 |
|
183 <dt><i>parent</i></dt> |
|
184 <dd> |
|
185 parent item to iterate (QTreeWidgetItem) |
|
186 </dd> |
|
187 </dl> |
|
188 <a NAME="EricTreeWidget.__scheduleRefresh" ID="EricTreeWidget.__scheduleRefresh"></a> |
|
189 <h4>EricTreeWidget.__scheduleRefresh</h4> |
|
190 <b>__scheduleRefresh</b>(<i></i>) |
|
191 |
|
192 <p> |
|
193 Private slot to schedule a refresh of the tree. |
|
194 </p> |
|
195 <a NAME="EricTreeWidget.addTopLevelItem" ID="EricTreeWidget.addTopLevelItem"></a> |
|
196 <h4>EricTreeWidget.addTopLevelItem</h4> |
|
197 <b>addTopLevelItem</b>(<i>item</i>) |
|
198 |
|
199 <p> |
|
200 Public method to add a top level item. |
|
201 </p> |
|
202 <dl> |
|
203 |
|
204 <dt><i>item</i></dt> |
|
205 <dd> |
|
206 item to be added as a top level item (QTreeWidgetItem) |
|
207 </dd> |
|
208 </dl> |
|
209 <a NAME="EricTreeWidget.addTopLevelItems" ID="EricTreeWidget.addTopLevelItems"></a> |
|
210 <h4>EricTreeWidget.addTopLevelItems</h4> |
|
211 <b>addTopLevelItems</b>(<i>items</i>) |
|
212 |
|
213 <p> |
|
214 Public method to add a list of top level items. |
|
215 </p> |
|
216 <dl> |
|
217 |
|
218 <dt><i>items</i></dt> |
|
219 <dd> |
|
220 items to be added as top level items |
|
221 (list of QTreeWidgetItem) |
|
222 </dd> |
|
223 </dl> |
|
224 <a NAME="EricTreeWidget.allItems" ID="EricTreeWidget.allItems"></a> |
|
225 <h4>EricTreeWidget.allItems</h4> |
|
226 <b>allItems</b>(<i></i>) |
|
227 |
|
228 <p> |
|
229 Public method to get a list of all items. |
|
230 </p> |
|
231 <dl> |
|
232 <dt>Return:</dt> |
|
233 <dd> |
|
234 list of all items (list of QTreeWidgetItem) |
|
235 </dd> |
|
236 </dl> |
|
237 <a NAME="EricTreeWidget.appendToParentItem" ID="EricTreeWidget.appendToParentItem"></a> |
|
238 <h4>EricTreeWidget.appendToParentItem</h4> |
|
239 <b>appendToParentItem</b>(<i>parent, item</i>) |
|
240 |
|
241 <p> |
|
242 Public method to append an item to a parent item. |
|
243 </p> |
|
244 <dl> |
|
245 |
|
246 <dt><i>parent</i></dt> |
|
247 <dd> |
|
248 text of the parent item (string) or |
|
249 the parent item (QTreeWidgetItem) |
|
250 </dd> |
|
251 <dt><i>item</i></dt> |
|
252 <dd> |
|
253 item to be appended (QTreeWidgetItem) |
|
254 </dd> |
|
255 </dl> |
|
256 <dl> |
|
257 <dt>Return:</dt> |
|
258 <dd> |
|
259 flag indicating success (boolean) |
|
260 </dd> |
|
261 </dl> |
|
262 <dl> |
|
263 |
|
264 <dt>Raises <b>RuntimeError</b>:</dt> |
|
265 <dd> |
|
266 raised to indicate an illegal type for |
|
267 the parent |
|
268 </dd> |
|
269 </dl> |
|
270 <a NAME="EricTreeWidget.clear" ID="EricTreeWidget.clear"></a> |
|
271 <h4>EricTreeWidget.clear</h4> |
|
272 <b>clear</b>(<i></i>) |
|
273 |
|
274 <p> |
|
275 Public slot to clear the tree. |
|
276 </p> |
|
277 <a NAME="EricTreeWidget.deleteItem" ID="EricTreeWidget.deleteItem"></a> |
|
278 <h4>EricTreeWidget.deleteItem</h4> |
|
279 <b>deleteItem</b>(<i>item</i>) |
|
280 |
|
281 <p> |
|
282 Public method to delete an item. |
|
283 </p> |
|
284 <dl> |
|
285 |
|
286 <dt><i>item</i></dt> |
|
287 <dd> |
|
288 item to be deleted (QTreeWidgetItem) |
|
289 </dd> |
|
290 </dl> |
|
291 <a NAME="EricTreeWidget.deleteItems" ID="EricTreeWidget.deleteItems"></a> |
|
292 <h4>EricTreeWidget.deleteItems</h4> |
|
293 <b>deleteItems</b>(<i>items</i>) |
|
294 |
|
295 <p> |
|
296 Public method to delete a list of items. |
|
297 </p> |
|
298 <dl> |
|
299 |
|
300 <dt><i>items</i></dt> |
|
301 <dd> |
|
302 items to be deleted (list of QTreeWidgetItem) |
|
303 </dd> |
|
304 </dl> |
|
305 <a NAME="EricTreeWidget.filterString" ID="EricTreeWidget.filterString"></a> |
|
306 <h4>EricTreeWidget.filterString</h4> |
|
307 <b>filterString</b>(<i>filterStr</i>) |
|
308 |
|
309 <p> |
|
310 Public slot to set a new filter. |
|
311 </p> |
|
312 <dl> |
|
313 |
|
314 <dt><i>filterStr</i></dt> |
|
315 <dd> |
|
316 filter to be set (string) |
|
317 </dd> |
|
318 </dl> |
|
319 <a NAME="EricTreeWidget.insertTopLevelItem" ID="EricTreeWidget.insertTopLevelItem"></a> |
|
320 <h4>EricTreeWidget.insertTopLevelItem</h4> |
|
321 <b>insertTopLevelItem</b>(<i>index, item</i>) |
|
322 |
|
323 <p> |
|
324 Public method to insert a top level item. |
|
325 </p> |
|
326 <dl> |
|
327 |
|
328 <dt><i>index</i></dt> |
|
329 <dd> |
|
330 index for the insertion (integer) |
|
331 </dd> |
|
332 <dt><i>item</i></dt> |
|
333 <dd> |
|
334 item to be inserted as a top level item (QTreeWidgetItem) |
|
335 </dd> |
|
336 </dl> |
|
337 <a NAME="EricTreeWidget.insertTopLevelItems" ID="EricTreeWidget.insertTopLevelItems"></a> |
|
338 <h4>EricTreeWidget.insertTopLevelItems</h4> |
|
339 <b>insertTopLevelItems</b>(<i>index, items</i>) |
|
340 |
|
341 <p> |
|
342 Public method to insert a list of top level items. |
|
343 </p> |
|
344 <dl> |
|
345 |
|
346 <dt><i>index</i></dt> |
|
347 <dd> |
|
348 index for the insertion (integer) |
|
349 </dd> |
|
350 <dt><i>items</i></dt> |
|
351 <dd> |
|
352 items to be inserted as top level items |
|
353 (list of QTreeWidgetItem) |
|
354 </dd> |
|
355 </dl> |
|
356 <a NAME="EricTreeWidget.mousePressEvent" ID="EricTreeWidget.mousePressEvent"></a> |
|
357 <h4>EricTreeWidget.mousePressEvent</h4> |
|
358 <b>mousePressEvent</b>(<i>evt</i>) |
|
359 |
|
360 <p> |
|
361 Protected method handling mouse press events. |
|
362 </p> |
|
363 <dl> |
|
364 |
|
365 <dt><i>evt</i></dt> |
|
366 <dd> |
|
367 mouse press event (QMouseEvent) |
|
368 </dd> |
|
369 </dl> |
|
370 <a NAME="EricTreeWidget.prependToParentItem" ID="EricTreeWidget.prependToParentItem"></a> |
|
371 <h4>EricTreeWidget.prependToParentItem</h4> |
|
372 <b>prependToParentItem</b>(<i>parent, item</i>) |
|
373 |
|
374 <p> |
|
375 Public method to prepend an item to a parent item. |
|
376 </p> |
|
377 <dl> |
|
378 |
|
379 <dt><i>parent</i></dt> |
|
380 <dd> |
|
381 text of the parent item (string) or |
|
382 the parent item (QTreeWidgetItem) |
|
383 </dd> |
|
384 <dt><i>item</i></dt> |
|
385 <dd> |
|
386 item to be prepended (QTreeWidgetItem) |
|
387 </dd> |
|
388 </dl> |
|
389 <dl> |
|
390 <dt>Return:</dt> |
|
391 <dd> |
|
392 flag indicating success (boolean) |
|
393 </dd> |
|
394 </dl> |
|
395 <dl> |
|
396 |
|
397 <dt>Raises <b>RuntimeError</b>:</dt> |
|
398 <dd> |
|
399 raised to indicate an illegal type for |
|
400 the parent |
|
401 </dd> |
|
402 </dl> |
|
403 <a NAME="EricTreeWidget.setDefaultItemShowMode" ID="EricTreeWidget.setDefaultItemShowMode"></a> |
|
404 <h4>EricTreeWidget.setDefaultItemShowMode</h4> |
|
405 <b>setDefaultItemShowMode</b>(<i>mode</i>) |
|
406 |
|
407 <p> |
|
408 Public method to set the default item show mode. |
|
409 </p> |
|
410 <dl> |
|
411 |
|
412 <dt><i>mode</i> (EricTreeWidgetItemsState)</dt> |
|
413 <dd> |
|
414 default mode |
|
415 </dd> |
|
416 </dl> |
|
417 <div align="right"><a href="#top">Up</a></div> |
|
418 <hr /> |
|
419 <hr /> |
|
420 <a NAME="EricTreeWidgetItemsState" ID="EricTreeWidgetItemsState"></a> |
|
421 <h2>EricTreeWidgetItemsState</h2> |
|
422 |
|
423 <p> |
|
424 Class defining the items expansion state. |
|
425 </p> |
|
426 <h3>Derived from</h3> |
|
427 enum.Enum |
|
428 <h3>Class Attributes</h3> |
|
429 |
|
430 <table> |
|
431 <tr><td>COLLAPSED</td></tr><tr><td>EXPANDED</td></tr> |
|
432 </table> |
|
433 <h3>Class Methods</h3> |
|
434 |
|
435 <table> |
|
436 <tr><td>None</td></tr> |
|
437 </table> |
|
438 <h3>Methods</h3> |
|
439 |
|
440 <table> |
|
441 <tr><td>None</td></tr> |
|
442 </table> |
|
443 <h3>Static Methods</h3> |
|
444 |
|
445 <table> |
|
446 <tr><td>None</td></tr> |
|
447 </table> |
|
448 |
|
449 <div align="right"><a href="#top">Up</a></div> |
|
450 <hr /> |
|
451 </body></html> |