From 89f862ab10893dcfc707fa9bcdbea6fb449600ca Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Mon, 17 Dec 2012 15:20:43 +0100 Subject: 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 --- src/widgets/widgets/qtabbar.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/widgets') 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); -- cgit v1.2.3