对DragDropMode的理解
QAbstractItemView::DragOnly | 1 | The view supports dragging of its own items |
感觉没什么用啊,看到一个禁止拖拽的小图表
QAbstractItemView::DropOnly | 2 | The view accepts drops |
什么也看不到
QAbstractItemView::DragDrop | 3 | The view supports both dragging and dropping |
拖拽完之后,会新建一个item
QAbstractItemView::InternalMove | 4 | The view accepts move (not copy) operations only from itself. |
拖拽,不新建,
self.treeWidget.setDragDropMode(QTreeWidget.InternalMove)