The weird case of proxy model

Rest in peace, David Bowie


So basically I spent the day working with Qt’s proxy model. I didn’t get anything done, literally. I ran into a really weird problem, the proxy model I was working on wasn’t propagating methods like data. I added them both in the source code and header, nada, nothing! I’m baffled with this behavior, my class inherited QSortFilterProxyModel and as the documentation states methods like data are virtual, thus I can override them. Sadly, I wasn’t near anywhere that.

I know the proxy model was working. Why? It rendered the rows equally to the model’s rowCount. So, I’m baffled indeed. Whatever it inherited it certainly wasn’t QSortFilterProxyModel, my guess is that it called directly the abstract method…

But why data… god knows. I know I tried to override a few methods, and to my surprise I couldn’t get anything working with index, and parent.

Hopefully tomorrow I’ll have better results…

sweet baby jesus, fixing typo

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.