[PyQt] Bug in QTableView.setModel()

Andreas Pakulat apaku at gmx.de
Mon Jan 7 09:33:35 GMT 2008


On 06.01.08 21:13:44, Aaron Digulla wrote:
> The root cause is that setModel() doesn't increment the usage counter of
> the python class passed in, so Python will GC it if I don't save a
> pointer elsewhere.

Thats by purpose. One reason I can think of is that you often want to
use the model elsewhere to insert data or do something with the data and
then you often don't want a QAbstractItemModel instance but your
specific subclass.

Andreas

-- 
You should emulate your heros, but don't carry it too far.  Especially
if they are dead.


More information about the PyQt mailing list