|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.EricWidgets.EricTextEditSearchWidget</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.EricWidgets.EricTextEditSearchWidget</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing a horizontal search widget for QTextEdit. |
|
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="#EricTextEditSearchWidget">EricTextEditSearchWidget</a></td> |
|
25 <td>Class implementing a horizontal search widget for QTextEdit.</td> |
|
26 </tr> |
|
27 <tr> |
|
28 <td><a href="#EricTextEditType">EricTextEditType</a></td> |
|
29 <td>Class defining the supported text edit types.</td> |
|
30 </tr> |
|
31 </table> |
|
32 <h3>Functions</h3> |
|
33 |
|
34 <table> |
|
35 <tr><td>None</td></tr> |
|
36 </table> |
|
37 <hr /> |
|
38 <hr /> |
|
39 <a NAME="EricTextEditSearchWidget" ID="EricTextEditSearchWidget"></a> |
|
40 <h2>EricTextEditSearchWidget</h2> |
|
41 |
|
42 <p> |
|
43 Class implementing a horizontal search widget for QTextEdit. |
|
44 </p> |
|
45 <h3>Signals</h3> |
|
46 <dl> |
|
47 |
|
48 <dt>closePressed()</dt> |
|
49 <dd> |
|
50 emitted to indicate the closing of the widget via |
|
51 the close button |
|
52 </dd> |
|
53 </dl> |
|
54 <h3>Derived from</h3> |
|
55 QWidget |
|
56 <h3>Class Attributes</h3> |
|
57 |
|
58 <table> |
|
59 <tr><td>None</td></tr> |
|
60 </table> |
|
61 <h3>Class Methods</h3> |
|
62 |
|
63 <table> |
|
64 <tr><td>None</td></tr> |
|
65 </table> |
|
66 <h3>Methods</h3> |
|
67 |
|
68 <table> |
|
69 |
|
70 <tr> |
|
71 <td><a href="#EricTextEditSearchWidget.__init__">EricTextEditSearchWidget</a></td> |
|
72 <td>Constructor</td> |
|
73 </tr> |
|
74 <tr> |
|
75 <td><a href="#EricTextEditSearchWidget.__addWidthForHeightLayout">__addWidthForHeightLayout</a></td> |
|
76 <td>Private method to set the middle part of the layout.</td> |
|
77 </tr> |
|
78 <tr> |
|
79 <td><a href="#EricTextEditSearchWidget.__closeButtonClicked">__closeButtonClicked</a></td> |
|
80 <td>Private slot to close the widget.</td> |
|
81 </tr> |
|
82 <tr> |
|
83 <td><a href="#EricTextEditSearchWidget.__find">__find</a></td> |
|
84 <td>Private method to search the associated text edit.</td> |
|
85 </tr> |
|
86 <tr> |
|
87 <td><a href="#EricTextEditSearchWidget.__findByReturnPressed">__findByReturnPressed</a></td> |
|
88 <td>Private slot to handle the returnPressed signal of the findtext combobox.</td> |
|
89 </tr> |
|
90 <tr> |
|
91 <td><a href="#EricTextEditSearchWidget.__findPrevNextQTextEdit">__findPrevNextQTextEdit</a></td> |
|
92 <td>Private method to to search the associated edit widget of type QTextEdit.</td> |
|
93 </tr> |
|
94 <tr> |
|
95 <td><a href="#EricTextEditSearchWidget.__findPrevNextQWebEngineView">__findPrevNextQWebEngineView</a></td> |
|
96 <td>Private method to to search the associated edit widget of type QWebEngineView.</td> |
|
97 </tr> |
|
98 <tr> |
|
99 <td><a href="#EricTextEditSearchWidget.__findTextFinished">__findTextFinished</a></td> |
|
100 <td>Private slot handling the findTextFinished signal of the web page.</td> |
|
101 </tr> |
|
102 <tr> |
|
103 <td><a href="#EricTextEditSearchWidget.__setFindtextComboBackground">__setFindtextComboBackground</a></td> |
|
104 <td>Private slot to change the findtext combo background to indicate errors.</td> |
|
105 </tr> |
|
106 <tr> |
|
107 <td><a href="#EricTextEditSearchWidget.__setSearchButtons">__setSearchButtons</a></td> |
|
108 <td>Private slot to set the state of the search buttons.</td> |
|
109 </tr> |
|
110 <tr> |
|
111 <td><a href="#EricTextEditSearchWidget.__setupUi">__setupUi</a></td> |
|
112 <td>Private method to generate the UI.</td> |
|
113 </tr> |
|
114 <tr> |
|
115 <td><a href="#EricTextEditSearchWidget.activate">activate</a></td> |
|
116 <td>Public slot to activate the widget.</td> |
|
117 </tr> |
|
118 <tr> |
|
119 <td><a href="#EricTextEditSearchWidget.attachTextEdit">attachTextEdit</a></td> |
|
120 <td>Public method to attach a QTextEdit or QWebEngineView widget.</td> |
|
121 </tr> |
|
122 <tr> |
|
123 <td><a href="#EricTextEditSearchWidget.deactivate">deactivate</a></td> |
|
124 <td>Public slot to deactivate the widget.</td> |
|
125 </tr> |
|
126 <tr> |
|
127 <td><a href="#EricTextEditSearchWidget.detachTextEdit">detachTextEdit</a></td> |
|
128 <td>Public method to detach the current text edit.</td> |
|
129 </tr> |
|
130 <tr> |
|
131 <td><a href="#EricTextEditSearchWidget.findNext">findNext</a></td> |
|
132 <td>Public slot to find the next occurrence of the current search term.</td> |
|
133 </tr> |
|
134 <tr> |
|
135 <td><a href="#EricTextEditSearchWidget.findPrev">findPrev</a></td> |
|
136 <td>Public slot to find the previous occurrence of the current search term.</td> |
|
137 </tr> |
|
138 <tr> |
|
139 <td><a href="#EricTextEditSearchWidget.keyPressEvent">keyPressEvent</a></td> |
|
140 <td>Protected slot to handle key press events.</td> |
|
141 </tr> |
|
142 <tr> |
|
143 <td><a href="#EricTextEditSearchWidget.on_findNextButton_clicked">on_findNextButton_clicked</a></td> |
|
144 <td>Private slot to find the next occurrence.</td> |
|
145 </tr> |
|
146 <tr> |
|
147 <td><a href="#EricTextEditSearchWidget.on_findPrevButton_clicked">on_findPrevButton_clicked</a></td> |
|
148 <td>Private slot to find the previous occurrence.</td> |
|
149 </tr> |
|
150 <tr> |
|
151 <td><a href="#EricTextEditSearchWidget.on_findtextCombo_editTextChanged">on_findtextCombo_editTextChanged</a></td> |
|
152 <td>Private slot to enable/disable the find buttons.</td> |
|
153 </tr> |
|
154 <tr> |
|
155 <td><a href="#EricTextEditSearchWidget.setWidthForHeight">setWidthForHeight</a></td> |
|
156 <td>Public method to set the 'width for height'.</td> |
|
157 </tr> |
|
158 <tr> |
|
159 <td><a href="#EricTextEditSearchWidget.showInfo">showInfo</a></td> |
|
160 <td>Public method to show some information in the info label.</td> |
|
161 </tr> |
|
162 </table> |
|
163 <h3>Static Methods</h3> |
|
164 |
|
165 <table> |
|
166 <tr><td>None</td></tr> |
|
167 </table> |
|
168 |
|
169 <a NAME="EricTextEditSearchWidget.__init__" ID="EricTextEditSearchWidget.__init__"></a> |
|
170 <h4>EricTextEditSearchWidget (Constructor)</h4> |
|
171 <b>EricTextEditSearchWidget</b>(<i>parent=None, widthForHeight=True, enableClose=False</i>) |
|
172 |
|
173 <p> |
|
174 Constructor |
|
175 </p> |
|
176 <dl> |
|
177 |
|
178 <dt><i>parent</i> (QWidget)</dt> |
|
179 <dd> |
|
180 reference to the parent widget |
|
181 </dd> |
|
182 <dt><i>widthForHeight</i> (bool)</dt> |
|
183 <dd> |
|
184 flag indicating to prefer width for height. |
|
185 If this parameter is False, some widgets are shown in a third |
|
186 line. |
|
187 </dd> |
|
188 <dt><i>enableClose</i> (bool)</dt> |
|
189 <dd> |
|
190 flag indicating to show a close button |
|
191 </dd> |
|
192 </dl> |
|
193 <a NAME="EricTextEditSearchWidget.__addWidthForHeightLayout" ID="EricTextEditSearchWidget.__addWidthForHeightLayout"></a> |
|
194 <h4>EricTextEditSearchWidget.__addWidthForHeightLayout</h4> |
|
195 <b>__addWidthForHeightLayout</b>(<i>widthForHeight</i>) |
|
196 |
|
197 <p> |
|
198 Private method to set the middle part of the layout. |
|
199 </p> |
|
200 <dl> |
|
201 |
|
202 <dt><i>widthForHeight</i> (bool)</dt> |
|
203 <dd> |
|
204 flag indicating to prefer width |
|
205 </dd> |
|
206 </dl> |
|
207 <a NAME="EricTextEditSearchWidget.__closeButtonClicked" ID="EricTextEditSearchWidget.__closeButtonClicked"></a> |
|
208 <h4>EricTextEditSearchWidget.__closeButtonClicked</h4> |
|
209 <b>__closeButtonClicked</b>(<i></i>) |
|
210 |
|
211 <p> |
|
212 Private slot to close the widget. |
|
213 </p> |
|
214 <p> |
|
215 Note: The widget is just hidden. |
|
216 </p> |
|
217 <a NAME="EricTextEditSearchWidget.__find" ID="EricTextEditSearchWidget.__find"></a> |
|
218 <h4>EricTextEditSearchWidget.__find</h4> |
|
219 <b>__find</b>(<i>backwards</i>) |
|
220 |
|
221 <p> |
|
222 Private method to search the associated text edit. |
|
223 </p> |
|
224 <dl> |
|
225 |
|
226 <dt><i>backwards</i> (bool)</dt> |
|
227 <dd> |
|
228 flag indicating a backwards search |
|
229 </dd> |
|
230 </dl> |
|
231 <a NAME="EricTextEditSearchWidget.__findByReturnPressed" ID="EricTextEditSearchWidget.__findByReturnPressed"></a> |
|
232 <h4>EricTextEditSearchWidget.__findByReturnPressed</h4> |
|
233 <b>__findByReturnPressed</b>(<i></i>) |
|
234 |
|
235 <p> |
|
236 Private slot to handle the returnPressed signal of the findtext |
|
237 combobox. |
|
238 </p> |
|
239 <a NAME="EricTextEditSearchWidget.__findPrevNextQTextEdit" ID="EricTextEditSearchWidget.__findPrevNextQTextEdit"></a> |
|
240 <h4>EricTextEditSearchWidget.__findPrevNextQTextEdit</h4> |
|
241 <b>__findPrevNextQTextEdit</b>(<i>backwards</i>) |
|
242 |
|
243 <p> |
|
244 Private method to to search the associated edit widget of |
|
245 type QTextEdit. |
|
246 </p> |
|
247 <dl> |
|
248 |
|
249 <dt><i>backwards</i> (bool)</dt> |
|
250 <dd> |
|
251 flag indicating a backwards search |
|
252 </dd> |
|
253 </dl> |
|
254 <a NAME="EricTextEditSearchWidget.__findPrevNextQWebEngineView" ID="EricTextEditSearchWidget.__findPrevNextQWebEngineView"></a> |
|
255 <h4>EricTextEditSearchWidget.__findPrevNextQWebEngineView</h4> |
|
256 <b>__findPrevNextQWebEngineView</b>(<i>backwards</i>) |
|
257 |
|
258 <p> |
|
259 Private method to to search the associated edit widget of |
|
260 type QWebEngineView. |
|
261 </p> |
|
262 <dl> |
|
263 |
|
264 <dt><i>backwards</i> (bool)</dt> |
|
265 <dd> |
|
266 flag indicating a backwards search |
|
267 </dd> |
|
268 </dl> |
|
269 <a NAME="EricTextEditSearchWidget.__findTextFinished" ID="EricTextEditSearchWidget.__findTextFinished"></a> |
|
270 <h4>EricTextEditSearchWidget.__findTextFinished</h4> |
|
271 <b>__findTextFinished</b>(<i>result</i>) |
|
272 |
|
273 <p> |
|
274 Private slot handling the findTextFinished signal of the web page. |
|
275 </p> |
|
276 <dl> |
|
277 |
|
278 <dt><i>result</i> (QWebEngineFindTextResult)</dt> |
|
279 <dd> |
|
280 reference to the QWebEngineFindTextResult object of the |
|
281 last search |
|
282 </dd> |
|
283 </dl> |
|
284 <a NAME="EricTextEditSearchWidget.__setFindtextComboBackground" ID="EricTextEditSearchWidget.__setFindtextComboBackground"></a> |
|
285 <h4>EricTextEditSearchWidget.__setFindtextComboBackground</h4> |
|
286 <b>__setFindtextComboBackground</b>(<i>error</i>) |
|
287 |
|
288 <p> |
|
289 Private slot to change the findtext combo background to indicate |
|
290 errors. |
|
291 </p> |
|
292 <dl> |
|
293 |
|
294 <dt><i>error</i> (bool)</dt> |
|
295 <dd> |
|
296 flag indicating an error condition |
|
297 </dd> |
|
298 </dl> |
|
299 <a NAME="EricTextEditSearchWidget.__setSearchButtons" ID="EricTextEditSearchWidget.__setSearchButtons"></a> |
|
300 <h4>EricTextEditSearchWidget.__setSearchButtons</h4> |
|
301 <b>__setSearchButtons</b>(<i>enabled</i>) |
|
302 |
|
303 <p> |
|
304 Private slot to set the state of the search buttons. |
|
305 </p> |
|
306 <dl> |
|
307 |
|
308 <dt><i>enabled</i> (bool)</dt> |
|
309 <dd> |
|
310 flag indicating the state |
|
311 </dd> |
|
312 </dl> |
|
313 <a NAME="EricTextEditSearchWidget.__setupUi" ID="EricTextEditSearchWidget.__setupUi"></a> |
|
314 <h4>EricTextEditSearchWidget.__setupUi</h4> |
|
315 <b>__setupUi</b>(<i>widthForHeight, enableClose</i>) |
|
316 |
|
317 <p> |
|
318 Private method to generate the UI. |
|
319 </p> |
|
320 <dl> |
|
321 |
|
322 <dt><i>widthForHeight</i> (bool)</dt> |
|
323 <dd> |
|
324 flag indicating to prefer width for height |
|
325 </dd> |
|
326 <dt><i>enableClose</i> (bool)</dt> |
|
327 <dd> |
|
328 flag indicating to show a close button |
|
329 </dd> |
|
330 </dl> |
|
331 <a NAME="EricTextEditSearchWidget.activate" ID="EricTextEditSearchWidget.activate"></a> |
|
332 <h4>EricTextEditSearchWidget.activate</h4> |
|
333 <b>activate</b>(<i></i>) |
|
334 |
|
335 <p> |
|
336 Public slot to activate the widget. |
|
337 </p> |
|
338 <a NAME="EricTextEditSearchWidget.attachTextEdit" ID="EricTextEditSearchWidget.attachTextEdit"></a> |
|
339 <h4>EricTextEditSearchWidget.attachTextEdit</h4> |
|
340 <b>attachTextEdit</b>(<i>textedit, editType=EricTextEditType.QTEXTEDIT</i>) |
|
341 |
|
342 <p> |
|
343 Public method to attach a QTextEdit or QWebEngineView widget. |
|
344 </p> |
|
345 <dl> |
|
346 |
|
347 <dt><i>textedit</i> (QTextEdit, QTextBrowser or QWebEngineView)</dt> |
|
348 <dd> |
|
349 reference to the edit widget to be attached |
|
350 </dd> |
|
351 <dt><i>editType</i> (EricTextEditType)</dt> |
|
352 <dd> |
|
353 type of the attached edit widget |
|
354 </dd> |
|
355 </dl> |
|
356 <a NAME="EricTextEditSearchWidget.deactivate" ID="EricTextEditSearchWidget.deactivate"></a> |
|
357 <h4>EricTextEditSearchWidget.deactivate</h4> |
|
358 <b>deactivate</b>(<i></i>) |
|
359 |
|
360 <p> |
|
361 Public slot to deactivate the widget. |
|
362 </p> |
|
363 <a NAME="EricTextEditSearchWidget.detachTextEdit" ID="EricTextEditSearchWidget.detachTextEdit"></a> |
|
364 <h4>EricTextEditSearchWidget.detachTextEdit</h4> |
|
365 <b>detachTextEdit</b>(<i></i>) |
|
366 |
|
367 <p> |
|
368 Public method to detach the current text edit. |
|
369 </p> |
|
370 <a NAME="EricTextEditSearchWidget.findNext" ID="EricTextEditSearchWidget.findNext"></a> |
|
371 <h4>EricTextEditSearchWidget.findNext</h4> |
|
372 <b>findNext</b>(<i></i>) |
|
373 |
|
374 <p> |
|
375 Public slot to find the next occurrence of the current search term. |
|
376 </p> |
|
377 <a NAME="EricTextEditSearchWidget.findPrev" ID="EricTextEditSearchWidget.findPrev"></a> |
|
378 <h4>EricTextEditSearchWidget.findPrev</h4> |
|
379 <b>findPrev</b>(<i></i>) |
|
380 |
|
381 <p> |
|
382 Public slot to find the previous occurrence of the current search term. |
|
383 </p> |
|
384 <a NAME="EricTextEditSearchWidget.keyPressEvent" ID="EricTextEditSearchWidget.keyPressEvent"></a> |
|
385 <h4>EricTextEditSearchWidget.keyPressEvent</h4> |
|
386 <b>keyPressEvent</b>(<i>event</i>) |
|
387 |
|
388 <p> |
|
389 Protected slot to handle key press events. |
|
390 </p> |
|
391 <dl> |
|
392 |
|
393 <dt><i>event</i> (QKeyEvent)</dt> |
|
394 <dd> |
|
395 reference to the key press event |
|
396 </dd> |
|
397 </dl> |
|
398 <a NAME="EricTextEditSearchWidget.on_findNextButton_clicked" ID="EricTextEditSearchWidget.on_findNextButton_clicked"></a> |
|
399 <h4>EricTextEditSearchWidget.on_findNextButton_clicked</h4> |
|
400 <b>on_findNextButton_clicked</b>(<i></i>) |
|
401 |
|
402 <p> |
|
403 Private slot to find the next occurrence. |
|
404 </p> |
|
405 <a NAME="EricTextEditSearchWidget.on_findPrevButton_clicked" ID="EricTextEditSearchWidget.on_findPrevButton_clicked"></a> |
|
406 <h4>EricTextEditSearchWidget.on_findPrevButton_clicked</h4> |
|
407 <b>on_findPrevButton_clicked</b>(<i></i>) |
|
408 |
|
409 <p> |
|
410 Private slot to find the previous occurrence. |
|
411 </p> |
|
412 <a NAME="EricTextEditSearchWidget.on_findtextCombo_editTextChanged" ID="EricTextEditSearchWidget.on_findtextCombo_editTextChanged"></a> |
|
413 <h4>EricTextEditSearchWidget.on_findtextCombo_editTextChanged</h4> |
|
414 <b>on_findtextCombo_editTextChanged</b>(<i>txt</i>) |
|
415 |
|
416 <p> |
|
417 Private slot to enable/disable the find buttons. |
|
418 </p> |
|
419 <dl> |
|
420 |
|
421 <dt><i>txt</i> (str)</dt> |
|
422 <dd> |
|
423 text of the combobox |
|
424 </dd> |
|
425 </dl> |
|
426 <a NAME="EricTextEditSearchWidget.setWidthForHeight" ID="EricTextEditSearchWidget.setWidthForHeight"></a> |
|
427 <h4>EricTextEditSearchWidget.setWidthForHeight</h4> |
|
428 <b>setWidthForHeight</b>(<i>widthForHeight</i>) |
|
429 |
|
430 <p> |
|
431 Public method to set the 'width for height'. |
|
432 </p> |
|
433 <dl> |
|
434 |
|
435 <dt><i>widthForHeight</i> (bool)</dt> |
|
436 <dd> |
|
437 flag indicating to prefer width |
|
438 </dd> |
|
439 </dl> |
|
440 <a NAME="EricTextEditSearchWidget.showInfo" ID="EricTextEditSearchWidget.showInfo"></a> |
|
441 <h4>EricTextEditSearchWidget.showInfo</h4> |
|
442 <b>showInfo</b>(<i>info</i>) |
|
443 |
|
444 <p> |
|
445 Public method to show some information in the info label. |
|
446 </p> |
|
447 <dl> |
|
448 |
|
449 <dt><i>info</i> (str)</dt> |
|
450 <dd> |
|
451 informational text to be shown |
|
452 </dd> |
|
453 </dl> |
|
454 <div align="right"><a href="#top">Up</a></div> |
|
455 <hr /> |
|
456 <hr /> |
|
457 <a NAME="EricTextEditType" ID="EricTextEditType"></a> |
|
458 <h2>EricTextEditType</h2> |
|
459 |
|
460 <p> |
|
461 Class defining the supported text edit types. |
|
462 </p> |
|
463 <h3>Derived from</h3> |
|
464 enum.Enum |
|
465 <h3>Class Attributes</h3> |
|
466 |
|
467 <table> |
|
468 <tr><td>QTEXTBROWSER</td></tr><tr><td>QTEXTEDIT</td></tr><tr><td>QWEBENGINEVIEW</td></tr><tr><td>UNKNOWN</td></tr> |
|
469 </table> |
|
470 <h3>Class Methods</h3> |
|
471 |
|
472 <table> |
|
473 <tr><td>None</td></tr> |
|
474 </table> |
|
475 <h3>Methods</h3> |
|
476 |
|
477 <table> |
|
478 <tr><td>None</td></tr> |
|
479 </table> |
|
480 <h3>Static Methods</h3> |
|
481 |
|
482 <table> |
|
483 <tr><td>None</td></tr> |
|
484 </table> |
|
485 |
|
486 <div align="right"><a href="#top">Up</a></div> |
|
487 <hr /> |
|
488 </body></html> |