diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-29 01:11:08 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-29 01:11:08 -0600 |
commit | 8a055d66f43592c257cece2eb8cc021808062917 (patch) | |
tree | d0922f201bd5d24b62a33160d1d9baf9e89f9a70 /examples2/tut9.py | |
parent | b388516ca2691303a076a0764fd40bf7116fe43d (diff) | |
download | pytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip |
Initial TQt conversion
Diffstat (limited to 'examples2/tut9.py')
-rwxr-xr-x | examples2/tut9.py | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/examples2/tut9.py b/examples2/tut9.py index 16c7d69..fdcd9f0 100755 --- a/examples2/tut9.py +++ b/examples2/tut9.py @@ -1,17 +1,17 @@ #!/usr/bin/env python -# Qt tutorial 9. +# TQt tutorial 9. 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,26 +53,26 @@ class CannonField(QWidget): self.emit(PYSIGNAL('angleChanged(int)'),(self.ang,)) def paintEvent(self,ev): - p = QPainter(self) + p = TQPainter(self) - p.setBrush(Qt.blue) - p.setPen(Qt.NoPen) + p.setBrush(TQt.blue) + p.setPen(TQt.NoPen) p.translate(0,self.rect().bottom()) - p.drawPie(QRect(-35,-35,70,70),0,90 * 16) + p.drawPie(TQRect(-35,-35,70,70),0,90 * 16) p.rotate(-self.ang) - p.drawRect(QRect(33,-4,15,8)) + p.drawRect(TQRect(33,-4,15,8)) 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') @@ -83,10 +83,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) @@ -94,8 +94,8 @@ class MyWidget(QWidget): self.angle.setFocus() -QApplication.setColorSpec(QApplication.CustomColor) -a = QApplication(sys.argv) +TQApplication.setColorSpec(TQApplication.CustomColor) +a = TQApplication(sys.argv) w = MyWidget() w.setGeometry(100,100,500,355) |