Я делаю приложение, в котором пользователь может добавлять новые данные в QTreeModel в любое время. Родитель, по которому он размещается, автоматически расширяется, чтобы показать новый элемент:Qt: Как автообновлять родителей нового элемента QTreeView при использовании QSortFilterProxyModel
self.tree = DiceModel(headers)
self.treeView.setModel(self.tree)
expand_node = self.tree.addRoll()
#addRoll makes a node, adds it, and returns the (parent) note to be expanded
self.treeView.expand(expand_node)
Это работает по желанию. Если не добавить QSortFilterProxyModel к смешиванию:
self.tree = DiceModel(headers)
self.sort = DiceSort(self.tree)
self.treeView.setModel(self.sort)
expand_node = self.tree.addRoll()
#addRoll makes a node, adds it, and returns the (parent) note to be expanded
self.treeView.expand(expand_node)
родитель больше не расширяется. Любая идея, что я делаю неправильно?