summaryrefslogtreecommitdiffstats
path: root/examples3/tut10.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples3/tut10.py')
-rwxr-xr-xexamples3/tut10.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/examples3/tut10.py b/examples3/tut10.py
index 182d04d..919ea7e 100755
--- a/examples3/tut10.py
+++ b/examples3/tut10.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python
-# Qt tutorial 10.
+# TQt tutorial 10.
import sys
import qt
-class LCDRange(qt.QVBox):
+class LCDRange(qt.TQVBox):
def __init__(self, parent=None, name=None):
- qt.QVBox.__init__(self, parent, name)
+ qt.TQVBox.__init__(self, parent, name)
- lcd = qt.QLCDNumber(2, self, "lcd")
- self.slider = qt.QSlider(qt.Qt.Horizontal, self, "slider")
+ lcd = qt.TQLCDNumber(2, self, "lcd")
+ self.slider = qt.TQSlider(qt.TQt.Horizontal, self, "slider")
self.slider.setRange(0, 99)
self.slider.setValue(0)
self.connect(self.slider, qt.SIGNAL("valueChanged(int)"), lcd, qt.SLOT("display(int)"))
@@ -31,13 +31,13 @@ class LCDRange(qt.QVBox):
self.slider.setRange(minVal, maxVal)
-class CannonField(qt.QWidget):
+class CannonField(qt.TQWidget):
def __init__(self, parent=None, name=None):
- qt.QWidget.__init__(self, parent, name)
+ qt.TQWidget.__init__(self, parent, name)
self.ang = 45
self.f = 0
- self.setPalette(qt.QPalette(qt.QColor(250, 250, 200)))
+ self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200)))
def angle(self):
return self.ang
@@ -69,38 +69,38 @@ class CannonField(qt.QWidget):
return
cr = self.cannonRect()
- pix = qt.QPixmap(cr.size())
+ pix = qt.TQPixmap(cr.size())
pix.fill(self, cr.topLeft())
- p = qt.QPainter(pix)
+ p = qt.TQPainter(pix)
- p.setBrush(qt.Qt.blue)
- p.setPen(qt.Qt.NoPen)
+ p.setBrush(qt.TQt.blue)
+ p.setPen(qt.TQt.NoPen)
p.translate(0, pix.height() - 1)
- p.drawPie(qt.QRect(-35, -35, 70, 70), 0, 90 * 16)
+ p.drawPie(qt.TQRect(-35, -35, 70, 70), 0, 90 * 16)
p.rotate(-self.ang)
- p.drawRect(qt.QRect(33, -4, 15, 8))
+ p.drawRect(qt.TQRect(33, -4, 15, 8))
p.end()
p.begin(self)
p.drawPixmap(cr.topLeft(), pix)
def cannonRect(self):
- r = qt.QRect(0, 0, 50, 50)
+ r = qt.TQRect(0, 0, 50, 50)
r.moveBottomLeft(self.rect().bottomLeft())
return r
def sizePolicy(self):
- return qt.QSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding)
+ return qt.TQSizePolicy(qt.TQSizePolicy.Expanding, qt.TQSizePolicy.Expanding)
-class MyWidget(qt.QWidget):
+class MyWidget(qt.TQWidget):
def __init__(self, parent=None, name=None):
- qt.QWidget.__init__(self, parent, name)
+ qt.TQWidget.__init__(self, parent, name)
- quit = qt.QPushButton("&Quit", self, "quit")
- quit.setFont(qt.QFont("Times", 18, qt.QFont.Bold))
+ quit = qt.TQPushButton("&Quit", self, "quit")
+ quit.setFont(qt.TQFont("Times", 18, qt.TQFont.Bold))
self.connect(quit, qt.SIGNAL("clicked()"), qt.qApp, qt.SLOT("quit()"))
self.angle = LCDRange(self, "angle")
@@ -117,13 +117,13 @@ class MyWidget(qt.QWidget):
self.connect(self.force, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setForce)
self.connect(self.cannonField, qt.PYSIGNAL("forceChanged(int)"), self.force.setValue)
- grid = qt.QGridLayout(self, 2, 2, 10)
+ grid = qt.TQGridLayout(self, 2, 2, 10)
grid.addWidget(quit, 0, 0)
grid.addWidget(self.cannonField, 1, 1)
grid.setColStretch(1, 10)
- leftBox = qt.QVBoxLayout()
+ leftBox = qt.TQVBoxLayout()
grid.addLayout(leftBox, 1, 0)
@@ -135,8 +135,8 @@ class MyWidget(qt.QWidget):
self.angle.setFocus()
-qt.QApplication.setColorSpec(qt.QApplication.CustomColor)
-a = qt.QApplication(sys.argv)
+qt.TQApplication.setColorSpec(qt.TQApplication.CustomColor)
+a = qt.TQApplication(sys.argv)
w = MyWidget()
w.setGeometry(100, 100, 500, 355)