How to repaint a QTreeView after calling QItemSelectionModel::select?

258 views Asked by At

I have a QTreeView using a custom QAbstractItemModel. I update the tree view selection with

treeView->selectionModel()->select(selection, QItemSelectionModel::ClearAndSelect);

Which should also emit the signal selectionChanged for the tree view to receive. My issue is the tree view doesn't refresh until I interact with it with my cursor.

I've tried calling treeView->update() but it doesn't make a difference. What am I missing?

1

There are 1 answers

1
nathans On

Apologies, I've realised I was blocking the QItemSelectionModel signals further up my chain to avoid repeat calls of functions.