[PyQt] using QPersistentModelIndex in a dictionary?

Phil Thompson phil at riverbankcomputing.com
Wed Oct 1 08:52:04 BST 2008


On Tue, 30 Sep 2008 18:41:32 -0700, "Erick Tryzelaar"
<idadesub at users.sourceforge.net> wrote:
> I noticed that while QModelIndexes are hash to the same value, it
> seems that QPersistentModelIndexes do not:
> 
>>>> a=QPersistentModelIndex()
>>>> b=QPersistentModelIndex()
>>>> hash(a)
> 46912496540400
>>>> hash(b)
> 46912496540536
> 
> Can this be added? Also, it'd be even neater if the hash equaled
> QModelIndexes so that we could search a dict using either of them.

Qt doesn't implement qHash() for QPersistentModelIndex.

Phil


More information about the PyQt mailing list