PDA

View Full Version : QSortFilterProxyModel and custom QTreeView-class - selectionChanged not working



Fenzor
20th October 2016, 08:45
Hi!

I have an issue that manifested after changing from using a custom QAbstractItemModel directly, to using QSortFilterProxyModel as a proxy model.
Now in my custom QTreeView class the reimplemented function "selectionChanged" is never called. This is a new behavior...
Sorting of my data works at least...
Also none of the rows in my TreeView are highlighted when I click on them.

I tried to create a new QItemSelectionModel, setting it to the TreeView and connecting it to a slot I created. But that also didn't work...

Can it be something I may have forgotten?

anda_skoa
20th October 2016, 17:30
Selection should work independently of the model as long as the item flags allow selection.

Cheers,
_

Fenzor
21st October 2016, 09:30
Thanks for the reply!
It didn't seem like the issue was with my flags. But it made me try to look a little harder at my code.
I tried to rewrite some of the code and it magically worked... :p
Probably something that I missed the first time around.

Thanks! :)