diff options
author | Błażej Szczygieł <spaz16@wp.pl> | 2016-01-15 02:29:57 +0100 |
---|---|---|
committer | Błażej Szczygieł <spaz16@wp.pl> | 2016-01-28 17:40:53 +0000 |
commit | 58f8dd4f92e0e647ed530554d7edf3d1a901f552 (patch) | |
tree | 3141e9d6473a2ce4d3d0f13dcf2d462f3d2805f7 /tests | |
parent | ee9621b9dc6cab96df627aa7b926e6256ea2102a (diff) |
QtWidgets: Allow to cover up the window container by another widget
When the window container already has a window handle, allow embedded
windows to use this handle as a parent. This change will allow proper
window stacking and clipping.
Task-number: QTBUG-50477
Change-Id: I8d656ecb99e0c42ae7a7ac461e5e5b5d801f5493
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp index dfc53c9164..94b3f9089f 100644 --- a/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp +++ b/tests/auto/widgets/kernel/qwindowcontainer/tst_qwindowcontainer.cpp @@ -81,6 +81,7 @@ private slots: void testActivation(); void testAncestorChange(); void testDockWidget(); + void testNativeContainerParent(); void cleanup(); private: @@ -330,6 +331,23 @@ void tst_QWindowContainer::testDockWidget() QTRY_COMPARE(window->parent(), mainWindow.window()->windowHandle()); } +void tst_QWindowContainer::testNativeContainerParent() +{ + QWidget root; + root.setWindowTitle(QTest::currentTestFunction()); + root.setGeometry(m_availableGeometry.x() + 50, m_availableGeometry.y() + 50, 200, 200); + + Window *window = new Window(); + QWidget *container = QWidget::createWindowContainer(window, &root); + container->setAttribute(Qt::WA_NativeWindow); + container->setGeometry(50, 50, 150, 150); + + root.show(); + + QVERIFY(QTest::qWaitForWindowExposed(window)); + QTRY_COMPARE(window->parent(), container->windowHandle()); +} + QTEST_MAIN(tst_QWindowContainer) #include "tst_qwindowcontainer.moc" |