hide placeholder text when QLineEdit has preedit text

Change-Id: Ica84e9ce715702b690906ef748970e16d9162c4b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Aurélien Gâteau <agateau@kde.org>
This commit is contained in:
Tasuku Suzuki 2013-05-27 00:37:18 +09:00 committed by The Qt Project
parent 0a55499c9a
commit 46106c4e16

View File

@ -1802,7 +1802,7 @@ void QLineEdit::paintEvent(QPaintEvent *)
int minLB = qMax(0, -fm.minLeftBearing()); int minLB = qMax(0, -fm.minLeftBearing());
int minRB = qMax(0, -fm.minRightBearing()); int minRB = qMax(0, -fm.minRightBearing());
if (d->control->text().isEmpty()) { if (d->control->text().isEmpty() && d->control->preeditAreaText().isEmpty()) {
if (!d->placeholderText.isEmpty()) { if (!d->placeholderText.isEmpty()) {
QColor col = pal.text().color(); QColor col = pal.text().color();
col.setAlpha(128); col.setAlpha(128);