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