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