eric7/Documentation/Source/eric7.EricWidgets.EricSpellCheckedTextEdit.html

branch
eric7
changeset 8428
2deec2f8a9ab
parent 8427
5ccf32f95805
child 8432
074407b4c107
equal deleted inserted replaced
8427:5ccf32f95805 8428:2deec2f8a9ab
61 <hr /> 61 <hr />
62 <a NAME="EnchantHighlighter" ID="EnchantHighlighter"></a> 62 <a NAME="EnchantHighlighter" ID="EnchantHighlighter"></a>
63 <h2>EnchantHighlighter</h2> 63 <h2>EnchantHighlighter</h2>
64 64
65 <p> 65 <p>
66 Class implementing a QSyntaxHighlighter subclass that consults a 66 Class implementing a QSyntaxHighlighter subclass that consults a
67 pyEnchant dictionary to highlight misspelled words. 67 pyEnchant dictionary to highlight misspelled words.
68 </p> 68 </p>
69 <h3>Derived from</h3> 69 <h3>Derived from</h3>
70 QSyntaxHighlighter 70 QSyntaxHighlighter
71 <h3>Class Attributes</h3> 71 <h3>Class Attributes</h3>
72 72
116 <a NAME="EnchantHighlighter.__init__" ID="EnchantHighlighter.__init__"></a> 116 <a NAME="EnchantHighlighter.__init__" ID="EnchantHighlighter.__init__"></a>
117 <h4>EnchantHighlighter (Constructor)</h4> 117 <h4>EnchantHighlighter (Constructor)</h4>
118 <b>EnchantHighlighter</b>(<i>*args</i>) 118 <b>EnchantHighlighter</b>(<i>*args</i>)
119 119
120 <p> 120 <p>
121 Constructor 121 Constructor
122 </p> 122 </p>
123 <dl> 123 <dl>
124 124
125 <dt><i>*args</i> (list)</dt> 125 <dt><i>*args</i> (list)</dt>
126 <dd> 126 <dd>
130 <a NAME="EnchantHighlighter.chunkers" ID="EnchantHighlighter.chunkers"></a> 130 <a NAME="EnchantHighlighter.chunkers" ID="EnchantHighlighter.chunkers"></a>
131 <h4>EnchantHighlighter.chunkers</h4> 131 <h4>EnchantHighlighter.chunkers</h4>
132 <b>chunkers</b>(<i></i>) 132 <b>chunkers</b>(<i></i>)
133 133
134 <p> 134 <p>
135 Public method to get the chunkers in use. 135 Public method to get the chunkers in use.
136 </p> 136 </p>
137 <dl> 137 <dl>
138 <dt>Return:</dt> 138 <dt>Return:</dt>
139 <dd> 139 <dd>
140 list of chunkers in use 140 list of chunkers in use
149 <a NAME="EnchantHighlighter.dict" ID="EnchantHighlighter.dict"></a> 149 <a NAME="EnchantHighlighter.dict" ID="EnchantHighlighter.dict"></a>
150 <h4>EnchantHighlighter.dict</h4> 150 <h4>EnchantHighlighter.dict</h4>
151 <b>dict</b>(<i></i>) 151 <b>dict</b>(<i></i>)
152 152
153 <p> 153 <p>
154 Public method to get the spelling dictionary in use. 154 Public method to get the spelling dictionary in use.
155 </p> 155 </p>
156 <dl> 156 <dl>
157 <dt>Return:</dt> 157 <dt>Return:</dt>
158 <dd> 158 <dd>
159 spelling dictionary 159 spelling dictionary
168 <a NAME="EnchantHighlighter.highlightBlock" ID="EnchantHighlighter.highlightBlock"></a> 168 <a NAME="EnchantHighlighter.highlightBlock" ID="EnchantHighlighter.highlightBlock"></a>
169 <h4>EnchantHighlighter.highlightBlock</h4> 169 <h4>EnchantHighlighter.highlightBlock</h4>
170 <b>highlightBlock</b>(<i>text</i>) 170 <b>highlightBlock</b>(<i>text</i>)
171 171
172 <p> 172 <p>
173 Public method to apply the text highlight. 173 Public method to apply the text highlight.
174 </p> 174 </p>
175 <dl> 175 <dl>
176 176
177 <dt><i>text</i> (str)</dt> 177 <dt><i>text</i> (str)</dt>
178 <dd> 178 <dd>
182 <a NAME="EnchantHighlighter.setChunkers" ID="EnchantHighlighter.setChunkers"></a> 182 <a NAME="EnchantHighlighter.setChunkers" ID="EnchantHighlighter.setChunkers"></a>
183 <h4>EnchantHighlighter.setChunkers</h4> 183 <h4>EnchantHighlighter.setChunkers</h4>
184 <b>setChunkers</b>(<i>chunkers</i>) 184 <b>setChunkers</b>(<i>chunkers</i>)
185 185
186 <p> 186 <p>
187 Public method to set the chunkers to be used. 187 Public method to set the chunkers to be used.
188 </p> 188 </p>
189 <dl> 189 <dl>
190 190
191 <dt><i>chunkers</i> (list)</dt> 191 <dt><i>chunkers</i> (list)</dt>
192 <dd> 192 <dd>
196 <a NAME="EnchantHighlighter.setDict" ID="EnchantHighlighter.setDict"></a> 196 <a NAME="EnchantHighlighter.setDict" ID="EnchantHighlighter.setDict"></a>
197 <h4>EnchantHighlighter.setDict</h4> 197 <h4>EnchantHighlighter.setDict</h4>
198 <b>setDict</b>(<i>spellDict</i>) 198 <b>setDict</b>(<i>spellDict</i>)
199 199
200 <p> 200 <p>
201 Public method to set the spelling dictionary to be used. 201 Public method to set the spelling dictionary to be used.
202 </p> 202 </p>
203 <dl> 203 <dl>
204 204
205 <dt><i>spellDict</i> (enchant.Dict)</dt> 205 <dt><i>spellDict</i> (enchant.Dict)</dt>
206 <dd> 206 <dd>
212 <hr /> 212 <hr />
213 <a NAME="EricSpellCheckedPlainTextEdit" ID="EricSpellCheckedPlainTextEdit"></a> 213 <a NAME="EricSpellCheckedPlainTextEdit" ID="EricSpellCheckedPlainTextEdit"></a>
214 <h2>EricSpellCheckedPlainTextEdit</h2> 214 <h2>EricSpellCheckedPlainTextEdit</h2>
215 215
216 <p> 216 <p>
217 Class implementing a QPlainTextEdit with built-in spell checker. 217 Class implementing a QPlainTextEdit with built-in spell checker.
218 </p> 218 </p>
219 <h3>Derived from</h3> 219 <h3>Derived from</h3>
220 QPlainTextEdit, SpellCheckMixin 220 QPlainTextEdit, SpellCheckMixin
221 <h3>Class Attributes</h3> 221 <h3>Class Attributes</h3>
222 222
246 <a NAME="EricSpellCheckedPlainTextEdit.__init__" ID="EricSpellCheckedPlainTextEdit.__init__"></a> 246 <a NAME="EricSpellCheckedPlainTextEdit.__init__" ID="EricSpellCheckedPlainTextEdit.__init__"></a>
247 <h4>EricSpellCheckedPlainTextEdit (Constructor)</h4> 247 <h4>EricSpellCheckedPlainTextEdit (Constructor)</h4>
248 <b>EricSpellCheckedPlainTextEdit</b>(<i>*args</i>) 248 <b>EricSpellCheckedPlainTextEdit</b>(<i>*args</i>)
249 249
250 <p> 250 <p>
251 Constructor 251 Constructor
252 </p> 252 </p>
253 <dl> 253 <dl>
254 254
255 <dt><i>*args</i> (list)</dt> 255 <dt><i>*args</i> (list)</dt>
256 <dd> 256 <dd>
262 <hr /> 262 <hr />
263 <a NAME="EricSpellCheckedTextEdit" ID="EricSpellCheckedTextEdit"></a> 263 <a NAME="EricSpellCheckedTextEdit" ID="EricSpellCheckedTextEdit"></a>
264 <h2>EricSpellCheckedTextEdit</h2> 264 <h2>EricSpellCheckedTextEdit</h2>
265 265
266 <p> 266 <p>
267 Class implementing a QTextEdit with built-in spell checker. 267 Class implementing a QTextEdit with built-in spell checker.
268 </p> 268 </p>
269 <h3>Derived from</h3> 269 <h3>Derived from</h3>
270 QTextEdit, SpellCheckMixin 270 QTextEdit, SpellCheckMixin
271 <h3>Class Attributes</h3> 271 <h3>Class Attributes</h3>
272 272
300 <a NAME="EricSpellCheckedTextEdit.__init__" ID="EricSpellCheckedTextEdit.__init__"></a> 300 <a NAME="EricSpellCheckedTextEdit.__init__" ID="EricSpellCheckedTextEdit.__init__"></a>
301 <h4>EricSpellCheckedTextEdit (Constructor)</h4> 301 <h4>EricSpellCheckedTextEdit (Constructor)</h4>
302 <b>EricSpellCheckedTextEdit</b>(<i>*args</i>) 302 <b>EricSpellCheckedTextEdit</b>(<i>*args</i>)
303 303
304 <p> 304 <p>
305 Constructor 305 Constructor
306 </p> 306 </p>
307 <dl> 307 <dl>
308 308
309 <dt><i>*args</i> (list)</dt> 309 <dt><i>*args</i> (list)</dt>
310 <dd> 310 <dd>
314 <a NAME="EricSpellCheckedTextEdit.setAcceptRichText" ID="EricSpellCheckedTextEdit.setAcceptRichText"></a> 314 <a NAME="EricSpellCheckedTextEdit.setAcceptRichText" ID="EricSpellCheckedTextEdit.setAcceptRichText"></a>
315 <h4>EricSpellCheckedTextEdit.setAcceptRichText</h4> 315 <h4>EricSpellCheckedTextEdit.setAcceptRichText</h4>
316 <b>setAcceptRichText</b>(<i>accept</i>) 316 <b>setAcceptRichText</b>(<i>accept</i>)
317 317
318 <p> 318 <p>
319 Public method to set the text edit mode. 319 Public method to set the text edit mode.
320 </p> 320 </p>
321 <dl> 321 <dl>
322 322
323 <dt><i>accept</i> (bool)</dt> 323 <dt><i>accept</i> (bool)</dt>
324 <dd> 324 <dd>
330 <hr /> 330 <hr />
331 <a NAME="SpellCheckMixin" ID="SpellCheckMixin"></a> 331 <a NAME="SpellCheckMixin" ID="SpellCheckMixin"></a>
332 <h2>SpellCheckMixin</h2> 332 <h2>SpellCheckMixin</h2>
333 333
334 <p> 334 <p>
335 Class implementing the spell-check mixin for the widget classes. 335 Class implementing the spell-check mixin for the widget classes.
336 </p> 336 </p>
337 <h3>Derived from</h3> 337 <h3>Derived from</h3>
338 None 338 None
339 <h3>Class Attributes</h3> 339 <h3>Class Attributes</h3>
340 340
341 <table> 341 <table>
342 <tr><td>MaxSuggestions</td></tr> 342 <tr><td>DefaultLanguage</td></tr><tr><td>MaxSuggestions</td></tr>
343 </table> 343 </table>
344 <h3>Class Methods</h3> 344 <h3>Class Methods</h3>
345 345
346 <table> 346 <table>
347 <tr><td>None</td></tr> 347
348 <tr>
349 <td><a href="#SpellCheckMixin.setDefaultLanguage">setDefaultLanguage</a></td>
350 <td>Class method to set the default spell-check language.</td>
351 </tr>
348 </table> 352 </table>
349 <h3>Methods</h3> 353 <h3>Methods</h3>
350 354
351 <table> 355 <table>
352 356
407 411
408 <table> 412 <table>
409 <tr><td>None</td></tr> 413 <tr><td>None</td></tr>
410 </table> 414 </table>
411 415
416 <a NAME="SpellCheckMixin.setDefaultLanguage" ID="SpellCheckMixin.setDefaultLanguage"></a>
417 <h4>SpellCheckMixin.setDefaultLanguage (class method)</h4>
418 <b>setDefaultLanguage</b>(<i>language</i>)
419
420 <p>
421 Class method to set the default spell-check language.
422 </p>
423 <dl>
424
425 <dt><i>language</i> (str)</dt>
426 <dd>
427 language to be set as default
428 </dd>
429 </dl>
412 <a NAME="SpellCheckMixin.__init__" ID="SpellCheckMixin.__init__"></a> 430 <a NAME="SpellCheckMixin.__init__" ID="SpellCheckMixin.__init__"></a>
413 <h4>SpellCheckMixin (Constructor)</h4> 431 <h4>SpellCheckMixin (Constructor)</h4>
414 <b>SpellCheckMixin</b>(<i></i>) 432 <b>SpellCheckMixin</b>(<i></i>)
415 433
416 <p> 434 <p>
417 Constructor 435 Constructor
418 </p> 436 </p>
419 <a NAME="SpellCheckMixin.__correctWord" ID="SpellCheckMixin.__correctWord"></a> 437 <a NAME="SpellCheckMixin.__correctWord" ID="SpellCheckMixin.__correctWord"></a>
420 <h4>SpellCheckMixin.__correctWord</h4> 438 <h4>SpellCheckMixin.__correctWord</h4>
421 <b>__correctWord</b>(<i>act</i>) 439 <b>__correctWord</b>(<i>act</i>)
422 440
423 <p> 441 <p>
424 Private slot to correct the misspelled word with the selected 442 Private slot to correct the misspelled word with the selected
425 correction. 443 correction.
426 </p> 444 </p>
427 <dl> 445 <dl>
428 446
429 <dt><i>act</i> (QAction)</dt> 447 <dt><i>act</i> (QAction)</dt>
430 <dd> 448 <dd>
434 <a NAME="SpellCheckMixin.__createCorrectionsMenu" ID="SpellCheckMixin.__createCorrectionsMenu"></a> 452 <a NAME="SpellCheckMixin.__createCorrectionsMenu" ID="SpellCheckMixin.__createCorrectionsMenu"></a>
435 <h4>SpellCheckMixin.__createCorrectionsMenu</h4> 453 <h4>SpellCheckMixin.__createCorrectionsMenu</h4>
436 <b>__createCorrectionsMenu</b>(<i>cursor, parent=None</i>) 454 <b>__createCorrectionsMenu</b>(<i>cursor, parent=None</i>)
437 455
438 <p> 456 <p>
439 Private method to create a menu for corrections of the selected word. 457 Private method to create a menu for corrections of the selected
458 word.
440 </p> 459 </p>
441 <dl> 460 <dl>
442 461
443 <dt><i>cursor</i> (QTextCursor)</dt> 462 <dt><i>cursor</i> (QTextCursor)</dt>
444 <dd> 463 <dd>
464 <a NAME="SpellCheckMixin.__createFormatsMenu" ID="SpellCheckMixin.__createFormatsMenu"></a> 483 <a NAME="SpellCheckMixin.__createFormatsMenu" ID="SpellCheckMixin.__createFormatsMenu"></a>
465 <h4>SpellCheckMixin.__createFormatsMenu</h4> 484 <h4>SpellCheckMixin.__createFormatsMenu</h4>
466 <b>__createFormatsMenu</b>(<i>parent=None</i>) 485 <b>__createFormatsMenu</b>(<i>parent=None</i>)
467 486
468 <p> 487 <p>
469 Private method to create a menu for selecting the document format. 488 Private method to create a menu for selecting the document format.
470 </p> 489 </p>
471 <dl> 490 <dl>
472 491
473 <dt><i>parent</i> (QWidget (optional))</dt> 492 <dt><i>parent</i> (QWidget (optional))</dt>
474 <dd> 493 <dd>
490 <a NAME="SpellCheckMixin.__createLanguagesMenu" ID="SpellCheckMixin.__createLanguagesMenu"></a> 509 <a NAME="SpellCheckMixin.__createLanguagesMenu" ID="SpellCheckMixin.__createLanguagesMenu"></a>
491 <h4>SpellCheckMixin.__createLanguagesMenu</h4> 510 <h4>SpellCheckMixin.__createLanguagesMenu</h4>
492 <b>__createLanguagesMenu</b>(<i>parent=None</i>) 511 <b>__createLanguagesMenu</b>(<i>parent=None</i>)
493 512
494 <p> 513 <p>
495 Private method to create a menu for selecting the spell-check language. 514 Private method to create a menu for selecting the spell-check
515 language.
496 </p> 516 </p>
497 <dl> 517 <dl>
498 518
499 <dt><i>parent</i> (QWidget (optional))</dt> 519 <dt><i>parent</i> (QWidget (optional))</dt>
500 <dd> 520 <dd>
516 <a NAME="SpellCheckMixin.__createSpellcheckContextMenu" ID="SpellCheckMixin.__createSpellcheckContextMenu"></a> 536 <a NAME="SpellCheckMixin.__createSpellcheckContextMenu" ID="SpellCheckMixin.__createSpellcheckContextMenu"></a>
517 <h4>SpellCheckMixin.__createSpellcheckContextMenu</h4> 537 <h4>SpellCheckMixin.__createSpellcheckContextMenu</h4>
518 <b>__createSpellcheckContextMenu</b>(<i>pos</i>) 538 <b>__createSpellcheckContextMenu</b>(<i>pos</i>)
519 539
520 <p> 540 <p>
521 Private method to create the spell-check context menu. 541 Private method to create the spell-check context menu.
522 </p> 542 </p>
523 <dl> 543 <dl>
524 544
525 <dt><i>pos</i> (QPoint)</dt> 545 <dt><i>pos</i> (QPoint)</dt>
526 <dd> 546 <dd>
542 <a NAME="SpellCheckMixin.__cursorForMisspelling" ID="SpellCheckMixin.__cursorForMisspelling"></a> 562 <a NAME="SpellCheckMixin.__cursorForMisspelling" ID="SpellCheckMixin.__cursorForMisspelling"></a>
543 <h4>SpellCheckMixin.__cursorForMisspelling</h4> 563 <h4>SpellCheckMixin.__cursorForMisspelling</h4>
544 <b>__cursorForMisspelling</b>(<i>pos</i>) 564 <b>__cursorForMisspelling</b>(<i>pos</i>)
545 565
546 <p> 566 <p>
547 Private method to create a text cursor selecting the misspelled word. 567 Private method to create a text cursor selecting the misspelled
568 word.
548 </p> 569 </p>
549 <dl> 570 <dl>
550 571
551 <dt><i>pos</i> (QPoint)</dt> 572 <dt><i>pos</i> (QPoint)</dt>
552 <dd> 573 <dd>
568 <a NAME="SpellCheckMixin.__setFormat" ID="SpellCheckMixin.__setFormat"></a> 589 <a NAME="SpellCheckMixin.__setFormat" ID="SpellCheckMixin.__setFormat"></a>
569 <h4>SpellCheckMixin.__setFormat</h4> 590 <h4>SpellCheckMixin.__setFormat</h4>
570 <b>__setFormat</b>(<i>act</i>) 591 <b>__setFormat</b>(<i>act</i>)
571 592
572 <p> 593 <p>
573 Private slot to set the selected document format. 594 Private slot to set the selected document format.
574 </p> 595 </p>
575 <dl> 596 <dl>
576 597
577 <dt><i>act</i> (QAction)</dt> 598 <dt><i>act</i> (QAction)</dt>
578 <dd> 599 <dd>
582 <a NAME="SpellCheckMixin.__setLanguage" ID="SpellCheckMixin.__setLanguage"></a> 603 <a NAME="SpellCheckMixin.__setLanguage" ID="SpellCheckMixin.__setLanguage"></a>
583 <h4>SpellCheckMixin.__setLanguage</h4> 604 <h4>SpellCheckMixin.__setLanguage</h4>
584 <b>__setLanguage</b>(<i>act</i>) 605 <b>__setLanguage</b>(<i>act</i>)
585 606
586 <p> 607 <p>
587 Private slot to set the selected language. 608 Private slot to set the selected language.
588 </p> 609 </p>
589 <dl> 610 <dl>
590 611
591 <dt><i>act</i> (QAction)</dt> 612 <dt><i>act</i> (QAction)</dt>
592 <dd> 613 <dd>
596 <a NAME="SpellCheckMixin.contextMenuEvent" ID="SpellCheckMixin.contextMenuEvent"></a> 617 <a NAME="SpellCheckMixin.contextMenuEvent" ID="SpellCheckMixin.contextMenuEvent"></a>
597 <h4>SpellCheckMixin.contextMenuEvent</h4> 618 <h4>SpellCheckMixin.contextMenuEvent</h4>
598 <b>contextMenuEvent</b>(<i>evt</i>) 619 <b>contextMenuEvent</b>(<i>evt</i>)
599 620
600 <p> 621 <p>
601 Protected method to handle context menu events to add a spelling 622 Protected method to handle context menu events to add a spelling
602 suggestions submenu. 623 suggestions submenu.
603 </p> 624 </p>
604 <dl> 625 <dl>
605 626
606 <dt><i>evt</i> (QContextMenuEvent)</dt> 627 <dt><i>evt</i> (QContextMenuEvent)</dt>
607 <dd> 628 <dd>
611 <a NAME="SpellCheckMixin.dict" ID="SpellCheckMixin.dict"></a> 632 <a NAME="SpellCheckMixin.dict" ID="SpellCheckMixin.dict"></a>
612 <h4>SpellCheckMixin.dict</h4> 633 <h4>SpellCheckMixin.dict</h4>
613 <b>dict</b>(<i></i>) 634 <b>dict</b>(<i></i>)
614 635
615 <p> 636 <p>
616 Public method to get a reference to the dictionary in use. 637 Public method to get a reference to the dictionary in use.
617 </p> 638 </p>
618 <dl> 639 <dl>
619 <dt>Return:</dt> 640 <dt>Return:</dt>
620 <dd> 641 <dd>
621 reference to the current dictionary 642 reference to the current dictionary
630 <a NAME="SpellCheckMixin.setDict" ID="SpellCheckMixin.setDict"></a> 651 <a NAME="SpellCheckMixin.setDict" ID="SpellCheckMixin.setDict"></a>
631 <h4>SpellCheckMixin.setDict</h4> 652 <h4>SpellCheckMixin.setDict</h4>
632 <b>setDict</b>(<i>spellDict</i>) 653 <b>setDict</b>(<i>spellDict</i>)
633 654
634 <p> 655 <p>
635 Public method to set the dictionary to be used. 656 Public method to set the dictionary to be used.
636 </p> 657 </p>
637 <dl> 658 <dl>
638 659
639 <dt><i>spellDict</i> (emchant.Dict)</dt> 660 <dt><i>spellDict</i> (emchant.Dict)</dt>
640 <dd> 661 <dd>
644 <a NAME="SpellCheckMixin.setFormat" ID="SpellCheckMixin.setFormat"></a> 665 <a NAME="SpellCheckMixin.setFormat" ID="SpellCheckMixin.setFormat"></a>
645 <h4>SpellCheckMixin.setFormat</h4> 666 <h4>SpellCheckMixin.setFormat</h4>
646 <b>setFormat</b>(<i>formatName</i>) 667 <b>setFormat</b>(<i>formatName</i>)
647 668
648 <p> 669 <p>
649 Public method to set the document format. 670 Public method to set the document format.
650 </p> 671 </p>
651 <dl> 672 <dl>
652 673
653 <dt><i>formatName</i> (str)</dt> 674 <dt><i>formatName</i> (str)</dt>
654 <dd> 675 <dd>

eric ide

mercurial