11#include "ktextwidgets_export.h"
15#include <sonnet/highlighter.h>
19class SpellCheckDecorator;
22class KTextEditPrivate;
45class KTEXTWIDGETS_EXPORT
KTextEdit :
public QTextEdit
48#if KTEXTWIDGETS_BUILD_DEPRECATED_SINCE(5, 0)
49 Q_PROPERTY(QString clickMessage READ clickMessage WRITE setClickMessage)
51 Q_PROPERTY(
bool checkSpellingEnabled READ checkSpellingEnabled WRITE setCheckSpellingEnabled)
52 Q_PROPERTY(QString spellCheckingLanguage READ spellCheckingLanguage WRITE setSpellCheckingLanguage)
59 explicit KTextEdit(
const QString &text, QWidget *parent =
nullptr);
184#if KTEXTWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0)
191 KTEXTWIDGETS_DEPRECATED_VERSION(5, 0,
"Use QTextEdit::setPlaceholderText(const QString&)")
192 inline
void setClickMessage(const QString &msg)
194 setPlaceholderText(msg);
198#if KTEXTWIDGETS_ENABLE_DEPRECATED_SINCE(5, 0)
203 KTEXTWIDGETS_DEPRECATED_VERSION(5, 0,
"Use QTextEdit::placeholderText()")
204 inline QString clickMessage()
const
206 return placeholderText();
338 void slotReplaceNext();
388 KTEXTWIDGETS_NO_EXPORT
KTextEdit(KTextEditPrivate &dd,
const QString &text, QWidget *parent);
389 KTEXTWIDGETS_NO_EXPORT
KTextEdit(KTextEditPrivate &dd, QWidget *parent);
395 std::unique_ptr<class KTextEditPrivate>
const d;
The KRichTextEdit class provides a widget to edit and display rich text.
Definition krichtextedit.h:51
A KRichTextEdit with common actions.
Definition krichtextwidget.h:40
A KDE'ified QTextEdit.
Definition ktextedit.h:46
void forceSpellChecking()
void clearDecorator()
clearDecorator clear the spellcheckerdecorator
virtual void setCheckSpellingEnabled(bool check)
Turns background spell checking for this text edit on or off.
void setSpellCheckingLanguage(const QString &language)
Set the spell check language which will be used for highlighting spelling mistakes and for the spellc...
virtual QMenu * mousePopupMenu()
Return standard KTextEdit popupMenu.
void checkSpelling()
Show a dialog to check the spelling.
void addTextDecorator(Sonnet::SpellCheckDecorator *decorator)
Add custom spell checker decorator.
void spellCheckingCanceled()
signal spellCheckingCanceled is sent when we cancel spell checking.
virtual void deleteWordBack()
Deletes a word backwards from the current cursor position, if available.
void showSpellConfigDialog(const QString &windowIcon=QString())
Opens a Sonnet::ConfigDialog for this text edit.
void highlightWord(int length, int pos)
Selects the characters at the specified position.
virtual bool shouldBlockBeSpellChecked(const QString &block) const
Returns true if the given paragraph or block should be spellcheck.
virtual bool checkSpellingEnabled() const
Returns true if background spell checking is enabled for this text edit.
KTextEdit(const QString &text, QWidget *parent=nullptr)
Constructs a KTextEdit object.
void replace()
Create replace dialogbox.
void enableFindReplace(bool enabled)
Enable find replace action.
void showAutoCorrectButton(bool show)
~KTextEdit() override
Destroys the KTextEdit object.
virtual void deleteWordForward()
Deletes a word forwards from the current cursor position, if available.
bool event(QEvent *) override
Reimplemented to catch "delete word" shortcut events.
virtual void createHighlighter()
Allows to create a specific highlighter if reimplemented.
void contextMenuEvent(QContextMenuEvent *) override
Reimplemented from QTextEdit to add spelling related items when appropriate.
void keyPressEvent(QKeyEvent *) override
Reimplemented for internal reasons.
void spellCheckingFinished()
signal spellCheckingFinished is sent when we finish spell check or we click on "Terminate" button in ...
void focusInEvent(QFocusEvent *) override
Reimplemented to instantiate a KDictSpellingHighlighter, if spellchecking is enabled.
const QString & spellCheckingLanguage() const
KTextEdit(QWidget *parent=nullptr)
Constructs a KTextEdit object.
void showTabAction(bool show)
void spellCheckerAutoCorrect(const QString ¤tWord, const QString &autoCorrectWord)
void setHighlighter(Sonnet::Highlighter *_highLighter)
Sets a custom background spell highlighter for this text edit.
void checkSpellingChanged(bool)
emit signal when we activate or not autospellchecking
void spellCheckStatus(const QString &)
Signal sends when spell checking is finished/stopped/completed.
void aboutToShowContextMenu(QMenu *menu)
Emitted before the context menu is displayed.
Sonnet::Highlighter * highlighter() const
Returns the current highlighter, which is 0 if spell checking is disabled.
virtual void setReadOnly(bool readOnly)
Reimplemented to set a proper "deactivated" background color.
void languageChanged(const QString &language)
Emitted when the user changes the language in the spellcheck dialog shown by checkSpelling() or when ...