diff options
Diffstat (limited to 'examples2/tut8.py')
-rwxr-xr-x | examples2/tut8.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/examples2/tut8.py b/examples2/tut8.py index 045a4ef..2c16d22 100755 --- a/examples2/tut8.py +++ b/examples2/tut8.py @@ -1,17 +1,17 @@ #!/usr/bin/env python -# Qt tutorial 8. +# TQt tutorial 8. import sys from qt import * -class LCDRange(QVBox): +class LCDRange(TQVBox): def __init__(self,parent=None,name=None): - QVBox.__init__(self,parent,name) + TQVBox.__init__(self,parent,name) - lcd = QLCDNumber(2,self,'lcd') - self.slider = QSlider(Qt.Horizontal,self,'slider') + lcd = TQLCDNumber(2,self,'lcd') + self.slider = TQSlider(TQt.Horizontal,self,'slider') self.slider.setRange(0,99) self.slider.setValue(0) self.connect(self.slider,SIGNAL('valueChanged(int)'),lcd,SLOT('display(int)')) @@ -31,12 +31,12 @@ class LCDRange(QVBox): self.slider.setRange(minVal,maxVal) -class CannonField(QWidget): +class CannonField(TQWidget): def __init__(self,parent=None,name=None): - QWidget.__init__(self,parent,name) + TQWidget.__init__(self,parent,name) self.ang = 45 - self.setPalette(QPalette(QColor(250,250,200))) + self.setPalette(TQPalette(TQColor(250,250,200))) def angle(self): return self.ang @@ -53,19 +53,19 @@ class CannonField(QWidget): self.emit(PYSIGNAL('angleChanged(int)'),(self.ang,)) def paintEvent(self,ev): - p = QPainter(self) + p = TQPainter(self) p.drawText(200,200,'Angle = %d' % (self.ang)) def sizePolicy(self): - return QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Expanding) + return TQSizePolicy(TQSizePolicy.Expanding,TQSizePolicy.Expanding) -class MyWidget(QWidget): +class MyWidget(TQWidget): def __init__(self,parent=None,name=None): - QWidget.__init__(self,parent,name) + TQWidget.__init__(self,parent,name) - quit = QPushButton('Quit',self,'quit') - quit.setFont(QFont('Times',18,QFont.Bold)) + quit = TQPushButton('Quit',self,'quit') + quit.setFont(TQFont('Times',18,TQFont.Bold)) self.connect(quit,SIGNAL('clicked()'),qApp,SLOT('quit()')) self.angle = LCDRange(self,'angle') @@ -76,10 +76,10 @@ class MyWidget(QWidget): self.connect(self.angle,PYSIGNAL('valueChanged(int)'),self.cannonField.setAngle) self.connect(self.cannonField,PYSIGNAL('angleChanged(int)'),self.angle.setValue) - grid = QGridLayout(self,2,2,10) + grid = TQGridLayout(self,2,2,10) grid.addWidget(quit,0,0) - grid.addWidget(self.angle,1,0,Qt.AlignTop) + grid.addWidget(self.angle,1,0,TQt.AlignTop) grid.addWidget(self.cannonField,1,1) grid.setColStretch(1,10) @@ -87,7 +87,7 @@ class MyWidget(QWidget): self.angle.setFocus() -a = QApplication(sys.argv) +a = TQApplication(sys.argv) w = MyWidget() w.setGeometry(100,100,500,355) |