summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-10-27 21:09:25 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-10-27 21:09:25 (GMT)
commit77819edac505823226c40033e76d2dda0e8b363a (patch)
treeb7e7f031a91cebab1b8b1e68c1e81f15338cac18 /tests/auto
parentd67626bcfa000b8a1102768cdf4b69b8b8537a97 (diff)
parent1aba4fde2e407764cafe39520cc52dc9a3b8dd31 (diff)
downloadQt-77819edac505823226c40033e76d2dda0e8b363a.zip
Qt-77819edac505823226c40033e76d2dda0e8b363a.tar.gz
Qt-77819edac505823226c40033e76d2dda0e8b363a.tar.bz2
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: Fix bug in QML debug client installation Doc clarification for Loader. Phonon MMF backend: set _q_DummyWindowSurface property on VideoWidget Create dummy window surface if if _q_DummyWindowSurface property is set Remove widget subtree from backing store tracker when reparented Suppress call to controlVisibilityChanged for null control pointer Set the location of the closing brace. Fix patch_capabilities.pl script for explicit set of capabilities Fix empty mifconv TARGETFILE in some edge cases.
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index a2b8d5b..c7d4617 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -9692,14 +9692,25 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
child.setAutoFillBackground(true);
child.setPalette(Qt::blue);
+ QWidget grandChild(&child);
+ grandChild.setAutoFillBackground(true);
+ grandChild.setPalette(Qt::yellow);
+
QVBoxLayout layout(&parent);
layout.setContentsMargins(10, 10, 10, 10);
layout.addWidget(&child);
parent.setLayout(&layout);
- child.winId();
+ QVBoxLayout childLayout(&child);
+ childLayout.setContentsMargins(10, 10, 10, 10);
+ childLayout.addWidget(&grandChild);
+ child.setLayout(&childLayout);
+
+ // Ensure that this widget and all its ancestors are native
+ grandChild.winId();
parent.show();
+
QTest::qWaitForWindowShown(&parent);
// Check that child window does not obscure parent window
@@ -9708,18 +9719,24 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
// Native child widget should share parent's backing store
QVERIFY(0 != backingStore(parent));
QVERIFY(0 == backingStore(child));
+ QVERIFY(0 == backingStore(grandChild));
// Make child widget full screen
child.setWindowFlags((child.windowFlags() | Qt::Window) ^ Qt::SubWindow);
child.setWindowState(child.windowState() | Qt::WindowFullScreen);
child.show();
+
+ // Paint into the child to ensure that it gets a backing store
+ QPainter painter(&child);
+ painter.fillRect(QRect(0, 0, 90, 90), Qt::white);
+
QTest::qWaitForWindowShown(&child);
// Ensure that 'window hidden' event is received by parent
qApp->processEvents();
// Check that child window obscures parent window
- QVERIFY(parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
+ QVERIFY(parent.visibleRegion().subtracted(child.visibleRegion() + grandChild.visibleRegion()).isEmpty());
// Now that extent of child widget goes beyond parent's extent,
// a new backing store should be created for the child widget.
@@ -9735,11 +9752,12 @@ void tst_QWidget::destroyBackingStoreWhenHidden()
QTest::qWaitForWindowShown(&child);
// Check that parent is now visible again
- QVERIFY(!parent.visibleRegion().subtracted(child.visibleRegion()).isEmpty());
+ QVERIFY(!parent.visibleRegion().subtracted(child.visibleRegion() + grandChild.visibleRegion()).isEmpty());
// Native child widget should once again share parent's backing store
QVERIFY(0 != backingStore(parent));
QVERIFY(0 == backingStore(child));
+ QVERIFY(0 == backingStore(grandChild));
}
// 6. Partial reveal followed by full reveal