I have a subclassed QTreeView with a custom model. The model interfaces with a QList. I want to implement a custom internal drag and drop for the view. I already have drag and drop working for dragging files into the view from external file viewers. Basically what I want to do is that when rows are dragged in the view itself, the QList order changes: ie. I takeAt() and insert() in the list.
The docs are a little unclear as to what needs to be overridden in the model and the view. Currently, I have subclassed QMimeData and added an API to get which items is the list are being moved. I think that it won't be a problem to use that info to insert them back into the list, however I am not entirely sure as to what I should do with the rows in the view/model. The docs mention that you should implement removeRows() for the model, but they don't go on to say if you should call that function in the model explicitly yourself, or call it via the view, or what. Does anyone have any experience with this?