[PyQt] About dimensions of QAbstractTableModel
Vicent Mas
uvemas at gmail.com
Tue Nov 30 09:40:13 GMT 2010
On 2010-11-29 Andreas Pakulat <apaku at gmx.de> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101130/b7cca7b6/attachment.pgp>
More information about the PyQt
mailing list