diff options
author | aneejit1 <[email protected]> | 2022-04-19 13:21:52 +0000 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2022-07-28 00:56:02 +0200 |
commit | 52f8f8436dc2af136156ef95dbb8463481a78df8 (patch) | |
tree | 50e5f757a67774f98bfa931ef191dcc07683996d /examples2/desktop.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 <[email protected]>
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit 6be046642290c28c17949022fb66ae02ac21d544)
Diffstat (limited to 'examples2/desktop.py')
-rwxr-xr-x | examples2/desktop.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/examples2/desktop.py b/examples2/desktop.py index 049f39d..7f48159 100755 --- a/examples2/desktop.py +++ b/examples2/desktop.py @@ -26,7 +26,7 @@ maxcurves = 8 def poly(): d = TQApplication.desktop() - d.setBackgroundColor(white) + d.setPaletteBackgroundColor(white) xvel = [ 0 ] * 8 yvel = [ 0 ] * 8 head = 0 @@ -65,16 +65,16 @@ def poly(): y = y + yvel[i] if x >= maxx: x = maxx - (x - maxx + 1) - xvel[i] = -velocity(i) + xvel[i] = -velocity(i) if x <= minx: x = minx + (minx - x + 1) - xvel[i] = velocity(i) + xvel[i] = velocity(i) if y >= maxy: y = maxy - (y - maxy + 1) - yvel[i] = -velocity(i) + yvel[i] = -velocity(i) if y <= miny: y = miny + (miny - y + 1) - yvel[i] = velocity(i) + yvel[i] = velocity(i) a[head].setPoint(i, x, y) paint.end() @@ -98,7 +98,7 @@ def rotate(): m = TQWMatrix() m.rotate(i) rpm = pm.xForm(m) - d.setBackgroundPixmap(rpm) + d.setPaletteBackgroundPixmap(rpm) d.update() def generateStone(pm, c1, c2, c3): @@ -142,7 +142,7 @@ class DesktopWidget(TQWidget): if not self.pm: self.pm = TQPixmap(64, 64) generateStone(self.pm, c1, c2, c3) - self.setBackgroundPixmap(self.pm) + self.setPaletteBackgroundPixmap(self.pm) self.update() br = self.fontMetrics().boundingRect(self.text) offscreen = TQPixmap(br.width(), br.height()) @@ -186,7 +186,7 @@ def desktopText(s='Troll Tech'): drawShadeText(p, -r.x()+border, -r.y()+border, s, c2, c3) p.end() - tqApp.desktop().setBackgroundPixmap(pm) + tqApp.desktop().setPaletteBackgroundPixmap(pm) a = TQApplication(sys.argv) if len(sys.argv) > 1: |