summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qsimpledrag.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index 9aab332ef5..bd409c124f 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -310,11 +310,15 @@ void QBasicDrag::updateCursor(Qt::DropAction action)
m_dndHasSetOverrideCursor = true;
} else {
QCursor *cursor = QGuiApplication::overrideCursor();
- if (!pixmap.isNull()) {
- if (cursor->pixmap().cacheKey() != pixmap.cacheKey())
- QGuiApplication::changeOverrideCursor(QCursor(pixmap));
- } else if (cursorShape != cursor->shape()) {
- QGuiApplication::changeOverrideCursor(QCursor(cursorShape));
+ if (!cursor) {
+ QGuiApplication::changeOverrideCursor(pixmap.isNull() ? QCursor(cursorShape) : QCursor(pixmap));
+ } else {
+ if (!pixmap.isNull()) {
+ if (cursor->pixmap().cacheKey() != pixmap.cacheKey())
+ QGuiApplication::changeOverrideCursor(QCursor(pixmap));
+ } else if (cursorShape != cursor->shape()) {
+ QGuiApplication::changeOverrideCursor(QCursor(cursorShape));
+ }
}
}
#endif