summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2017-09-01 09:29:05 +0200
committerAndy Shaw <andy.shaw@qt.io>2017-09-01 08:17:55 +0000
commite3753542d00aaed7b9890064e7d7923d3b3bc9e1 (patch)
tree6394b694ffc42f83d503668c115de25cf5af5399
parentf02740515348339963af18ff795f7cdfb1b1f8cc (diff)
Set embedded native parent handle on an already created widget window
When the parent already has a window for it (such as if QOpenGLWidget is used) then the _q_embedded_native_parent_handle property needs to be set on the window as this will not happen automatically in the platform plugin. Change-Id: I7e5816da1c22bf53bb039a19713ae1a3e5970b3c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--src/activeqt/control/qaxserverbase.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp
index c4eea69..9519e0a 100644
--- a/src/activeqt/control/qaxserverbase.cpp
+++ b/src/activeqt/control/qaxserverbase.cpp
@@ -1429,8 +1429,14 @@ LRESULT QT_WIN_CALLBACK QAxServerBase::ActiveXProc(HWND hWnd, UINT uMsg, WPARAM
&& !that->qt.widget->isVisible()) {
HWND h = static_cast<HWND>(QGuiApplication::platformNativeInterface()->
nativeResourceForWindow("handle", widgetWindow));
- if (h)
+ if (h) {
::SetParent(h, that->m_hWnd);
+ // Since the window is already created, we need to set the
+ // property directly to ensure it does not believe it is
+ // toplevel.
+ widgetWindow->setProperty("_q_embedded_native_parent_handle",
+ WId(that->m_hWnd));
+ }
Qt::WindowFlags flags = widgetWindow->flags();
widgetWindow->setFlags(flags | Qt::FramelessWindowHint);
}