diff --git a/src/platformsupport/dnd/qsimpledrag.cpp b/src/platformsupport/dnd/qsimpledrag.cpp index 587e70b0f3..f2ff177055 100644 --- a/src/platformsupport/dnd/qsimpledrag.cpp +++ b/src/platformsupport/dnd/qsimpledrag.cpp @@ -140,7 +140,6 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e) QKeyEvent *ke = static_cast(e); if (ke->key() == Qt::Key_Escape && e->type() == QEvent::KeyPress) { cancel(); - resetDndState(true); disableEventFilter(); exitDndEventLoop(); @@ -154,13 +153,10 @@ bool QBasicDrag::eventFilter(QObject *o, QEvent *e) case QEvent::MouseButtonRelease: disableEventFilter(); - if (canDrop()) { drop(static_cast(e)); - resetDndState(false); } else { cancel(); - resetDndState(true); } exitDndEventLoop(); return true; // Eat all mouse events @@ -195,7 +191,7 @@ Qt::DropAction QBasicDrag::drag(QDrag *o) return m_executed_drop_action; } -void QBasicDrag::resetDndState(bool /* deleteSource */) +void QBasicDrag::restoreCursor() { if (m_restoreCursor) { #ifndef QT_NO_CURSOR @@ -227,6 +223,7 @@ void QBasicDrag::endDrag() void QBasicDrag::cancel() { disableEventFilter(); + restoreCursor(); m_drag_icon_window->setVisible(false); } @@ -239,6 +236,7 @@ void QBasicDrag::move(const QMouseEvent *) void QBasicDrag::drop(const QMouseEvent *) { disableEventFilter(); + restoreCursor(); m_drag_icon_window->setVisible(false); } diff --git a/src/platformsupport/dnd/qsimpledrag_p.h b/src/platformsupport/dnd/qsimpledrag_p.h index b2d4191b89..10237b36d7 100644 --- a/src/platformsupport/dnd/qsimpledrag_p.h +++ b/src/platformsupport/dnd/qsimpledrag_p.h @@ -88,7 +88,7 @@ protected: private: void enableEventFilter(); void disableEventFilter(); - void resetDndState(bool deleteSource); + void restoreCursor(); void exitDndEventLoop(); bool m_restoreCursor; diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp index 91acb5de02..8ce4ef5f04 100644 --- a/src/plugins/platforms/xcb/qxcbdrag.cpp +++ b/src/plugins/platforms/xcb/qxcbdrag.cpp @@ -523,7 +523,6 @@ void QXcbDrag::drop(const QMouseEvent *event) current_proxy_target = 0; source_time = 0; // current_embedding_widget = 0; - // #fixme resetDndState(false); } Qt::DropAction QXcbDrag::toDropAction(xcb_atom_t a) const