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