diff options
author | Jan Arve Saether <jan-arve.saether@digia.com> | 2012-12-17 15:20:43 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-04 15:18:56 +0100 |
commit | 89f862ab10893dcfc707fa9bcdbea6fb449600ca (patch) | |
tree | e87a7e935583928a107a74e3e3867ed34053dd56 | |
parent | 07e69c789686a949459e48cbcbd4dc0ea4b3dd8c (diff) |
Do not send QAccessible::Focus when current index is changed.
This had the unfortunate side-effect that focus was reported to change
(but it didn't) just because the qtabbar was shown.
Found by clicking the different categories on the left-hand side of the
options dialog in Qt Creator.
So, what happened was that clicking "Text Editor" would move the
accessibility focus (that the AT client saw) to the "Font & Colors" tab)
Change-Id: I19a508f6a32a77696079d24c3c6408cb6c3d9fd5
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
-rw-r--r-- | src/widgets/widgets/qtabbar.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index 8cd86dd3f1..84a1668b3c 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -1182,9 +1182,11 @@ void QTabBar::setCurrentIndex(int index) d->layoutTab(index); #ifndef QT_NO_ACCESSIBILITY if (QAccessible::isActive()) { - QAccessibleEvent focusEvent(this, QAccessible::Focus); - focusEvent.setChild(index); - QAccessible::updateAccessibility(&focusEvent); + if (hasFocus()) { + QAccessibleEvent focusEvent(this, QAccessible::Focus); + focusEvent.setChild(index); + QAccessible::updateAccessibility(&focusEvent); + } QAccessibleEvent selectionEvent(this, QAccessible::Selection); selectionEvent.setChild(index); QAccessible::updateAccessibility(&selectionEvent); |