[PyQt] order of flags significant in coercing

Phil Thompson phil at riverbankcomputing.com
Mon Sep 13 20:20:13 BST 2010


On Wed, 8 Sep 2010 14:56:00 +0200, "Hans-Peter Jansen" <hpj at urpla.net>
wrote:
> Hi Phil, 
> 
> there's an issue with the order of flags when coercing to int for e.g. 
> QPainter.paintText():
> 
>>>> from PyQt4.QtCore import *
>>>> type(Qt.AlignLeft|Qt.TextWordWrap|Qt.AlignTop)
> <class 'PyQt4.QtCore.Alignment'>
>>>> type(Qt.AlignLeft|Qt.AlignTop|Qt.TextWordWrap)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: unsupported operand type(s) for |: 'Alignment' and 'TextFlag'

Should be fixed in tonight's PyQt snapshot.

Thanks,
Phil


More information about the PyQt mailing list