From eeb31ad10a1c1b26233f383de6d1b2b217cde08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Mon, 21 Jan 2013 11:01:12 +0100 Subject: Keep QLineEdit placeholder text visible when focused This is useful when the widget is focused by default, and also gives another opportunity to the user to read the message before typing, removing the need for workarounds like clicking in another text entry to bring back the placeholder message. Change-Id: I4a2981a6656a87934b5c8ed4a8a2dc13b748c94d Reviewed-by: Gabriel de Dietrich Reviewed-by: Olivier Goffart Reviewed-by: Jens Bache-Wiig --- examples/widgets/widgets/lineedits/window.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'examples/widgets/widgets') diff --git a/examples/widgets/widgets/lineedits/window.cpp b/examples/widgets/widgets/lineedits/window.cpp index 0749e8d4fd..a0871e7c77 100644 --- a/examples/widgets/widgets/lineedits/window.cpp +++ b/examples/widgets/widgets/lineedits/window.cpp @@ -55,6 +55,7 @@ Window::Window() echoComboBox->addItem(tr("No Echo")); echoLineEdit = new QLineEdit; + echoLineEdit->setPlaceholderText("Placeholder Text"); echoLineEdit->setFocus(); //! [0] @@ -68,6 +69,7 @@ Window::Window() validatorComboBox->addItem(tr("Double validator")); validatorLineEdit = new QLineEdit; + validatorLineEdit->setPlaceholderText("Placeholder Text"); //! [1] //! [2] @@ -80,6 +82,7 @@ Window::Window() alignmentComboBox->addItem(tr("Right")); alignmentLineEdit = new QLineEdit; + alignmentLineEdit->setPlaceholderText("Placeholder Text"); //! [2] //! [3] @@ -93,6 +96,7 @@ Window::Window() inputMaskComboBox->addItem(tr("License key")); inputMaskLineEdit = new QLineEdit; + inputMaskLineEdit->setPlaceholderText("Placeholder Text"); //! [3] //! [4] @@ -104,6 +108,7 @@ Window::Window() accessComboBox->addItem(tr("True")); accessLineEdit = new QLineEdit; + accessLineEdit->setPlaceholderText("Placeholder Text"); //! [4] //! [5] -- cgit v1.2.3