diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-01 18:24:37 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-01 18:24:37 -0600 |
commit | 4e997a9c6e25689dca65a2ec573a599699ef8170 (patch) | |
tree | fdb5ecac42fb8204df9fc8c9abe1c784d4719e0e /PerlQt/examples/drawlines/drawlines.pl | |
parent | bfa107694b2507a7116f8856cafe4ab1375da8a9 (diff) | |
download | libtqt-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.pl | 20 |
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; |