diff options
Diffstat (limited to 'PerlQt/examples/drawdemo/drawdemo.pl')
-rw-r--r-- | PerlQt/examples/drawdemo/drawdemo.pl | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/PerlQt/examples/drawdemo/drawdemo.pl b/PerlQt/examples/drawdemo/drawdemo.pl index c58e10d..f119a94 100644 --- a/PerlQt/examples/drawdemo/drawdemo.pl +++ b/PerlQt/examples/drawdemo/drawdemo.pl @@ -1,12 +1,12 @@ #!/usr/bin/perl -w use strict; package DrawView; -use Qt; -use Qt::isa qw(Qt::Widget); -use Qt::slots +use TQt; +use TQt::isa qw(TQt::Widget); +use TQt::slots updateIt => ['int'], printIt => []; -use Qt::attributes qw( +use TQt::attributes qw( printer bgroup _print @@ -26,19 +26,19 @@ use Qt::attributes qw( sub drawColorWheel { my $p = shift; - my $f = Qt::Font("times", 18, &Qt::Font::Bold); + my $f = TQt::Font("times", 18, &TQt::Font::Bold); $p->setFont($f); $p->setPen(&black); $p->setWindow(0, 0, 500, 500); # defines coordinate system for my $i (0..35) { - my $matrix = Qt::WMatrix; + my $matrix = TQt::WMatrix; $matrix->translate(250.0, 250.0); # move to center $matrix->shear(0.0, 0.3); # twist it $matrix->rotate($i*10.0); # rotate 0,10,20,.. degrees $p->setWorldMatrix($matrix); # use this world matrix - my $c = Qt::Color; + my $c = TQt::Color; $c->setHsv($i*10, 255, 255); # rainbow effect $p->setBrush($c); # solid fill with color $c $p->drawRect(70, -10, 80, 10); # draw the rectangle @@ -59,7 +59,7 @@ sub drawFonts { my $y = 0; for my $f (@fonts) { for my $s (@sizes) { - my $font = Qt::Font($f, $s); + my $font = TQt::Font($f, $s); $p->setFont($font); my $fm = $p->fontMetrics; $y += $fm->ascent; @@ -75,10 +75,10 @@ sub drawFonts { sub drawShapes { my $p = shift; - my $b1 = Qt::Brush(&blue); - my $b2 = Qt::Brush(&green, &Dense6Pattern); # green 12% fill - my $b3 = Qt::Brush(&NoBrush); # void brush - my $b4 = Qt::Brush(&CrossPattern); # black cross pattern + my $b1 = TQt::Brush(&blue); + my $b2 = TQt::Brush(&green, &Dense6Pattern); # green 12% fill + my $b3 = TQt::Brush(&NoBrush); # void brush + my $b4 = TQt::Brush(&CrossPattern); # black cross pattern $p->setPen(&red); $p->setBrush($b1); @@ -105,13 +105,13 @@ our @drawFunctions = ( sub NEW { shift->SUPER::NEW(@_); - setCaption("PerlQt Draw Demo Application"); + setCaption("PerlTQt Draw Demo Application"); setBackgroundColor(&white); # Create a button group to contain all buttons - bgroup = Qt::ButtonGroup(this); + bgroup = TQt::ButtonGroup(this); bgroup->resize(200, 200); - this->connect(bgroup, SIGNAL('clicked(int)'), SLOT('updateIt(int)')); + this->connect(bgroup, TQT_SIGNAL('clicked(int)'), TQT_SLOT('updateIt(int)')); # Calculate the size for the radio buttons my $maxwidth = 80; @@ -128,7 +128,7 @@ sub NEW { for my $i (0 .. $#drawFunctions) { my $n = $drawFunctions[$i]{name}; - my $rb = Qt::RadioButton($n, bgroup); + my $rb = TQt::RadioButton($n, bgroup); $rb->setGeometry(10, $i*30+10, $maxwidth, 30); $maxheight += 30; @@ -145,12 +145,12 @@ sub NEW { bgroup->resize($maxwidth, $maxheight); - printer = Qt::Printer; + printer = TQt::Printer; - _print = Qt::PushButton("Print...", bgroup); + _print = TQt::PushButton("Print...", bgroup); _print->resize(80, 30); _print->move($maxwidth/2 - _print->width/2, maxindex*30+20); - this->connect(_print, SIGNAL('clicked()'), SLOT('printIt()')); + this->connect(_print, TQT_SIGNAL('clicked()'), TQT_SLOT('printIt()')); bgroup->resize($maxwidth, _print->y+_print->height+10); @@ -172,13 +172,13 @@ sub drawIt { sub printIt { if(printer->setup(this)) { - my $paint = Qt::Painter(printer); + my $paint = TQt::Painter(printer); drawIt($paint); } } sub paintEvent { - my $paint = Qt::Painter(this); + my $paint = TQt::Painter(this); drawIt($paint); } @@ -187,12 +187,12 @@ sub resizeEvent { } package main; -use Qt; +use TQt; use DrawView; -my $app = Qt::Application(\@ARGV); +my $app = TQt::Application(\@ARGV); my $draw = DrawView; $app->setMainWidget($draw); -$draw->setCaption("PerlQt Example - Drawdemo"); +$draw->setCaption("PerlTQt Example - Drawdemo"); $draw->show; exit $app->exec; |