diff options
author | Benjamin Port <benjamin.port@ben2367.fr> | 2013-04-10 17:49:57 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-28 10:53:32 +0200 |
commit | aedeb1cca6112962284c477d5a2c240519910891 (patch) | |
tree | f270af824dcb19d8fe6ba379d6270c47ab6bf8e9 /src/widgets/widgets/qtextedit.h | |
parent | 7ed15da3c1b9e2bb26f414a10bfc6e6d79d7cc7b (diff) |
Added a placeholderText property to QTextEdit.
This commit adds a placeholder text for text edit. If text edit doesn't
have focus and the document() is empty, this placeholder will be shown.
Change-Id: I8b51f1a246452b63d6390e94853cf2864a7ff05f
Reviewed-by: David Faure (KDE) <faure@kde.org>
Diffstat (limited to 'src/widgets/widgets/qtextedit.h')
-rw-r--r-- | src/widgets/widgets/qtextedit.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h index e1471848e7..06ec5fb889 100644 --- a/src/widgets/widgets/qtextedit.h +++ b/src/widgets/widgets/qtextedit.h @@ -85,6 +85,7 @@ class Q_WIDGETS_EXPORT QTextEdit : public QAbstractScrollArea Q_PROPERTY(int cursorWidth READ cursorWidth WRITE setCursorWidth) Q_PROPERTY(Qt::TextInteractionFlags textInteractionFlags READ textInteractionFlags WRITE setTextInteractionFlags) Q_PROPERTY(QTextDocument *document READ document WRITE setDocument DESIGNABLE false) + Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText) public: enum LineWrapMode { NoWrap, @@ -108,6 +109,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; |