summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-07-10 14:12:06 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-11 08:34:14 +0200
commitb6b5de9907479d9c52ad12d3adc0952192cac492 (patch)
treefcbe56b478c12f8850ab91d1f1efacea19514350
parent9e64bb707883e9ec6aa18b95a151520e43803d60 (diff)
Set native parent handle property on widget.
QWidgetWindow may not exist at that point. Task-number: QTBUG-31672 Task-number: QTBUG-32343 Change-Id: Ia74e4d9250704ac97aac17b892bc8de9a6d535fb Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
-rw-r--r--src/activeqt/control/qaxserverbase.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp
index d0b0db4..daf2d77 100644
--- a/src/activeqt/control/qaxserverbase.cpp
+++ b/src/activeqt/control/qaxserverbase.cpp
@@ -1382,18 +1382,16 @@ LRESULT QT_WIN_CALLBACK QAxServerBase::ActiveXProc(HWND hWnd, UINT uMsg, WPARAM
if(wParam) {
that->internalCreate();
if (!that->stayTopLevel) {
- QWindow *widgetWindow = that->qt.widget->windowHandle();
// Set this property on window to pass the native handle to platform plugin,
// so that it can create the window with proper flags instead of thinking
// it is toplevel.
- if (widgetWindow) {
- widgetWindow->setProperty("_q_embedded_native_parent_handle", WId(that->m_hWnd));
+ that->qt.widget->setProperty("_q_embedded_native_parent_handle", WId(that->m_hWnd));
+ if (QWindow *widgetWindow = that->qt.widget->windowHandle()) {
// If embedded widget is native, such as QGLWidget, it may have already created
// a window before now, probably as an undesired toplevel. In that case set the
// proper parent window and set the window frameless to position it correctly.
- if (widgetWindow
- && that->qt.widget->testAttribute(Qt::WA_WState_Created)
+ if (that->qt.widget->testAttribute(Qt::WA_WState_Created)
&& !that->qt.widget->isVisible()) {
HWND h = static_cast<HWND>(QGuiApplication::platformNativeInterface()->
nativeResourceForWindow("handle", widgetWindow));