From ba1aefa85da937b20b47e21e31feb2d330d005e3 Mon Sep 17 00:00:00 2001 From: Benjamin Port Date: Mon, 10 Jun 2013 16:57:28 +0200 Subject: [PATCH] Fix setPlaceholderText in QLineEdit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since we don't use focus to show/hide place holder text, we don't need to check widget focus but if text is empty. Change-Id: I37f2fdb9e20a64ca38c61e60190f95635695c613 Reviewed-by: Aurélien Gâteau Reviewed-by: David Faure (KDE) --- src/widgets/widgets/qlineedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp index 6d648f1126..8e218894d2 100644 --- a/src/widgets/widgets/qlineedit.cpp +++ b/src/widgets/widgets/qlineedit.cpp @@ -351,7 +351,7 @@ void QLineEdit::setPlaceholderText(const QString& placeholderText) Q_D(QLineEdit); if (d->placeholderText != placeholderText) { d->placeholderText = placeholderText; - if (!hasFocus()) + if (d->control->text().isEmpty()) update(); } }