class KRichTextEdit |
|
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:
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(). @since 4.1 |
|
Constructs a KRichTextEdit object
text - The initial text of the text edit, which is interpreted as HTML. parent - The parent widget |
|
Constructs a KRichTextEdit object.
parent - The parent widget |
|
Sets the alignment of the current block to Centered |
|
Sets the alignment of the current block to Justified |
|
Sets the alignment of the current block to Left Aligned |
|
Sets the alignment of the current block to Right Aligned |
|
Returns true if the list item at the current position can be dedented.
See also canIndentList |
|
Returns true if the list item at the current position can be indented.
See also canDedentList |
|
Returns the text of the link at the current position or an empty string
if the cursor is not on a link.
See also currentLinkUrl Returns The link text |
|
Returns the URL target (href) of the link at the current position or an
empty string if the cursor is not on a link.
See also currentLinkText Returns The link target URL |
|
This enables rich text mode. Nothing is done except changing the internal mode and allowing rich text pastes. |
|
Decreases the nesting level of the current block or selected blocks.
See also canDedentList |
|
Increases the nesting level of the current block or selected blocks.
See also canIndentList |
|
Inserts a horizontal rule below the current block. |
|
Reimplemented. Catches key press events. Used to handle some key presses on lists. |
|
If the cursor is on a link, sets the cursor to a selection of the
text of the link. If the cursor is not on a link, selects the current word
or existing selection.
cursor - The cursor to use to select the text. See also updateLink |
|
Convenience function to select the link text using the active cursor.
See also selectLinkText |
|
Emitted whenever the user has finished making a selection. (on mouse up) |
|
Sets the current word or selection to the font font
font - the font of the text will be set to this font |
|
Sets the current word or selection to the font family fontFamily
fontFamily - The text's font family will be changed to this one |
|
Sets the current word or selection to the font size size
size - The text's font will get this size |
|
Sets the list style of the current list, or creates a new list using the
current block. The _styleindex corresponds to the QTextListFormat.Style
_styleIndex - The list will get this style |
|
Sets the background color of the current word or selection to color.
color - The text will get this foreground color |
|
Toggles the bold formatting of the current word or selection at the current
cursor position.
bold - If true, the text will be set to bold |
|
Sets the foreground color of the current word or selection to color.
color - The text will get this background color |
|
Toggles the italic formatting of the current word or selection at the current
cursor position.
italic - If true, the text will be set to italic |
|
Replaces all the content of the text edit with the given string.
If the string is in rich text format, the text is inserted as rich text,
otherwise it is inserted as plain text.
text - The text to insert |
|
Toggles the strikeout formatting of the current word or selection at the current
cursor position.
strikeOut - If true, the text will be struck out |
|
Toggles the underline formatting of the current word or selection at the current
cursor position.
underline - If true, the text will be underlined |
|
This will switch the editor to plain text mode. All rich text formatting will be destroyed. |
|
Returns The current text mode |
|
Emitted whenever the text mode is changed.
mode - The new text mode |
|
Returns The plain text string if in plain text mode or the HTML code if in rich text mode. The text is not word-wrapped. |
|
This will clean some of the bad html produced by the underlying QTextEdit It walks over all lines and cleans up a bit. Should be improved to produce our own Html. |
|
Replaces the current selection with a hyperlink with the link URL linkUrl
and the link text linkText.
See also selectLinkText See also currentLinkUrl See also currentLinkText linkUrl - The link will get this URL as href (target) linkText - The link will get this alternative text, which is the text displayed in the text edit. |
The mode the edit widget is in.
Plain | - | - | ||
Rich | - | - |