summaryrefslogtreecommitdiffstats
path: root/examples2/tut10.py
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2011-11-29 01:11:08 -0600
committerTimothy Pearson <[email protected]>2011-11-29 01:11:08 -0600
commit8a055d66f43592c257cece2eb8cc021808062917 (patch)
treed0922f201bd5d24b62a33160d1d9baf9e89f9a70 /examples2/tut10.py
parentb388516ca2691303a076a0764fd40bf7116fe43d (diff)
downloadpytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz
pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip
Initial TQt conversion
Diffstat (limited to 'examples2/tut10.py')
-rwxr-xr-xexamples2/tut10.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/examples2/tut10.py b/examples2/tut10.py
index 0470a85..c852626 100755
--- a/examples2/tut10.py
+++ b/examples2/tut10.py
@@ -1,17 +1,17 @@
#!/usr/bin/env python
-# Qt tutorial 10.
+# TQt tutorial 10.
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,13 +31,13 @@ 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.f = 0
- self.setPalette(QPalette(QColor(250,250,200)))
+ self.setPalette(TQPalette(TQColor(250,250,200)))
def angle(self):
return self.ang
@@ -69,38 +69,38 @@ class CannonField(QWidget):
return
cr = self.cannonRect()
- pix = QPixmap(cr.size())
+ pix = TQPixmap(cr.size())
pix.fill(self,cr.topLeft())
- p = QPainter(pix)
+ p = TQPainter(pix)
- p.setBrush(Qt.blue)
- p.setPen(Qt.NoPen)
+ p.setBrush(TQt.blue)
+ p.setPen(TQt.NoPen)
p.translate(0,pix.height() - 1)
- 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))
p.end()
p.begin(self)
p.drawPixmap(cr.topLeft(),pix)
def cannonRect(self):
- r = QRect(0,0,50,50)
+ r = TQRect(0,0,50,50)
r.moveBottomLeft(self.rect().bottomLeft())
return r
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')
@@ -117,13 +117,13 @@ class MyWidget(QWidget):
self.connect(self.force,PYSIGNAL('valueChanged(int)'),self.cannonField.setForce)
self.connect(self.cannonField,PYSIGNAL('forceChanged(int)'),self.force.setValue)
- grid = QGridLayout(self,2,2,10)
+ grid = TQGridLayout(self,2,2,10)
grid.addWidget(quit,0,0)
grid.addWidget(self.cannonField,1,1)
grid.setColStretch(1,10)
- leftBox = QVBoxLayout()
+ leftBox = TQVBoxLayout()
grid.addLayout(leftBox,1,0)
@@ -135,8 +135,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)