From pykde Thu Oct 26 16:14:30 2006 From: "Phil Thompson" Date: Thu, 26 Oct 2006 16:14:30 +0000 To: pykde Subject: Re: [PyKDE] Problem with QPainter.drawText() flags Message-Id: <42927.195.6.25.120.1161879270.squirrel () river-bank ! demon ! co ! uk> X-MARC-Message: https://marc.info/?l=pykde&m=116187952724932 > Hi - > > In Qt4, the QPainter.drawText() variants that use a rectangle also have > a flags parameter. According to the Qt4 documentation, the flags > parameter can be an OR combination of Qt.AlignmentFlag and Qt.TextFlag. > > In PyQt 4.01, the drawText() function works fine with a combination of > alignment flags, but it throws a TypeError with a combination of > alignment and text flags. Cast then to ints first then or them. Something like... int(Qt.Alignment...|Qt.Alignment...)|int(Qt.Text...|Qt.Text...) ...or cast them to ints individually if you prefer. Phil _______________________________________________ PyKDE mailing list PyKDE@mats.imk.fraunhofer.de http://mats.imk.fraunhofer.de/mailman/listinfo/pykde