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