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