summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qlineedit.h
diff options
context:
space:
mode:
authorRobert Griebl <rgriebl@trolltech.com>2009-12-02 16:43:45 (GMT)
committerRobert Griebl <rgriebl@trolltech.com>2009-12-03 10:31:37 (GMT)
commit635a9da9c42834c0c9c3b2329db4aae408ce820a (patch)
tree8c8440b3a7a23484ceb29f08505c0f745d5f9d88 /src/gui/widgets/qlineedit.h
parente1ef51cdddf4187ab68d09f42438e45a6bbf85f4 (diff)
downloadQt-635a9da9c42834c0c9c3b2329db4aae408ce820a.zip
Qt-635a9da9c42834c0c9c3b2329db4aae408ce820a.tar.gz
Qt-635a9da9c42834c0c9c3b2329db4aae408ce820a.tar.bz2
Added a placeholderText(*) property to QLineEdit.
Please note: Qt for Maemo5 will already use it in 4.6, while the other platforms will be enabled in 4.7 (otherwise be would break BIC there) This commit adds a so-called placeholder text for line edits. If the widget doesn't have focus and the text() is empty, this placeholder will be shown. (*) also known as hint, click-message or descriptive text Reviewed-by: jasplin
Diffstat (limited to 'src/gui/widgets/qlineedit.h')
-rw-r--r--src/gui/widgets/qlineedit.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/widgets/qlineedit.h b/src/gui/widgets/qlineedit.h
index ac918c7..594e488 100644
--- a/src/gui/widgets/qlineedit.h
+++ b/src/gui/widgets/qlineedit.h
@@ -83,6 +83,10 @@ class Q_GUI_EXPORT QLineEdit : public QWidget
Q_PROPERTY(bool undoAvailable READ isUndoAvailable)
Q_PROPERTY(bool redoAvailable READ isRedoAvailable)
Q_PROPERTY(bool acceptableInput READ hasAcceptableInput)
+// ### Qt 4.7: remove this #if guard
+#if (QT_VERSION >= 0x407000) || defined(Q_WS_MAEMO_5)
+ Q_PROPERTY(QString placeholderText READ placeholderText WRITE setPlaceholderText)
+#endif
public:
explicit QLineEdit(QWidget* parent=0);
@@ -98,6 +102,12 @@ public:
QString displayText() const;
+// ### Qt 4.7: remove this #if guard
+#if (QT_VERSION >= 0x407000) || defined(Q_WS_MAEMO_5)
+ QString placeholderText() const;
+ void setPlaceholderText(const QString &);
+#endif
+
int maxLength() const;
void setMaxLength(int);