On Saturday 10 December 2005 6:13 pm, Baz Walter wrote: > The PyQt4 implementation of Flags (such as QtCore.Qt.Alignment) has support > for the and/or/xor binary arithmetic operations and augmented assignment. > > These works okay so long as both operands are Flags of the same type: > >>> from PyQt4 import QtCore > >>> a = QtCore.Qt.Alignment(QtCore.Qt.AlignmentFlag(0)) > >>> b = QtCore.Qt.Alignment(QtCore.Qt.AlignmentFlag(1)) > >>> int(a|b) > > 1 > > ... but not if one operand is, say, an int or another type of Flag: > >>> o = QtCore.Qt.Orientations(QtCore.Qt.Orientation(0)) > >>> int(a|o) > > Segmentation fault > > >>> int(a|3) > > Segmentation fault > > Is there any way to fix this so that it results in, say, a TypeError?
It will be fixed in tonight's SIP snapshot. > Also, would it be possible to have a default argument of zero/None for > these > > Flags so they can be created like this: > >>> f = QtCore.Qt.Orientations() > >>> int(f) > > 0 It will be in tonight's PyQt snapshot. Thanks, Phil _______________________________________________ PyKDE mailing list [email protected] http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
