|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.WebBrowser.History.HistoryTreeModel</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.WebBrowser.History.HistoryTreeModel</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing the history tree model. |
|
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="#HistoryTreeModel">HistoryTreeModel</a></td> |
|
39 <td>Class implementing the history tree model.</td> |
|
40 </tr> |
|
41 </table> |
|
42 <h3>Functions</h3> |
|
43 |
|
44 <table> |
|
45 <tr><td>None</td></tr> |
|
46 </table> |
|
47 <hr /> |
|
48 <hr /> |
|
49 <a NAME="HistoryTreeModel" ID="HistoryTreeModel"></a> |
|
50 <h2>HistoryTreeModel</h2> |
|
51 |
|
52 <p> |
|
53 Class implementing the history tree model. |
|
54 </p> |
|
55 <h3>Derived from</h3> |
|
56 QAbstractProxyModel |
|
57 <h3>Class Attributes</h3> |
|
58 |
|
59 <table> |
|
60 <tr><td>None</td></tr> |
|
61 </table> |
|
62 <h3>Class Methods</h3> |
|
63 |
|
64 <table> |
|
65 <tr><td>None</td></tr> |
|
66 </table> |
|
67 <h3>Methods</h3> |
|
68 |
|
69 <table> |
|
70 |
|
71 <tr> |
|
72 <td><a href="#HistoryTreeModel.__init__">HistoryTreeModel</a></td> |
|
73 <td>Constructor</td> |
|
74 </tr> |
|
75 <tr> |
|
76 <td><a href="#HistoryTreeModel.__sourceDateRow">__sourceDateRow</a></td> |
|
77 <td>Private method to translate the top level date row into the offset where that date starts.</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#HistoryTreeModel.__sourceReset">__sourceReset</a></td> |
|
81 <td>Private slot to handle a reset of the source model.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#HistoryTreeModel.__sourceRowsInserted">__sourceRowsInserted</a></td> |
|
85 <td>Private slot to handle the insertion of data in the source model.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#HistoryTreeModel.__sourceRowsRemoved">__sourceRowsRemoved</a></td> |
|
89 <td>Private slot to handle the removal of data in the source model.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#HistoryTreeModel.columnCount">columnCount</a></td> |
|
93 <td>Public method to get the number of columns.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#HistoryTreeModel.data">data</a></td> |
|
97 <td>Public method to get data from the model.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#HistoryTreeModel.flags">flags</a></td> |
|
101 <td>Public method to get the item flags.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#HistoryTreeModel.hasChildren">hasChildren</a></td> |
|
105 <td>Public method to check, if an entry has some children.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#HistoryTreeModel.headerData">headerData</a></td> |
|
109 <td>Public method to get the header data.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#HistoryTreeModel.index">index</a></td> |
|
113 <td>Public method to create an index.</td> |
|
114 </tr> |
|
115 <tr> |
|
116 <td><a href="#HistoryTreeModel.mapFromSource">mapFromSource</a></td> |
|
117 <td>Public method to map an index to the proxy model index.</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#HistoryTreeModel.mapToSource">mapToSource</a></td> |
|
121 <td>Public method to map an index to the source model index.</td> |
|
122 </tr> |
|
123 <tr> |
|
124 <td><a href="#HistoryTreeModel.parent">parent</a></td> |
|
125 <td>Public method to get the parent index.</td> |
|
126 </tr> |
|
127 <tr> |
|
128 <td><a href="#HistoryTreeModel.removeRows">removeRows</a></td> |
|
129 <td>Public method to remove entries from the model.</td> |
|
130 </tr> |
|
131 <tr> |
|
132 <td><a href="#HistoryTreeModel.rowCount">rowCount</a></td> |
|
133 <td>Public method to determine the number of rows.</td> |
|
134 </tr> |
|
135 <tr> |
|
136 <td><a href="#HistoryTreeModel.setSourceModel">setSourceModel</a></td> |
|
137 <td>Public method to set the source model.</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="HistoryTreeModel.__init__" ID="HistoryTreeModel.__init__"></a> |
|
147 <h4>HistoryTreeModel (Constructor)</h4> |
|
148 <b>HistoryTreeModel</b>(<i>sourceModel, parent=None</i>) |
|
149 |
|
150 <p> |
|
151 Constructor |
|
152 </p> |
|
153 <dl> |
|
154 |
|
155 <dt><i>sourceModel</i></dt> |
|
156 <dd> |
|
157 reference to the source model (QAbstractItemModel) |
|
158 </dd> |
|
159 <dt><i>parent</i></dt> |
|
160 <dd> |
|
161 reference to the parent object (QObject) |
|
162 </dd> |
|
163 </dl> |
|
164 <a NAME="HistoryTreeModel.__sourceDateRow" ID="HistoryTreeModel.__sourceDateRow"></a> |
|
165 <h4>HistoryTreeModel.__sourceDateRow</h4> |
|
166 <b>__sourceDateRow</b>(<i>row</i>) |
|
167 |
|
168 <p> |
|
169 Private method to translate the top level date row into the offset |
|
170 where that date starts. |
|
171 </p> |
|
172 <dl> |
|
173 |
|
174 <dt><i>row</i></dt> |
|
175 <dd> |
|
176 row number of the date (integer) |
|
177 </dd> |
|
178 </dl> |
|
179 <dl> |
|
180 <dt>Return:</dt> |
|
181 <dd> |
|
182 offset where that date starts (integer) |
|
183 </dd> |
|
184 </dl> |
|
185 <a NAME="HistoryTreeModel.__sourceReset" ID="HistoryTreeModel.__sourceReset"></a> |
|
186 <h4>HistoryTreeModel.__sourceReset</h4> |
|
187 <b>__sourceReset</b>(<i></i>) |
|
188 |
|
189 <p> |
|
190 Private slot to handle a reset of the source model. |
|
191 </p> |
|
192 <a NAME="HistoryTreeModel.__sourceRowsInserted" ID="HistoryTreeModel.__sourceRowsInserted"></a> |
|
193 <h4>HistoryTreeModel.__sourceRowsInserted</h4> |
|
194 <b>__sourceRowsInserted</b>(<i>parent, start, end</i>) |
|
195 |
|
196 <p> |
|
197 Private slot to handle the insertion of data in the source model. |
|
198 </p> |
|
199 <dl> |
|
200 |
|
201 <dt><i>parent</i></dt> |
|
202 <dd> |
|
203 reference to the parent index (QModelIndex) |
|
204 </dd> |
|
205 <dt><i>start</i></dt> |
|
206 <dd> |
|
207 start row (integer) |
|
208 </dd> |
|
209 <dt><i>end</i></dt> |
|
210 <dd> |
|
211 end row (integer) |
|
212 </dd> |
|
213 </dl> |
|
214 <a NAME="HistoryTreeModel.__sourceRowsRemoved" ID="HistoryTreeModel.__sourceRowsRemoved"></a> |
|
215 <h4>HistoryTreeModel.__sourceRowsRemoved</h4> |
|
216 <b>__sourceRowsRemoved</b>(<i>parent, start, end</i>) |
|
217 |
|
218 <p> |
|
219 Private slot to handle the removal of data in the source model. |
|
220 </p> |
|
221 <dl> |
|
222 |
|
223 <dt><i>parent</i></dt> |
|
224 <dd> |
|
225 reference to the parent index (QModelIndex) |
|
226 </dd> |
|
227 <dt><i>start</i></dt> |
|
228 <dd> |
|
229 start row (integer) |
|
230 </dd> |
|
231 <dt><i>end</i></dt> |
|
232 <dd> |
|
233 end row (integer) |
|
234 </dd> |
|
235 </dl> |
|
236 <a NAME="HistoryTreeModel.columnCount" ID="HistoryTreeModel.columnCount"></a> |
|
237 <h4>HistoryTreeModel.columnCount</h4> |
|
238 <b>columnCount</b>(<i>parent=None</i>) |
|
239 |
|
240 <p> |
|
241 Public method to get the number of columns. |
|
242 </p> |
|
243 <dl> |
|
244 |
|
245 <dt><i>parent</i></dt> |
|
246 <dd> |
|
247 index of parent (QModelIndex) |
|
248 </dd> |
|
249 </dl> |
|
250 <dl> |
|
251 <dt>Return:</dt> |
|
252 <dd> |
|
253 number of columns (integer) |
|
254 </dd> |
|
255 </dl> |
|
256 <a NAME="HistoryTreeModel.data" ID="HistoryTreeModel.data"></a> |
|
257 <h4>HistoryTreeModel.data</h4> |
|
258 <b>data</b>(<i>index, role=Qt.ItemDataRole.DisplayRole</i>) |
|
259 |
|
260 <p> |
|
261 Public method to get data from the model. |
|
262 </p> |
|
263 <dl> |
|
264 |
|
265 <dt><i>index</i></dt> |
|
266 <dd> |
|
267 index of history entry to get data for (QModelIndex) |
|
268 </dd> |
|
269 <dt><i>role</i></dt> |
|
270 <dd> |
|
271 data role (integer) |
|
272 </dd> |
|
273 </dl> |
|
274 <dl> |
|
275 <dt>Return:</dt> |
|
276 <dd> |
|
277 history entry data |
|
278 </dd> |
|
279 </dl> |
|
280 <a NAME="HistoryTreeModel.flags" ID="HistoryTreeModel.flags"></a> |
|
281 <h4>HistoryTreeModel.flags</h4> |
|
282 <b>flags</b>(<i>index</i>) |
|
283 |
|
284 <p> |
|
285 Public method to get the item flags. |
|
286 </p> |
|
287 <dl> |
|
288 |
|
289 <dt><i>index</i></dt> |
|
290 <dd> |
|
291 index of the item (QModelIndex) |
|
292 </dd> |
|
293 </dl> |
|
294 <dl> |
|
295 <dt>Return:</dt> |
|
296 <dd> |
|
297 flags (Qt.ItemFlags) |
|
298 </dd> |
|
299 </dl> |
|
300 <a NAME="HistoryTreeModel.hasChildren" ID="HistoryTreeModel.hasChildren"></a> |
|
301 <h4>HistoryTreeModel.hasChildren</h4> |
|
302 <b>hasChildren</b>(<i>parent=None</i>) |
|
303 |
|
304 <p> |
|
305 Public method to check, if an entry has some children. |
|
306 </p> |
|
307 <dl> |
|
308 |
|
309 <dt><i>parent</i></dt> |
|
310 <dd> |
|
311 index of the entry to check (QModelIndex) |
|
312 </dd> |
|
313 </dl> |
|
314 <dl> |
|
315 <dt>Return:</dt> |
|
316 <dd> |
|
317 flag indicating the presence of children (boolean) |
|
318 </dd> |
|
319 </dl> |
|
320 <a NAME="HistoryTreeModel.headerData" ID="HistoryTreeModel.headerData"></a> |
|
321 <h4>HistoryTreeModel.headerData</h4> |
|
322 <b>headerData</b>(<i>section, orientation, role=Qt.ItemDataRole.DisplayRole</i>) |
|
323 |
|
324 <p> |
|
325 Public method to get the header data. |
|
326 </p> |
|
327 <dl> |
|
328 |
|
329 <dt><i>section</i></dt> |
|
330 <dd> |
|
331 section number (integer) |
|
332 </dd> |
|
333 <dt><i>orientation</i></dt> |
|
334 <dd> |
|
335 header orientation (Qt.Orientation) |
|
336 </dd> |
|
337 <dt><i>role</i></dt> |
|
338 <dd> |
|
339 data role (Qt.ItemDataRole) |
|
340 </dd> |
|
341 </dl> |
|
342 <dl> |
|
343 <dt>Return:</dt> |
|
344 <dd> |
|
345 header data |
|
346 </dd> |
|
347 </dl> |
|
348 <a NAME="HistoryTreeModel.index" ID="HistoryTreeModel.index"></a> |
|
349 <h4>HistoryTreeModel.index</h4> |
|
350 <b>index</b>(<i>row, column, parent=None</i>) |
|
351 |
|
352 <p> |
|
353 Public method to create an index. |
|
354 </p> |
|
355 <dl> |
|
356 |
|
357 <dt><i>row</i></dt> |
|
358 <dd> |
|
359 row number for the index (integer) |
|
360 </dd> |
|
361 <dt><i>column</i></dt> |
|
362 <dd> |
|
363 column number for the index (integer) |
|
364 </dd> |
|
365 <dt><i>parent</i></dt> |
|
366 <dd> |
|
367 index of the parent item (QModelIndex) |
|
368 </dd> |
|
369 </dl> |
|
370 <dl> |
|
371 <dt>Return:</dt> |
|
372 <dd> |
|
373 requested index (QModelIndex) |
|
374 </dd> |
|
375 </dl> |
|
376 <a NAME="HistoryTreeModel.mapFromSource" ID="HistoryTreeModel.mapFromSource"></a> |
|
377 <h4>HistoryTreeModel.mapFromSource</h4> |
|
378 <b>mapFromSource</b>(<i>sourceIndex</i>) |
|
379 |
|
380 <p> |
|
381 Public method to map an index to the proxy model index. |
|
382 </p> |
|
383 <dl> |
|
384 |
|
385 <dt><i>sourceIndex</i></dt> |
|
386 <dd> |
|
387 reference to a source model index (QModelIndex) |
|
388 </dd> |
|
389 </dl> |
|
390 <dl> |
|
391 <dt>Return:</dt> |
|
392 <dd> |
|
393 proxy model index (QModelIndex) |
|
394 </dd> |
|
395 </dl> |
|
396 <a NAME="HistoryTreeModel.mapToSource" ID="HistoryTreeModel.mapToSource"></a> |
|
397 <h4>HistoryTreeModel.mapToSource</h4> |
|
398 <b>mapToSource</b>(<i>proxyIndex</i>) |
|
399 |
|
400 <p> |
|
401 Public method to map an index to the source model index. |
|
402 </p> |
|
403 <dl> |
|
404 |
|
405 <dt><i>proxyIndex</i></dt> |
|
406 <dd> |
|
407 reference to a proxy model index (QModelIndex) |
|
408 </dd> |
|
409 </dl> |
|
410 <dl> |
|
411 <dt>Return:</dt> |
|
412 <dd> |
|
413 source model index (QModelIndex) |
|
414 </dd> |
|
415 </dl> |
|
416 <a NAME="HistoryTreeModel.parent" ID="HistoryTreeModel.parent"></a> |
|
417 <h4>HistoryTreeModel.parent</h4> |
|
418 <b>parent</b>(<i>index</i>) |
|
419 |
|
420 <p> |
|
421 Public method to get the parent index. |
|
422 </p> |
|
423 <dl> |
|
424 |
|
425 <dt><i>index</i></dt> |
|
426 <dd> |
|
427 index of item to get parent (QModelIndex) |
|
428 </dd> |
|
429 </dl> |
|
430 <dl> |
|
431 <dt>Return:</dt> |
|
432 <dd> |
|
433 index of parent (QModelIndex) |
|
434 </dd> |
|
435 </dl> |
|
436 <a NAME="HistoryTreeModel.removeRows" ID="HistoryTreeModel.removeRows"></a> |
|
437 <h4>HistoryTreeModel.removeRows</h4> |
|
438 <b>removeRows</b>(<i>row, count, parent=None</i>) |
|
439 |
|
440 <p> |
|
441 Public method to remove entries from the model. |
|
442 </p> |
|
443 <dl> |
|
444 |
|
445 <dt><i>row</i></dt> |
|
446 <dd> |
|
447 row of the first entry to remove (integer) |
|
448 </dd> |
|
449 <dt><i>count</i></dt> |
|
450 <dd> |
|
451 number of entries to remove (integer) |
|
452 </dd> |
|
453 <dt><i>parent</i></dt> |
|
454 <dd> |
|
455 index of the parent entry (QModelIndex) |
|
456 </dd> |
|
457 </dl> |
|
458 <dl> |
|
459 <dt>Return:</dt> |
|
460 <dd> |
|
461 flag indicating successful removal (boolean) |
|
462 </dd> |
|
463 </dl> |
|
464 <a NAME="HistoryTreeModel.rowCount" ID="HistoryTreeModel.rowCount"></a> |
|
465 <h4>HistoryTreeModel.rowCount</h4> |
|
466 <b>rowCount</b>(<i>parent=None</i>) |
|
467 |
|
468 <p> |
|
469 Public method to determine the number of rows. |
|
470 </p> |
|
471 <dl> |
|
472 |
|
473 <dt><i>parent</i></dt> |
|
474 <dd> |
|
475 index of parent (QModelIndex) |
|
476 </dd> |
|
477 </dl> |
|
478 <dl> |
|
479 <dt>Return:</dt> |
|
480 <dd> |
|
481 number of rows (integer) |
|
482 </dd> |
|
483 </dl> |
|
484 <a NAME="HistoryTreeModel.setSourceModel" ID="HistoryTreeModel.setSourceModel"></a> |
|
485 <h4>HistoryTreeModel.setSourceModel</h4> |
|
486 <b>setSourceModel</b>(<i>sourceModel</i>) |
|
487 |
|
488 <p> |
|
489 Public method to set the source model. |
|
490 </p> |
|
491 <dl> |
|
492 |
|
493 <dt><i>sourceModel</i></dt> |
|
494 <dd> |
|
495 reference to the source model (QAbstractItemModel) |
|
496 </dd> |
|
497 </dl> |
|
498 <div align="right"><a href="#top">Up</a></div> |
|
499 <hr /> |
|
500 </body></html> |