From 02d44966ba6369fedf3073283bdde0610b42c0d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B8rgen=20Lind?= Date: Tue, 26 Apr 2011 17:44:04 +0200 Subject: [PATCH] Add proper parent logic for qwidget (cherry picked from commit 98118fb729c39083718c220383fff462ba8eaebd) --- src/gui/kernel/qwidget_qpa.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index efecb44..855397e 100644 --- a/src/gui/kernel/qwidget_qpa.cpp +++ b/src/gui/kernel/qwidget_qpa.cpp @@ -109,17 +109,17 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO setWinId(win->winId()); - //first check children. and create them if necessary -// q_createNativeChildrenAndSetParent(q->platformWindow(),q); - -// //if we we have a parent, then set correct parent; -// if (!q->isWindow()) { -// if (QWidget *nativeParent = q->nativeParentWidget()) { -// if (nativeParent->platformWindow()) { -// platformWindow->setParent(nativeParent->platformWindow()); -// } -// } -// } +// first check children. and create them if necessary + q_createNativeChildrenAndSetParent(q->windowHandle(),q); + + //if we we have a parent, then set correct parent; + if (!q->isWindow()) { + if (QWidget *nativeParent = q->nativeParentWidget()) { + if (nativeParent->windowHandle()) { + win->setParent(nativeParent->windowHandle()); + } + } + } QApplicationPrivate::platformIntegration()->moveToScreen(q, topData()->screenIndex); // qDebug() << "create_sys" << q << q->internalWinId(); -- 2.7.4