diff options
Diffstat (limited to 'PerlQt/examples/progress/progress.pl')
-rw-r--r-- | PerlQt/examples/progress/progress.pl | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/PerlQt/examples/progress/progress.pl b/PerlQt/examples/progress/progress.pl index a63e95e..4112e64 100644 --- a/PerlQt/examples/progress/progress.pl +++ b/PerlQt/examples/progress/progress.pl @@ -4,9 +4,9 @@ use strict; package AnimatedThingy; -use Qt; -use Qt::isa "Qt::Label"; -use Qt::attributes qw[ +use TQt; +use TQt::isa "TQt::Label"; +use TQt::attributes qw[ label step ox oy @@ -49,12 +49,12 @@ sub hide sub sizeHint { - Qt::Size(120,100) + TQt::Size(120,100) } sub timerEvent { - my $p = Qt::Painter(this); + my $p = TQt::Painter(this); my $pn= $p->pen; $pn->setWidth(2); $pn->setColor(backgroundColor()); @@ -73,7 +73,7 @@ sub timerEvent ox->[1][step] = x1; oy->[1][step] = y1; - my $c = Qt::Color; + my $c = TQt::Color; $c->setHsv( (step*255)/nqix, 255, 255 ); # rainbow effect $pn->setColor($c); $pn->setWidth(2); @@ -86,13 +86,13 @@ sub timerEvent sub paintEvent { my $ev = shift; - my $p = Qt::Painter(this); + my $p = TQt::Painter(this); my $pn= $p->pen; $pn->setWidth(2); $p->setPen($pn); $p->setClipRect($ev->rect); for (my $i=0; $i<nqix; $i++) { - my $c = Qt::Color; + my $c = TQt::Color; $c->setHsv( ($i*255)/nqix, 255, 255 ); # rainbow effect $pn->setColor($c); $p->setPen($pn); @@ -115,9 +115,9 @@ sub inc package CPUWaster; -use Qt; -use Qt::isa "Qt::Widget"; -use Qt::attributes qw[ +use TQt; +use TQt::isa "TQt::Widget"; +use TQt::attributes qw[ menubar file options @@ -132,7 +132,7 @@ use Qt::attributes qw[ timer_driven default_label ]; -use Qt::slots +use TQt::slots drawItemRects => ['int'], doMenuItem => ['int'], stopDrawing => [ ], @@ -154,22 +154,22 @@ sub NEW menubar = MenuBar( this, "menu" ); pb = 0; - file = Qt::PopupMenu; + file = TQt::PopupMenu; menubar->insertItem( "&File", file ); for (my $i=first_draw_item; $i<=last_draw_item; $i++) { file->insertItem( drawItemRects($i)." Rectangles", $i) } - Qt::Object::connect( menubar, SIGNAL "activated(int)", this, SLOT "doMenuItem(int)" ); + TQt::Object::connect( menubar, TQT_SIGNAL "activated(int)", this, TQT_SLOT "doMenuItem(int)" ); file->insertSeparator; - file->insertItem( "Quit", Qt::app(), SLOT "quit()" ); - options = Qt::PopupMenu; + file->insertItem( "Quit", TQt::app(), TQT_SLOT "quit()" ); + options = TQt::PopupMenu; menubar->insertItem( "&Options", options ); - td_id = options->insertItem( "Timer driven", this, SLOT "timerDriven()" ); - ld_id = options->insertItem( "Loop driven", this, SLOT "loopDriven()" ); + td_id = options->insertItem( "Timer driven", this, TQT_SLOT "timerDriven()" ); + ld_id = options->insertItem( "Loop driven", this, TQT_SLOT "loopDriven()" ); options->insertSeparator; - dl_id = options->insertItem( "Default label", this, SLOT "defaultLabel()" ); - cl_id = options->insertItem( "Custom label", this, SLOT "customLabel()" ); + dl_id = options->insertItem( "Default label", this, TQT_SLOT "defaultLabel()" ); + cl_id = options->insertItem( "Custom label", this, TQT_SLOT "customLabel()" ); options->insertSeparator; - md_id = options->insertItem( "No minimum duration", this, SLOT "toggleMinimumDuration()" ); + md_id = options->insertItem( "No minimum duration", this, TQT_SLOT "toggleMinimumDuration()" ); options->setCheckable( 1 ); loopDriven(); customLabel(); @@ -240,14 +240,14 @@ sub timerEvent rects--; { - my $p = Qt::Painter(this); + my $p = TQt::Painter(this); my $ww = width(); my $wh = height(); if ( $ww > 8 && $wh > 8 ) { - my $c = Qt::Color(rand(255), rand(255), rand(255)); + my $c = TQt::Color(rand(255), rand(255), rand(255)); my $x = rand($ww-8); my $y = rand($wh-8); my $w = rand($ww-$x); @@ -259,7 +259,7 @@ sub timerEvent if (!rects || got_stop) { pb->setProgress( pb->totalSteps ); - my $p = Qt::Painter(this); + my $p = TQt::Painter(this); $p->fillRect(0, 0, width(), height(), Brush(backgroundColor())); enableDrawingItems(1); killTimers(); @@ -301,7 +301,7 @@ sub draw pb = newProgressDialog("Drawing rectangles.\n". "Using timer event.", $n, 0); pb->setCaption("Please Wait"); - Qt::Object::connect(pb, SIGNAL "cancelled()", this, SLOT "stopDrawing()"); + TQt::Object::connect(pb, TQT_SIGNAL "cancelled()", this, TQT_SLOT "stopDrawing()"); enableDrawingItems(0); startTimer(0); got_stop = 0; @@ -312,7 +312,7 @@ sub draw "Using loop.", $n, 1); $lpb->setCaption("Please Wait"); - my $p = Qt::Painter(this); + my $p = TQt::Painter(this); for (my $i=0; $i<$n; $i++) { if(!($i%100)) @@ -321,7 +321,7 @@ sub draw last if ( $lpb->wasCancelled ); } my ($cw, $ch) = (width(), height()); - my $c = Qt::Color(rand(255), rand(255), rand(255)); + my $c = TQt::Color(rand(255), rand(255), rand(255)); my $x = rand($cw-8); my $y = rand($cw-8); my $w = rand($cw-$x); @@ -337,10 +337,10 @@ sub draw package main; -use Qt; +use TQt; use CPUWaster; -my $a=Qt::Application(\@ARGV); +my $a=TQt::Application(\@ARGV); my $w=CPUWaster; $w->show; |