QtSpell
0.7.4
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 | 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... | |
![]() | |
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 | checkSpelling (int start=0, int end=-1) |
Check the spelling. More... | |
void | clearUndoRedo () |
Clears the undo/redo stack. More... | |
void | setUndoRedoEnabled (bool enabled) |
Sets whether undo/redo functionality is enabled. More... | |
![]() | |
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 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 219 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 170 of file TextEditChecker.cpp.
References QtSpell::Checker::checkWord(), and QtSpell::TextCursor::moveWordEnd().
void QtSpell::TextEditChecker::clearUndoRedo | ( | ) |
Clears the undo/redo stack.
Definition at line 216 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 240 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 253 of file TextEditChecker.cpp.
|
inlineprivatevirtual |
Returns whether a widget is attached to the checker.
Implements QtSpell::Checker.
Definition at line 309 of file QtSpell.hpp.
|
slot |
Redo the last edit operation.
Definition at line 337 of file TextEditChecker.cpp.
|
signal |
Emitted when the redo stak changes.
available | Whether redo steps are available. |
Referenced by setUndoRedoEnabled().
void QtSpell::TextEditChecker::setTextEdit | ( | QTextEdit * | textEdit | ) |
Set the QTextEdit to check.
textEdit | The QTextEdit to check, or 0 to detach. |
Definition at line 105 of file TextEditChecker.cpp.
Referenced by setTextEdit(), and ~TextEditChecker().
void QtSpell::TextEditChecker::setTextEdit | ( | QPlainTextEdit * | textEdit | ) |
Set the QPlainTextEdit to check.
textEdit | The QPlainTextEdit to check, or 0 to detach. |
Definition at line 110 of file TextEditChecker.cpp.
References setTextEdit().
void QtSpell::TextEditChecker::setUndoRedoEnabled | ( | bool | enabled | ) |
Sets whether undo/redo functionality is enabled.
enabled | Whether undo/redo is enabled. |
Definition at line 223 of file TextEditChecker.cpp.
References redoAvailable(), and undoAvailable().
|
slot |
Undo the last edit operation.
Definition at line 327 of file TextEditChecker.cpp.
|
signal |
Emitted when the undo stack changes.
available | Whether undo steps are available. |
Referenced by setUndoRedoEnabled().