[PyKDE] tableview and model

Andreas Pakulat apaku at gmx.de
Sat Feb 25 12:49:40 GMT 2006


On 25.02.06 02:10:06, Andreas Pakulat wrote:
> On 24.02.06 18:45:18, Phil Thompson wrote:
> > On Friday 24 February 2006 3:48 pm, Olivier Fournier wrote:
> > > I'll be happy you can help me!
> > 
> > Because setModel() doesn't take ownership of the model. In the first example 
> > model stays alive while it is being used. In the second it is garbage 
> > collected while it is still in use.
> 
> Huh? I thought we already corrected this?

Just to make sure I get this right: Using the Qt-delivered models I have
to keep a reference to them, but when I subclass those models I don't?
Because here the following works perfectly:

self.tableview.setModel(MyModel(list_))

There MyModel is derived from QAbstractItemModel and list_ is just a
list of data items.

Andreas

-- 
Excellent day for putting Slinkies on an escalator.




More information about the PyQt mailing list