[PyQt] Bug in QTableView.setModel()
digulla at hepe.com
Sun Jan 6 20:13:44 GMT 2008
When I create a python implementation of a table model derived from
QAbstractTableModel and use that in QTableView.setModel(), I have
spurious errors afterwards: Sometimes, the redraw doesn't work,
sometimes, I can't select anything, etc.
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
My quick fix was to write a helper class that extends QTableView and
saves a reference to the model in setModel() but it would be better if
that could be handled in the SIP layer.
Aaron "Optimizer" Digulla a.k.a. Philmann Dark
"It's not the universe that's limited, it's our imagination.
Follow me and I'll show you something beyond the limits."
More information about the PyQt