lib.spelltextedit.*¶
Provides
- class lib.spelltextedit.LineNumberArea(parent)[source]¶
Bases:
QWidget
- Parameters:
parent (
QPlainTextEdit
) – Editor in which the line numbers shall be displayed
- class lib.spelltextedit.PythonEnchantHighlighter(*args)[source]¶
Bases:
QSyntaxHighlighter
QSyntaxHighlighter subclass which consults a PyEnchant dictionary
- braces = ['\\{', '\\}', '\\(', '\\)', '\\[', '\\]']¶
- enable_enchant = False¶
- err_format = <PyQt5.QtGui.QTextCharFormat object>¶
- keywords = ['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']¶
- match_multiline(text, delimiter, in_state, style)[source]¶
Do highlighting of multi-line strings.
delimiter
should be a regex for triple-single-quotes or triple-double-quotes, andin_state
should be a unique integer to represent the corresponding state changes when inside those strings. Returns True if we’re still inside a multi-line string when this function is finished.
- operators = ['=', '==', '!=', '<', '<=', '>', '>=', '\\+', '-', '\\*', '/', '//', '\\%', '\\*\\*', '\\+=', '-=', '\\*=', '/=', '\\%=', '\\^', '\\|', '\\&', '\\~', '>>', '<<']¶
- class lib.spelltextedit.SpellTextEdit(parent=None, line_numbers=True, font_family='Monospace')[source]¶
Bases:
QPlainTextEdit
QPlainTextEdit subclass which does spell-checking using PyEnchant
- createCorrectionsMenu(cursor, parent=None)[source]¶
Create and return a menu for correcting the selected word.
- createFormatsMenu(parent=None)[source]¶
Create and return a menu for selecting the spell-check language.
- createLanguagesMenu(parent=None)[source]¶
Create and return a menu for selecting the spell-check language.
- createSpellcheckContextMenu(pos)[source]¶
Create and return an augmented default context menu.
This may be used as an alternative to the QPoint-taking form of
createStandardContextMenu
and will work on pre-5.5 Qt.
- cursorForMisspelling(pos)[source]¶
Return a cursor selecting the misspelled word at
pos
orNone
This leverages the fact that QPlainTextEdit already has a system for processing its contents in limited-size blocks to keep things fast.
- max_suggestions = 20¶
- show_line_numbers(visible)[source]¶
Show line number area if visible else hide it
- Parameters:
visible (
bool
) – Line number area visibility
- spaces_per_tab = 4¶