From f703881b8176dfcc85b8d1cb3b8449722bb0ebf8 Mon Sep 17 00:00:00 2001 From: Andre de la Rocha Date: Thu, 30 Apr 2020 07:17:18 +0200 Subject: Fix Narrator spelling password characters in Quick TextInput Quick was not setting the "passwordEdit" accessible state for TextInput controls set with a password-editing echo mode. Thus the platform accessibility layer would not let the accessibility client (Microsoft Narrator, in the reported case) know that the text being edited was a password, making it spell the letters instead of something like "hidden". Fixes: QTBUG-82433 Change-Id: Ic659f031f6bad2ae3d7e500333dc8e2f27797a08 Reviewed-by: Friedemann Kleint Reviewed-by: Oliver Wolff (cherry picked from commit 788a3a183f8c49c1a88270c1456c3d47423df240) --- src/quick/accessible/qaccessiblequickitem.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/quick') diff --git a/src/quick/accessible/qaccessiblequickitem.cpp b/src/quick/accessible/qaccessiblequickitem.cpp index b87203c3ef..5e1ae25c38 100644 --- a/src/quick/accessible/qaccessiblequickitem.cpp +++ b/src/quick/accessible/qaccessiblequickitem.cpp @@ -43,6 +43,7 @@ #include "QtQuick/private/qquickitem_p.h" #include "QtQuick/private/qquicktext_p.h" +#include "QtQuick/private/qquicktextinput_p.h" #include "QtQuick/private/qquickaccessibleattached_p.h" #include "QtQuick/qquicktextdocument.h" QT_BEGIN_NAMESPACE @@ -197,6 +198,9 @@ QAccessible::State QAccessibleQuickItem::state() const state.focusable = true; if (item()->hasActiveFocus()) state.focused = true; + if (role() == QAccessible::EditableText) + if (auto ti = qobject_cast(item())) + state.passwordEdit = ti->echoMode() != QQuickTextInput::Normal; return state; } -- cgit v1.2.3