diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-04-23 13:27:55 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-25 15:18:29 +0200 |
commit | aa920e627497f9f079e956132bcebc8eadddf3fd (patch) | |
tree | f707b8488e60c5fc7b5c31e877048688269d9b14 | |
parent | 58e48831f17f154e4b7a4cd9b519e9ce4e645d8c (diff) |
Accessibility Windows: Improve Menus
This would especially trigger when moving the focus between menus - after
the right menu got the focus we would send another event for the QMenuBar,
preventing the screen reader from reading the actually selected menu,
announcing the menu bar instead.
[ChangeLog][QtWidgets][QMenu] Accessibility: Menus are read by screen
readers with more reliability.
Task-number: QTBUG-38498
Change-Id: Ie4028120b234949380315296bf07ca53863d0ad8
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 2 | ||||
-rw-r--r-- | src/widgets/widgets/qmenu.cpp | 3 | ||||
-rw-r--r-- | src/widgets/widgets/qmenubar.cpp | 3 |
3 files changed, 0 insertions, 8 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index f79eaf197d..65e435fbdc 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -6002,10 +6002,8 @@ void QWidget::setFocus(Qt::FocusReason reason) if (!(testAttribute(Qt::WA_WState_Created) && window()->windowType() != Qt::Popup && internalWinId())) //setFocusWidget will already post a focus event for us (that the AT client receives) on Windows # endif -# ifdef Q_OS_UNIX // menus update the focus manually and this would create bogus events if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem"))) -# endif { QAccessibleEvent event(f, QAccessible::Focus); QAccessible::updateAccessibility(&event); diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index eb93e461c0..4cf39b3bb5 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -1091,9 +1091,6 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e QAccessibleEvent focusEvent(q, QAccessible::Focus); focusEvent.setChild(actionIndex); QAccessible::updateAccessibility(&focusEvent); - QAccessibleEvent selectionEvent(q, QAccessible::Selection); - focusEvent.setChild(actionIndex); - QAccessible::updateAccessibility(&selectionEvent); } #endif action->showStatusText(topCausedWidget()); diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index 03ab490823..729e08c7a5 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -531,9 +531,6 @@ void QMenuBarPrivate::_q_actionHovered() QAccessibleEvent focusEvent(q, QAccessible::Focus); focusEvent.setChild(actionIndex); QAccessible::updateAccessibility(&focusEvent); - QAccessibleEvent selectionEvent(q, QAccessible::Selection); - selectionEvent.setChild(actionIndex); - QAccessible::updateAccessibility(&selectionEvent); } #endif //QT_NO_ACCESSIBILITY } |