I have a QTreeView of a QStandardItemModel. I have a button that allows the user to move a row up in the tree among its siblings, and I do this using QStandardItem.takeRow() and QStandardItem.insertRow().
In pseudocode, I have:My concern is that I am doing something wrong because I need to put in the expandAll() for things to work: otherwise when I reset the model the view collapses the entire tree. Is there a way to reset my model without having to re-expand my tree?Qt Code:
model.beginResetModel() #perform insert and take operations here model.endResetModel() view.expandAll()To copy to clipboard, switch view to plain text mode
Bookmarks