diff options
author | Gareth Stockwell <gareth.stockwell@accenture.com> | 2009-10-21 14:14:26 +0100 |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@accenture.com> | 2009-10-21 14:39:14 +0100 |
commit | e7e687f737c19eda884448b6991836a102f0f3f4 (patch) | |
tree | 68898633109c78f6391345b9cbca30ff3bc4bb3a /tests/auto/qwidget/tst_qwidget.cpp | |
parent | 1f3200b2cd25a379079700dea489901970845b0f (diff) | |
download | qt4-tools-e7e687f737c19eda884448b6991836a102f0f3f4.tar.gz |
Fixed logical error in winIdChanged auto test.
The test (see 02fbfdbd) previously asserted that changing the parent
of a native widget caused a WinIdChange event on Symbian, but not on
other platforms. The test now asserts that:
1. Changing the parent of a native widget causes a WinIdChange
event on all platforms.
2. Changing the grandparent of a native widget causes a WinIdChange
event only on Symbian.
Reviewed-by: Paul Olav Tvete
Diffstat (limited to 'tests/auto/qwidget/tst_qwidget.cpp')
-rw-r--r-- | tests/auto/qwidget/tst_qwidget.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index a03f1122a2..050d1c516f 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -4391,12 +4391,27 @@ void tst_QWidget::winIdChangeEvent() { // Changing parent of a native widget + // Should cause winId of child to change, on all platforms QWidget parent1, parent2; WinIdChangeWidget child(&parent1); const WId winIdBefore = child.winId(); QCOMPARE(child.m_winIdChangeEventCount, 1); child.setParent(&parent2); const WId winIdAfter = child.internalWinId(); + QVERIFY(winIdBefore != winIdAfter); + QCOMPARE(child.m_winIdChangeEventCount, 2); + } + + { + // Changing grandparent of a native widget + // Should cause winId of grandchild to change only on Symbian + QWidget grandparent1, grandparent2; + QWidget parent(&grandparent1); + WinIdChangeWidget child(&parent); + const WId winIdBefore = child.winId(); + QCOMPARE(child.m_winIdChangeEventCount, 1); + parent.setParent(&grandparent2); + const WId winIdAfter = child.internalWinId(); #ifdef Q_OS_SYMBIAN QVERIFY(winIdBefore != winIdAfter); QCOMPARE(child.m_winIdChangeEventCount, 2); |