QWidget: Fix a crash when platform window creation fails

Add a check on the platform window to QWidgetPrivate::create_sys().

Task-number: QTBUG-65783
Change-Id: I077882e1cf22ef49bb6f578f7460493ef48c9627
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
bb10
Friedemann Kleint 2018-01-16 08:23:55 +01:00
parent 99b89d30fa
commit 9de2ef6f5a
1 changed files with 2 additions and 1 deletions

View File

@ -1480,7 +1480,8 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
if (q->windowType() != Qt::Desktop || q->testAttribute(Qt::WA_NativeWindow)) {
win->create();
// Enable nonclient-area events for QDockWidget and other NonClientArea-mouse event processing.
win->handle()->setFrameStrutEventsEnabled(true);
if (QPlatformWindow *platformWindow = win->handle())
platformWindow->setFrameStrutEventsEnabled(true);
}
data.window_flags = win->flags();