[Interest] Why doesn't my model filter update?
mwoehlke.floss at gmail.com
Tue Feb 18 22:17:00 CET 2020
On 18/02/2020 15.35, Matthew Woehlke wrote:
> I have a QAbstractItemModel. I also have a QSortFilterProxyModel acting
> as a filter for the model, which in turn is used to feed a QTreeView.
> The filter accepts or rejects rows based on a custom data role of the
> source model.
> However, when the source model's data changes, the tree view does not
> update, and the filter's filterAcceptsRow is never called. What could I
> be doing wrong?
> The filter *does* have filterRole set correctly, and *does* have
> dynamicSortFilter set. (filterKeyColumn isn't set, but I'm using 0, and
> anyway setting it to -1 had no effect.) I've verified that the source
> model is emitting dataChanged() and is not blocking signals.
> The filter setup is at
> The model dataChanged is emitted at
Sigh... I found the problem.
I wonder if anyone else can spot it? ;-)
(Hint: it's near one of the bits of code linked above.)
More information about the Interest