From c2f14423632c840bacd0254f90cd6132ed62a390 Mon Sep 17 00:00:00 2001 From: Sebastian Sauer Date: Wed, 21 Jul 2010 17:09:53 +0200 Subject: Improve QAccessible for QAccessibleTabBar On QAccessibleTabBar::text return text of the current tab for the case the QTabBar itself is asked for it's Name. Merge-request: 2405 Reviewed-by: Harald Fernengel --- src/plugins/accessible/widgets/complexwidgets.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/accessible/widgets/complexwidgets.cpp b/src/plugins/accessible/widgets/complexwidgets.cpp index 8be1560..803786f 100644 --- a/src/plugins/accessible/widgets/complexwidgets.cpp +++ b/src/plugins/accessible/widgets/complexwidgets.cpp @@ -1512,10 +1512,14 @@ QString QAccessibleTabBar::text(Text t, int child) const default: break; } - } else if (child > 0) { + } else { switch (t) { case Name: - return qt_accStripAmp(tabBar()->tabText(child - 1)); + if (child > 0) + return qt_accStripAmp(tabBar()->tabText(child - 1)); + else if (tabBar()->currentIndex() != -1) + return qt_accStripAmp(tabBar()->tabText(tabBar()->currentIndex())); + break; default: break; } -- cgit v0.12