97 void setMode( Mode mode );
104 QString toPlainText()
const;
111 QString toHtml()
const;
123 QTextDocument *
document() {
return mTextEdit->document(); }
130 QTextCursor
textCursor()
const {
return mTextEdit->textCursor(); }
137 void setTextCursor(
const QTextCursor &cursor ) { mTextEdit->setTextCursor( cursor ); }
146 void setText(
const QString &text );
163 void focusInEvent( QFocusEvent *event )
override;
166 void setPlainText(
const QString &text ) { mTextEdit->setPlainText( text ); }
167 void setHtml(
const QString &text ) { mTextEdit->setHtml( text ); }
168 void textRemoveFormat();
169 void textRemoveAllFormat();
171 void textUnderline();
172 void textStrikeout();
174 void textSize(
const QString &p );
175 void textLink(
bool checked );
176 void textStyle(
int index );
179 void listBullet(
bool checked );
180 void listOrdered(
bool checked );
181 void slotCurrentCharFormatChanged(
const QTextCharFormat &format );
182 void slotCursorPositionChanged();
183 void slotClipboardDataChanged();
184 void increaseIndentation();
185 void decreaseIndentation();
187 void editSource(
bool enabled );
190 void mergeFormatOnWordOrSelection(
const QTextCharFormat &format );
191 void fontChanged(
const QFont &f );
192 void fgColorChanged(
const QColor &
c );
193 void bgColorChanged(
const QColor &
c );
194 void list(
bool checked, QTextListFormat::Style style );
195 void indent(
int delta );
197 Mode mMode = Mode::QTextDocument;
199 int mFontSizeH1 = 18;
200 int mFontSizeH2 = 16;
201 int mFontSizeH3 = 14;
202 int mFontSizeH4 = 12;
206 ParagraphStandard = 0,
214 QComboBox *mParagraphStyleCombo =
nullptr;
215 QComboBox *mFontSizeCombo =
nullptr;
221 QPointer<QTextList> mLastBlockList;
222 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 ...