summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-09-23 17:08:09 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-09-23 17:08:09 (GMT)
commitece91e45cf35c056e72d1acf7fa9fedc7b46409f (patch)
tree3c48ec43095916885590cf9c2faa6bc182eac298
parent29cf5da6b1f0db349deb0a0842c0e57dd9a3783b (diff)
parent3df9ac2f0719718ceb7385e46445447d95fd7857 (diff)
downloadQt-ece91e45cf35c056e72d1acf7fa9fedc7b46409f.zip
Qt-ece91e45cf35c056e72d1acf7fa9fedc7b46409f.tar.gz
Qt-ece91e45cf35c056e72d1acf7fa9fedc7b46409f.tar.bz2
Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qt-water-team
* 'master' of git://scm.dev.nokia.troll.no/qt/qt-water-team: Fix accessible menu not returning child name.
-rw-r--r--src/plugins/accessible/widgets/qaccessiblemenu.cpp2
-rw-r--r--tests/auto/qaccessibility/tst_qaccessibility.cpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/accessible/widgets/qaccessiblemenu.cpp b/src/plugins/accessible/widgets/qaccessiblemenu.cpp
index 4ae1d15..e9e5ca8 100644
--- a/src/plugins/accessible/widgets/qaccessiblemenu.cpp
+++ b/src/plugins/accessible/widgets/qaccessiblemenu.cpp
@@ -93,7 +93,7 @@ int QAccessibleMenu::childAt(int x, int y) const
QString QAccessibleMenu::text(Text t, int child) const
{
QString tx = QAccessibleWidgetEx::text(t, child);
- if (tx.size())
+ if (!child && tx.size())
return tx;
switch (t) {
diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp
index d452820..d24f52f 100644
--- a/tests/auto/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp
@@ -2531,6 +2531,12 @@ void tst_QAccessibility::menuTest()
QCOMPARE(interface->actionText(QAccessible::DefaultAction, QAccessible::Name, 4), QString());
QCOMPARE(interface->actionText(QAccessible::DefaultAction, QAccessible::Name, 5), QString("Execute"));
+ // QTBUG-21578 - after setting accessible name on a menu it would no longer
+ // return the right names for it's children.
+ QCOMPARE(interface->text(QAccessible::Name, 1), QString("New..."));
+ file->setAccessibleName("File");
+ QCOMPARE(interface->text(QAccessible::Name, 1), QString("New..."));
+
QAccessibleInterface *iface = 0;
QAccessibleInterface *iface2 = 0;