Don't crash if qApp->overrideCursor() is 0

Change-Id: I9e61be7ed537a988ce8ccca20f672f5c66275452
Reviewed-on: http://codereview.qt-project.org/5561
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Lars Knoll 2011-09-26 22:59:22 +02:00 committed by Qt by Nokia
parent 009480275e
commit 926d6189bf

View File

@ -365,10 +365,9 @@ void QDragManager::updateCursor()
cursorShape = Qt::DragMoveCursor;
}
}
if (cursorShape != qApp->overrideCursor()->shape()) {
qDebug() << "setting cursor shape to" << cursorShape;
QCursor *cursor = qApp->overrideCursor();
if (cursor && cursorShape != cursor->shape())
qApp->changeOverrideCursor(QCursor(cursorShape));
}
}