On 2010-11-29 Andreas Pakulat <[email protected]> said: > > I don't know Marks book, but I do know that his material is high > quality. Sure for a simple example to learn the basics returning a > static number regardless of the parent item passed in is fine. Its > easier to understand for beginners, but that doesn't mean its correct. > And once your model gets more complicated or you use it for different > views you'll eventually run into behavioural weirdness. At that point > you should verify that your model works sanely (according to what Qt's > itemviews define as sane, which may not be the same as the definition of > a human brain ;). Best/easiest way to do that is adding the mentioned > modeltest to your model and run your app. One of the things that it'll > instantly assert on is returning non-0 amount of rows for a valid > parent but no index/data for it. >
I completely agree. I insisted in the simple approach because I was focused on
the Ian's sample code, which seems to fit in the simplest case.
Thanks a lot for your enlightening answer,
Vicent
::
Share what you know, learn what you don't
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
