summaryrefslogtreecommitdiffstats
path: root/PerlQt/examples/drawlines/drawlines.pl
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-01 18:24:37 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-01 18:24:37 -0600
commit4e997a9c6e25689dca65a2ec573a599699ef8170 (patch)
treefdb5ecac42fb8204df9fc8c9abe1c784d4719e0e /PerlQt/examples/drawlines/drawlines.pl
parentbfa107694b2507a7116f8856cafe4ab1375da8a9 (diff)
downloadlibtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.tar.gz
libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.zip
Initial TQt conversion
Diffstat (limited to 'PerlQt/examples/drawlines/drawlines.pl')
-rw-r--r--PerlQt/examples/drawlines/drawlines.pl20
1 files changed, 10 insertions, 10 deletions
diff --git a/PerlQt/examples/drawlines/drawlines.pl b/PerlQt/examples/drawlines/drawlines.pl
index 7297fa2..1d7575f 100644
--- a/PerlQt/examples/drawlines/drawlines.pl
+++ b/PerlQt/examples/drawlines/drawlines.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl -w
use strict;
package ConnectWidget;
-use Qt;
-use Qt::isa qw(Qt::Widget);
-use Qt::attributes qw(
+use TQt;
+use TQt::isa qw(TQt::Widget);
+use TQt::attributes qw(
points
colors
count
@@ -25,13 +25,13 @@ sub NEW {
points = [];
my @colors;
for(1 .. MAXCOLORS) {
- push @colors, Qt::Color(rand(255), rand(255), rand(255));
+ push @colors, TQt::Color(rand(255), rand(255), rand(255));
}
colors = \@colors;
}
sub paintEvent {
- my $paint = Qt::Painter(this);
+ my $paint = TQt::Painter(this);
for(my $i = 0; $i < count-1; $i++) {
for(my $j = $i+1; $j < count; $j++) {
$paint->setPen(colors->[rand(MAXCOLORS)]);
@@ -55,20 +55,20 @@ sub mouseReleaseEvent {
sub mouseMoveEvent {
my $e = shift;
if(down && count < MAXPOINTS) {
- my $paint = Qt::Painter(this);
- push @{this->points}, Qt::Point($e->pos);
+ my $paint = TQt::Painter(this);
+ push @{this->points}, TQt::Point($e->pos);
count++;
$paint->drawPoint($e->pos);
}
}
package main;
-use Qt;
+use TQt;
use ConnectWidget;
-my $a = Qt::Application(\@ARGV);
+my $a = TQt::Application(\@ARGV);
my $connect = ConnectWidget;
-$connect->setCaption("PerlQt Example - Draw lines");
+$connect->setCaption("PerlTQt Example - Draw lines");
$a->setMainWidget($connect);
$connect->show;
exit $a->exec;