|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Debugger.VariablesViewer</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.Debugger.VariablesViewer</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the variables viewer view based on QTreeView. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>SORT_ROLE</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#VariableItem">VariableItem</a></td> |
|
25 <td>Class implementing the data structure for all variable items.</td> |
|
26 </tr> |
|
27 <tr> |
|
28 <td><a href="#VariablesModel">VariablesModel</a></td> |
|
29 <td>Class implementing the data model for QTreeView.</td> |
|
30 </tr> |
|
31 <tr> |
|
32 <td><a href="#VariablesProxyModel">VariablesProxyModel</a></td> |
|
33 <td>Class for handling the sort operations.</td> |
|
34 </tr> |
|
35 <tr> |
|
36 <td><a href="#VariablesViewer">VariablesViewer</a></td> |
|
37 <td>Class implementing the variables viewer view.</td> |
|
38 </tr> |
|
39 </table> |
|
40 <h3>Functions</h3> |
|
41 |
|
42 <table> |
|
43 <tr><td>None</td></tr> |
|
44 </table> |
|
45 <hr /> |
|
46 <hr /> |
|
47 <a NAME="VariableItem" ID="VariableItem"></a> |
|
48 <h2>VariableItem</h2> |
|
49 |
|
50 <p> |
|
51 Class implementing the data structure for all variable items. |
|
52 </p> |
|
53 <h3>Derived from</h3> |
|
54 None |
|
55 <h3>Class Attributes</h3> |
|
56 |
|
57 <table> |
|
58 <tr><td>noOfItemsStr</td></tr><tr><td>rx_nonprintable</td></tr><tr><td>unsized</td></tr> |
|
59 </table> |
|
60 <h3>Class Methods</h3> |
|
61 |
|
62 <table> |
|
63 <tr><td>None</td></tr> |
|
64 </table> |
|
65 <h3>Methods</h3> |
|
66 |
|
67 <table> |
|
68 |
|
69 <tr> |
|
70 <td><a href="#VariableItem.__init__">VariableItem</a></td> |
|
71 <td>Constructor</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#VariableItem.__getName">__getName</a></td> |
|
75 <td>Private method to extract the variable name.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#VariableItem.__getValue">__getValue</a></td> |
|
79 <td>Private method to process the variables value.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#VariableItem.absolutCount">absolutCount</a></td> |
|
83 <td>Public property to get the total number of children.</td> |
|
84 </tr> |
|
85 </table> |
|
86 <h3>Static Methods</h3> |
|
87 |
|
88 <table> |
|
89 <tr><td>None</td></tr> |
|
90 </table> |
|
91 |
|
92 <a NAME="VariableItem.__init__" ID="VariableItem.__init__"></a> |
|
93 <h4>VariableItem (Constructor)</h4> |
|
94 <b>VariableItem</b>(<i>parent, dvar, indicator, dtype, hasChildren, length, dvalue</i>) |
|
95 |
|
96 <p> |
|
97 Constructor |
|
98 </p> |
|
99 <dl> |
|
100 |
|
101 <dt><i>parent</i> (VariableItem)</dt> |
|
102 <dd> |
|
103 reference to the parent item |
|
104 </dd> |
|
105 <dt><i>dvar</i> (str)</dt> |
|
106 <dd> |
|
107 variable name |
|
108 </dd> |
|
109 <dt><i>indicator</i> (str)</dt> |
|
110 <dd> |
|
111 type indicator appended to the name |
|
112 </dd> |
|
113 <dt><i>dtype</i> (str)</dt> |
|
114 <dd> |
|
115 type string |
|
116 </dd> |
|
117 <dt><i>hasChildren</i> (bool)</dt> |
|
118 <dd> |
|
119 indicator for children |
|
120 </dd> |
|
121 <dt><i>length</i> (int)</dt> |
|
122 <dd> |
|
123 length of the array or string (-1 if uninitialized |
|
124 numpy.ndarray) |
|
125 </dd> |
|
126 <dt><i>dvalue</i> (str)</dt> |
|
127 <dd> |
|
128 value string |
|
129 </dd> |
|
130 </dl> |
|
131 <a NAME="VariableItem.__getName" ID="VariableItem.__getName"></a> |
|
132 <h4>VariableItem.__getName</h4> |
|
133 <b>__getName</b>(<i>dvar</i>) |
|
134 |
|
135 <p> |
|
136 Private method to extract the variable name. |
|
137 </p> |
|
138 <dl> |
|
139 |
|
140 <dt><i>dvar</i> (str)</dt> |
|
141 <dd> |
|
142 name of variable maybe with ID |
|
143 </dd> |
|
144 </dl> |
|
145 <a NAME="VariableItem.__getValue" ID="VariableItem.__getValue"></a> |
|
146 <h4>VariableItem.__getValue</h4> |
|
147 <b>__getValue</b>(<i>dtype, dvalue, indicator, length</i>) |
|
148 |
|
149 <p> |
|
150 Private method to process the variables value. |
|
151 </p> |
|
152 <p> |
|
153 Define and limit value, set tooltip text. If type is known to have |
|
154 children, the corresponding flag is set. |
|
155 </p> |
|
156 <dl> |
|
157 |
|
158 <dt><i>dtype</i> (str)</dt> |
|
159 <dd> |
|
160 type string |
|
161 </dd> |
|
162 <dt><i>dvalue</i> (str)</dt> |
|
163 <dd> |
|
164 value of variable encoded as utf-8 |
|
165 </dd> |
|
166 <dt><i>indicator</i> (str)</dt> |
|
167 <dd> |
|
168 type indicator appended to the name |
|
169 </dd> |
|
170 <dt><i>length</i> (int or str)</dt> |
|
171 <dd> |
|
172 length of the array or string (-1 if uninitialized |
|
173 numpy.ndarray) |
|
174 </dd> |
|
175 </dl> |
|
176 <a NAME="VariableItem.absolutCount" ID="VariableItem.absolutCount"></a> |
|
177 <h4>VariableItem.absolutCount</h4> |
|
178 <b>absolutCount</b>(<i></i>) |
|
179 |
|
180 <p> |
|
181 Public property to get the total number of children. |
|
182 </p> |
|
183 <dl> |
|
184 <dt>Return:</dt> |
|
185 <dd> |
|
186 total number of children |
|
187 </dd> |
|
188 </dl> |
|
189 <dl> |
|
190 <dt>Return Type:</dt> |
|
191 <dd> |
|
192 int |
|
193 </dd> |
|
194 </dl> |
|
195 <div align="right"><a href="#top">Up</a></div> |
|
196 <hr /> |
|
197 <hr /> |
|
198 <a NAME="VariablesModel" ID="VariablesModel"></a> |
|
199 <h2>VariablesModel</h2> |
|
200 |
|
201 <p> |
|
202 Class implementing the data model for QTreeView. |
|
203 </p> |
|
204 <h3>Signals</h3> |
|
205 <dl> |
|
206 |
|
207 <dt>expand</dt> |
|
208 <dd> |
|
209 trigger QTreeView to expand given index |
|
210 </dd> |
|
211 </dl> |
|
212 <h3>Derived from</h3> |
|
213 QAbstractItemModel |
|
214 <h3>Class Attributes</h3> |
|
215 |
|
216 <table> |
|
217 <tr><td>None</td></tr> |
|
218 </table> |
|
219 <h3>Class Methods</h3> |
|
220 |
|
221 <table> |
|
222 <tr><td>None</td></tr> |
|
223 </table> |
|
224 <h3>Methods</h3> |
|
225 |
|
226 <table> |
|
227 |
|
228 <tr> |
|
229 <td><a href="#VariablesModel.__init__">VariablesModel</a></td> |
|
230 <td>Constructor</td> |
|
231 </tr> |
|
232 <tr> |
|
233 <td><a href="#VariablesModel.__buildTreePath">__buildTreePath</a></td> |
|
234 <td>Private method to build up a path from the root to parent.</td> |
|
235 </tr> |
|
236 <tr> |
|
237 <td><a href="#VariablesModel.__cleanupParentList">__cleanupParentList</a></td> |
|
238 <td>Private method to remove items which are left over at the end of the child list.</td> |
|
239 </tr> |
|
240 <tr> |
|
241 <td><a href="#VariablesModel.__findPendingItem">__findPendingItem</a></td> |
|
242 <td>Private method to find the next item to request data from debugger.</td> |
|
243 </tr> |
|
244 <tr> |
|
245 <td><a href="#VariablesModel.__findVariable">__findVariable</a></td> |
|
246 <td>Private method to get to the given variable.</td> |
|
247 </tr> |
|
248 <tr> |
|
249 <td><a href="#VariablesModel.clear">clear</a></td> |
|
250 <td>Public method to clear the complete data model.</td> |
|
251 </tr> |
|
252 <tr> |
|
253 <td><a href="#VariablesModel.columnCount">columnCount</a></td> |
|
254 <td>Public method to get the column count.</td> |
|
255 </tr> |
|
256 <tr> |
|
257 <td><a href="#VariablesModel.data">data</a></td> |
|
258 <td>Public method get the role data of item.</td> |
|
259 </tr> |
|
260 <tr> |
|
261 <td><a href="#VariablesModel.flags">flags</a></td> |
|
262 <td>Public method to get the item flags.</td> |
|
263 </tr> |
|
264 <tr> |
|
265 <td><a href="#VariablesModel.getMore">getMore</a></td> |
|
266 <td>Public method to fetch the next variable from debugger.</td> |
|
267 </tr> |
|
268 <tr> |
|
269 <td><a href="#VariablesModel.handlePreferencesChanged">handlePreferencesChanged</a></td> |
|
270 <td>Public slot to handle the preferencesChanged signal.</td> |
|
271 </tr> |
|
272 <tr> |
|
273 <td><a href="#VariablesModel.hasChildren">hasChildren</a></td> |
|
274 <td>Public method to get a flag if parent has children.</td> |
|
275 </tr> |
|
276 <tr> |
|
277 <td><a href="#VariablesModel.headerData">headerData</a></td> |
|
278 <td>Public method get the header names.</td> |
|
279 </tr> |
|
280 <tr> |
|
281 <td><a href="#VariablesModel.index">index</a></td> |
|
282 <td>Public method to get the index of item at row:column of parent.</td> |
|
283 </tr> |
|
284 <tr> |
|
285 <td><a href="#VariablesModel.parent">parent</a></td> |
|
286 <td>Public method to get the parent of the given child.</td> |
|
287 </tr> |
|
288 <tr> |
|
289 <td><a href="#VariablesModel.resetModifiedMarker">resetModifiedMarker</a></td> |
|
290 <td>Public method to remove the modified marker from changed items.</td> |
|
291 </tr> |
|
292 <tr> |
|
293 <td><a href="#VariablesModel.rowCount">rowCount</a></td> |
|
294 <td>Public method to get the row count.</td> |
|
295 </tr> |
|
296 <tr> |
|
297 <td><a href="#VariablesModel.setExpanded">setExpanded</a></td> |
|
298 <td>Public method to set the expanded state of item.</td> |
|
299 </tr> |
|
300 <tr> |
|
301 <td><a href="#VariablesModel.showVariables">showVariables</a></td> |
|
302 <td>Public method to update the data model of variable in pathlist.</td> |
|
303 </tr> |
|
304 </table> |
|
305 <h3>Static Methods</h3> |
|
306 |
|
307 <table> |
|
308 <tr><td>None</td></tr> |
|
309 </table> |
|
310 |
|
311 <a NAME="VariablesModel.__init__" ID="VariablesModel.__init__"></a> |
|
312 <h4>VariablesModel (Constructor)</h4> |
|
313 <b>VariablesModel</b>(<i>treeView, globalScope</i>) |
|
314 |
|
315 <p> |
|
316 Constructor |
|
317 </p> |
|
318 <dl> |
|
319 |
|
320 <dt><i>treeView</i> (VariablesViewer)</dt> |
|
321 <dd> |
|
322 QTreeView showing the data |
|
323 </dd> |
|
324 <dt><i>globalScope</i> (bool)</dt> |
|
325 <dd> |
|
326 flag indicating global (True) or local (False) |
|
327 variables |
|
328 </dd> |
|
329 </dl> |
|
330 <a NAME="VariablesModel.__buildTreePath" ID="VariablesModel.__buildTreePath"></a> |
|
331 <h4>VariablesModel.__buildTreePath</h4> |
|
332 <b>__buildTreePath</b>(<i>parent</i>) |
|
333 |
|
334 <p> |
|
335 Private method to build up a path from the root to parent. |
|
336 </p> |
|
337 <dl> |
|
338 |
|
339 <dt><i>parent</i> (VariableItem)</dt> |
|
340 <dd> |
|
341 item to build the path for |
|
342 </dd> |
|
343 </dl> |
|
344 <dl> |
|
345 <dt>Return:</dt> |
|
346 <dd> |
|
347 list of names denoting the path from the root |
|
348 </dd> |
|
349 </dl> |
|
350 <dl> |
|
351 <dt>Return Type:</dt> |
|
352 <dd> |
|
353 tuple of str |
|
354 </dd> |
|
355 </dl> |
|
356 <a NAME="VariablesModel.__cleanupParentList" ID="VariablesModel.__cleanupParentList"></a> |
|
357 <h4>VariablesModel.__cleanupParentList</h4> |
|
358 <b>__cleanupParentList</b>(<i>parent, parentIdx</i>) |
|
359 |
|
360 <p> |
|
361 Private method to remove items which are left over at the end of the |
|
362 child list. |
|
363 </p> |
|
364 <dl> |
|
365 |
|
366 <dt><i>parent</i> (VariableItem)</dt> |
|
367 <dd> |
|
368 to clean up |
|
369 </dd> |
|
370 <dt><i>parentIdx</i> (QModelIndex)</dt> |
|
371 <dd> |
|
372 the parent index as QModelIndex |
|
373 </dd> |
|
374 </dl> |
|
375 <a NAME="VariablesModel.__findPendingItem" ID="VariablesModel.__findPendingItem"></a> |
|
376 <h4>VariablesModel.__findPendingItem</h4> |
|
377 <b>__findPendingItem</b>(<i>parent=None, pathlist=()</i>) |
|
378 |
|
379 <p> |
|
380 Private method to find the next item to request data from debugger. |
|
381 </p> |
|
382 <dl> |
|
383 |
|
384 <dt><i>parent</i> (VariableItem)</dt> |
|
385 <dd> |
|
386 the model parent |
|
387 </dd> |
|
388 <dt><i>pathlist</i> (list of str)</dt> |
|
389 <dd> |
|
390 full path to the variable |
|
391 </dd> |
|
392 </dl> |
|
393 <dl> |
|
394 <dt>Return:</dt> |
|
395 <dd> |
|
396 next item index to request data from debugger |
|
397 </dd> |
|
398 </dl> |
|
399 <dl> |
|
400 <dt>Return Type:</dt> |
|
401 <dd> |
|
402 QModelIndex |
|
403 </dd> |
|
404 </dl> |
|
405 <a NAME="VariablesModel.__findVariable" ID="VariablesModel.__findVariable"></a> |
|
406 <h4>VariablesModel.__findVariable</h4> |
|
407 <b>__findVariable</b>(<i>pathlist</i>) |
|
408 |
|
409 <p> |
|
410 Private method to get to the given variable. |
|
411 </p> |
|
412 <dl> |
|
413 |
|
414 <dt><i>pathlist</i> (list of str)</dt> |
|
415 <dd> |
|
416 full path to the variable |
|
417 </dd> |
|
418 </dl> |
|
419 <dl> |
|
420 <dt>Return:</dt> |
|
421 <dd> |
|
422 the found variable or None if it doesn't exist |
|
423 </dd> |
|
424 </dl> |
|
425 <dl> |
|
426 <dt>Return Type:</dt> |
|
427 <dd> |
|
428 VariableItem or None |
|
429 </dd> |
|
430 </dl> |
|
431 <a NAME="VariablesModel.clear" ID="VariablesModel.clear"></a> |
|
432 <h4>VariablesModel.clear</h4> |
|
433 <b>clear</b>(<i>reset=False</i>) |
|
434 |
|
435 <p> |
|
436 Public method to clear the complete data model. |
|
437 </p> |
|
438 <dl> |
|
439 |
|
440 <dt><i>reset</i> (bool)</dt> |
|
441 <dd> |
|
442 flag to clear the expanded keys also |
|
443 </dd> |
|
444 </dl> |
|
445 <a NAME="VariablesModel.columnCount" ID="VariablesModel.columnCount"></a> |
|
446 <h4>VariablesModel.columnCount</h4> |
|
447 <b>columnCount</b>(<i>parent=QModelIndex()</i>) |
|
448 |
|
449 <p> |
|
450 Public method to get the column count. |
|
451 </p> |
|
452 <dl> |
|
453 |
|
454 <dt><i>parent</i> (QModelIndex)</dt> |
|
455 <dd> |
|
456 the model parent |
|
457 </dd> |
|
458 </dl> |
|
459 <dl> |
|
460 <dt>Return:</dt> |
|
461 <dd> |
|
462 number of columns |
|
463 </dd> |
|
464 </dl> |
|
465 <dl> |
|
466 <dt>Return Type:</dt> |
|
467 <dd> |
|
468 int |
|
469 </dd> |
|
470 </dl> |
|
471 <a NAME="VariablesModel.data" ID="VariablesModel.data"></a> |
|
472 <h4>VariablesModel.data</h4> |
|
473 <b>data</b>(<i>index, role=Qt.ItemDataRole.DisplayRole</i>) |
|
474 |
|
475 <p> |
|
476 Public method get the role data of item. |
|
477 </p> |
|
478 <dl> |
|
479 |
|
480 <dt><i>index</i> (QModelIndex)</dt> |
|
481 <dd> |
|
482 the model index |
|
483 </dd> |
|
484 <dt><i>role</i> (QtCore.Qt.ItemDataRole)</dt> |
|
485 <dd> |
|
486 the requested data role |
|
487 </dd> |
|
488 </dl> |
|
489 <dl> |
|
490 <dt>Return:</dt> |
|
491 <dd> |
|
492 role data of item |
|
493 </dd> |
|
494 </dl> |
|
495 <dl> |
|
496 <dt>Return Type:</dt> |
|
497 <dd> |
|
498 Any |
|
499 </dd> |
|
500 </dl> |
|
501 <a NAME="VariablesModel.flags" ID="VariablesModel.flags"></a> |
|
502 <h4>VariablesModel.flags</h4> |
|
503 <b>flags</b>(<i>index</i>) |
|
504 |
|
505 <p> |
|
506 Public method to get the item flags. |
|
507 </p> |
|
508 <dl> |
|
509 |
|
510 <dt><i>index</i> (QModelIndex)</dt> |
|
511 <dd> |
|
512 of item |
|
513 </dd> |
|
514 </dl> |
|
515 <dl> |
|
516 <dt>Return:</dt> |
|
517 <dd> |
|
518 item flags |
|
519 </dd> |
|
520 </dl> |
|
521 <dl> |
|
522 <dt>Return Type:</dt> |
|
523 <dd> |
|
524 QtCore.Qt.ItemFlag |
|
525 </dd> |
|
526 </dl> |
|
527 <a NAME="VariablesModel.getMore" ID="VariablesModel.getMore"></a> |
|
528 <h4>VariablesModel.getMore</h4> |
|
529 <b>getMore</b>(<i></i>) |
|
530 |
|
531 <p> |
|
532 Public method to fetch the next variable from debugger. |
|
533 </p> |
|
534 <a NAME="VariablesModel.handlePreferencesChanged" ID="VariablesModel.handlePreferencesChanged"></a> |
|
535 <h4>VariablesModel.handlePreferencesChanged</h4> |
|
536 <b>handlePreferencesChanged</b>(<i></i>) |
|
537 |
|
538 <p> |
|
539 Public slot to handle the preferencesChanged signal. |
|
540 </p> |
|
541 <a NAME="VariablesModel.hasChildren" ID="VariablesModel.hasChildren"></a> |
|
542 <h4>VariablesModel.hasChildren</h4> |
|
543 <b>hasChildren</b>(<i>parent=QModelIndex()</i>) |
|
544 |
|
545 <p> |
|
546 Public method to get a flag if parent has children. |
|
547 </p> |
|
548 <dl> |
|
549 |
|
550 <dt><i>parent</i> (QModelIndex)</dt> |
|
551 <dd> |
|
552 the model parent |
|
553 </dd> |
|
554 </dl> |
|
555 <dl> |
|
556 <dt>Return:</dt> |
|
557 <dd> |
|
558 flag indicating parent has children |
|
559 </dd> |
|
560 </dl> |
|
561 <dl> |
|
562 <dt>Return Type:</dt> |
|
563 <dd> |
|
564 bool |
|
565 </dd> |
|
566 </dl> |
|
567 <a NAME="VariablesModel.headerData" ID="VariablesModel.headerData"></a> |
|
568 <h4>VariablesModel.headerData</h4> |
|
569 <b>headerData</b>(<i>section, orientation, role=Qt.ItemDataRole.DisplayRole</i>) |
|
570 |
|
571 <p> |
|
572 Public method get the header names. |
|
573 </p> |
|
574 <dl> |
|
575 |
|
576 <dt><i>section</i> (int)</dt> |
|
577 <dd> |
|
578 the header section (row/column) |
|
579 </dd> |
|
580 <dt><i>orientation</i> (QtCore.Qt.Orientation)</dt> |
|
581 <dd> |
|
582 the header's orientation |
|
583 </dd> |
|
584 <dt><i>role</i> (QtCore.Qt.ItemDataRole)</dt> |
|
585 <dd> |
|
586 the requested data role |
|
587 </dd> |
|
588 </dl> |
|
589 <dl> |
|
590 <dt>Return:</dt> |
|
591 <dd> |
|
592 header name |
|
593 </dd> |
|
594 </dl> |
|
595 <dl> |
|
596 <dt>Return Type:</dt> |
|
597 <dd> |
|
598 str or None |
|
599 </dd> |
|
600 </dl> |
|
601 <a NAME="VariablesModel.index" ID="VariablesModel.index"></a> |
|
602 <h4>VariablesModel.index</h4> |
|
603 <b>index</b>(<i>row, column, parent=QModelIndex()</i>) |
|
604 |
|
605 <p> |
|
606 Public method to get the index of item at row:column of parent. |
|
607 </p> |
|
608 <dl> |
|
609 |
|
610 <dt><i>row</i> (int)</dt> |
|
611 <dd> |
|
612 number of rows |
|
613 </dd> |
|
614 <dt><i>column</i> (int)</dt> |
|
615 <dd> |
|
616 number of columns |
|
617 </dd> |
|
618 <dt><i>parent</i> (QModelIndex)</dt> |
|
619 <dd> |
|
620 the model parent |
|
621 </dd> |
|
622 </dl> |
|
623 <dl> |
|
624 <dt>Return:</dt> |
|
625 <dd> |
|
626 new model index for child |
|
627 </dd> |
|
628 </dl> |
|
629 <dl> |
|
630 <dt>Return Type:</dt> |
|
631 <dd> |
|
632 QModelIndex |
|
633 </dd> |
|
634 </dl> |
|
635 <a NAME="VariablesModel.parent" ID="VariablesModel.parent"></a> |
|
636 <h4>VariablesModel.parent</h4> |
|
637 <b>parent</b>(<i>child</i>) |
|
638 |
|
639 <p> |
|
640 Public method to get the parent of the given child. |
|
641 </p> |
|
642 <dl> |
|
643 |
|
644 <dt><i>child</i> (QModelIndex)</dt> |
|
645 <dd> |
|
646 the model child node |
|
647 </dd> |
|
648 </dl> |
|
649 <dl> |
|
650 <dt>Return:</dt> |
|
651 <dd> |
|
652 new model index for parent |
|
653 </dd> |
|
654 </dl> |
|
655 <dl> |
|
656 <dt>Return Type:</dt> |
|
657 <dd> |
|
658 QModelIndex |
|
659 </dd> |
|
660 </dl> |
|
661 <a NAME="VariablesModel.resetModifiedMarker" ID="VariablesModel.resetModifiedMarker"></a> |
|
662 <h4>VariablesModel.resetModifiedMarker</h4> |
|
663 <b>resetModifiedMarker</b>(<i>parentIdx=QModelIndex(), pathlist=()</i>) |
|
664 |
|
665 <p> |
|
666 Public method to remove the modified marker from changed items. |
|
667 </p> |
|
668 <dl> |
|
669 |
|
670 <dt><i>parentIdx</i> (QModelIndex)</dt> |
|
671 <dd> |
|
672 item to reset marker |
|
673 </dd> |
|
674 <dt><i>pathlist</i> (list of str)</dt> |
|
675 <dd> |
|
676 full path to the variable |
|
677 </dd> |
|
678 </dl> |
|
679 <a NAME="VariablesModel.rowCount" ID="VariablesModel.rowCount"></a> |
|
680 <h4>VariablesModel.rowCount</h4> |
|
681 <b>rowCount</b>(<i>parent=QModelIndex()</i>) |
|
682 |
|
683 <p> |
|
684 Public method to get the row count. |
|
685 </p> |
|
686 <dl> |
|
687 |
|
688 <dt><i>parent</i> (QModelIndex)</dt> |
|
689 <dd> |
|
690 the model parent |
|
691 </dd> |
|
692 </dl> |
|
693 <dl> |
|
694 <dt>Return:</dt> |
|
695 <dd> |
|
696 number of rows |
|
697 </dd> |
|
698 </dl> |
|
699 <dl> |
|
700 <dt>Return Type:</dt> |
|
701 <dd> |
|
702 int |
|
703 </dd> |
|
704 </dl> |
|
705 <a NAME="VariablesModel.setExpanded" ID="VariablesModel.setExpanded"></a> |
|
706 <h4>VariablesModel.setExpanded</h4> |
|
707 <b>setExpanded</b>(<i>index, state</i>) |
|
708 |
|
709 <p> |
|
710 Public method to set the expanded state of item. |
|
711 </p> |
|
712 <dl> |
|
713 |
|
714 <dt><i>index</i> (QModelIndex)</dt> |
|
715 <dd> |
|
716 item to change expanded state |
|
717 </dd> |
|
718 <dt><i>state</i> (bool)</dt> |
|
719 <dd> |
|
720 state of the item |
|
721 </dd> |
|
722 </dl> |
|
723 <a NAME="VariablesModel.showVariables" ID="VariablesModel.showVariables"></a> |
|
724 <h4>VariablesModel.showVariables</h4> |
|
725 <b>showVariables</b>(<i>vlist, frmnr, pathlist=None</i>) |
|
726 |
|
727 <p> |
|
728 Public method to update the data model of variable in pathlist. |
|
729 </p> |
|
730 <dl> |
|
731 |
|
732 <dt><i>vlist</i> (list of str)</dt> |
|
733 <dd> |
|
734 the list of variables to be displayed. Each |
|
735 list entry is a tuple of three values. |
|
736 <ul> |
|
737 <li>the variable name (string)</li> |
|
738 <li>the variables type (string)</li> |
|
739 <li>the variables value (string)</li> |
|
740 </ul> |
|
741 </dd> |
|
742 <dt><i>frmnr</i> (int)</dt> |
|
743 <dd> |
|
744 frame number (0 is the current frame) |
|
745 </dd> |
|
746 <dt><i>pathlist</i> (list of str)</dt> |
|
747 <dd> |
|
748 full path to the variable |
|
749 </dd> |
|
750 </dl> |
|
751 <div align="right"><a href="#top">Up</a></div> |
|
752 <hr /> |
|
753 <hr /> |
|
754 <a NAME="VariablesProxyModel" ID="VariablesProxyModel"></a> |
|
755 <h2>VariablesProxyModel</h2> |
|
756 |
|
757 <p> |
|
758 Class for handling the sort operations. |
|
759 </p> |
|
760 <h3>Derived from</h3> |
|
761 QSortFilterProxyModel |
|
762 <h3>Class Attributes</h3> |
|
763 |
|
764 <table> |
|
765 <tr><td>None</td></tr> |
|
766 </table> |
|
767 <h3>Class Methods</h3> |
|
768 |
|
769 <table> |
|
770 <tr><td>None</td></tr> |
|
771 </table> |
|
772 <h3>Methods</h3> |
|
773 |
|
774 <table> |
|
775 |
|
776 <tr> |
|
777 <td><a href="#VariablesProxyModel.__init__">VariablesProxyModel</a></td> |
|
778 <td>Constructor</td> |
|
779 </tr> |
|
780 <tr> |
|
781 <td><a href="#VariablesProxyModel.hasChildren">hasChildren</a></td> |
|
782 <td>Public method to get a flag if parent has children.</td> |
|
783 </tr> |
|
784 <tr> |
|
785 <td><a href="#VariablesProxyModel.setExpanded">setExpanded</a></td> |
|
786 <td>Public slot to get a flag if parent has children.</td> |
|
787 </tr> |
|
788 </table> |
|
789 <h3>Static Methods</h3> |
|
790 |
|
791 <table> |
|
792 <tr><td>None</td></tr> |
|
793 </table> |
|
794 |
|
795 <a NAME="VariablesProxyModel.__init__" ID="VariablesProxyModel.__init__"></a> |
|
796 <h4>VariablesProxyModel (Constructor)</h4> |
|
797 <b>VariablesProxyModel</b>(<i>parent=None</i>) |
|
798 |
|
799 <p> |
|
800 Constructor |
|
801 </p> |
|
802 <dl> |
|
803 |
|
804 <dt><i>parent</i> (QModelIndex)</dt> |
|
805 <dd> |
|
806 the parent model index |
|
807 </dd> |
|
808 </dl> |
|
809 <a NAME="VariablesProxyModel.hasChildren" ID="VariablesProxyModel.hasChildren"></a> |
|
810 <h4>VariablesProxyModel.hasChildren</h4> |
|
811 <b>hasChildren</b>(<i>parent</i>) |
|
812 |
|
813 <p> |
|
814 Public method to get a flag if parent has children. |
|
815 </p> |
|
816 <p> |
|
817 The given model index has to be transformed to the underlying source |
|
818 model to get the correct result. |
|
819 </p> |
|
820 <dl> |
|
821 |
|
822 <dt><i>parent</i> (QModelIndex)</dt> |
|
823 <dd> |
|
824 the model parent |
|
825 </dd> |
|
826 </dl> |
|
827 <dl> |
|
828 <dt>Return:</dt> |
|
829 <dd> |
|
830 flag if parent has children |
|
831 </dd> |
|
832 </dl> |
|
833 <dl> |
|
834 <dt>Return Type:</dt> |
|
835 <dd> |
|
836 bool |
|
837 </dd> |
|
838 </dl> |
|
839 <a NAME="VariablesProxyModel.setExpanded" ID="VariablesProxyModel.setExpanded"></a> |
|
840 <h4>VariablesProxyModel.setExpanded</h4> |
|
841 <b>setExpanded</b>(<i>index, state</i>) |
|
842 |
|
843 <p> |
|
844 Public slot to get a flag if parent has children. |
|
845 </p> |
|
846 <p> |
|
847 The given model index has to be transformed to the underlying source |
|
848 model to get the correct result. |
|
849 </p> |
|
850 <dl> |
|
851 |
|
852 <dt><i>index</i> (QModelIndex)</dt> |
|
853 <dd> |
|
854 item to change expanded state |
|
855 </dd> |
|
856 <dt><i>state</i> (bool)</dt> |
|
857 <dd> |
|
858 state of the item |
|
859 </dd> |
|
860 </dl> |
|
861 <div align="right"><a href="#top">Up</a></div> |
|
862 <hr /> |
|
863 <hr /> |
|
864 <a NAME="VariablesViewer" ID="VariablesViewer"></a> |
|
865 <h2>VariablesViewer</h2> |
|
866 |
|
867 <p> |
|
868 Class implementing the variables viewer view. |
|
869 </p> |
|
870 <p> |
|
871 This view is used to display the variables of the program being |
|
872 debugged in a tree. Compound types will be shown with |
|
873 their main entry first. Once the subtree has been expanded, the |
|
874 individual entries will be shown. Double clicking an entry will |
|
875 expand or collapse the item, if it has children and the double click |
|
876 was performed on the first column of the tree, otherwise it'll |
|
877 popup a dialog showing the variables parameters in a more readable |
|
878 form. This is especially useful for lengthy strings. |
|
879 </p> |
|
880 <p> |
|
881 This view has two modes for displaying the global and the local |
|
882 variables. |
|
883 </p> |
|
884 <h3>Signals</h3> |
|
885 <dl> |
|
886 |
|
887 <dt>preferencesChanged()</dt> |
|
888 <dd> |
|
889 to inform model about new background colours |
|
890 </dd> |
|
891 </dl> |
|
892 <h3>Derived from</h3> |
|
893 QTreeView |
|
894 <h3>Class Attributes</h3> |
|
895 |
|
896 <table> |
|
897 <tr><td>None</td></tr> |
|
898 </table> |
|
899 <h3>Class Methods</h3> |
|
900 |
|
901 <table> |
|
902 <tr><td>None</td></tr> |
|
903 </table> |
|
904 <h3>Methods</h3> |
|
905 |
|
906 <table> |
|
907 |
|
908 <tr> |
|
909 <td><a href="#VariablesViewer.__init__">VariablesViewer</a></td> |
|
910 <td>Constructor</td> |
|
911 </tr> |
|
912 <tr> |
|
913 <td><a href="#VariablesViewer.__collapseChildren">__collapseChildren</a></td> |
|
914 <td>Private slot to collapse all child items of current parent.</td> |
|
915 </tr> |
|
916 <tr> |
|
917 <td><a href="#VariablesViewer.__configure">__configure</a></td> |
|
918 <td>Private method to open the configuration dialog.</td> |
|
919 </tr> |
|
920 <tr> |
|
921 <td><a href="#VariablesViewer.__configureFilter">__configureFilter</a></td> |
|
922 <td>Private method to open the variables filter dialog.</td> |
|
923 </tr> |
|
924 <tr> |
|
925 <td><a href="#VariablesViewer.__createPopupMenus">__createPopupMenus</a></td> |
|
926 <td>Private method to generate the popup menus.</td> |
|
927 </tr> |
|
928 <tr> |
|
929 <td><a href="#VariablesViewer.__expandChildren">__expandChildren</a></td> |
|
930 <td>Private slot to expand all child items of current parent.</td> |
|
931 </tr> |
|
932 <tr> |
|
933 <td><a href="#VariablesViewer.__itemDoubleClicked">__itemDoubleClicked</a></td> |
|
934 <td>Private method called if an item was double clicked.</td> |
|
935 </tr> |
|
936 <tr> |
|
937 <td><a href="#VariablesViewer.__mdlRequestExpand">__mdlRequestExpand</a></td> |
|
938 <td>Private method to inform the view about items to be expand.</td> |
|
939 </tr> |
|
940 <tr> |
|
941 <td><a href="#VariablesViewer.__refreshView">__refreshView</a></td> |
|
942 <td>Private slot to refresh the view.</td> |
|
943 </tr> |
|
944 <tr> |
|
945 <td><a href="#VariablesViewer.__showContextMenu">__showContextMenu</a></td> |
|
946 <td>Private slot to show the context menu.</td> |
|
947 </tr> |
|
948 <tr> |
|
949 <td><a href="#VariablesViewer.__showDetails">__showDetails</a></td> |
|
950 <td>Private slot to show details about the selected variable.</td> |
|
951 </tr> |
|
952 <tr> |
|
953 <td><a href="#VariablesViewer.__showVariableDetails">__showVariableDetails</a></td> |
|
954 <td>Private method to show details about a variable.</td> |
|
955 </tr> |
|
956 <tr> |
|
957 <td><a href="#VariablesViewer.handleResetUI">handleResetUI</a></td> |
|
958 <td>Public method to reset the VariablesViewer.</td> |
|
959 </tr> |
|
960 <tr> |
|
961 <td><a href="#VariablesViewer.resizeEvent">resizeEvent</a></td> |
|
962 <td>Protected slot informing about the widget size change.</td> |
|
963 </tr> |
|
964 <tr> |
|
965 <td><a href="#VariablesViewer.showVariable">showVariable</a></td> |
|
966 <td>Public method to show variables in a list.</td> |
|
967 </tr> |
|
968 <tr> |
|
969 <td><a href="#VariablesViewer.showVariables">showVariables</a></td> |
|
970 <td>Public method to show variables in a list.</td> |
|
971 </tr> |
|
972 <tr> |
|
973 <td><a href="#VariablesViewer.verticalScrollbarValueChanged">verticalScrollbarValueChanged</a></td> |
|
974 <td>Public slot informing about the scrollbar change.</td> |
|
975 </tr> |
|
976 </table> |
|
977 <h3>Static Methods</h3> |
|
978 |
|
979 <table> |
|
980 <tr><td>None</td></tr> |
|
981 </table> |
|
982 |
|
983 <a NAME="VariablesViewer.__init__" ID="VariablesViewer.__init__"></a> |
|
984 <h4>VariablesViewer (Constructor)</h4> |
|
985 <b>VariablesViewer</b>(<i>viewer, globalScope, parent=None</i>) |
|
986 |
|
987 <p> |
|
988 Constructor |
|
989 </p> |
|
990 <dl> |
|
991 |
|
992 <dt><i>viewer</i> (DebugViewer)</dt> |
|
993 <dd> |
|
994 reference to the debug viewer object |
|
995 </dd> |
|
996 <dt><i>globalScope</i> (bool)</dt> |
|
997 <dd> |
|
998 flag indicating global (True) or local (False) |
|
999 variables |
|
1000 </dd> |
|
1001 <dt><i>parent</i> (QWidget)</dt> |
|
1002 <dd> |
|
1003 the parent |
|
1004 </dd> |
|
1005 </dl> |
|
1006 <a NAME="VariablesViewer.__collapseChildren" ID="VariablesViewer.__collapseChildren"></a> |
|
1007 <h4>VariablesViewer.__collapseChildren</h4> |
|
1008 <b>__collapseChildren</b>(<i></i>) |
|
1009 |
|
1010 <p> |
|
1011 Private slot to collapse all child items of current parent. |
|
1012 </p> |
|
1013 <a NAME="VariablesViewer.__configure" ID="VariablesViewer.__configure"></a> |
|
1014 <h4>VariablesViewer.__configure</h4> |
|
1015 <b>__configure</b>(<i></i>) |
|
1016 |
|
1017 <p> |
|
1018 Private method to open the configuration dialog. |
|
1019 </p> |
|
1020 <a NAME="VariablesViewer.__configureFilter" ID="VariablesViewer.__configureFilter"></a> |
|
1021 <h4>VariablesViewer.__configureFilter</h4> |
|
1022 <b>__configureFilter</b>(<i></i>) |
|
1023 |
|
1024 <p> |
|
1025 Private method to open the variables filter dialog. |
|
1026 </p> |
|
1027 <a NAME="VariablesViewer.__createPopupMenus" ID="VariablesViewer.__createPopupMenus"></a> |
|
1028 <h4>VariablesViewer.__createPopupMenus</h4> |
|
1029 <b>__createPopupMenus</b>(<i></i>) |
|
1030 |
|
1031 <p> |
|
1032 Private method to generate the popup menus. |
|
1033 </p> |
|
1034 <a NAME="VariablesViewer.__expandChildren" ID="VariablesViewer.__expandChildren"></a> |
|
1035 <h4>VariablesViewer.__expandChildren</h4> |
|
1036 <b>__expandChildren</b>(<i></i>) |
|
1037 |
|
1038 <p> |
|
1039 Private slot to expand all child items of current parent. |
|
1040 </p> |
|
1041 <a NAME="VariablesViewer.__itemDoubleClicked" ID="VariablesViewer.__itemDoubleClicked"></a> |
|
1042 <h4>VariablesViewer.__itemDoubleClicked</h4> |
|
1043 <b>__itemDoubleClicked</b>(<i>index</i>) |
|
1044 |
|
1045 <p> |
|
1046 Private method called if an item was double clicked. |
|
1047 </p> |
|
1048 <dl> |
|
1049 |
|
1050 <dt><i>index</i> (QModelIndex)</dt> |
|
1051 <dd> |
|
1052 the double clicked item |
|
1053 </dd> |
|
1054 </dl> |
|
1055 <a NAME="VariablesViewer.__mdlRequestExpand" ID="VariablesViewer.__mdlRequestExpand"></a> |
|
1056 <h4>VariablesViewer.__mdlRequestExpand</h4> |
|
1057 <b>__mdlRequestExpand</b>(<i>modelIndex</i>) |
|
1058 |
|
1059 <p> |
|
1060 Private method to inform the view about items to be expand. |
|
1061 </p> |
|
1062 <dl> |
|
1063 |
|
1064 <dt><i>modelIndex</i> (QModelIndex)</dt> |
|
1065 <dd> |
|
1066 the model index |
|
1067 </dd> |
|
1068 </dl> |
|
1069 <a NAME="VariablesViewer.__refreshView" ID="VariablesViewer.__refreshView"></a> |
|
1070 <h4>VariablesViewer.__refreshView</h4> |
|
1071 <b>__refreshView</b>(<i></i>) |
|
1072 |
|
1073 <p> |
|
1074 Private slot to refresh the view. |
|
1075 </p> |
|
1076 <a NAME="VariablesViewer.__showContextMenu" ID="VariablesViewer.__showContextMenu"></a> |
|
1077 <h4>VariablesViewer.__showContextMenu</h4> |
|
1078 <b>__showContextMenu</b>(<i>coord</i>) |
|
1079 |
|
1080 <p> |
|
1081 Private slot to show the context menu. |
|
1082 </p> |
|
1083 <dl> |
|
1084 |
|
1085 <dt><i>coord</i> (QPoint)</dt> |
|
1086 <dd> |
|
1087 the position of the mouse pointer |
|
1088 </dd> |
|
1089 </dl> |
|
1090 <a NAME="VariablesViewer.__showDetails" ID="VariablesViewer.__showDetails"></a> |
|
1091 <h4>VariablesViewer.__showDetails</h4> |
|
1092 <b>__showDetails</b>(<i></i>) |
|
1093 |
|
1094 <p> |
|
1095 Private slot to show details about the selected variable. |
|
1096 </p> |
|
1097 <a NAME="VariablesViewer.__showVariableDetails" ID="VariablesViewer.__showVariableDetails"></a> |
|
1098 <h4>VariablesViewer.__showVariableDetails</h4> |
|
1099 <b>__showVariableDetails</b>(<i>index</i>) |
|
1100 |
|
1101 <p> |
|
1102 Private method to show details about a variable. |
|
1103 </p> |
|
1104 <dl> |
|
1105 |
|
1106 <dt><i>index</i> (QModelIndex)</dt> |
|
1107 <dd> |
|
1108 reference to the variable item |
|
1109 </dd> |
|
1110 </dl> |
|
1111 <a NAME="VariablesViewer.handleResetUI" ID="VariablesViewer.handleResetUI"></a> |
|
1112 <h4>VariablesViewer.handleResetUI</h4> |
|
1113 <b>handleResetUI</b>(<i></i>) |
|
1114 |
|
1115 <p> |
|
1116 Public method to reset the VariablesViewer. |
|
1117 </p> |
|
1118 <a NAME="VariablesViewer.resizeEvent" ID="VariablesViewer.resizeEvent"></a> |
|
1119 <h4>VariablesViewer.resizeEvent</h4> |
|
1120 <b>resizeEvent</b>(<i>event</i>) |
|
1121 |
|
1122 <p> |
|
1123 Protected slot informing about the widget size change. |
|
1124 </p> |
|
1125 <dl> |
|
1126 |
|
1127 <dt><i>event</i> (QResizeEvent)</dt> |
|
1128 <dd> |
|
1129 information |
|
1130 </dd> |
|
1131 </dl> |
|
1132 <a NAME="VariablesViewer.showVariable" ID="VariablesViewer.showVariable"></a> |
|
1133 <h4>VariablesViewer.showVariable</h4> |
|
1134 <b>showVariable</b>(<i>vlist</i>) |
|
1135 |
|
1136 <p> |
|
1137 Public method to show variables in a list. |
|
1138 </p> |
|
1139 <dl> |
|
1140 |
|
1141 <dt><i>vlist</i> (list)</dt> |
|
1142 <dd> |
|
1143 the list of subitems to be displayed. |
|
1144 The first element gives the path of the |
|
1145 parent variable. Each other list entry is |
|
1146 a tuple of three values. |
|
1147 <ul> |
|
1148 <li>the variable name (string)</li> |
|
1149 <li>the variables type (string)</li> |
|
1150 <li>the variables value (string)</li> |
|
1151 </ul> |
|
1152 </dd> |
|
1153 </dl> |
|
1154 <a NAME="VariablesViewer.showVariables" ID="VariablesViewer.showVariables"></a> |
|
1155 <h4>VariablesViewer.showVariables</h4> |
|
1156 <b>showVariables</b>(<i>vlist, frmnr</i>) |
|
1157 |
|
1158 <p> |
|
1159 Public method to show variables in a list. |
|
1160 </p> |
|
1161 <dl> |
|
1162 |
|
1163 <dt><i>vlist</i> (list)</dt> |
|
1164 <dd> |
|
1165 the list of variables to be displayed. Each |
|
1166 list entry is a tuple of three values. |
|
1167 <ul> |
|
1168 <li>the variable name (string)</li> |
|
1169 <li>the variables type (string)</li> |
|
1170 <li>the variables value (string)</li> |
|
1171 </ul> |
|
1172 </dd> |
|
1173 <dt><i>frmnr</i> (int)</dt> |
|
1174 <dd> |
|
1175 frame number (0 is the current frame) |
|
1176 </dd> |
|
1177 </dl> |
|
1178 <a NAME="VariablesViewer.verticalScrollbarValueChanged" ID="VariablesViewer.verticalScrollbarValueChanged"></a> |
|
1179 <h4>VariablesViewer.verticalScrollbarValueChanged</h4> |
|
1180 <b>verticalScrollbarValueChanged</b>(<i>value</i>) |
|
1181 |
|
1182 <p> |
|
1183 Public slot informing about the scrollbar change. |
|
1184 </p> |
|
1185 <dl> |
|
1186 |
|
1187 <dt><i>value</i> (int)</dt> |
|
1188 <dd> |
|
1189 current value of the vertical scrollbar |
|
1190 </dd> |
|
1191 </dl> |
|
1192 <div align="right"><a href="#top">Up</a></div> |
|
1193 <hr /> |
|
1194 </body></html> |