Fix setPlaceholderText in QLineEdit

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 <agateau@kde.org>
Reviewed-by: David Faure (KDE) <faure@kde.org>
This commit is contained in:
Benjamin Port 2013-06-10 16:57:28 +02:00 committed by The Qt Project
parent 062974bf1f
commit ba1aefa85d

View File

@ -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();
}
}