Move winId!=0 assertion from QWindow to QWidget
In "very basic platform plugins", the platform window ID can be null, which conflicts with QWidget's special treatment of 0 as a parented widget. Such is the case with EGLFS, which can return a null native window handle for winId on some EGL implementations. Move the assertion winId!=0 into the widget framework, as this assert is not relevant for non-widget applications. A large proportion of basic platform plugin users will see relief from this unnecessary assertion. Change-Id: I25c9d96550cd747c77c9516d773e9cdebf7440ab Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This commit is contained in:
parent
6a41fa832e
commit
ddbcf78308
@ -502,10 +502,7 @@ WId QWindow::winId() const
|
|||||||
if(!d->platformWindow)
|
if(!d->platformWindow)
|
||||||
const_cast<QWindow *>(this)->create();
|
const_cast<QWindow *>(this)->create();
|
||||||
|
|
||||||
WId id = d->platformWindow->winId();
|
return d->platformWindow->winId();
|
||||||
// See the QPlatformWindow::winId() documentation
|
|
||||||
Q_ASSERT(id != WId(0));
|
|
||||||
return id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -153,7 +153,10 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
|
|||||||
}
|
}
|
||||||
|
|
||||||
setWindowModified_helper();
|
setWindowModified_helper();
|
||||||
setWinId(win->winId());
|
WId id = win->winId();
|
||||||
|
// See the QPlatformWindow::winId() documentation
|
||||||
|
Q_ASSERT(id != WId(0));
|
||||||
|
setWinId(id);
|
||||||
|
|
||||||
// Check children and create windows for them if necessary
|
// Check children and create windows for them if necessary
|
||||||
q_createNativeChildrenAndSetParent(q);
|
q_createNativeChildrenAndSetParent(q);
|
||||||
|
Loading…
Reference in New Issue
Block a user