summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2010-08-19 09:52:55 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2010-08-19 09:52:55 (GMT)
commit872ccdcc090cec252cea2109d2fc9f2f2ee4c795 (patch)
tree7b14b977528cb6e833a765afce3c9bf6e55c94af /tests/auto/qwidget
parent74d519f87e804b624ac76337fe2905d512d363fc (diff)
parentf6cfafde26b4735965be8df0d11e9d7c297c75b9 (diff)
downloadQt-872ccdcc090cec252cea2109d2fc9f2f2ee4c795.zip
Qt-872ccdcc090cec252cea2109d2fc9f2f2ee4c795.tar.gz
Qt-872ccdcc090cec252cea2109d2fc9f2f2ee4c795.tar.bz2
Merge remote branch 'qt/4.7' into lighthouse-4.7
Conflicts: src/opengl/qgl_p.h
Diffstat (limited to 'tests/auto/qwidget')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp75
1 files changed, 74 insertions, 1 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index 57b01f1..b618479 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -9745,7 +9745,6 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
QVERIFY(0 != backingStore(child));
// Parent is obscured, therefore its backing store should be destroyed
- QEXPECT_FAIL("", "QTBUG-12406", Continue);
QVERIFY(0 == backingStore(parent));
// Disable full screen
@@ -9761,6 +9760,80 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
QVERIFY(0 != backingStore(parent));
QVERIFY(0 == backingStore(child));
}
+
+ // 6. Partial reveal followed by full reveal
+ {
+ QWidget upper;
+ upper.setAutoFillBackground(true);
+ upper.setPalette(Qt::red);
+ upper.setGeometry(50, 50, 100, 100);
+
+ QWidget lower;
+ lower.setAutoFillBackground(true);
+ lower.setPalette(Qt::green);
+ lower.setGeometry(50, 50, 100, 100);
+
+ lower.show();
+ QTest::qWaitForWindowShown(&lower);
+ upper.show();
+ QTest::qWaitForWindowShown(&upper);
+ upper.raise();
+
+ QVERIFY(0 != backingStore(upper));
+ QVERIFY(0 == backingStore(lower));
+
+ // Check that upper obscures lower
+ QVERIFY(lower.visibleRegion().subtracted(upper.visibleRegion()).isEmpty());
+
+ // Partially reveal lower
+ upper.move(100, 100);
+
+ // Completely reveal lower
+ upper.hide();
+
+ // Hide lower widget - this should cause its backing store to be deleted
+ lower.hide();
+
+ // 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