diff options
author | Andrew Knight <andrew.knight@digia.com> | 2013-09-06 08:32:09 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-09 12:48:25 +0200 |
commit | ddbcf783086941d6c189cd4822ac9fa63b35af34 (patch) | |
tree | 33ef584c946da955cd3f80dafc587e2a5ca76a47 /src/widgets/kernel/qwidget_qpa.cpp | |
parent | 6a41fa832e76b489adef9b26ee5cc7f9a83953cc (diff) |
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>
Diffstat (limited to 'src/widgets/kernel/qwidget_qpa.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget_qpa.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 665aa4b17a..a06283be02 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -153,7 +153,10 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO } 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 q_createNativeChildrenAndSetParent(q); |