summaryrefslogtreecommitdiffstats
path: root/examples3/tut8.py
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-29 01:11:08 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-29 01:11:08 -0600
commit8a055d66f43592c257cece2eb8cc021808062917 (patch)
treed0922f201bd5d24b62a33160d1d9baf9e89f9a70 /examples3/tut8.py
parentb388516ca2691303a076a0764fd40bf7116fe43d (diff)
downloadpytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz
pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip
Initial TQt conversion
Diffstat (limited to 'examples3/tut8.py')
-rwxr-xr-xexamples3/tut8.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/examples3/tut8.py b/examples3/tut8.py
index f7dd156..2bbc7b9 100755
--- a/examples3/tut8.py
+++ b/examples3/tut8.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python
-# Qt tutorial 8.
+# TQt tutorial 8.
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)"))
@@ -32,12 +32,12 @@ 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.setPalette(qt.QPalette(qt.QColor(250, 250, 200)))
+ self.setPalette(qt.TQPalette(qt.TQColor(250, 250, 200)))
def angle(self):
return self.ang
@@ -54,19 +54,19 @@ class CannonField(qt.QWidget):
self.emit(qt.PYSIGNAL("angleChanged(int)"), (self.ang, ))
def paintEvent(self, ev):
- p = qt.QPainter(self)
+ p = qt.TQPainter(self)
p.drawText(200, 200, "Angle = %d" % (self.ang))
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")
@@ -77,10 +77,10 @@ class MyWidget(qt.QWidget):
self.connect(self.angle, qt.PYSIGNAL("valueChanged(int)"), self.cannonField.setAngle)
self.connect(self.cannonField, qt.PYSIGNAL("angleChanged(int)"), self.angle.setValue)
- grid = qt.QGridLayout(self, 2, 2, 10)
+ grid = qt.TQGridLayout(self, 2, 2, 10)
grid.addWidget(quit, 0, 0)
- grid.addWidget(self.angle, 1, 0, qt.Qt.AlignTop)
+ grid.addWidget(self.angle, 1, 0, qt.TQt.AlignTop)
grid.addWidget(self.cannonField, 1, 1)
grid.setColStretch(1, 10)
@@ -88,7 +88,7 @@ class MyWidget(qt.QWidget):
self.angle.setFocus()
-a = qt.QApplication(sys.argv)
+a = qt.TQApplication(sys.argv)
w = MyWidget()
w.setGeometry(100, 100, 500, 355)