Check screen before changing cursor

Task-number: QTBUG-43508
Change-Id: I6b525cab2a3958f4e3528ed8102d07984f152e60
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
bb10
Joni Poikelin 2014-12-22 10:00:54 +02:00 committed by Shawn Rutledge
parent 033318f7a7
commit 0920e00932
1 changed files with 2 additions and 1 deletions

View File

@ -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);