[PyQt] Re: memory corruption storing python objects in a QModelIndex with createIndex

Andreas Pakulat apaku at gmx.de
Thu Oct 2 08:50:47 BST 2008


On 01.10.08 19:10:47, Erick Tryzelaar wrote:
> Thanks Andreas. I fixed your suggestions, plus i shuffled some stuff
> around and I think I got it to work. In the meantime, I think I found
> a bug in modeltest. This is the simplest model I could come up with:
> 
> 
> class Model(QStringListModel):
>     pass
> 
> def main():
>     app = QCoreApplication(sys.argv)
> 
>     model = Model(['a', 'b'])
>     test = modeltest.ModelTest(model, app)
> 
> main()
> 
> 
> But it throws this exception:

Could be related to PyQt4 vs. C++ instances (i.e. the index is created in
C++ and the model pointer only has the QStringListModel part, but
self.model also contains the PyQt4 part).

But there are possibly other bugs, which were also in the C++ version of
modeltest, but have since been fixed there.

Andreas

-- 
Excellent day to have a rotten day.


More information about the PyQt mailing list