ResizableTextEdit: Store current text
This commit is contained in:
parent
dc8520ebec
commit
40f3e828aa
|
@ -46,6 +46,8 @@ void ResizableTextEdit::resizeEvent(QResizeEvent *e) {
|
||||||
|
|
||||||
void ResizableTextEdit::SetText(const QString &text) {
|
void ResizableTextEdit::SetText(const QString &text) {
|
||||||
|
|
||||||
|
text_ = text;
|
||||||
|
|
||||||
QTextEdit::setText(text);
|
QTextEdit::setText(text);
|
||||||
|
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
|
|
|
@ -32,12 +32,16 @@ class ResizableTextEdit : public QTextEdit {
|
||||||
|
|
||||||
virtual QSize sizeHint() const override;
|
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) { SetText(text); }
|
||||||
void SetText(const QString &text);
|
void SetText(const QString &text);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void resizeEvent(QResizeEvent *event) override;
|
virtual void resizeEvent(QResizeEvent *event) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString text_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RESIZABLETEXTEDIT_H
|
#endif // RESIZABLETEXTEDIT_H
|
||||||
|
|
Loading…
Reference in New Issue