Add proper parent logic for qwidget
authorJørgen Lind <jorgen.lind@nokia.com>
Tue, 26 Apr 2011 15:44:04 +0000 (17:44 +0200)
committerSamuel Rødal <samuel.rodal@nokia.com>
Thu, 28 Apr 2011 13:38:57 +0000 (15:38 +0200)
(cherry picked from commit 98118fb729c39083718c220383fff462ba8eaebd)

src/gui/kernel/qwidget_qpa.cpp

index efecb44..855397e 100644 (file)
@@ -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();