Hello
I try to program a QTreeView, that enables user to
1. pick an item of class A and to drop it on class B, B will take that item and insert it into his subtree.
2. Class A items can not be dropped on other items of class A
this->setDragEnabled(true);
this->setAcceptDrops(true);
this->setDragDropMode(InternalMove);
this->setDefaultDropAction(Qt::MoveAction);
this->setDropIndicatorShown(true);
this->setAnimated(true);
this->setAutoScroll(true);
this->setWordWrap(true);
this->setAlternatingRowColors(true);
this->setAutoScroll(true);
this->setDragEnabled(true);
this->setAcceptDrops(true);
this->setDragDropMode(InternalMove);
this->setDefaultDropAction(Qt::MoveAction);
this->setDropIndicatorShown(true);
this->setAnimated(true);
this->setAutoScroll(true);
this->setWordWrap(true);
this->setAlternatingRowColors(true);
this->setAutoScroll(true);
QTreeView::dropEvent(event);
To copy to clipboard, switch view to plain text mode
The items are dropped correctly, but the drop leaves an empty item in place from which the item was dragged. What to do about this?
Bookmarks