|
void | selectionFinished () |
| Emitted whenever the user has finished making a selection.
|
|
void | textModeChanged (KRichTextEdit::Mode mode) |
| Emitted whenever the text mode is changed.
|
|
void | aboutToShowContextMenu (QMenu *menu) |
| Emitted before the context menu is displayed.
|
|
void | checkSpellingChanged (bool) |
| emit signal when we activate or not autospellchecking
|
|
void | languageChanged (const QString &language) |
| Emitted when the user changes the language in the spellcheck dialog shown by checkSpelling() or when calling setSpellCheckingLanguage().
|
|
void | spellCheckerAutoCorrect (const QString ¤tWord, const QString &autoCorrectWord) |
|
void | spellCheckingCanceled () |
| signal spellCheckingCanceled is sent when we cancel spell checking.
|
|
void | spellCheckingFinished () |
| signal spellCheckingFinished is sent when we finish spell check or we click on "Terminate" button in sonnet dialogbox
|
|
void | spellCheckStatus (const QString &) |
| Signal sends when spell checking is finished/stopped/completed.
|
|
|
void | alignCenter () |
| Sets the alignment of the current block to Centered.
|
|
void | alignJustify () |
| Sets the alignment of the current block to Justified.
|
|
void | alignLeft () |
| Sets the alignment of the current block to Left Aligned.
|
|
void | alignRight () |
| Sets the alignment of the current block to Right Aligned.
|
|
void | indentListLess () |
| Decreases the nesting level of the current block or selected blocks.
|
|
void | indentListMore () |
| Increases the nesting level of the current block or selected blocks.
|
|
void | insertHorizontalRule () |
| Inserts a horizontal rule below the current block.
|
|
void | insertPlainTextImplementation () |
|
void | makeLeftToRight () |
| Sets the direction of the current block to Left-To-Right.
|
|
void | makeRightToLeft () |
| Sets the direction of the current block to Right-To-Left.
|
|
void | setFont (const QFont &font) |
| Sets the current word or selection to the font font.
|
|
void | setFontFamily (const QString &fontFamily) |
| Sets the current word or selection to the font family fontFamily.
|
|
void | setFontSize (int size) |
| Sets the current word or selection to the font size size.
|
|
void | setHeadingLevel (int level) |
| Sets the heading level of a current block or selection.
|
|
void | setListStyle (int _styleIndex) |
| Sets the list style of the current list, or creates a new list using the current block.
|
|
void | setTextBackgroundColor (const QColor &color) |
| Sets the background color of the current word or selection to color.
|
|
void | setTextBold (bool bold) |
| Toggles the bold formatting of the current word or selection at the current cursor position.
|
|
void | setTextForegroundColor (const QColor &color) |
| Sets the foreground color of the current word or selection to color.
|
|
void | setTextItalic (bool italic) |
| Toggles the italic formatting of the current word or selection at the current cursor position.
|
|
void | setTextStrikeOut (bool strikeOut) |
| Toggles the strikeout formatting of the current word or selection at the current cursor position.
|
|
void | setTextSubScript (bool subscript) |
| Toggles the subscript formatting of the current word or selection at the current cursor position.
|
|
void | setTextSuperScript (bool superscript) |
| Toggles the superscript formatting of the current word or selection at the current cursor position.
|
|
void | setTextUnderline (bool underline) |
| Toggles the underline formatting of the current word or selection at the current cursor position.
|
|
void | switchToPlainText () |
| This will switch the editor to plain text mode.
|
|
QString | toCleanHtml () const |
| This will clean some of the bad html produced by the underlying QTextEdit It walks over all lines and cleans up a bit.
|
|
void | addTextDecorator (Sonnet::SpellCheckDecorator *decorator) |
| Add custom spell checker decorator.
|
|
void | checkSpelling () |
| Show a dialog to check the spelling.
|
|
void | clearDecorator () |
| clearDecorator clear the spellcheckerdecorator
|
|
void | replace () |
| Create replace dialogbox.
|
|
void | setSpellCheckingLanguage (const QString &language) |
| Set the spell check language which will be used for highlighting spelling mistakes and for the spellcheck dialog.
|
|
void | showSpellConfigDialog (const QString &windowIcon=QString()) |
| Opens a Sonnet::ConfigDialog for this text edit.
|
|
|
| KRichTextEdit (const QString &text, QWidget *parent=nullptr) |
| Constructs a KRichTextEdit object.
|
|
| KRichTextEdit (QWidget *parent=nullptr) |
| Constructs a KRichTextEdit object.
|
|
| ~KRichTextEdit () override |
| Destructor.
|
|
bool | canDedentList () const |
| Returns true if the list item at the current position can be dedented.
|
|
bool | canIndentList () const |
| Returns true if the list item at the current position can be indented.
|
|
QString | currentLinkText () const |
| Returns the text of the link at the current position or an empty string if the cursor is not on a link.
|
|
QString | currentLinkUrl () const |
| Returns the URL target (href) of the link at the current position or an empty string if the cursor is not on a link.
|
|
void | enableRichTextMode () |
| This enables rich text mode.
|
|
void | selectLinkText () const |
| Convenience function to select the link text using the active cursor.
|
|
void | selectLinkText (QTextCursor *cursor) const |
| If the cursor is on a link, sets the cursor to a selection of the text of the link.
|
|
void | setTextOrHtml (const QString &text) |
| Replaces all the content of the text edit with the given string.
|
|
Mode | textMode () const |
|
QString | textOrHtml () const |
|
void | updateLink (const QString &linkUrl, const QString &linkText) |
| Replaces the current selection with a hyperlink with the link URL linkUrl and the link text linkText.
|
|
| KTextEdit (const QString &text, QWidget *parent=nullptr) |
| Constructs a KTextEdit object.
|
|
| KTextEdit (QWidget *parent=nullptr) |
| Constructs a KTextEdit object.
|
|
| ~KTextEdit () override |
| Destroys the KTextEdit object.
|
|
virtual bool | checkSpellingEnabled () const |
| Returns true if background spell checking is enabled for this text edit.
|
|
virtual void | createHighlighter () |
| Allows to create a specific highlighter if reimplemented.
|
|
void | enableFindReplace (bool enabled) |
| Enable find replace action.
|
|
void | forceSpellChecking () |
|
Sonnet::Highlighter * | highlighter () const |
| Returns the current highlighter, which is 0 if spell checking is disabled.
|
|
void | highlightWord (int length, int pos) |
| Selects the characters at the specified position.
|
|
virtual QMenu * | mousePopupMenu () |
| Return standard KTextEdit popupMenu.
|
|
virtual void | setCheckSpellingEnabled (bool check) |
| Turns background spell checking for this text edit on or off.
|
|
void | setHighlighter (Sonnet::Highlighter *_highLighter) |
| Sets a custom background spell highlighter for this text edit.
|
|
virtual void | setReadOnly (bool readOnly) |
| Reimplemented to set a proper "deactivated" background color.
|
|
virtual bool | shouldBlockBeSpellChecked (const QString &block) const |
| Returns true if the given paragraph or block should be spellcheck.
|
|
void | showAutoCorrectButton (bool show) |
|
void | showTabAction (bool show) |
|
const QString & | spellCheckingLanguage () const |
|
|
| __attribute__ ((visibility("hidden"))) KRichTextEdit(KRichTextEditPrivate &dd |
|
| __attribute__ ((visibility("hidden"))) KRichTextEdit(KRichTextEditPrivate &dd |
|
void | keyPressEvent (QKeyEvent *event) override |
| Reimplemented.
|
|
KTEXTWIDGETS_NO_EXPORT | KTextEdit (KTextEditPrivate &dd, const QString &text, QWidget *parent) |
|
KTEXTWIDGETS_NO_EXPORT | KTextEdit (KTextEditPrivate &dd, QWidget *parent) |
|
void | contextMenuEvent (QContextMenuEvent *) override |
| Reimplemented from QTextEdit to add spelling related items when appropriate.
|
|
virtual void | deleteWordBack () |
| Deletes a word backwards from the current cursor position, if available.
|
|
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.
|
|
void | focusInEvent (QFocusEvent *) override |
| Reimplemented to instantiate a KDictSpellingHighlighter, if spellchecking is enabled.
|
|
void | keyPressEvent (QKeyEvent *) override |
| Reimplemented for internal reasons.
|
|
The KRichTextEdit class provides a widget to edit and display rich text.
It offers several additional rich text editing functions to KTextEdit and makes them easier to access including:
- Changing fonts, sizes.
- Font formatting, such as bold, underline, italic, foreground and background color.
- Paragraph alignment
- Ability to edit and remove hyperlinks
- Nested list handling
- Simple actions to insert tables. TODO
The KRichTextEdit can be in two modes: Rich text mode and plain text mode. Calling functions which modify the format/style of the text will automatically enable the rich text mode. Rich text mode is sometimes also referred to as HTML mode.
Do not call setAcceptRichText() or acceptRichText() yourself. Instead simply connect to the slots which insert the rich text, use switchToPlainText() or enableRichTextMode().
KRichTextEdit Widget
- Since
- 4.1