diff options
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 807c16875d..95fbcdc7df 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -6516,15 +6516,11 @@ void QWidget::setFocus(Qt::FocusReason reason) QApplicationPrivate::setFocusWidget(f, reason); #if QT_CONFIG(accessibility) - // If the widget gets focus because its window becomes active, then the accessibility - // subsystem is already informed about the window opening, and also knows which child - // within the window has focus. Don't interrupt it by emitting another focus event. - if (reason != Qt::ActiveWindowFocusReason) { - // menus update the focus manually and this would create bogus events - if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem"))) { - QAccessibleEvent event(f, QAccessible::Focus); - QAccessible::updateAccessibility(&event); - } + // menus update the focus manually and this would create bogus events + if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem"))) + { + QAccessibleEvent event(f, QAccessible::Focus); + QAccessible::updateAccessibility(&event); } #endif #if QT_CONFIG(graphicsview) |