diff options
author | José Millán Soto <fid@gpul.org> | 2012-01-18 14:47:44 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-06 03:53:31 (GMT) |
commit | 827f7db3d99c17e66ccccef578060a9feed66312 (patch) | |
tree | 05741cdb7ce479056aa39838e2a5be92b31caea1 | |
parent | 4672db851932db81ce5fbfca924399697b4d511e (diff) | |
download | Qt-827f7db3d99c17e66ccccef578060a9feed66312.zip Qt-827f7db3d99c17e66ccccef578060a9feed66312.tar.gz Qt-827f7db3d99c17e66ccccef578060a9feed66312.tar.bz2 |
Do not check isActiveWindow to determine if an accessible widget is focusable
QWidget::isActiveWindow() was being checked in QAccessibleWidget::state to
determine if a widget is focusable. As a result, focusable widgets were reported
to be not focusable when the window was not active.
Change-Id: I765eddca859d859d19d31bd2e9ffe3b132a1a4ef
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
-rw-r--r-- | src/gui/accessible/qaccessiblewidget.cpp | 2 | ||||
-rw-r--r-- | tests/auto/qaccessibility/tst_qaccessibility.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/accessible/qaccessiblewidget.cpp b/src/gui/accessible/qaccessiblewidget.cpp index beb251b..a03bc34 100644 --- a/src/gui/accessible/qaccessiblewidget.cpp +++ b/src/gui/accessible/qaccessiblewidget.cpp @@ -940,7 +940,7 @@ QAccessible::State QAccessibleWidget::state(int child) const QWidget *w = widget(); if (w->testAttribute(Qt::WA_WState_Visible) == false) state |= Invisible; - if (w->focusPolicy() != Qt::NoFocus && w->isActiveWindow()) + if (w->focusPolicy() != Qt::NoFocus) state |= Focusable; if (w->hasFocus()) state |= Focused; diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp index 9d1ca91..1b35349 100644 --- a/tests/auto/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp @@ -3027,7 +3027,7 @@ void tst_QAccessibility::lineEditTest() QCOMPARE(iface->childCount(), 0); QVERIFY(iface->state(0) & QAccessible::Sizeable); QVERIFY(iface->state(0) & QAccessible::Movable); - QCOMPARE(bool(iface->state(0) & QAccessible::Focusable), le->isActiveWindow()); + QVERIFY(iface->state(0) & QAccessible::Focusable); QVERIFY(iface->state(0) & QAccessible::Selectable); QVERIFY(iface->state(0) & QAccessible::HasPopup); QCOMPARE(bool(iface->state(0) & QAccessible::Focused), le->hasFocus()); @@ -3056,7 +3056,7 @@ void tst_QAccessibility::lineEditTest() QApplication::processEvents(); QVERIFY(!(iface->state(0) & QAccessible::Sizeable)); QVERIFY(!(iface->state(0) & QAccessible::Movable)); - QCOMPARE(bool(iface->state(0) & QAccessible::Focusable), le->isActiveWindow()); + QVERIFY(iface->state(0) & QAccessible::Focusable); QVERIFY(iface->state(0) & QAccessible::Selectable); QVERIFY(iface->state(0) & QAccessible::HasPopup); QCOMPARE(bool(iface->state(0) & QAccessible::Focused), le->hasFocus()); |