summaryrefslogtreecommitdiffstats
path: root/PerlQt/examples/aclock
diff options
context:
space:
mode:
Diffstat (limited to 'PerlQt/examples/aclock')
-rw-r--r--PerlQt/examples/aclock/AnalogClock.pm42
-rw-r--r--PerlQt/examples/aclock/aclock.pl6
2 files changed, 24 insertions, 24 deletions
diff --git a/PerlQt/examples/aclock/AnalogClock.pm b/PerlQt/examples/aclock/AnalogClock.pm
index d4aeff9..0a52c44 100644
--- a/PerlQt/examples/aclock/AnalogClock.pm
+++ b/PerlQt/examples/aclock/AnalogClock.pm
@@ -1,24 +1,24 @@
package AnalogClock;
-use Qt;
-use Qt::isa qw(Qt::Widget);
-use Qt::slots
- setTime => ['const QTime&'],
- drawClock => ['QPainter*'],
+use TQt;
+use TQt::isa qw(TQt::Widget);
+use TQt::slots
+ setTime => ['const TQTime&'],
+ drawClock => ['TQPainter*'],
timeout => [];
-use Qt::attributes qw(
+use TQt::attributes qw(
clickPos
_time
);
#
-# Constructs an analog clock widget that uses an internal QTimer
+# Constructs an analog clock widget that uses an internal TQTimer
#
sub NEW {
shift->SUPER::NEW(@_);
- _time = Qt::Time::currentTime(); # get current time
- my $internalTimer = Qt::Timer(this); # create internal timer
- this->connect($internalTimer, SIGNAL('timeout()'), SLOT('timeout()'));
+ _time = TQt::Time::currentTime(); # get current time
+ my $internalTimer = TQt::Timer(this); # create internal timer
+ this->connect($internalTimer, TQT_SIGNAL('timeout()'), TQT_SLOT('timeout()'));
$internalTimer->start(5000); # emit signal every 5 seconds
}
@@ -26,11 +26,11 @@ sub mousePressEvent {
my $e = shift;
if(isTopLevel()) {
# Lack of operators is really noticable here
- my $topLeft = Qt::Point(
+ my $topLeft = TQt::Point(
geometry()->topLeft->x - frameGeometry()->topLeft->x,
geometry()->topLeft->y - frameGeometry()->topLeft->y
);
- clickPos = Qt::Point($e->pos->x + $topLeft->x,
+ clickPos = TQt::Point($e->pos->x + $topLeft->x,
$e->pos->y + $topLeft->y);
}
}
@@ -38,7 +38,7 @@ sub mousePressEvent {
sub mouseMoveEvent {
my $e = shift;
if(isTopLevel()) {
- move(Qt::Point($e->globalPos->x - clickPos->x,
+ move(TQt::Point($e->globalPos->x - clickPos->x,
$e->globalPos->y - clickPos->y));
}
}
@@ -49,11 +49,11 @@ sub setTime {
}
#
-# The QTimer::timeout() signal is received by this slot.
+# The TQTimer::timeout() signal is received by this slot.
#
sub timeout {
- my $new_time = Qt::Time::currentTime(); # get the current time
+ my $new_time = TQt::Time::currentTime(); # get the current time
_time = _time->addSecs(5);
if($new_time->minute != _time->minute) { # minute has changed
if(autoMask()) {
@@ -66,7 +66,7 @@ sub timeout {
sub paintEvent {
return if autoMask();
- my $paint = Qt::Painter(this);
+ my $paint = TQt::Painter(this);
$paint->setBrush(colorGroup()->foreground);
drawClock($paint);
}
@@ -75,10 +75,10 @@ sub paintEvent {
# instead of paintEvent()
sub updateMask { # paint clock mask
- my $bm = Qt::Bitmap(size());
+ my $bm = TQt::Bitmap(size());
$bm->fill(&color0); # transparent
- my $paint = Qt::Painter;
+ my $paint = TQt::Painter;
$paint->begin($bm, this);
$paint->setBrush(&color1); # use non-transparent color
$paint->setPen(&color1);
@@ -105,8 +105,8 @@ sub drawClock {
$paint->setViewport($v->left + ($v->width-$d)/2,
$v->top - ($v->height-$d)/2, $d, $d);
- # _time = Qt::Time::currentTime();
- my $pts = Qt::PointArray();
+ # _time = TQt::Time::currentTime();
+ my $pts = TQt::PointArray();
$paint->save;
$paint->rotate(30*(_time->hour%12-3) + _time->minute/2);
@@ -131,7 +131,7 @@ sub drawClock {
sub setAutoMask {
my $b = shift;
setBackgroundMode($b ? &PaletteForeground : &PaletteBackground);
- Qt::Widget::setAutoMask($b);
+ TQt::Widget::setAutoMask($b);
}
1;
diff --git a/PerlQt/examples/aclock/aclock.pl b/PerlQt/examples/aclock/aclock.pl
index ff59ec1..b4ae659 100644
--- a/PerlQt/examples/aclock/aclock.pl
+++ b/PerlQt/examples/aclock/aclock.pl
@@ -1,13 +1,13 @@
#!/usr/bin/perl -w
use strict;
-use Qt;
+use TQt;
use AnalogClock;
-my $a = Qt::Application(\@ARGV);
+my $a = TQt::Application(\@ARGV);
my $clock = AnalogClock;
$clock->setAutoMask(1) if @ARGV and $ARGV[0] eq '-transparent';
$clock->resize(100, 100);
$a->setMainWidget($clock);
-$clock->setCaption("PerlQt example - Analog Clock");
+$clock->setCaption("PerlTQt example - Analog Clock");
$clock->show;
exit $a->exec;