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