diff options
Diffstat (limited to 'examples3/tut9.py')
-rwxr-xr-x | examples3/tut9.py | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/examples3/tut9.py b/examples3/tut9.py index aba7ddc..6c1880a 100755 --- a/examples3/tut9.py +++ b/examples3/tut9.py @@ -1,17 +1,17 @@ #!/usr/bin/env python -# Qt tutorial 9. +# TQt tutorial 9. 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,12 +31,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 @@ -53,26 +53,26 @@ 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.setBrush(qt.Qt.blue) - p.setPen(qt.Qt.NoPen) + p.setBrush(qt.TQt.blue) + p.setPen(qt.TQt.NoPen) p.translate(0, self.rect().bottom()) - 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)) 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") @@ -83,10 +83,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) @@ -94,8 +94,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) |