summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2010-08-10 16:08:37 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-09-02 06:20:59 (GMT)
commit2b1d027180fcea0e575c59818fc21541ff235f58 (patch)
tree6a9b1d8392032f47b389fdae50315047983784e5
parente96078a01ea7a2a79b07bf6ab7ebd17eafa38560 (diff)
downloadQt-2b1d027180fcea0e575c59818fc21541ff235f58.zip
Qt-2b1d027180fcea0e575c59818fc21541ff235f58.tar.gz
Qt-2b1d027180fcea0e575c59818fc21541ff235f58.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 (cherry picked from commit b5360eb223d5377beb62008fcc1da48f432dc8dd)
-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