Fix crash with drag cursor handling
7a7c722782
caused a regresssion in some
cases.
Change-Id: I1089a79534d811b195de663ff664d9ba5a6ac6c5
Fixes: QTBUG-74110
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
1e4dec12d5
commit
d1141b6c90
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user