summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-09-09 17:45:42 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-10 13:07:46 +0000
commitdc3b19b9e0d48d14d705658c9eda66635b735474 (patch)
tree8ea6861cb21031ac858fad7eed5e152dccfbf184 /src/widgets
parent7dcb8ed3481771719a329eac4df60ee89a494fa4 (diff)
Set Qt::SubWindow on windows embedded by QWidget::createWindowContainer
The embedded window is parented into the containing QWindowContainer widget, which may either have a window handle itself, or is a child of a widget that has one (typically the top level). By setting Qt::SubWindow we inform clients about the embedded window's place in the world, allowing e.g. QPlatformIntegration::defaultWindowState to choose the correct state (Qt::WindowNoState) for the window instead of making it Qt::WindowMaximized on iOS. Change-Id: Icf834192d99fee455aaba3c57bee1a4f1fde5025 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 296621a52f220dfd5456f6fb936f513a7b85b1af) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index b4d889fdfa..5484544444 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -234,6 +234,8 @@ QWindowContainer::QWindowContainer(QWindow *embeddedWindow, QWidget *parent, Qt:
d->fakeParent.setObjectName(windowName + QLatin1String("ContainerFakeParent"));
d->window->setParent(&d->fakeParent);
+ d->window->setFlag(Qt::SubWindow);
+
setAcceptDrops(true);
connect(QGuiApplication::instance(), SIGNAL(focusWindowChanged(QWindow*)), this, SLOT(focusWindowChanged(QWindow*)));