summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qdnd.cpp18
-rw-r--r--src/gui/kernel/qdnd_p.h3
2 files changed, 21 insertions, 0 deletions
diff --git a/src/gui/kernel/qdnd.cpp b/src/gui/kernel/qdnd.cpp
index 8ce4f119c0..4ed2515115 100644
--- a/src/gui/kernel/qdnd.cpp
+++ b/src/gui/kernel/qdnd.cpp
@@ -511,6 +511,24 @@ void QDragManager::cancel(bool deleteSource)
global_accepted_action = Qt::IgnoreAction;
}
+/*!
+ Called from startDrag() in QPlatformDrag implementations that do not need
+ the desktop-oriented stuff provided by the event filter (e.g. because their
+ drag is not based on mouse events). Instead, they will manage everything on
+ their own, will not rely on move/drop/cancel, and will call stopDrag() to stop
+ the event loop when the drag is over.
+ */
+void QDragManager::unmanageEvents()
+{
+ qApp->removeEventFilter(this);
+}
+
+void QDragManager::stopDrag()
+{
+ if (eventLoop)
+ eventLoop->exit();
+}
+
#endif // QT_NO_DRAGANDDROP
#if !(defined(QT_NO_DRAGANDDROP) && defined(QT_NO_CLIPBOARD))
diff --git a/src/gui/kernel/qdnd_p.h b/src/gui/kernel/qdnd_p.h
index 7159acf594..2a81de5c7f 100644
--- a/src/gui/kernel/qdnd_p.h
+++ b/src/gui/kernel/qdnd_p.h
@@ -200,6 +200,9 @@ public:
QShapedPixmapWindow *shapedPixmapWindow;
+ void unmanageEvents();
+ void stopDrag();
+
private:
QMimeData *platformDropData;