Add a startDrag to QPlatformDrag

This can be used to initialize data
when a drag starts. The Xdnd implementation
at least has a need for it.

Reviewed-by: Samuel
This commit is contained in:
Lars Knoll 2011-06-02 23:19:36 +02:00
parent 28391442e7
commit 92edbd2060
2 changed files with 4 additions and 1 deletions

View File

@ -473,7 +473,7 @@ Qt::DropAction QDragManager::drag(QDrag *o)
oldstate = Qt::NoModifier; // #### Should use state that caused the drag
// drag_mode = mode;
possible_actions = dragPrivate()->possible_actions;
possible_actions = dragPrivate()->possible_actions;
willDrop = false;
object->d_func()->target = 0;
@ -487,6 +487,8 @@ Qt::DropAction QDragManager::drag(QDrag *o)
#endif
updatePixmap();
platformDrag->startDrag();
eventLoop = new QEventLoop;
(void) eventLoop->exec();
delete eventLoop;

View File

@ -56,6 +56,7 @@ public:
virtual QMimeData *platformDropData() = 0;
virtual void startDrag() {};
virtual void move(const QMouseEvent *me) = 0;
virtual void drop(const QMouseEvent *me) = 0;
virtual void cancel() = 0;