This is motivated by visiting a customer that re-implemented the
::winId method and returned WId(0) that resulted in a crash. Currently
there is only a comment inside the implementation of the ::winId
default implementation. Add a note to the API documentation, add
a Q_ASSERT to check if our assumption holds true.
Change-Id: I8607a4efc4f561f7849c976cd2454f6fbcb20eaa
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Q_D(const QWindow);
if(!d->platformWindow)
const_cast<QWindow *>(this)->create();
- return d->platformWindow->winId();
+
+ WId id = d->platformWindow->winId();
+ // See the QPlatformWindow::winId() documentation
+ Q_ASSERT(id != WId(0));
+ return id;
}
QWindow *QWindow::parent() const