src/eric7/Documentation/Source/eric7.WebBrowser.History.HistoryCompleter.html

branch
eric7
changeset 9209
b99e7fd55fd3
parent 8596
d64760b2da50
child 10070
9f5758c0fec1
equal deleted inserted replaced
9208:3fc8dfeb6ebe 9209:b99e7fd55fd3
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.WebBrowser.History.HistoryCompleter</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.WebBrowser.History.HistoryCompleter</h1>
10
11 <p>
12 Module implementing a special completer for the history.
13 </p>
14 <h3>Global Attributes</h3>
15
16 <table>
17 <tr><td>None</td></tr>
18 </table>
19 <h3>Classes</h3>
20
21 <table>
22
23 <tr>
24 <td><a href="#HistoryCompleter">HistoryCompleter</a></td>
25 <td>Class implementing a completer for the browser history.</td>
26 </tr>
27 <tr>
28 <td><a href="#HistoryCompletionModel">HistoryCompletionModel</a></td>
29 <td>Class implementing a special model for history based completions.</td>
30 </tr>
31 <tr>
32 <td><a href="#HistoryCompletionView">HistoryCompletionView</a></td>
33 <td>Class implementing a special completer view for history based completions.</td>
34 </tr>
35 </table>
36 <h3>Functions</h3>
37
38 <table>
39 <tr><td>None</td></tr>
40 </table>
41 <hr />
42 <hr />
43 <a NAME="HistoryCompleter" ID="HistoryCompleter"></a>
44 <h2>HistoryCompleter</h2>
45
46 <p>
47 Class implementing a completer for the browser history.
48 </p>
49 <h3>Derived from</h3>
50 QCompleter
51 <h3>Class Attributes</h3>
52
53 <table>
54 <tr><td>None</td></tr>
55 </table>
56 <h3>Class Methods</h3>
57
58 <table>
59 <tr><td>None</td></tr>
60 </table>
61 <h3>Methods</h3>
62
63 <table>
64
65 <tr>
66 <td><a href="#HistoryCompleter.__init__">HistoryCompleter</a></td>
67 <td>Constructor</td>
68 </tr>
69 <tr>
70 <td><a href="#HistoryCompleter.__updateFilter">__updateFilter</a></td>
71 <td>Private slot to update the search string.</td>
72 </tr>
73 <tr>
74 <td><a href="#HistoryCompleter.pathFromIndex">pathFromIndex</a></td>
75 <td>Public method to get a path for a given index.</td>
76 </tr>
77 <tr>
78 <td><a href="#HistoryCompleter.splitPath">splitPath</a></td>
79 <td>Public method to split the given path into strings, that are used to match at each level in the model.</td>
80 </tr>
81 </table>
82 <h3>Static Methods</h3>
83
84 <table>
85 <tr><td>None</td></tr>
86 </table>
87
88 <a NAME="HistoryCompleter.__init__" ID="HistoryCompleter.__init__"></a>
89 <h4>HistoryCompleter (Constructor)</h4>
90 <b>HistoryCompleter</b>(<i>model, parent=None</i>)
91
92 <p>
93 Constructor
94 </p>
95 <dl>
96
97 <dt><i>model</i></dt>
98 <dd>
99 reference to the model (QAbstractItemModel)
100 </dd>
101 <dt><i>parent</i></dt>
102 <dd>
103 reference to the parent object (QObject)
104 </dd>
105 </dl>
106 <a NAME="HistoryCompleter.__updateFilter" ID="HistoryCompleter.__updateFilter"></a>
107 <h4>HistoryCompleter.__updateFilter</h4>
108 <b>__updateFilter</b>(<i></i>)
109
110 <p>
111 Private slot to update the search string.
112 </p>
113 <a NAME="HistoryCompleter.pathFromIndex" ID="HistoryCompleter.pathFromIndex"></a>
114 <h4>HistoryCompleter.pathFromIndex</h4>
115 <b>pathFromIndex</b>(<i>idx</i>)
116
117 <p>
118 Public method to get a path for a given index.
119 </p>
120 <dl>
121
122 <dt><i>idx</i></dt>
123 <dd>
124 reference to the index (QModelIndex)
125 </dd>
126 </dl>
127 <dl>
128 <dt>Return:</dt>
129 <dd>
130 the actual URL from the history (string)
131 </dd>
132 </dl>
133 <a NAME="HistoryCompleter.splitPath" ID="HistoryCompleter.splitPath"></a>
134 <h4>HistoryCompleter.splitPath</h4>
135 <b>splitPath</b>(<i>path</i>)
136
137 <p>
138 Public method to split the given path into strings, that are used to
139 match at each level in the model.
140 </p>
141 <dl>
142
143 <dt><i>path</i></dt>
144 <dd>
145 path to be split (string)
146 </dd>
147 </dl>
148 <dl>
149 <dt>Return:</dt>
150 <dd>
151 list of path elements (list of strings)
152 </dd>
153 </dl>
154 <div align="right"><a href="#top">Up</a></div>
155 <hr />
156 <hr />
157 <a NAME="HistoryCompletionModel" ID="HistoryCompletionModel"></a>
158 <h2>HistoryCompletionModel</h2>
159
160 <p>
161 Class implementing a special model for history based completions.
162 </p>
163 <h3>Derived from</h3>
164 QSortFilterProxyModel
165 <h3>Class Attributes</h3>
166
167 <table>
168 <tr><td>HistoryCompletionRole</td></tr>
169 </table>
170 <h3>Class Methods</h3>
171
172 <table>
173 <tr><td>None</td></tr>
174 </table>
175 <h3>Methods</h3>
176
177 <table>
178
179 <tr>
180 <td><a href="#HistoryCompletionModel.__init__">HistoryCompletionModel</a></td>
181 <td>Constructor</td>
182 </tr>
183 <tr>
184 <td><a href="#HistoryCompletionModel.data">data</a></td>
185 <td>Public method to get data from the model.</td>
186 </tr>
187 <tr>
188 <td><a href="#HistoryCompletionModel.filterAcceptsRow">filterAcceptsRow</a></td>
189 <td>Public method to determine, if the row is acceptable.</td>
190 </tr>
191 <tr>
192 <td><a href="#HistoryCompletionModel.isValid">isValid</a></td>
193 <td>Public method to check the model for validity.</td>
194 </tr>
195 <tr>
196 <td><a href="#HistoryCompletionModel.lessThan">lessThan</a></td>
197 <td>Public method used to sort the displayed items.</td>
198 </tr>
199 <tr>
200 <td><a href="#HistoryCompletionModel.searchString">searchString</a></td>
201 <td>Public method to get the current search string.</td>
202 </tr>
203 <tr>
204 <td><a href="#HistoryCompletionModel.setSearchString">setSearchString</a></td>
205 <td>Public method to set the current search string.</td>
206 </tr>
207 <tr>
208 <td><a href="#HistoryCompletionModel.setValid">setValid</a></td>
209 <td>Public method to set the model's validity.</td>
210 </tr>
211 </table>
212 <h3>Static Methods</h3>
213
214 <table>
215 <tr><td>None</td></tr>
216 </table>
217
218 <a NAME="HistoryCompletionModel.__init__" ID="HistoryCompletionModel.__init__"></a>
219 <h4>HistoryCompletionModel (Constructor)</h4>
220 <b>HistoryCompletionModel</b>(<i>parent=None</i>)
221
222 <p>
223 Constructor
224 </p>
225 <dl>
226
227 <dt><i>parent</i></dt>
228 <dd>
229 reference to the parent object (QObject)
230 </dd>
231 </dl>
232 <a NAME="HistoryCompletionModel.data" ID="HistoryCompletionModel.data"></a>
233 <h4>HistoryCompletionModel.data</h4>
234 <b>data</b>(<i>index, role=Qt.ItemDataRole.DisplayRole</i>)
235
236 <p>
237 Public method to get data from the model.
238 </p>
239 <dl>
240
241 <dt><i>index</i></dt>
242 <dd>
243 index of history entry to get data for (QModelIndex)
244 </dd>
245 <dt><i>role</i></dt>
246 <dd>
247 data role (integer)
248 </dd>
249 </dl>
250 <dl>
251 <dt>Return:</dt>
252 <dd>
253 history entry data
254 </dd>
255 </dl>
256 <a NAME="HistoryCompletionModel.filterAcceptsRow" ID="HistoryCompletionModel.filterAcceptsRow"></a>
257 <h4>HistoryCompletionModel.filterAcceptsRow</h4>
258 <b>filterAcceptsRow</b>(<i>sourceRow, sourceParent</i>)
259
260 <p>
261 Public method to determine, if the row is acceptable.
262 </p>
263 <dl>
264
265 <dt><i>sourceRow</i></dt>
266 <dd>
267 row number in the source model (integer)
268 </dd>
269 <dt><i>sourceParent</i></dt>
270 <dd>
271 index of the source item (QModelIndex)
272 </dd>
273 </dl>
274 <dl>
275 <dt>Return:</dt>
276 <dd>
277 flag indicating acceptance (boolean)
278 </dd>
279 </dl>
280 <a NAME="HistoryCompletionModel.isValid" ID="HistoryCompletionModel.isValid"></a>
281 <h4>HistoryCompletionModel.isValid</h4>
282 <b>isValid</b>(<i></i>)
283
284 <p>
285 Public method to check the model for validity.
286 </p>
287 <dl>
288 <dt>Return:</dt>
289 <dd>
290 flag indicating a valid status (boolean)
291 </dd>
292 </dl>
293 <a NAME="HistoryCompletionModel.lessThan" ID="HistoryCompletionModel.lessThan"></a>
294 <h4>HistoryCompletionModel.lessThan</h4>
295 <b>lessThan</b>(<i>left, right</i>)
296
297 <p>
298 Public method used to sort the displayed items.
299 </p>
300 <p>
301 It implements a special sorting function based on the history entry's
302 frequency giving a bonus to hits that match on a word boundary so that
303 e.g. "dot.python-projects.org" is a better result for typing "dot" than
304 "slashdot.org". However, it only looks for the string in the host name,
305 not the entire URL, since while it makes sense to e.g. give
306 "www.phoronix.com" a bonus for "ph", it does NOT make sense to give
307 "www.yadda.com/foo.php" the bonus.
308 </p>
309 <dl>
310
311 <dt><i>left</i> (QModelIndex)</dt>
312 <dd>
313 index of left item
314 </dd>
315 <dt><i>right</i> (QModelIndex)</dt>
316 <dd>
317 index of right item
318 </dd>
319 </dl>
320 <dl>
321 <dt>Return:</dt>
322 <dd>
323 true, if left is less than right
324 </dd>
325 </dl>
326 <dl>
327 <dt>Return Type:</dt>
328 <dd>
329 bool
330 </dd>
331 </dl>
332 <a NAME="HistoryCompletionModel.searchString" ID="HistoryCompletionModel.searchString"></a>
333 <h4>HistoryCompletionModel.searchString</h4>
334 <b>searchString</b>(<i></i>)
335
336 <p>
337 Public method to get the current search string.
338 </p>
339 <dl>
340 <dt>Return:</dt>
341 <dd>
342 current search string (string)
343 </dd>
344 </dl>
345 <a NAME="HistoryCompletionModel.setSearchString" ID="HistoryCompletionModel.setSearchString"></a>
346 <h4>HistoryCompletionModel.setSearchString</h4>
347 <b>setSearchString</b>(<i>sstring</i>)
348
349 <p>
350 Public method to set the current search string.
351 </p>
352 <dl>
353
354 <dt><i>sstring</i></dt>
355 <dd>
356 new search string (string)
357 </dd>
358 </dl>
359 <a NAME="HistoryCompletionModel.setValid" ID="HistoryCompletionModel.setValid"></a>
360 <h4>HistoryCompletionModel.setValid</h4>
361 <b>setValid</b>(<i>valid</i>)
362
363 <p>
364 Public method to set the model's validity.
365 </p>
366 <dl>
367
368 <dt><i>valid</i></dt>
369 <dd>
370 flag indicating the new valid status (boolean)
371 </dd>
372 </dl>
373 <div align="right"><a href="#top">Up</a></div>
374 <hr />
375 <hr />
376 <a NAME="HistoryCompletionView" ID="HistoryCompletionView"></a>
377 <h2>HistoryCompletionView</h2>
378
379 <p>
380 Class implementing a special completer view for history based completions.
381 </p>
382 <h3>Derived from</h3>
383 QTableView
384 <h3>Class Attributes</h3>
385
386 <table>
387 <tr><td>None</td></tr>
388 </table>
389 <h3>Class Methods</h3>
390
391 <table>
392 <tr><td>None</td></tr>
393 </table>
394 <h3>Methods</h3>
395
396 <table>
397
398 <tr>
399 <td><a href="#HistoryCompletionView.__init__">HistoryCompletionView</a></td>
400 <td>Constructor</td>
401 </tr>
402 <tr>
403 <td><a href="#HistoryCompletionView.resizeEvent">resizeEvent</a></td>
404 <td>Protected method handling resize events.</td>
405 </tr>
406 <tr>
407 <td><a href="#HistoryCompletionView.sizeHintForRow">sizeHintForRow</a></td>
408 <td>Public method to give a size hint for rows.</td>
409 </tr>
410 </table>
411 <h3>Static Methods</h3>
412
413 <table>
414 <tr><td>None</td></tr>
415 </table>
416
417 <a NAME="HistoryCompletionView.__init__" ID="HistoryCompletionView.__init__"></a>
418 <h4>HistoryCompletionView (Constructor)</h4>
419 <b>HistoryCompletionView</b>(<i>parent=None</i>)
420
421 <p>
422 Constructor
423 </p>
424 <dl>
425
426 <dt><i>parent</i></dt>
427 <dd>
428 reference to the parent widget (QWidget)
429 </dd>
430 </dl>
431 <a NAME="HistoryCompletionView.resizeEvent" ID="HistoryCompletionView.resizeEvent"></a>
432 <h4>HistoryCompletionView.resizeEvent</h4>
433 <b>resizeEvent</b>(<i>evt</i>)
434
435 <p>
436 Protected method handling resize events.
437 </p>
438 <dl>
439
440 <dt><i>evt</i></dt>
441 <dd>
442 reference to the resize event (QResizeEvent)
443 </dd>
444 </dl>
445 <a NAME="HistoryCompletionView.sizeHintForRow" ID="HistoryCompletionView.sizeHintForRow"></a>
446 <h4>HistoryCompletionView.sizeHintForRow</h4>
447 <b>sizeHintForRow</b>(<i>row</i>)
448
449 <p>
450 Public method to give a size hint for rows.
451 </p>
452 <dl>
453
454 <dt><i>row</i></dt>
455 <dd>
456 row number (integer)
457 </dd>
458 </dl>
459 <dl>
460 <dt>Return:</dt>
461 <dd>
462 desired row height (integer)
463 </dd>
464 </dl>
465 <div align="right"><a href="#top">Up</a></div>
466 <hr />
467 </body></html>

eric ide

mercurial