summaryrefslogtreecommitdiffstats
path: root/examples3/drawlines.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples3/drawlines.py')
-rwxr-xr-xexamples3/drawlines.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples3/drawlines.py b/examples3/drawlines.py
index 3e21db7..bdbe814 100755
--- a/examples3/drawlines.py
+++ b/examples3/drawlines.py
@@ -13,10 +13,10 @@ MAXCOLORS = 40;
# ConnectWidget - draws connected lines
#
-class ConnectWidget(QWidget):
+class ConnectWidget(TQWidget):
def __init__(self):
- QWidget.__init__(self)
- self.setEraseColor( Qt.white ) # white background
+ TQWidget.__init__(self)
+ self.setEraseColor( TQt.white ) # white background
self.count = 0;
self.down = FALSE
@@ -24,15 +24,15 @@ class ConnectWidget(QWidget):
self.colors = []
for i in range(MAXPOINTS): # init arrays
- self.points.append(QPoint())
+ self.points.append(TQPoint())
for i in range(MAXCOLORS):
- self.colors.append(QColor( random.randint(0,255), random.randint(0,255), random.randint(0,255) ))
+ self.colors.append(TQColor( random.randint(0,255), random.randint(0,255), random.randint(0,255) ))
#
# Handles paint events for the connect widget.
#
def paintEvent(self, pe):
- paint = QPainter( self )
+ paint = TQPainter( self )
for i in range(self.count-1): # connect all points
for j in range(i+1, self.count):
paint.setPen( self.colors[random.randint(0,MAXCOLORS-1)] ) # set random pen color
@@ -58,17 +58,17 @@ class ConnectWidget(QWidget):
#
def mouseMoveEvent(self, me):
if self.down and self.count < MAXPOINTS:
- paint = QPainter( self )
- self.points[self.count] = QPoint(me.pos()) # add point
+ paint = TQPainter( self )
+ self.points[self.count] = TQPoint(me.pos()) # add point
paint.drawPoint( me.pos() ) # plot point
self.count = self.count+1
#
# Create and display a ConnectWidget.
#
-a = QApplication( sys.argv )
+a = TQApplication( sys.argv )
connect = ConnectWidget()
-connect.setCaption( "PyQt Example - Draw lines")
+connect.setCaption( "PyTQt Example - Draw lines")
a.setMainWidget( connect )
connect.show()
a.exec_loop()