summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-08-10 16:08:37 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-08-18 09:13:50 (GMT)
commitb5360eb223d5377beb62008fcc1da48f432dc8dd (patch)
tree83323f88d519621586fc39d0a61c33b569099501 /tests/auto/qwidget
parentcc1b6475a99994908cbd6309a08fd08614f18221 (diff)
downloadQt-b5360eb223d5377beb62008fcc1da48f432dc8dd.zip
Qt-b5360eb223d5377beb62008fcc1da48f432dc8dd.tar.gz
Qt-b5360eb223d5377beb62008fcc1da48f432dc8dd.tar.bz2
Test backing store is deleted after reparenting a visible native child widget
After the following sequence: * Create a TLW, parent1 * Create a child of parent1, and make it a native widget * Create another TLW, parent2 * Show parent1 and parent2 * Reparent child so its parent is now parent2 * Hide parent1 parent1's backing store should be deleted, when running on Symbian. Task-number: QTBUG-12817 Reviewed-by: Jason Barron
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index e6e8970..ba0be3e 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -9795,6 +9795,43 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
// Check that backing store was deleted
WAIT_AND_VERIFY(0 == backingStore(lower));
}
+
+ // 7. Reparenting of visible native child widget
+ {
+ QWidget parent1;
+ parent1.setAutoFillBackground(true);
+ parent1.setPalette(Qt::green);
+ parent1.setGeometry(50, 50, 100, 100);
+
+ QWidget *child = new QWidget(&parent1);
+ child->winId();
+ child->setAutoFillBackground(true);
+ child->setPalette(Qt::red);
+ child->setGeometry(10, 10, 30, 30);
+
+ QWidget parent2;
+ parent2.setAutoFillBackground(true);
+ parent2.setPalette(Qt::blue);
+ parent2.setGeometry(150, 150, 100, 100);
+
+ parent1.show();
+ QTest::qWaitForWindowShown(&parent1);
+ QVERIFY(0 != backingStore(parent1));
+
+ parent2.show();
+ QTest::qWaitForWindowShown(&parent2);
+ QVERIFY(0 != backingStore(parent2));
+
+ child->setParent(&parent2);
+ child->setGeometry(10, 10, 30, 30);
+ child->show();
+
+ parent1.hide();
+ WAIT_AND_VERIFY(0 == backingStore(parent1));
+
+ parent2.hide();
+ WAIT_AND_VERIFY(0 == backingStore(parent2));
+ }
}
#undef WAIT_AND_VERIFY