|
QtSpell
0.9.0
Spell checking for Qt text widgets
|
Checker class for QTextEdit widgets. More...
#include <QtSpell.hpp>
Inherits QtSpell::Checker.
Public Slots | |
| void | undo () |
| Undo the last edit operation. More... | |
| void | redo () |
| Redo the last edit operation. More... | |
| void | clearUndoRedo () |
| Clears the undo/redo stack. More... | |
Public Slots inherited from QtSpell::Checker | |
| void | setSpellingEnabled (bool enabled) |
| Set whether spell checking should be performed. More... | |
Signals | |
| void | undoAvailable (bool available) |
| Emitted when the undo stack changes. More... | |
| void | redoAvailable (bool available) |
| Emitted when the redo stak changes. More... | |
Signals inherited from QtSpell::Checker | |
| void | languageChanged (const QString &newLang) |
| This signal is emitted when the user selects a new language from the spellchecker UI. More... | |
Public Member Functions | |
| TextEditChecker (QObject *parent=0) | |
| TextEditChecker object constructor. | |
| ~TextEditChecker () | |
| TextEditChecker object destructor. | |
| void | setTextEdit (QTextEdit *textEdit) |
| Set the QTextEdit to check. More... | |
| void | setTextEdit (QPlainTextEdit *textEdit) |
| Set the QPlainTextEdit to check. More... | |
| void | setNoSpellingPropertyId (int propertyId) |
| Set the QTextCharFormat property identifier which marks whether a word ought to be spell-checked. More... | |
| int | noSpellingPropertyId () const |
| Returns the current QTextCharFormat property identifier which marks whether a word ought to be spell-checked. More... | |
| void | checkSpelling (int start=0, int end=-1) |
| Check the spelling. More... | |
| void | setUndoRedoEnabled (bool enabled) |
| Sets whether undo/redo functionality is enabled. More... | |
Public Member Functions inherited from QtSpell::Checker | |
| Checker (QObject *parent=0) | |
| QtSpell::Checker object constructor. | |
| virtual | ~Checker () |
| QtSpell::Checker object destructor. | |
| bool | setLanguage (const QString &lang) |
| Set the spell checking language. More... | |
| const QString & | getLanguage () const |
| Retreive the current spelling language. More... | |
| void | setDecodeLanguageCodes (bool decode) |
| Set whether to decode language codes in the UI. More... | |
| bool | getDecodeLanguageCodes () const |
| Return whether langauge codes are decoded in the UI. More... | |
| void | setShowCheckSpellingCheckbox (bool show) |
| Set whether to display an "Check spelling" checkbox in the UI. More... | |
| bool | getShowCheckSpellingCheckbox () const |
| Return whether a "Check spelling" checkbox is displayed in the UI. More... | |
| bool | getSpellingEnabled () const |
| Return whether spellchecking is performed. More... | |
| void | addWordToDictionary (const QString &word) |
| Add the specified word to the user dictionary. More... | |
| bool | checkWord (const QString &word) const |
| Check the specified word. More... | |
| void | ignoreWord (const QString &word) const |
| Ignore a word for the current session. More... | |
| QList< QString > | getSpellingSuggestions (const QString &word) const |
| Retreive a list of spelling suggestions for the misspelled word. More... | |
Private Member Functions | |
| QString | getWord (int pos, int *start=0, int *end=0) const |
| Get the word at the specified cursor position. More... | |
| void | insertWord (int start, int end, const QString &word) |
| Replaces the specified range with the specified word. More... | |
| bool | isAttached () const |
| Returns whether a widget is attached to the checker. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from QtSpell::Checker | |
| static QList< QString > | getLanguageList () |
| Requests the list of languages available for spell checking. More... | |
| static QString | decodeLanguageCode (const QString &lang) |
| Translates a language code to a human readable format (i.e. "en_US" -> "English (United States)"). More... | |
Checker class for QTextEdit widgets.
Sample usage:
Definition at line 231 of file QtSpell.hpp.
|
virtual |
Check the spelling.
| start | The start position within the buffer. |
| end | The end position within the buffer (-1 for the buffer end). |
Implements QtSpell::Checker.
Definition at line 167 of file TextEditChecker.cpp.
References QtSpell::Checker::checkWord(), and QtSpell::TextCursor::moveWordEnd().
|
slot |
Clears the undo/redo stack.
Definition at line 237 of file TextEditChecker.cpp.
|
privatevirtual |
Get the word at the specified cursor position.
| pos | The cursor position. |
| start | If not 0, will contain the start position of the word. |
| end | If not 0, will contain the end position of the word. |
Implements QtSpell::Checker.
Definition at line 261 of file TextEditChecker.cpp.
References QtSpell::TextCursor::moveWordStart().
|
privatevirtual |
Replaces the specified range with the specified word.
| start | The start position. |
| end | The end position. |
| word | The word to insert. |
Implements QtSpell::Checker.
Definition at line 274 of file TextEditChecker.cpp.
|
inlineprivatevirtual |
Returns whether a widget is attached to the checker.
Implements QtSpell::Checker.
Definition at line 340 of file QtSpell.hpp.
|
inline |
Returns the current QTextCharFormat property identifier which marks whether a word ought to be spell-checked.
Definition at line 273 of file QtSpell.hpp.
|
slot |
Redo the last edit operation.
Definition at line 357 of file TextEditChecker.cpp.
|
signal |
Emitted when the redo stak changes.
| available | Whether redo steps are available. |
Referenced by setUndoRedoEnabled().
|
inline |
Set the QTextCharFormat property identifier which marks whether a word ought to be spell-checked.
| propertyId | By default this is -1, meaning that no such property is set. To enable, pass a value above QTextFormat::UserProperty. |
Definition at line 266 of file QtSpell.hpp.
| void QtSpell::TextEditChecker::setTextEdit | ( | QPlainTextEdit * | textEdit | ) |
Set the QPlainTextEdit to check.
| textEdit | The QPlainTextEdit to check, or 0 to detach. |
Definition at line 107 of file TextEditChecker.cpp.
References setTextEdit().
| void QtSpell::TextEditChecker::setTextEdit | ( | QTextEdit * | textEdit | ) |
Set the QTextEdit to check.
| textEdit | The QTextEdit to check, or 0 to detach. |
Definition at line 102 of file TextEditChecker.cpp.
Referenced by setTextEdit(), and ~TextEditChecker().
| void QtSpell::TextEditChecker::setUndoRedoEnabled | ( | bool | enabled | ) |
Sets whether undo/redo functionality is enabled.
| enabled | Whether undo/redo is enabled. |
Definition at line 244 of file TextEditChecker.cpp.
References redoAvailable(), and undoAvailable().
|
slot |
Undo the last edit operation.
Definition at line 347 of file TextEditChecker.cpp.
|
signal |
Emitted when the undo stack changes.
| available | Whether undo steps are available. |
Referenced by setUndoRedoEnabled().
1.8.16