I\'ve created a child class of QTreeWidget that I want to be able to drag items from another tree widget too (I want to handle the insertion myself though), as well as from
In PySide2 this works for me
def dropEvent(self, event):
if event.mimeData().hasFormat('application/x-qabstractitemmodeldatalist'):
data = event.mimeData()
source_item = QtGui.QStandardItemModel()
source_item.dropMimeData(data, QtCore.Qt.CopyAction, 0,0, QtCore.QModelIndex())
print(source_item.item(0, 0).text())