[Development] QML DropArea documentation unhelpful
kfunk at kde.org
Wed May 14 22:04:13 CEST 2014
I'm trying to get my head around the QML Drag and Drop API and keep finding
oddities. (I've already posted some bugs and CRs in order to improve the
situation). But here's a new one:
DropArea has a 'onDropped' signal, that is supposed to be emitted "when a drop
event occurs within the bounds of a a DropArea." . Great. In good faith,
I've added a DropArea to my Item, implemented DropArea.onDropped and presumed
that this handler would be called as soon as I drop something on it (using a
Now, that's not the case:
DropArea.onEntered is called, but never DropArea.onDropped.
This is *very* confusing for the first time user.
 suggests adding something like this to the MouseArea initiating the drag:
That will work, but it looks really more like a crude hack. Digging through
the source code, it seems that DropArea.onDropped is only called in case of
"external drop" events. The 'externaldraganddrop' example is also the only
user of that handler.
However, I believe we should try calling DropArea.onDropped in all cases --
without the work-around from above.
Makes sense? If yes, I'll try to prepare a patch which addresses this. Happy
to get any kind of feedback on this issue.
More information about the Development