diff --git a/src/widgets/resizabletextedit.cpp b/src/widgets/resizabletextedit.cpp index 67b5e3183..2d44b7903 100644 --- a/src/widgets/resizabletextedit.cpp +++ b/src/widgets/resizabletextedit.cpp @@ -46,6 +46,8 @@ void ResizableTextEdit::resizeEvent(QResizeEvent *e) { void ResizableTextEdit::SetText(const QString &text) { + text_ = text; + QTextEdit::setText(text); updateGeometry(); diff --git a/src/widgets/resizabletextedit.h b/src/widgets/resizabletextedit.h index 28da1f5cb..2b020ef0c 100644 --- a/src/widgets/resizabletextedit.h +++ b/src/widgets/resizabletextedit.h @@ -32,12 +32,16 @@ class ResizableTextEdit : public QTextEdit { virtual QSize sizeHint() const override; + QString text() const { return Text(); } + QString Text() const { return text_; } void setText(const QString &text) { SetText(text); } void SetText(const QString &text); protected: virtual void resizeEvent(QResizeEvent *event) override; + private: + QString text_; }; #endif // RESIZABLETEXTEDIT_H