[PyKDE] subclassing QAbstractListModel

Phil Thompson phil at riverbankcomputing.co.uk
Tue May 2 18:11:56 BST 2006


On Tuesday 02 May 2006 5:59 pm, Tom Brown wrote:
> I am subclassing QAbstractListModel and getting an error in __init__().
> Here is the code where I receive the error:
>
> class StringsModel(QAbstractListModel):
>   def __init__(self, strings, parent=None):
>     QAbstractListModel.__init__(parent)
>     self.strings = strings
>
> When I run my application, this is the error I get:
>
>   File "/home/tbrown/projects/programUboot195/stringsmodel.py", line 5, in
> __init__
>     QAbstractListModel.__init__(parent)
> TypeError: descriptor '__init__' requires a 'sip.wrapper' object but
> received a 'NoneType'
>
> I've subclassed QAbstractItemModel to create a tree model and did not get
> the error above. The development of the StringModel and tree model were on
> different machines. I believe the sip versions are different as well as the
> PyQt4 snapshot. The versions I am using for the StringModel are:
>
> sip: 4.4.3
> PyQt4: PyQt4-gpl-snapshot-20060424
>
> I did not see anything in the PyQt4 changelog that addressed this issue
> specifically. So, what am I missing?

self

Phil




More information about the PyQt mailing list