From 864544eb1a72d4ae7d95ec26a172a539aa9d8437 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 6 Sep 2023 10:35:54 +0200 Subject: [PATCH] QFontComboBox: inform accessibility about model reset when filter changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signals are blocked explicitly, so the modelReset signal that would normally make the view update the accessibility framework does not work. Update accessibility explicitly. Fixes: QTBUG-114423 Change-Id: Iba6f0b9dfb258e85111326184d7899bf0570a5c1 Reviewed-by: Tor Arne Vestbø (cherry picked from commit a0b7eee6c6af8d233e3bb7bd5c39f9059ec994f0) Reviewed-by: Qt Cherry-pick Bot --- src/widgets/widgets/qfontcombobox.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/widgets/widgets/qfontcombobox.cpp b/src/widgets/widgets/qfontcombobox.cpp index 886ac64549c..799d70d2b4c 100644 --- a/src/widgets/widgets/qfontcombobox.cpp +++ b/src/widgets/widgets/qfontcombobox.cpp @@ -3,6 +3,7 @@ #include "qfontcombobox.h" +#include #include #include #include @@ -328,6 +329,13 @@ void QFontComboBoxPrivate::_q_updateModel() { const QSignalBlocker blocker(m); m->setStringList(list); + // Since the modelReset signal is blocked the view will not emit an accessibility event + #if QT_CONFIG(accessibility) + if (QAccessible::isActive()) { + QAccessibleTableModelChangeEvent accessibleEvent(q->view(), QAccessibleTableModelChangeEvent::ModelReset); + QAccessible::updateAccessibility(&accessibleEvent); + } + #endif } if (list.isEmpty()) {