Using drag and drop with ListView to create an inventory UI
问题 I'd like to create an inventory UI for my game using ListView, where the items can be removed from the inventory by dragging and dropping them in the level. If an item was not dropped properly (still inside the inventory), it should be placed back where it was before the drag. I've got the following code, but I don't know how to achieve what I'm after, even after looking at the Drag and Drop example. import QtQuick 2.3 Rectangle { id: root width: 400 height: 400 ListView { id: listView width: