From 0920e00932b2686b59247633ea01669fcc398f9c Mon Sep 17 00:00:00 2001 From: Joni Poikelin Date: Mon, 22 Dec 2014 10:00:54 +0200 Subject: Check screen before changing cursor Task-number: QTBUG-43508 Change-Id: I6b525cab2a3958f4e3528ed8102d07984f152e60 Reviewed-by: Shawn Rutledge --- src/gui/kernel/qwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index c5d88b198b..a4b5376b6f 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2393,7 +2393,8 @@ void QWindowPrivate::setCursor(const QCursor *newCursor) hasCursor = false; } // Only attempt to set cursor and emit signal if there is an actual platform cursor - if (q->screen()->handle()->cursor()) { + QScreen* screen = q->screen(); + if (screen && screen->handle()->cursor()) { applyCursor(); QEvent event(QEvent::CursorChange); QGuiApplication::sendEvent(q, &event); -- cgit v1.2.3