Originally Posted by Big Duck
Qt Code:
tableView->horizontalHeader()->hide();To copy to clipboard, switch view to plain text mode
You don't have to reimplement removeRows(). You have to reimplement removeRow(). the former will call removeRow() for each row which is to be removed, so you don't have to subclass it. removeRow() should... remove a row pointed by the index from the model (meaning its internal representation). For example, if you hold your items in a QList, you should remove an item associated with the index from that list.I've got as far as subclassing standardItemView and re implementing :
supportedDropActions() const
removeRows(int row, int count, const QModelIndex &parent)
Look above.My trouble is what to put in removeRows so that a MoveAction is done on the model. At the moment I get copying of data in the view.
That's because the item is copied as a child of the item you drop it on. You should reimplement dropMimeData() to correct that.Another problem is that when dragging the treeView item, I get a row with a + as its a treeView Im using, any ideas where I'm going wrong.
Bookmarks