[Development] QDrag and mouse events to QML MouseArea

Alberto Mardegan mardy at users.sourceforge.net
Tue Apr 12 22:34:03 CEST 2016


Hi all!
  I wanted to try fixing this bug:

https://bugreports.qt.io/browse/QTBUG-49876

(in QML, the dragged item disappears during the drag and drop operation,
if the dragType is Drag.Automatic -- external drag)

First of all, after some investigation I wonder whether this is actually
a bug, or if we should just document that during an external
(inter-process) drag the QML item won't be dragged; if one wants to see
a QML item being dragged during an external drag, then that's
QTBUG-37366, which I'm attempting to fix here (reviews welcome, BTW):

   https://codereview.qt-project.org/#/c/155445/

So, the question is whether QTBUG-49876 is valid at all. And if it is
valid, how should it be fixed?

Maybe QSimpleDrag's eventFilter() could forward the mouse move events to
the QWindow, but I suspect that this might not play too well with
hovering; so, it should be done only when QDrag is explicitly asked to.
Also, QSimpleDrag is AFAIK used only in Linux and OS X, so there should
be a different implementation for Windows.

My suggestion is that the bug is invalid, and we document that when
initiating an external DnD operations the target item should be anchored
(so that it does not move at all) and that the new Drag.pixmapUrl
property can be used to provide a visual feedback.

Opinions welcome :-)

Ciao,
  Alberto



More information about the Development mailing list