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/aclock.py | |
parent | b388516ca2691303a076a0764fd40bf7116fe43d (diff) | |
download | pytqt-8a055d66f43592c257cece2eb8cc021808062917.tar.gz pytqt-8a055d66f43592c257cece2eb8cc021808062917.zip |
Initial TQt conversion
Diffstat (limited to 'examples2/aclock.py')
-rwxr-xr-x | examples2/aclock.py | 26 |
1 files changed, 13 insertions, 13 deletions
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) |