[PyQt] overriding QSqlRelationalTableModel's data method

Phil Thompson phil at riverbankcomputing.com
Sat Apr 3 16:42:35 BST 2010


On Sat, 3 Apr 2010 08:28:07 -0700, Scott Frankel <frankel at circlesfx.com>
wrote:
> On Apr 2, 2010, at 5:24 PM, Phil Thompson wrote:
> 
>> On Fri, 2 Apr 2010 17:05:15 -0700, Scott Frankel <frankel at circlesfx.com 
>> >
>> wrote:
>>> In my attempts so far, my model instance
>>> isn't calling its data() method.  (See attached.)
>>
>> Because you've added a data() method to your QWidget subclass. You  
>> need a
>> sub-class of QSqlRelationalTableModel.
> 
> 
> Thanks for the tip!  There must still be another reason for the  
> model's data() method not being called.  Still doesn't work.  I hope  
> it's not as obvious as the first!  (See revised model, attached.)

All you've done is replace QWidget with QSqlRelationTableModel. You aren't
actually using that sub-class as your model.

Phil


More information about the PyQt mailing list