对DragDropMode的理解

 

 

QAbstractItemView::DragOnly1

The view supports dragging of its own items

感觉没什么用啊,看到一个禁止拖拽的小图表

 

 

QAbstractItemView::DropOnly2The view accepts drops

什么也看不到 

 

 

 

 

QAbstractItemView::DragDrop3The view supports both dragging and dropping

拖拽完之后,会新建一个item

 

 

QAbstractItemView::InternalMove4The view accepts move (not copy) operations only from itself.

拖拽,不新建,

self.treeWidget.setDragDropMode(QTreeWidget.InternalMove)

 

 

 

 

 

 

 

 
posted @ 2020-06-28 14:11  bH1pJ  阅读(63)  评论(0编辑  收藏  举报