diff options
author | Mikhail Svetkin <mikhail.svetkin@gmail.com> | 2013-12-26 22:41:39 +0600 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-23 07:53:53 +0100 |
commit | 382faed8c78335fe44828aee8ca6c0284bb9c9f7 (patch) | |
tree | 04130abbb261a901180981ff08e1daac1e61b116 /src/widgets/widgets/qplaintextedit.h | |
parent | ea8e48a6799cf742ea23f4a30dcfc38a4988fe56 (diff) |
Add a placeholderText property to QPlainTextEdit
Setting this property makes the editor display a grayed-out
placeholder text as long as the document() is empty.
Change-Id: I997edb867419613ff7cedc760a87c684a2ded711
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets/widgets/qplaintextedit.h')
-rw-r--r-- | src/widgets/widgets/qplaintextedit.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/widgets/qplaintextedit.h b/src/widgets/widgets/qplaintextedit.h index 81548818ef..c276c23571 100644 --- a/src/widgets/widgets/qplaintextedit.h +++ b/src/widgets/widgets/qplaintextedit.h @@ -83,6 +83,7 @@ class Q_WIDGETS_EXPORT QPlainTextEdit : public QAbstractScrollArea Q_PROPERTY(int maximumBlockCount READ maximumBlockCount WRITE setMaximumBlockCount) Q_PROPERTY(bool backgroundVisible READ backgroundVisible WRITE setBackgroundVisible) Q_PROPERTY(bool centerOnScroll READ centerOnScroll WRITE setCenterOnScroll) + Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText) public: enum LineWrapMode { NoWrap, @@ -96,6 +97,9 @@ public: void setDocument(QTextDocument *document); QTextDocument *document() const; + void setPlaceholderText(const QString &placeholderText); + QString placeholderText() const; + void setTextCursor(const QTextCursor &cursor); QTextCursor textCursor() const; |