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