Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Find what you need - explore our website and developer resources
16 December 2021
Model/View programming can be hard -- no -- correction: it is hard!
Your hard crafted models might work just fine when you connect them to a view, but how about when hooking them up to multiple views?
Or even worse: put a (partially broken?) proxy model on top of your model. Will it behave well still?
And of course, you only do add such a proxy model years after you write the original model, at a time when you've forgotten about the finer details about your model.
A solution to this is to add the model tester that comes with Qt to all of your models.
In this video, I will show you a class I've written that automatically does this and I will explain what the QAbstractItemModelTester really does.
The example code showcased in this video is available here: https://github.com/KDAB/kdabtv/tree/master/Qt-Widgets-and-more/ModelTesting
All Qt Widgets and more videos:
https://www.youtube.com/playlist?list=PL6CJYn40gN6gf-G-o6syFwGrtq3kItEqI