diff options
| author | aneejit1 <aneejit1@gmail.com> | 2022-04-19 13:21:52 +0000 |
|---|---|---|
| committer | Slávek Banko <slavek.banko@axis.cz> | 2022-07-28 00:56:02 +0200 |
| commit | 52f8f8436dc2af136156ef95dbb8463481a78df8 (patch) | |
| tree | 50e5f757a67774f98bfa931ef191dcc07683996d /examples3/fontdisplayer.py | |
| parent | 228b87ea89625d0783fdfe60114eba89e0f37942 (diff) | |
| download | pytqt-52f8f8436dc2af136156ef95dbb8463481a78df8.tar.gz pytqt-52f8f8436dc2af136156ef95dbb8463481a78df8.zip | |
Updates to support Python version 3
Amendments to the sip source and configuration/build scripts to allow
for support under Python version 3. The examples have been updated
using "2to3" along with some manual changes to sort out intentation
and casting to integer from float.
Signed-off-by: aneejit1 <aneejit1@gmail.com>
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 6be046642290c28c17949022fb66ae02ac21d544)
Diffstat (limited to 'examples3/fontdisplayer.py')
| -rwxr-xr-x | examples3/fontdisplayer.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples3/fontdisplayer.py b/examples3/fontdisplayer.py index 7e66572..1f616bf 100755 --- a/examples3/fontdisplayer.py +++ b/examples3/fontdisplayer.py @@ -41,15 +41,15 @@ class FontRowTable( TQFrame ): fm = self.fontMetrics() ml = self.frameWidth() + self.margin() + 1 + max(0,-fm.minLeftBearing()) mt = self.frameWidth() + self.margin() - cell = TQSize((self.width()-15-ml)/16,(self.height()-15-mt)/16) + cell = TQSize(int((self.width()-15-ml)/16),int((self.height()-15-mt)/16)) if not cell.width() or not cell.height() : return - mini = r.left() / cell.width() - maxi = (r.right()+cell.width()-1) / cell.width() - minj = r.top() / cell.height() - maxj = (r.bottom()+cell.height()-1) / cell.height() + mini = int(r.left() / cell.width()) + maxi = int((r.right()+cell.width()-1) / cell.width()) + minj = int(r.top() / cell.height()) + maxj = int((r.bottom()+cell.height()-1) / cell.height()) h = fm.height() @@ -83,13 +83,13 @@ class FontRowTable( TQFrame ): else: sign = positive if l > 0: lsign = 0 else: lsign = 1 - p.fillRect(x+lsign, y-h/2, abs(l),-h/2, TQBrush(sign)) + p.fillRect(x+lsign, int(y-h/2), abs(l),int(-h/2), TQBrush(sign)) if r : if r < 0: sign = rnegative else: sign = rpositive if r > 0: rsign = r else: rsign = 0 - p.fillRect(x+w-rsign,y+2, abs(r),-h/2, TQBrush(sign)) + p.fillRect(int(x+w-rsign),y+2, abs(r),int(-h/2), TQBrush(sign)) s = TQString( ch ) p.setPen(TQPen(TQt.black)) p.drawText(x,y,s) |
