96 void setMode( Mode mode );
103 QString toPlainText()
const;
110 QString toHtml()
const;
122 QTextDocument *
document() {
return mTextEdit->document(); }
129 QTextCursor
textCursor()
const {
return mTextEdit->textCursor(); }
136 void setTextCursor(
const QTextCursor &cursor ) { mTextEdit->setTextCursor( cursor ); }
145 void setText(
const QString &text );
162 void focusInEvent( QFocusEvent *event )
override;
165 void setPlainText(
const QString &text ) { mTextEdit->setPlainText( text ); }
166 void setHtml(
const QString &text ) { mTextEdit->setHtml( text ); }
167 void textRemoveFormat();
168 void textRemoveAllFormat();
170 void textUnderline();
171 void textStrikeout();
173 void textSize(
const QString &p );
174 void textLink(
bool checked );
175 void textStyle(
int index );
178 void listBullet(
bool checked );
179 void listOrdered(
bool checked );
180 void slotCurrentCharFormatChanged(
const QTextCharFormat &format );
181 void slotCursorPositionChanged();
182 void slotClipboardDataChanged();
183 void increaseIndentation();
184 void decreaseIndentation();
186 void editSource(
bool enabled );
189 void mergeFormatOnWordOrSelection(
const QTextCharFormat &format );
190 void fontChanged(
const QFont &f );
191 void fgColorChanged(
const QColor &
c );
192 void bgColorChanged(
const QColor &
c );
193 void list(
bool checked, QTextListFormat::Style style );
194 void indent(
int delta );
196 Mode mMode = Mode::QTextDocument;
198 int mFontSizeH1 = 18;
199 int mFontSizeH2 = 16;
200 int mFontSizeH3 = 14;
201 int mFontSizeH4 = 12;
205 ParagraphStandard = 0,
213 QComboBox *mParagraphStyleCombo =
nullptr;
214 QComboBox *mFontSizeCombo =
nullptr;
220 QPointer<QTextList> mLastBlockList;
221 QString mMonospaceFontFamily;
A widget for editing rich text documents, with support for user controlled formatting of text and ins...
QTextCursor textCursor() const
Returns a reference to the text cursor.
Mode mode() const
Returns the widget's mode, which defines which formatting options are exposed in the widget.
void setTextCursor(const QTextCursor &cursor)
Sets the current text cursor.
void textChanged()
Emitted when the text contents are changed.
QTextEdit * textEdit()
Returns the widget's QTextEditor control.
QTextDocument * document()
Returns a reference to the QTextDocument shown in the widget.
Handles rendering text using rich formatting options, including drop shadows, buffers and background ...