Use placeholder text for accessible description of QLineEdit

If the accessible description of a QLineEdit is requested and none has been
set, the placeholder text will be provided if one is available.

Change-Id: I4c0dad1d06fd3d8a6e00c963402d380c59bd7f05
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
bb10
José Millán Soto 2017-09-15 00:30:38 +02:00 committed by Frederik Gladhorn
parent 10b9ff0a4d
commit 2e0849e79c
1 changed files with 2 additions and 0 deletions

View File

@ -704,6 +704,8 @@ QString QAccessibleLineEdit::text(QAccessible::Text t) const
}
if (str.isEmpty())
str = QAccessibleWidget::text(t);
if (str.isEmpty() && t == QAccessible::Description)
str = lineEdit()->placeholderText();
return str;
}