I’ve been attempting to implement something similar to the QtQuick example drag and drop:
http://doc-snapshot.qt-project.org/5.0/qtquick/quick-draganddrop.html
It seems quite straightforward to drag items from a list to a Droparea and the example is almost what I want to do. In my case, however, I need to keep the original list intact (i.e. make a copy of the original list item to put in the Droparea). I’m assuming this line in DragTile.qml:
onReleased: parent = tile.Drag.target !== null ? tile.Drag.target : root
becomes something more like:
onReleased: {
if(tile.Drag.target !== null ) { cppModel.copyItem(tile.Drag.target) }
}
Is this reasonable?
Also, when in the process of dragging, can I leave the list item in place and drag some sort of graphical replacement for it? If so, how would I do this?
↧