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>
This commit is contained in:
Jan Arve Saether 2012-12-17 15:20:43 +01:00 committed by The Qt Project
parent 07e69c7896
commit 89f862ab10

View File

@ -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);