diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-04-26 17:44:04 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-04-28 15:38:57 +0200 |
commit | 02d44966ba6369fedf3073283bdde0610b42c0d0 (patch) | |
tree | 3268fe179e10804189671a307a1636bfe0484b8f /src/gui | |
parent | 61c6f64872a363cbde209e6f9a7cd05e79713c93 (diff) |
Add proper parent logic for qwidget
(cherry picked from commit 98118fb729c39083718c220383fff462ba8eaebd)
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qwidget_qpa.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/kernel/qwidget_qpa.cpp b/src/gui/kernel/qwidget_qpa.cpp index efecb4407c..855397e500 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(); |