Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, April 2007
Trouble dragging and dropping item in QTreeview with a QStandardItem model


Message 1 in thread

For some reason when I attempt to drop and drop an item with one or more
child items, it will only drag the parent into the target but not the
child items (the child items just disappear, i.e., no indication the
parent can be expanded, etc). Also I am only moving these items
internally within the same treeview...

 

The relevant settings are: 

 

TreeView: 

 

DragDropMode = QAbstractItemView::InternalMove

DragEnabled (tried both true and false)

DragDropModeOverwrite (false)

AcceptDrops = false

 

StandardItemModel:

 

setSupportedDragActions(Qt::MoveAction)

 

 

I also tried setting each individual item to SetDragEnabled(true) and
SetDropEnabled(true)... just in case.  Still no luck.  If I didn't know
better, I'd say it's a bug.

 

Any advice would be much appreciated.

 

Thanks,

Pete