summaryrefslogtreecommitdiffstats
path: root/tests/auto/other
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-09-13 12:14:13 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-18 14:52:38 +0200
commitede4f5e23b08e9b2cc8fb6a449ee9f667b8da9fa (patch)
tree11175bab8835c6f40faed5afd8b57b41b3a1716f /tests/auto/other
parentbeab941e1fc11c8fe0914c6a3207ba029eb96112 (diff)
Fix mapping to/from global coordinates for child/embedded windows.
QWidget's mapToGlobal() and mapFromGlobal() functions assumed that if the widget reports it's a window or if it has no parent widget, it must be a top level window whose coordinates are in global coordinates. This is not true for child QWindows or embedded native windows (QAxWidgets). Changed the logic for mapping coordinates to use equivalent methods from QWindow if widget has a window handle, and changed QWindow's methods to map coordinates using native methods if window is embedded. Also fixed newly failing accessibility autotest. The geometry related failures there popped up because now the position of the rect returned by accessible interface is actually correct while widget geometry still reports position 0,0 before widget has shown up. Task-number: QTBUG-26436 Change-Id: I658fafd0ce01eb1604ba255efeeba3073ca0189f Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'tests/auto/other')
-rw-r--r--tests/auto/other/qaccessibility/tst_qaccessibility.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
index 3e937fefd4..e9fe51dd0c 100644
--- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp
@@ -1489,6 +1489,8 @@ void tst_QAccessibility::spinBoxTest()
QVERIFY(interface);
QCOMPARE(interface->role(), QAccessible::SpinBox);
+ QVERIFY(QTest::qWaitForWindowExposed(spinBox));
+
const QRect widgetRect = spinBox->geometry();
const QRect accessibleRect = interface->rect();
QCOMPARE(accessibleRect, widgetRect);
@@ -1527,6 +1529,8 @@ void tst_QAccessibility::doubleSpinBoxTest()
QAccessibleInterface *interface = QAccessible::queryAccessibleInterface(doubleSpinBox);
QVERIFY(interface);
+ QVERIFY(QTest::qWaitForWindowExposed(doubleSpinBox));
+
const QRect widgetRect = doubleSpinBox->geometry();
const QRect accessibleRect = interface->rect();
QCOMPARE(accessibleRect, widgetRect);
@@ -2197,6 +2201,8 @@ void tst_QAccessibility::dialTest()
QVERIFY(interface);
QCOMPARE(interface->childCount(), 0);
+ QVERIFY(QTest::qWaitForWindowExposed(&dial));
+
QCOMPARE(interface->text(QAccessible::Value), QString::number(dial.value()));
QCOMPARE(interface->rect(), dial.geometry());
@@ -2827,6 +2833,7 @@ void tst_QAccessibility::comboBoxTest()
QComboBox combo;
combo.addItems(QStringList() << "one" << "two" << "three");
combo.show();
+
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(&combo);
QCOMPARE(verifyHierarchy(iface), 0);