KDEUI
KTextEdit Class Reference
#include <ktextedit.h>

Detailed Description
A KDE'ified QTextEdit.This is just a little subclass of QTextEdit, implementing some standard KDE features, like cursor auto-hiding, configurable wheelscrolling (fast-scroll or zoom), spell checking and deleting of entire words with Ctrl-Backspace or Ctrl-Delete.
This text edit provides two ways of spell checking: background checking, which will mark incorrectly spelled words red, and a spell check dialog, which lets the user check and correct all incorrectly spelled words.
Basic rule: whenever you want to use QTextEdit, use KTextEdit!
- See also:
- QTextEdit
Definition at line 44 of file ktextedit.h.
Constructor & Destructor Documentation
Constructs a KTextEdit object.
See QTextEdit::QTextEdit for details.
Definition at line 205 of file ktextedit.cpp.
KTextEdit::KTextEdit | ( | QWidget * | parent = 0 |
) | [explicit] |
Constructs a KTextEdit object.
See QTextEdit::QTextEdit for details.
Definition at line 211 of file ktextedit.cpp.
KTextEdit::~KTextEdit | ( | ) |
Member Function Documentation
void KTextEdit::checkSpelling | ( | ) | [slot] |
Create a modal dialog to check the spelling.
This slot will not return until spell checking has been completed.
Definition at line 505 of file ktextedit.cpp.
void KTextEdit::checkSpellingChanged | ( | bool | ) | [signal] |
emit signal when we activate or not autospellchecking
- Since:
- 4.1
bool KTextEdit::checkSpellingEnabled | ( | ) | const |
Returns true if background spell checking is enabled for this text edit.
Note that it even returns true if this is a read-only KTextEdit, where spell checking is actually disabled. By default spell checking is disabled.
- See also:
- setCheckSpellingEnabled()
Definition at line 468 of file ktextedit.cpp.
void KTextEdit::contextMenuEvent | ( | QContextMenuEvent * | event | ) | [protected, virtual] |
Reimplemented from QTextEdit to add spelling related items when appropriate.
Reimplemented from QTextEdit.
Definition at line 404 of file ktextedit.cpp.
void KTextEdit::createHighlighter | ( | ) | [virtual] |
Allows to create a specific highlighter if reimplemented.
By default, it creates a normal highlighter, based on the config file given to setSpellCheckingConfigFileName().
This highlighter is set each time spell checking is toggled on by calling setCheckSpellingEnabled(), but can later be overridden by calling setHighlighter().
Definition at line 420 of file ktextedit.cpp.
void KTextEdit::deleteWordBack | ( | ) | [protected, virtual] |
Deletes a word backwards from the current cursor position, if available.
Definition at line 326 of file ktextedit.cpp.
void KTextEdit::deleteWordForward | ( | ) | [protected, virtual] |
Deletes a word forwards from the current cursor position, if available.
Definition at line 334 of file ktextedit.cpp.
void KTextEdit::enableFindReplace | ( | bool | enabled | ) |
void KTextEdit::focusInEvent | ( | QFocusEvent * | event | ) | [protected, virtual] |
Reimplemented to instantiate a KDictSpellingHighlighter, if spellchecking is enabled.
Definition at line 460 of file ktextedit.cpp.
Sonnet::Highlighter * KTextEdit::highlighter | ( | ) | const |
Returns the current highlighter, which is 0 if spell checking is disabled.
The default highlighter is the one created by createHighlighter(), but might be overridden by setHighlighter().
- See also:
- setHighlighter()
Definition at line 425 of file ktextedit.cpp.
void KTextEdit::highlightWord | ( | int | length, | |
int | pos | |||
) |
Selects the characters at the specified position.
Any previous selection will be lost. The cursor is moved to the first character of the new selection.
- Parameters:
-
length The length of the selection, in number of characters pos The position of the first character of the selection
Definition at line 538 of file ktextedit.cpp.
void KTextEdit::keyPressEvent | ( | QKeyEvent * | event | ) | [protected, virtual] |
Reimplemented for internal reasons.
Reimplemented in KRichTextEdit.
Definition at line 748 of file ktextedit.cpp.
void KTextEdit::languageChanged | ( | const QString & | language | ) | [signal] |
Emitted when the user changes the language in the spellcheck dialog shown by checkSpelling().
- Parameters:
-
language the new language the user selected
- Since:
- 4.1
QMenu * KTextEdit::mousePopupMenu | ( | ) |
void KTextEdit::replace | ( | ) | [slot] |
void KTextEdit::setCheckSpellingEnabled | ( | bool | check | ) |
Turns background spell checking for this text edit on or off.
Note that spell checking is only available in read-writable KTextEdits.
Enabling spell checking will set back the current highlighter to the one returned by createHighlighter().
- See also:
- checkSpellingEnabled()
isReadOnly()
Definition at line 436 of file ktextedit.cpp.
void KTextEdit::setHighlighter | ( | Sonnet::Highlighter * | _highLighter | ) |
Sets a custom backgound spell highlighter for this text edit.
Normally, the highlighter returned by createHighlighter() will be used to detect and highlight incorrectly spelled words, but this function allows to set a custom highlighter.
This has to be called after enabling spell checking with setCheckSpellingEnabled(), otherwise it has no effect.
- See also:
- highlighter()
- Parameters:
-
highLighter the new highlighter which will be used now
Definition at line 430 of file ktextedit.cpp.
void KTextEdit::setReadOnly | ( | bool | readOnly | ) | [virtual] |
Reimplemented to set a proper "deactivated" background color.
Definition at line 473 of file ktextedit.cpp.
void KTextEdit::setSpellCheckingConfigFileName | ( | const QString & | fileName | ) |
Allows to override the config file where the settings for spell checking, like the current language or encoding, are stored.
By default, the global config file (kdeglobals) is used, to share spell check settings between all applications.
This has to be called before any spell checking is initiated.
- Parameters:
-
fileName the URL of the config file which will be used to read spell settings
- Bug:
- this has no effect for the spell dialog, only for the background check
Definition at line 222 of file ktextedit.cpp.
void KTextEdit::setSpellCheckingLanguage | ( | const QString & | language | ) |
change default language for spell checking dialogbox
- Since:
- 4.1
Definition at line 227 of file ktextedit.cpp.
void KTextEdit::slotDoFind | ( | ) | [protected, slot] |
Definition at line 620 of file ktextedit.cpp.
void KTextEdit::slotDoReplace | ( | ) | [protected, slot] |
void KTextEdit::slotFind | ( | ) | [protected, slot] |
Definition at line 668 of file ktextedit.cpp.
void KTextEdit::slotFindNext | ( | ) | [protected, slot] |
Definition at line 646 of file ktextedit.cpp.
void KTextEdit::slotReplace | ( | ) | [protected, slot] |
Definition at line 683 of file ktextedit.cpp.
void KTextEdit::slotReplaceNext | ( | ) | [protected, slot] |
Definition at line 589 of file ktextedit.cpp.
void KTextEdit::spellCheckStatus | ( | const QString & | ) | [signal] |
Signal sends when spell checking is finished/stopped/completed.
- Since:
- 4.1
void KTextEdit::wheelEvent | ( | QWheelEvent * | event | ) | [protected, virtual] |
Reimplemented to allow fast-wheelscrolling with Ctrl-Wheel or zoom.
Definition at line 412 of file ktextedit.cpp.
The documentation for this class was generated from the following files: