QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
A widget for editing rich text documents, with support for user controlled formatting of text and insertion of hyperlinks and images. More...
#include <qgsrichtexteditor.h>
Public Slots | |
void | clearSource () |
Clears the current text from the widget. More... | |
void | setText (const QString &text) |
Sets the text to show in the widget. More... | |
Public Member Functions | |
QgsRichTextEditor (QWidget *parent=nullptr) | |
Constructor for QgsRichTextEditor, with the specified parent widget. More... | |
QTextDocument * | document () |
Returns a reference to the QTextDocument shown in the widget. More... | |
void | setTextCursor (const QTextCursor &cursor) |
Sets the current text cursor. More... | |
QTextCursor | textCursor () const |
Returns a reference to the text cursor. More... | |
QString | toHtml () const |
Returns the widget's content as a HTML string. More... | |
QString | toPlainText () const |
Returns the widget's content as a plain text string. More... | |
Protected Member Functions | |
void | focusInEvent (QFocusEvent *event) override |
A widget for editing rich text documents, with support for user controlled formatting of text and insertion of hyperlinks and images.
QgsRichTextEditor provides a reusable widget for allowing users to edit rich text documents, and retrieving and setting the documents via HTML formatted strings.
Definition at line 58 of file qgsrichtexteditor.h.
QgsRichTextEditor::QgsRichTextEditor | ( | QWidget * | parent = nullptr | ) |
Constructor for QgsRichTextEditor, with the specified parent widget.
Definition at line 52 of file qgsrichtexteditor.cpp.
|
slot |
Clears the current text from the widget.
Definition at line 284 of file qgsrichtexteditor.cpp.
|
inline |
Returns a reference to the QTextDocument shown in the widget.
Definition at line 85 of file qgsrichtexteditor.h.
|
overrideprotected |
Definition at line 327 of file qgsrichtexteditor.cpp.
|
slot |
Sets the text to show in the widget.
The text can either be a plain text string or a HTML document.
Definition at line 684 of file qgsrichtexteditor.cpp.
|
inline |
Sets the current text cursor.
Definition at line 99 of file qgsrichtexteditor.h.
|
inline |
Returns a reference to the text cursor.
Definition at line 92 of file qgsrichtexteditor.h.
QString QgsRichTextEditor::toHtml | ( | ) | const |
Returns the widget's content as a HTML string.
Definition at line 235 of file qgsrichtexteditor.cpp.
QString QgsRichTextEditor::toPlainText | ( | ) | const |
Returns the widget's content as a plain text string.
Definition at line 220 of file qgsrichtexteditor.cpp.