[PyQt] order of flags significant in coercing

Hans-Peter Jansen hpj at urpla.net
Wed Sep 8 13:56:00 BST 2010


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'

Cheers,
Pete


More information about the PyQt mailing list