[PyQt] comparing two QItemSelection always return False?

Phil Thompson phil at riverbankcomputing.com
Thu Jul 1 13:49:11 BST 2010


On Wed, 30 Jun 2010 20:35:02 +0200, Zoltan Szalai <flc at freemail.hu> wrote:
> Hello,
> 
> What's the proper way to compare two QItemSelection instances? It seems 
> that using the == operation always returns False.
> Comparing their indexes() can do the job but it seems a bit redundant.
> 
> The attached code tries to demonstrate the problem. Make any selection 
> in the view and check the result of the three prints.
> The first one will always return False, while the second and third one 
> will always return True.
> Am I doing something wrong?

No, it's a bug. Fixed in tonight's PyQt snapshot.

Thanks,
Phil


More information about the PyQt mailing list