From de8a755a16abf0ddd0e3d8606dc6541716bb1f6f Mon Sep 17 00:00:00 2001 From: Sebastian Sauer Date: Wed, 21 Jul 2010 16:44:08 +0200 Subject: Improve QAccessible for QTabBar In a QTabBar on changing the curren tab call QAccessible::updateAccessibility to allow screen-readers like JAWS to read the tabText of the newly selected tab. Merge-request: 662 Reviewed-by: Harald Fernengel --- src/gui/widgets/qtabbar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp index d692307..bbc7e5d 100644 --- a/src/gui/widgets/qtabbar.cpp +++ b/src/gui/widgets/qtabbar.cpp @@ -1219,6 +1219,12 @@ void QTabBar::setCurrentIndex(int index) if (oldIndex >= 0 && oldIndex < count()) d->layoutTab(oldIndex); d->layoutTab(index); +#ifndef QT_NO_ACCESSIBILITY + if (QAccessible::isActive()) { + QAccessible::updateAccessibility(this, index + 1, QAccessible::Focus); + QAccessible::updateAccessibility(this, index + 1, QAccessible::Selection); + } +#endif #ifdef QT3_SUPPORT emit selected(index); #endif -- cgit v0.12