Add proper parent logic for qwidget
(cherry picked from commit 98118fb729c39083718c220383fff462ba8eaebd)
This commit is contained in:
parent
61c6f64872
commit
02d44966ba
@ -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);
|
||||
// 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->platformWindow()) {
|
||||
// platformWindow->setParent(nativeParent->platformWindow());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//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();
|
||||
|
Loading…
Reference in New Issue
Block a user