From 8a055d66f43592c257cece2eb8cc021808062917 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 29 Nov 2011 01:11:08 -0600 Subject: Initial TQt conversion --- examples2/aclock.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'examples2/aclock.py') diff --git a/examples2/aclock.py b/examples2/aclock.py index 38ed36c..9fc773b 100755 --- a/examples2/aclock.py +++ b/examples2/aclock.py @@ -3,34 +3,34 @@ import sys from qt import * -def QMIN(x, y): +def TQMIN(x, y): if y > x: return y return x -class AnalogClock(QWidget): +class AnalogClock(TQWidget): def __init__(self, *args): - apply(QWidget.__init__,(self,) + args) - self.time = QTime.currentTime() - internalTimer = QTimer(self) + apply(TQWidget.__init__,(self,) + args) + self.time = TQTime.currentTime() + internalTimer = TQTimer(self) self.connect(internalTimer, SIGNAL("timeout()"), self.timeout) internalTimer.start(5000) def timeout(self): - new_time = QTime.currentTime() + new_time = TQTime.currentTime() if new_time.minute() != self.time.minute(): self.update() def paintEvent(self, qe): if not self.isVisible(): return - self.time = QTime.currentTime() + self.time = TQTime.currentTime() - pts = QPointArray() - paint = QPainter(self) + pts = TQPointArray() + paint = TQPainter(self) paint.setBrush(self.foregroundColor()) - cp = QPoint(self.rect().center()) - d = QMIN(self.width(), self.height()) - matrix = QWMatrix() + cp = TQPoint(self.rect().center()) + d = TQMIN(self.width(), self.height()) + matrix = TQWMatrix() matrix.translate(cp.x(), cp.y()) matrix.scale(d/1000.0, d/1000.0) @@ -53,7 +53,7 @@ class AnalogClock(QWidget): paint.drawLine(450,0, 500,0) matrix.rotate(30) -a = QApplication(sys.argv) +a = TQApplication(sys.argv) clock = AnalogClock() clock.resize(100,100) a.setMainWidget(clock) -- cgit v1.2.1