Documentation/Source/eric4.Helpviewer.History.HistoryFilterModel.html

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

eric ide

mercurial