summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qdnd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qdnd.cpp')
-rw-r--r--src/gui/kernel/qdnd.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp
index 6cf986ff66..4edcfa886f 100644
--- a/src/gui/kernel/qdnd.cpp
+++ b/src/gui/kernel/qdnd.cpp
@@ -169,9 +169,13 @@ QDragManager *QDragManager::self()
QPixmap QDragManager::dragCursor(Qt::DropAction action) const
{
- QDragPrivate * d = dragPrivate();
- if (d && d->customCursors.contains(action))
- return d->customCursors[action];
+ typedef QMap<Qt::DropAction, QPixmap>::const_iterator Iterator;
+
+ if (const QDragPrivate *d = dragPrivate()) {
+ const Iterator it = d->customCursors.constFind(action);
+ if (it != d->customCursors.constEnd())
+ return it.value();
+ }
Qt::CursorShape shape = Qt::ForbiddenCursor;
switch (action) {
@@ -187,8 +191,7 @@ QPixmap QDragManager::dragCursor(Qt::DropAction action) const
default:
shape = Qt::ForbiddenCursor;
}
-
- return QGuiApplicationPrivate::instance()->getPixmapCursor(Qt::DragMoveCursor);
+ return QGuiApplicationPrivate::instance()->getPixmapCursor(shape);
}
Qt::DropAction QDragManager::defaultAction(Qt::DropActions possibleActions,