|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.EricWidgets.EricSpellCheckedTextEdit</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.EricSpellCheckedTextEdit</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing QTextEdit and QPlainTextEdit widgets with embedded spell |
|
13 checking. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 |
|
17 <table> |
|
18 <tr><td>None</td></tr> |
|
19 </table> |
|
20 <h3>Classes</h3> |
|
21 |
|
22 <table> |
|
23 |
|
24 <tr> |
|
25 <td><a href="#EnchantHighlighter">EnchantHighlighter</a></td> |
|
26 <td>Class implementing a QSyntaxHighlighter subclass that consults a pyEnchant dictionary to highlight misspelled words.</td> |
|
27 </tr> |
|
28 <tr> |
|
29 <td><a href="#EricSpellCheckedPlainTextEdit">EricSpellCheckedPlainTextEdit</a></td> |
|
30 <td>Class implementing a QPlainTextEdit with built-in spell checker.</td> |
|
31 </tr> |
|
32 <tr> |
|
33 <td><a href="#EricSpellCheckedTextEdit">EricSpellCheckedTextEdit</a></td> |
|
34 <td>Class implementing a QTextEdit with built-in spell checker.</td> |
|
35 </tr> |
|
36 <tr> |
|
37 <td><a href="#SpellCheckMixin">SpellCheckMixin</a></td> |
|
38 <td>Class implementing the spell-check mixin for the widget classes.</td> |
|
39 </tr> |
|
40 <tr> |
|
41 <td><a href="#SpellCheckMixin_1">SpellCheckMixin</a></td> |
|
42 <td>Class implementing the spell-check mixin for the widget classes.</td> |
|
43 </tr> |
|
44 </table> |
|
45 <h3>Functions</h3> |
|
46 |
|
47 <table> |
|
48 <tr><td>None</td></tr> |
|
49 </table> |
|
50 <hr /> |
|
51 <hr /> |
|
52 <a NAME="EnchantHighlighter" ID="EnchantHighlighter"></a> |
|
53 <h2>EnchantHighlighter</h2> |
|
54 |
|
55 <p> |
|
56 Class implementing a QSyntaxHighlighter subclass that consults a |
|
57 pyEnchant dictionary to highlight misspelled words. |
|
58 </p> |
|
59 <h3>Derived from</h3> |
|
60 QSyntaxHighlighter |
|
61 <h3>Class Attributes</h3> |
|
62 |
|
63 <table> |
|
64 <tr><td>ErrorFormat</td></tr><tr><td>TokenFilters</td></tr> |
|
65 </table> |
|
66 <h3>Class Methods</h3> |
|
67 |
|
68 <table> |
|
69 <tr><td>None</td></tr> |
|
70 </table> |
|
71 <h3>Methods</h3> |
|
72 |
|
73 <table> |
|
74 |
|
75 <tr> |
|
76 <td><a href="#EnchantHighlighter.__init__">EnchantHighlighter</a></td> |
|
77 <td>Constructor</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#EnchantHighlighter.chunkers">chunkers</a></td> |
|
81 <td>Public method to get the chunkers in use.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#EnchantHighlighter.dict">dict</a></td> |
|
85 <td>Public method to get the spelling dictionary in use.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#EnchantHighlighter.highlightBlock">highlightBlock</a></td> |
|
89 <td>Public method to apply the text highlight.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#EnchantHighlighter.setChunkers">setChunkers</a></td> |
|
93 <td>Public method to set the chunkers to be used.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#EnchantHighlighter.setDict">setDict</a></td> |
|
97 <td>Public method to set the spelling dictionary to be used.</td> |
|
98 </tr> |
|
99 </table> |
|
100 <h3>Static Methods</h3> |
|
101 |
|
102 <table> |
|
103 <tr><td>None</td></tr> |
|
104 </table> |
|
105 |
|
106 <a NAME="EnchantHighlighter.__init__" ID="EnchantHighlighter.__init__"></a> |
|
107 <h4>EnchantHighlighter (Constructor)</h4> |
|
108 <b>EnchantHighlighter</b>(<i>*args</i>) |
|
109 |
|
110 <p> |
|
111 Constructor |
|
112 </p> |
|
113 <dl> |
|
114 |
|
115 <dt><i>*args</i> (list)</dt> |
|
116 <dd> |
|
117 list of arguments for the QSyntaxHighlighter |
|
118 </dd> |
|
119 </dl> |
|
120 <a NAME="EnchantHighlighter.chunkers" ID="EnchantHighlighter.chunkers"></a> |
|
121 <h4>EnchantHighlighter.chunkers</h4> |
|
122 <b>chunkers</b>(<i></i>) |
|
123 |
|
124 <p> |
|
125 Public method to get the chunkers in use. |
|
126 </p> |
|
127 <dl> |
|
128 <dt>Return:</dt> |
|
129 <dd> |
|
130 list of chunkers in use |
|
131 </dd> |
|
132 </dl> |
|
133 <dl> |
|
134 <dt>Return Type:</dt> |
|
135 <dd> |
|
136 list |
|
137 </dd> |
|
138 </dl> |
|
139 <a NAME="EnchantHighlighter.dict" ID="EnchantHighlighter.dict"></a> |
|
140 <h4>EnchantHighlighter.dict</h4> |
|
141 <b>dict</b>(<i></i>) |
|
142 |
|
143 <p> |
|
144 Public method to get the spelling dictionary in use. |
|
145 </p> |
|
146 <dl> |
|
147 <dt>Return:</dt> |
|
148 <dd> |
|
149 spelling dictionary |
|
150 </dd> |
|
151 </dl> |
|
152 <dl> |
|
153 <dt>Return Type:</dt> |
|
154 <dd> |
|
155 enchant.Dict |
|
156 </dd> |
|
157 </dl> |
|
158 <a NAME="EnchantHighlighter.highlightBlock" ID="EnchantHighlighter.highlightBlock"></a> |
|
159 <h4>EnchantHighlighter.highlightBlock</h4> |
|
160 <b>highlightBlock</b>(<i>text</i>) |
|
161 |
|
162 <p> |
|
163 Public method to apply the text highlight. |
|
164 </p> |
|
165 <dl> |
|
166 |
|
167 <dt><i>text</i> (str)</dt> |
|
168 <dd> |
|
169 text to be spell-checked |
|
170 </dd> |
|
171 </dl> |
|
172 <a NAME="EnchantHighlighter.setChunkers" ID="EnchantHighlighter.setChunkers"></a> |
|
173 <h4>EnchantHighlighter.setChunkers</h4> |
|
174 <b>setChunkers</b>(<i>chunkers</i>) |
|
175 |
|
176 <p> |
|
177 Public method to set the chunkers to be used. |
|
178 </p> |
|
179 <dl> |
|
180 |
|
181 <dt><i>chunkers</i> (list)</dt> |
|
182 <dd> |
|
183 chunkers to be used |
|
184 </dd> |
|
185 </dl> |
|
186 <a NAME="EnchantHighlighter.setDict" ID="EnchantHighlighter.setDict"></a> |
|
187 <h4>EnchantHighlighter.setDict</h4> |
|
188 <b>setDict</b>(<i>spellDict</i>) |
|
189 |
|
190 <p> |
|
191 Public method to set the spelling dictionary to be used. |
|
192 </p> |
|
193 <dl> |
|
194 |
|
195 <dt><i>spellDict</i> (enchant.Dict)</dt> |
|
196 <dd> |
|
197 spelling dictionary |
|
198 </dd> |
|
199 </dl> |
|
200 <div align="right"><a href="#top">Up</a></div> |
|
201 <hr /> |
|
202 <hr /> |
|
203 <a NAME="EricSpellCheckedPlainTextEdit" ID="EricSpellCheckedPlainTextEdit"></a> |
|
204 <h2>EricSpellCheckedPlainTextEdit</h2> |
|
205 |
|
206 <p> |
|
207 Class implementing a QPlainTextEdit with built-in spell checker. |
|
208 </p> |
|
209 <h3>Derived from</h3> |
|
210 QPlainTextEdit, SpellCheckMixin |
|
211 <h3>Class Attributes</h3> |
|
212 |
|
213 <table> |
|
214 <tr><td>None</td></tr> |
|
215 </table> |
|
216 <h3>Class Methods</h3> |
|
217 |
|
218 <table> |
|
219 <tr><td>None</td></tr> |
|
220 </table> |
|
221 <h3>Methods</h3> |
|
222 |
|
223 <table> |
|
224 |
|
225 <tr> |
|
226 <td><a href="#EricSpellCheckedPlainTextEdit.__init__">EricSpellCheckedPlainTextEdit</a></td> |
|
227 <td>Constructor</td> |
|
228 </tr> |
|
229 </table> |
|
230 <h3>Static Methods</h3> |
|
231 |
|
232 <table> |
|
233 <tr><td>None</td></tr> |
|
234 </table> |
|
235 |
|
236 <a NAME="EricSpellCheckedPlainTextEdit.__init__" ID="EricSpellCheckedPlainTextEdit.__init__"></a> |
|
237 <h4>EricSpellCheckedPlainTextEdit (Constructor)</h4> |
|
238 <b>EricSpellCheckedPlainTextEdit</b>(<i>*args</i>) |
|
239 |
|
240 <p> |
|
241 Constructor |
|
242 </p> |
|
243 <dl> |
|
244 |
|
245 <dt><i>*args</i> (list)</dt> |
|
246 <dd> |
|
247 list of arguments for the QPlainTextEdit constructor. |
|
248 </dd> |
|
249 </dl> |
|
250 <div align="right"><a href="#top">Up</a></div> |
|
251 <hr /> |
|
252 <hr /> |
|
253 <a NAME="EricSpellCheckedTextEdit" ID="EricSpellCheckedTextEdit"></a> |
|
254 <h2>EricSpellCheckedTextEdit</h2> |
|
255 |
|
256 <p> |
|
257 Class implementing a QTextEdit with built-in spell checker. |
|
258 </p> |
|
259 <h3>Derived from</h3> |
|
260 QTextEdit, SpellCheckMixin |
|
261 <h3>Class Attributes</h3> |
|
262 |
|
263 <table> |
|
264 <tr><td>None</td></tr> |
|
265 </table> |
|
266 <h3>Class Methods</h3> |
|
267 |
|
268 <table> |
|
269 <tr><td>None</td></tr> |
|
270 </table> |
|
271 <h3>Methods</h3> |
|
272 |
|
273 <table> |
|
274 |
|
275 <tr> |
|
276 <td><a href="#EricSpellCheckedTextEdit.__init__">EricSpellCheckedTextEdit</a></td> |
|
277 <td>Constructor</td> |
|
278 </tr> |
|
279 <tr> |
|
280 <td><a href="#EricSpellCheckedTextEdit.setAcceptRichText">setAcceptRichText</a></td> |
|
281 <td>Public method to set the text edit mode.</td> |
|
282 </tr> |
|
283 </table> |
|
284 <h3>Static Methods</h3> |
|
285 |
|
286 <table> |
|
287 <tr><td>None</td></tr> |
|
288 </table> |
|
289 |
|
290 <a NAME="EricSpellCheckedTextEdit.__init__" ID="EricSpellCheckedTextEdit.__init__"></a> |
|
291 <h4>EricSpellCheckedTextEdit (Constructor)</h4> |
|
292 <b>EricSpellCheckedTextEdit</b>(<i>*args</i>) |
|
293 |
|
294 <p> |
|
295 Constructor |
|
296 </p> |
|
297 <dl> |
|
298 |
|
299 <dt><i>*args</i> (list)</dt> |
|
300 <dd> |
|
301 list of arguments for the QPlainTextEdit constructor. |
|
302 </dd> |
|
303 </dl> |
|
304 <a NAME="EricSpellCheckedTextEdit.setAcceptRichText" ID="EricSpellCheckedTextEdit.setAcceptRichText"></a> |
|
305 <h4>EricSpellCheckedTextEdit.setAcceptRichText</h4> |
|
306 <b>setAcceptRichText</b>(<i>accept</i>) |
|
307 |
|
308 <p> |
|
309 Public method to set the text edit mode. |
|
310 </p> |
|
311 <dl> |
|
312 |
|
313 <dt><i>accept</i> (bool)</dt> |
|
314 <dd> |
|
315 flag indicating to accept rich text |
|
316 </dd> |
|
317 </dl> |
|
318 <div align="right"><a href="#top">Up</a></div> |
|
319 <hr /> |
|
320 <hr /> |
|
321 <a NAME="SpellCheckMixin" ID="SpellCheckMixin"></a> |
|
322 <h2>SpellCheckMixin</h2> |
|
323 |
|
324 <p> |
|
325 Class implementing the spell-check mixin for the widget classes. |
|
326 </p> |
|
327 <h3>Derived from</h3> |
|
328 None |
|
329 <h3>Class Attributes</h3> |
|
330 |
|
331 <table> |
|
332 <tr><td>DefaultLanguage</td></tr><tr><td>DefaultUserExceptionList</td></tr><tr><td>DefaultUserWordList</td></tr><tr><td>MaxSuggestions</td></tr> |
|
333 </table> |
|
334 <h3>Class Methods</h3> |
|
335 |
|
336 <table> |
|
337 |
|
338 <tr> |
|
339 <td><a href="#SpellCheckMixin.setDefaultLanguage">setDefaultLanguage</a></td> |
|
340 <td>Class method to set the default spell-check language.</td> |
|
341 </tr> |
|
342 </table> |
|
343 <h3>Methods</h3> |
|
344 |
|
345 <table> |
|
346 |
|
347 <tr> |
|
348 <td><a href="#SpellCheckMixin.__init__">SpellCheckMixin</a></td> |
|
349 <td>Constructor</td> |
|
350 </tr> |
|
351 <tr> |
|
352 <td><a href="#SpellCheckMixin.__addRemoveEntry">__addRemoveEntry</a></td> |
|
353 <td>Private method to create a menu entry to remove the word at the menu position.</td> |
|
354 </tr> |
|
355 <tr> |
|
356 <td><a href="#SpellCheckMixin.__addToUserDict">__addToUserDict</a></td> |
|
357 <td>Private method to add a word to the user word or exclude list.</td> |
|
358 </tr> |
|
359 <tr> |
|
360 <td><a href="#SpellCheckMixin.__correctWord">__correctWord</a></td> |
|
361 <td>Private method to replace some misspelled text.</td> |
|
362 </tr> |
|
363 <tr> |
|
364 <td><a href="#SpellCheckMixin.__createCorrectionsMenu">__createCorrectionsMenu</a></td> |
|
365 <td>Private method to create a menu for corrections of the selected word.</td> |
|
366 </tr> |
|
367 <tr> |
|
368 <td><a href="#SpellCheckMixin.__createFormatsMenu">__createFormatsMenu</a></td> |
|
369 <td>Private method to create a menu for selecting the document format.</td> |
|
370 </tr> |
|
371 <tr> |
|
372 <td><a href="#SpellCheckMixin.__createLanguagesMenu">__createLanguagesMenu</a></td> |
|
373 <td>Private method to create a menu for selecting the spell-check language.</td> |
|
374 </tr> |
|
375 <tr> |
|
376 <td><a href="#SpellCheckMixin.__createSpellcheckContextMenu">__createSpellcheckContextMenu</a></td> |
|
377 <td>Private method to create the spell-check context menu.</td> |
|
378 </tr> |
|
379 <tr> |
|
380 <td><a href="#SpellCheckMixin.__cursorForMisspelling">__cursorForMisspelling</a></td> |
|
381 <td>Private method to create a text cursor selecting the misspelled word.</td> |
|
382 </tr> |
|
383 <tr> |
|
384 <td><a href="#SpellCheckMixin.__cursorForPosition">__cursorForPosition</a></td> |
|
385 <td>Private method to create a text cursor selecting the word at the given position.</td> |
|
386 </tr> |
|
387 <tr> |
|
388 <td><a href="#SpellCheckMixin.__setFormat">__setFormat</a></td> |
|
389 <td>Private slot to set the selected document format.</td> |
|
390 </tr> |
|
391 <tr> |
|
392 <td><a href="#SpellCheckMixin.__setLanguage">__setLanguage</a></td> |
|
393 <td>Private slot to set the selected language.</td> |
|
394 </tr> |
|
395 <tr> |
|
396 <td><a href="#SpellCheckMixin.__spellMenuTriggered">__spellMenuTriggered</a></td> |
|
397 <td>Private slot to handle a selection of the spell menu.</td> |
|
398 </tr> |
|
399 <tr> |
|
400 <td><a href="#SpellCheckMixin.contextMenuEvent">contextMenuEvent</a></td> |
|
401 <td>Protected method to handle context menu events to add a spelling suggestions submenu.</td> |
|
402 </tr> |
|
403 <tr> |
|
404 <td><a href="#SpellCheckMixin.dict">dict</a></td> |
|
405 <td>Public method to get a reference to the dictionary in use.</td> |
|
406 </tr> |
|
407 <tr> |
|
408 <td><a href="#SpellCheckMixin.setDict">setDict</a></td> |
|
409 <td>Public method to set the dictionary to be used.</td> |
|
410 </tr> |
|
411 <tr> |
|
412 <td><a href="#SpellCheckMixin.setFormat">setFormat</a></td> |
|
413 <td>Public method to set the document format.</td> |
|
414 </tr> |
|
415 <tr> |
|
416 <td><a href="#SpellCheckMixin.setLanguage">setLanguage</a></td> |
|
417 <td>Public slot to set the spellchecker language.</td> |
|
418 </tr> |
|
419 <tr> |
|
420 <td><a href="#SpellCheckMixin.setLanguageWithPWL">setLanguageWithPWL</a></td> |
|
421 <td>Public slot to set the spellchecker language and associated user word lists.</td> |
|
422 </tr> |
|
423 </table> |
|
424 <h3>Static Methods</h3> |
|
425 |
|
426 <table> |
|
427 <tr><td>None</td></tr> |
|
428 </table> |
|
429 |
|
430 <a NAME="SpellCheckMixin.setDefaultLanguage" ID="SpellCheckMixin.setDefaultLanguage"></a> |
|
431 <h4>SpellCheckMixin.setDefaultLanguage (class method)</h4> |
|
432 <b>setDefaultLanguage</b>(<i>language, pwl=None, pel=None</i>) |
|
433 |
|
434 <p> |
|
435 Class method to set the default spell-check language. |
|
436 </p> |
|
437 <dl> |
|
438 |
|
439 <dt><i>language</i> (str)</dt> |
|
440 <dd> |
|
441 language to be set as default |
|
442 </dd> |
|
443 <dt><i>pwl</i> (str)</dt> |
|
444 <dd> |
|
445 file name of the personal word list |
|
446 </dd> |
|
447 <dt><i>pel</i> (str)</dt> |
|
448 <dd> |
|
449 file name of the personal exclude list |
|
450 </dd> |
|
451 </dl> |
|
452 <a NAME="SpellCheckMixin.__init__" ID="SpellCheckMixin.__init__"></a> |
|
453 <h4>SpellCheckMixin (Constructor)</h4> |
|
454 <b>SpellCheckMixin</b>(<i></i>) |
|
455 |
|
456 <p> |
|
457 Constructor |
|
458 </p> |
|
459 <a NAME="SpellCheckMixin.__addRemoveEntry" ID="SpellCheckMixin.__addRemoveEntry"></a> |
|
460 <h4>SpellCheckMixin.__addRemoveEntry</h4> |
|
461 <b>__addRemoveEntry</b>(<i>cursor, menu</i>) |
|
462 |
|
463 <p> |
|
464 Private method to create a menu entry to remove the word at the |
|
465 menu position. |
|
466 </p> |
|
467 <dl> |
|
468 |
|
469 <dt><i>cursor</i> (QTextCursor)</dt> |
|
470 <dd> |
|
471 reference to the text cursor for the misspelled word |
|
472 </dd> |
|
473 <dt><i>menu</i> (QMenu)</dt> |
|
474 <dd> |
|
475 reference to the context menu |
|
476 </dd> |
|
477 </dl> |
|
478 <a NAME="SpellCheckMixin.__addToUserDict" ID="SpellCheckMixin.__addToUserDict"></a> |
|
479 <h4>SpellCheckMixin.__addToUserDict</h4> |
|
480 <b>__addToUserDict</b>(<i>word, command</i>) |
|
481 |
|
482 <p> |
|
483 Private method to add a word to the user word or exclude list. |
|
484 </p> |
|
485 <dl> |
|
486 |
|
487 <dt><i>word</i> (str)</dt> |
|
488 <dd> |
|
489 text to be added |
|
490 </dd> |
|
491 <dt><i>command</i> (str)</dt> |
|
492 <dd> |
|
493 command indicating the user dictionary type |
|
494 </dd> |
|
495 </dl> |
|
496 <a NAME="SpellCheckMixin.__correctWord" ID="SpellCheckMixin.__correctWord"></a> |
|
497 <h4>SpellCheckMixin.__correctWord</h4> |
|
498 <b>__correctWord</b>(<i>cursor, word</i>) |
|
499 |
|
500 <p> |
|
501 Private method to replace some misspelled text. |
|
502 </p> |
|
503 <dl> |
|
504 |
|
505 <dt><i>cursor</i> (QTextCursor)</dt> |
|
506 <dd> |
|
507 reference to the text cursor for the misspelled word |
|
508 </dd> |
|
509 <dt><i>word</i> (str)</dt> |
|
510 <dd> |
|
511 replacement text |
|
512 </dd> |
|
513 </dl> |
|
514 <a NAME="SpellCheckMixin.__createCorrectionsMenu" ID="SpellCheckMixin.__createCorrectionsMenu"></a> |
|
515 <h4>SpellCheckMixin.__createCorrectionsMenu</h4> |
|
516 <b>__createCorrectionsMenu</b>(<i>cursor, parent=None</i>) |
|
517 |
|
518 <p> |
|
519 Private method to create a menu for corrections of the selected |
|
520 word. |
|
521 </p> |
|
522 <dl> |
|
523 |
|
524 <dt><i>cursor</i> (QTextCursor)</dt> |
|
525 <dd> |
|
526 reference to the text cursor |
|
527 </dd> |
|
528 <dt><i>parent</i> (QWidget (optional))</dt> |
|
529 <dd> |
|
530 reference to the parent widget (defaults to None) |
|
531 </dd> |
|
532 </dl> |
|
533 <dl> |
|
534 <dt>Return:</dt> |
|
535 <dd> |
|
536 menu with corrections |
|
537 </dd> |
|
538 </dl> |
|
539 <dl> |
|
540 <dt>Return Type:</dt> |
|
541 <dd> |
|
542 QMenu |
|
543 </dd> |
|
544 </dl> |
|
545 <a NAME="SpellCheckMixin.__createFormatsMenu" ID="SpellCheckMixin.__createFormatsMenu"></a> |
|
546 <h4>SpellCheckMixin.__createFormatsMenu</h4> |
|
547 <b>__createFormatsMenu</b>(<i>parent=None</i>) |
|
548 |
|
549 <p> |
|
550 Private method to create a menu for selecting the document format. |
|
551 </p> |
|
552 <dl> |
|
553 |
|
554 <dt><i>parent</i> (QWidget (optional))</dt> |
|
555 <dd> |
|
556 reference to the parent widget (defaults to None) |
|
557 </dd> |
|
558 </dl> |
|
559 <dl> |
|
560 <dt>Return:</dt> |
|
561 <dd> |
|
562 menu with document formats |
|
563 </dd> |
|
564 </dl> |
|
565 <dl> |
|
566 <dt>Return Type:</dt> |
|
567 <dd> |
|
568 QMenu |
|
569 </dd> |
|
570 </dl> |
|
571 <a NAME="SpellCheckMixin.__createLanguagesMenu" ID="SpellCheckMixin.__createLanguagesMenu"></a> |
|
572 <h4>SpellCheckMixin.__createLanguagesMenu</h4> |
|
573 <b>__createLanguagesMenu</b>(<i>parent=None</i>) |
|
574 |
|
575 <p> |
|
576 Private method to create a menu for selecting the spell-check |
|
577 language. |
|
578 </p> |
|
579 <dl> |
|
580 |
|
581 <dt><i>parent</i> (QWidget (optional))</dt> |
|
582 <dd> |
|
583 reference to the parent widget (defaults to None) |
|
584 </dd> |
|
585 </dl> |
|
586 <dl> |
|
587 <dt>Return:</dt> |
|
588 <dd> |
|
589 menu with spell-check languages |
|
590 </dd> |
|
591 </dl> |
|
592 <dl> |
|
593 <dt>Return Type:</dt> |
|
594 <dd> |
|
595 QMenu |
|
596 </dd> |
|
597 </dl> |
|
598 <a NAME="SpellCheckMixin.__createSpellcheckContextMenu" ID="SpellCheckMixin.__createSpellcheckContextMenu"></a> |
|
599 <h4>SpellCheckMixin.__createSpellcheckContextMenu</h4> |
|
600 <b>__createSpellcheckContextMenu</b>(<i>pos</i>) |
|
601 |
|
602 <p> |
|
603 Private method to create the spell-check context menu. |
|
604 </p> |
|
605 <dl> |
|
606 |
|
607 <dt><i>pos</i> (QPoint)</dt> |
|
608 <dd> |
|
609 position of the mouse pointer |
|
610 </dd> |
|
611 </dl> |
|
612 <dl> |
|
613 <dt>Return:</dt> |
|
614 <dd> |
|
615 context menu with additional spell-check entries |
|
616 </dd> |
|
617 </dl> |
|
618 <dl> |
|
619 <dt>Return Type:</dt> |
|
620 <dd> |
|
621 QMenu |
|
622 </dd> |
|
623 </dl> |
|
624 <a NAME="SpellCheckMixin.__cursorForMisspelling" ID="SpellCheckMixin.__cursorForMisspelling"></a> |
|
625 <h4>SpellCheckMixin.__cursorForMisspelling</h4> |
|
626 <b>__cursorForMisspelling</b>(<i>pos</i>) |
|
627 |
|
628 <p> |
|
629 Private method to create a text cursor selecting the misspelled |
|
630 word. |
|
631 </p> |
|
632 <dl> |
|
633 |
|
634 <dt><i>pos</i> (QPoint)</dt> |
|
635 <dd> |
|
636 position of the misspelled word |
|
637 </dd> |
|
638 </dl> |
|
639 <dl> |
|
640 <dt>Return:</dt> |
|
641 <dd> |
|
642 text cursor for the misspelled word |
|
643 </dd> |
|
644 </dl> |
|
645 <dl> |
|
646 <dt>Return Type:</dt> |
|
647 <dd> |
|
648 QTextCursor |
|
649 </dd> |
|
650 </dl> |
|
651 <a NAME="SpellCheckMixin.__cursorForPosition" ID="SpellCheckMixin.__cursorForPosition"></a> |
|
652 <h4>SpellCheckMixin.__cursorForPosition</h4> |
|
653 <b>__cursorForPosition</b>(<i>pos</i>) |
|
654 |
|
655 <p> |
|
656 Private method to create a text cursor selecting the word at the |
|
657 given position. |
|
658 </p> |
|
659 <dl> |
|
660 |
|
661 <dt><i>pos</i> (QPoint)</dt> |
|
662 <dd> |
|
663 position of the misspelled word |
|
664 </dd> |
|
665 </dl> |
|
666 <dl> |
|
667 <dt>Return:</dt> |
|
668 <dd> |
|
669 text cursor for the word |
|
670 </dd> |
|
671 </dl> |
|
672 <dl> |
|
673 <dt>Return Type:</dt> |
|
674 <dd> |
|
675 QTextCursor |
|
676 </dd> |
|
677 </dl> |
|
678 <a NAME="SpellCheckMixin.__setFormat" ID="SpellCheckMixin.__setFormat"></a> |
|
679 <h4>SpellCheckMixin.__setFormat</h4> |
|
680 <b>__setFormat</b>(<i>act</i>) |
|
681 |
|
682 <p> |
|
683 Private slot to set the selected document format. |
|
684 </p> |
|
685 <dl> |
|
686 |
|
687 <dt><i>act</i> (QAction)</dt> |
|
688 <dd> |
|
689 reference to the selected action |
|
690 </dd> |
|
691 </dl> |
|
692 <a NAME="SpellCheckMixin.__setLanguage" ID="SpellCheckMixin.__setLanguage"></a> |
|
693 <h4>SpellCheckMixin.__setLanguage</h4> |
|
694 <b>__setLanguage</b>(<i>act</i>) |
|
695 |
|
696 <p> |
|
697 Private slot to set the selected language. |
|
698 </p> |
|
699 <dl> |
|
700 |
|
701 <dt><i>act</i> (QAction)</dt> |
|
702 <dd> |
|
703 reference to the selected action |
|
704 </dd> |
|
705 </dl> |
|
706 <a NAME="SpellCheckMixin.__spellMenuTriggered" ID="SpellCheckMixin.__spellMenuTriggered"></a> |
|
707 <h4>SpellCheckMixin.__spellMenuTriggered</h4> |
|
708 <b>__spellMenuTriggered</b>(<i>act</i>) |
|
709 |
|
710 <p> |
|
711 Private slot to handle a selection of the spell menu. |
|
712 </p> |
|
713 <dl> |
|
714 |
|
715 <dt><i>act</i> (QAction)</dt> |
|
716 <dd> |
|
717 reference to the selected action |
|
718 </dd> |
|
719 </dl> |
|
720 <a NAME="SpellCheckMixin.contextMenuEvent" ID="SpellCheckMixin.contextMenuEvent"></a> |
|
721 <h4>SpellCheckMixin.contextMenuEvent</h4> |
|
722 <b>contextMenuEvent</b>(<i>evt</i>) |
|
723 |
|
724 <p> |
|
725 Protected method to handle context menu events to add a spelling |
|
726 suggestions submenu. |
|
727 </p> |
|
728 <dl> |
|
729 |
|
730 <dt><i>evt</i> (QContextMenuEvent)</dt> |
|
731 <dd> |
|
732 reference to the context menu event |
|
733 </dd> |
|
734 </dl> |
|
735 <a NAME="SpellCheckMixin.dict" ID="SpellCheckMixin.dict"></a> |
|
736 <h4>SpellCheckMixin.dict</h4> |
|
737 <b>dict</b>(<i></i>) |
|
738 |
|
739 <p> |
|
740 Public method to get a reference to the dictionary in use. |
|
741 </p> |
|
742 <dl> |
|
743 <dt>Return:</dt> |
|
744 <dd> |
|
745 reference to the current dictionary |
|
746 </dd> |
|
747 </dl> |
|
748 <dl> |
|
749 <dt>Return Type:</dt> |
|
750 <dd> |
|
751 enchant.Dict |
|
752 </dd> |
|
753 </dl> |
|
754 <a NAME="SpellCheckMixin.setDict" ID="SpellCheckMixin.setDict"></a> |
|
755 <h4>SpellCheckMixin.setDict</h4> |
|
756 <b>setDict</b>(<i>spellDict</i>) |
|
757 |
|
758 <p> |
|
759 Public method to set the dictionary to be used. |
|
760 </p> |
|
761 <dl> |
|
762 |
|
763 <dt><i>spellDict</i> (emchant.Dict)</dt> |
|
764 <dd> |
|
765 reference to the spell-check dictionary |
|
766 </dd> |
|
767 </dl> |
|
768 <a NAME="SpellCheckMixin.setFormat" ID="SpellCheckMixin.setFormat"></a> |
|
769 <h4>SpellCheckMixin.setFormat</h4> |
|
770 <b>setFormat</b>(<i>formatName</i>) |
|
771 |
|
772 <p> |
|
773 Public method to set the document format. |
|
774 </p> |
|
775 <dl> |
|
776 |
|
777 <dt><i>formatName</i> (str)</dt> |
|
778 <dd> |
|
779 name of the document format |
|
780 </dd> |
|
781 </dl> |
|
782 <a NAME="SpellCheckMixin.setLanguage" ID="SpellCheckMixin.setLanguage"></a> |
|
783 <h4>SpellCheckMixin.setLanguage</h4> |
|
784 <b>setLanguage</b>(<i>language</i>) |
|
785 |
|
786 <p> |
|
787 Public slot to set the spellchecker language. |
|
788 </p> |
|
789 <dl> |
|
790 |
|
791 <dt><i>language</i> (str)</dt> |
|
792 <dd> |
|
793 language to be set |
|
794 </dd> |
|
795 </dl> |
|
796 <a NAME="SpellCheckMixin.setLanguageWithPWL" ID="SpellCheckMixin.setLanguageWithPWL"></a> |
|
797 <h4>SpellCheckMixin.setLanguageWithPWL</h4> |
|
798 <b>setLanguageWithPWL</b>(<i>language, pwl, pel</i>) |
|
799 |
|
800 <p> |
|
801 Public slot to set the spellchecker language and associated user |
|
802 word lists. |
|
803 </p> |
|
804 <dl> |
|
805 |
|
806 <dt><i>language</i> (str)</dt> |
|
807 <dd> |
|
808 language to be set |
|
809 </dd> |
|
810 <dt><i>pwl</i> (str)</dt> |
|
811 <dd> |
|
812 file name of the personal word list |
|
813 </dd> |
|
814 <dt><i>pel</i> (str)</dt> |
|
815 <dd> |
|
816 file name of the personal exclude list |
|
817 </dd> |
|
818 </dl> |
|
819 <div align="right"><a href="#top">Up</a></div> |
|
820 <hr /> |
|
821 <hr /> |
|
822 <a NAME="SpellCheckMixin_1" ID="SpellCheckMixin_1"></a> |
|
823 <h2>SpellCheckMixin</h2> |
|
824 |
|
825 <p> |
|
826 Class implementing the spell-check mixin for the widget classes. |
|
827 </p> |
|
828 <h3>Derived from</h3> |
|
829 None |
|
830 <h3>Class Attributes</h3> |
|
831 |
|
832 <table> |
|
833 <tr><td>None</td></tr> |
|
834 </table> |
|
835 <h3>Class Methods</h3> |
|
836 |
|
837 <table> |
|
838 |
|
839 <tr> |
|
840 <td><a href="#SpellCheckMixin_1.setDefaultLanguage">setDefaultLanguage</a></td> |
|
841 <td>Class method to set the default spell-check language.</td> |
|
842 </tr> |
|
843 </table> |
|
844 <h3>Methods</h3> |
|
845 |
|
846 <table> |
|
847 |
|
848 <tr> |
|
849 <td><a href="#SpellCheckMixin_1.__init__">SpellCheckMixin</a></td> |
|
850 <td>Constructor</td> |
|
851 </tr> |
|
852 <tr> |
|
853 <td><a href="#SpellCheckMixin_1.dict">dict</a></td> |
|
854 <td>Public method to get a reference to the dictionary in use.</td> |
|
855 </tr> |
|
856 <tr> |
|
857 <td><a href="#SpellCheckMixin_1.setDict">setDict</a></td> |
|
858 <td>Public method to set the dictionary to be used.</td> |
|
859 </tr> |
|
860 <tr> |
|
861 <td><a href="#SpellCheckMixin_1.setFormat">setFormat</a></td> |
|
862 <td>Public method to set the document format.</td> |
|
863 </tr> |
|
864 <tr> |
|
865 <td><a href="#SpellCheckMixin_1.setLanguage">setLanguage</a></td> |
|
866 <td>Public slot to set the spellchecker language.</td> |
|
867 </tr> |
|
868 <tr> |
|
869 <td><a href="#SpellCheckMixin_1.setLanguageWithPWL">setLanguageWithPWL</a></td> |
|
870 <td>Public slot to set the spellchecker language and associated user word lists.</td> |
|
871 </tr> |
|
872 </table> |
|
873 <h3>Static Methods</h3> |
|
874 |
|
875 <table> |
|
876 <tr><td>None</td></tr> |
|
877 </table> |
|
878 |
|
879 <a NAME="SpellCheckMixin_1.setDefaultLanguage" ID="SpellCheckMixin_1.setDefaultLanguage"></a> |
|
880 <h4>SpellCheckMixin.setDefaultLanguage (class method)</h4> |
|
881 <b>setDefaultLanguage</b>(<i>language, pwl=None, pel=None</i>) |
|
882 |
|
883 <p> |
|
884 Class method to set the default spell-check language. |
|
885 </p> |
|
886 <dl> |
|
887 |
|
888 <dt><i>language</i> (str)</dt> |
|
889 <dd> |
|
890 language to be set as default |
|
891 </dd> |
|
892 <dt><i>pwl</i> (str)</dt> |
|
893 <dd> |
|
894 file name of the personal word list |
|
895 </dd> |
|
896 <dt><i>pel</i> (str)</dt> |
|
897 <dd> |
|
898 file name of the personal exclude list |
|
899 </dd> |
|
900 </dl> |
|
901 <a NAME="SpellCheckMixin_1.__init__" ID="SpellCheckMixin_1.__init__"></a> |
|
902 <h4>SpellCheckMixin (Constructor)</h4> |
|
903 <b>SpellCheckMixin</b>(<i></i>) |
|
904 |
|
905 <p> |
|
906 Constructor |
|
907 </p> |
|
908 <a NAME="SpellCheckMixin_1.dict" ID="SpellCheckMixin_1.dict"></a> |
|
909 <h4>SpellCheckMixin.dict</h4> |
|
910 <b>dict</b>(<i></i>) |
|
911 |
|
912 <p> |
|
913 Public method to get a reference to the dictionary in use. |
|
914 </p> |
|
915 <dl> |
|
916 <dt>Return:</dt> |
|
917 <dd> |
|
918 reference to the current dictionary |
|
919 </dd> |
|
920 </dl> |
|
921 <dl> |
|
922 <dt>Return Type:</dt> |
|
923 <dd> |
|
924 enchant.Dict |
|
925 </dd> |
|
926 </dl> |
|
927 <a NAME="SpellCheckMixin_1.setDict" ID="SpellCheckMixin_1.setDict"></a> |
|
928 <h4>SpellCheckMixin.setDict</h4> |
|
929 <b>setDict</b>(<i>spellDict</i>) |
|
930 |
|
931 <p> |
|
932 Public method to set the dictionary to be used. |
|
933 </p> |
|
934 <dl> |
|
935 |
|
936 <dt><i>spellDict</i> (emchant.Dict)</dt> |
|
937 <dd> |
|
938 reference to the spell-check dictionary |
|
939 </dd> |
|
940 </dl> |
|
941 <a NAME="SpellCheckMixin_1.setFormat" ID="SpellCheckMixin_1.setFormat"></a> |
|
942 <h4>SpellCheckMixin.setFormat</h4> |
|
943 <b>setFormat</b>(<i>formatName</i>) |
|
944 |
|
945 <p> |
|
946 Public method to set the document format. |
|
947 </p> |
|
948 <dl> |
|
949 |
|
950 <dt><i>formatName</i> (str)</dt> |
|
951 <dd> |
|
952 name of the document format |
|
953 </dd> |
|
954 </dl> |
|
955 <a NAME="SpellCheckMixin_1.setLanguage" ID="SpellCheckMixin_1.setLanguage"></a> |
|
956 <h4>SpellCheckMixin.setLanguage</h4> |
|
957 <b>setLanguage</b>(<i>language</i>) |
|
958 |
|
959 <p> |
|
960 Public slot to set the spellchecker language. |
|
961 </p> |
|
962 <dl> |
|
963 |
|
964 <dt><i>language</i> (str)</dt> |
|
965 <dd> |
|
966 language to be set |
|
967 </dd> |
|
968 </dl> |
|
969 <a NAME="SpellCheckMixin_1.setLanguageWithPWL" ID="SpellCheckMixin_1.setLanguageWithPWL"></a> |
|
970 <h4>SpellCheckMixin.setLanguageWithPWL</h4> |
|
971 <b>setLanguageWithPWL</b>(<i>language, pwl, pel</i>) |
|
972 |
|
973 <p> |
|
974 Public slot to set the spellchecker language and associated user |
|
975 word lists. |
|
976 </p> |
|
977 <dl> |
|
978 |
|
979 <dt><i>language</i> (str)</dt> |
|
980 <dd> |
|
981 language to be set |
|
982 </dd> |
|
983 <dt><i>pwl</i> (str)</dt> |
|
984 <dd> |
|
985 file name of the personal word list |
|
986 </dd> |
|
987 <dt><i>pel</i> (str)</dt> |
|
988 <dd> |
|
989 file name of the personal exclude list |
|
990 </dd> |
|
991 </dl> |
|
992 <div align="right"><a href="#top">Up</a></div> |
|
993 <hr /> |
|
994 </body></html> |