summaryrefslogtreecommitdiffstats
path: root/examples3/fontdisplayer.py
diff options
context:
space:
mode:
authoraneejit1 <aneejit1@gmail.com>2022-04-19 13:21:52 +0000
committerSlávek Banko <slavek.banko@axis.cz>2022-07-27 18:08:53 +0200
commit6be046642290c28c17949022fb66ae02ac21d544 (patch)
treee7b38b35a42b27569b26736afc4e472a2a5d672d /examples3/fontdisplayer.py
parent63fe0b82b47e7ee31f91374d96022a3ae77a86c3 (diff)
downloadpytqt-6be046642290c28c17949022fb66ae02ac21d544.tar.gz
pytqt-6be046642290c28c17949022fb66ae02ac21d544.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>
Diffstat (limited to 'examples3/fontdisplayer.py')
-rwxr-xr-xexamples3/fontdisplayer.py14
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)