From e3753542d00aaed7b9890064e7d7923d3b3bc9e1 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 1 Sep 2017 09:29:05 +0200 Subject: 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 Reviewed-by: Friedemann Kleint --- src/activeqt/control/qaxserverbase.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(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); } -- cgit v1.2.3