diff options
Diffstat (limited to 'PerlQt/tutorials/t10/CannonField.pm')
-rw-r--r-- | PerlQt/tutorials/t10/CannonField.pm | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/PerlQt/tutorials/t10/CannonField.pm b/PerlQt/tutorials/t10/CannonField.pm index 27bfcee..08b2e10 100644 --- a/PerlQt/tutorials/t10/CannonField.pm +++ b/PerlQt/tutorials/t10/CannonField.pm @@ -1,14 +1,14 @@ package CannonField; use strict; -use Qt; -use Qt::isa qw(Qt::Widget); -use Qt::signals +use TQt; +use TQt::isa qw(TQt::Widget); +use TQt::signals angleChanged => ['int'], forceChanged => ['int']; -use Qt::slots +use TQt::slots setAngle => ['int'], setForce => ['int']; -use Qt::attributes qw( +use TQt::attributes qw( ang f ); @@ -22,7 +22,7 @@ sub NEW { ang = 45; f = 0; - setPalette(Qt::Palette(Qt::Color(250, 250, 200))); + setPalette(TQt::Palette(TQt::Color(250, 250, 200))); } sub setAngle { @@ -47,16 +47,16 @@ sub paintEvent { my $e = shift; return unless $e->rect->intersects(cannonRect()); my $cr = cannonRect(); - my $pix = Qt::Pixmap($cr->size); + my $pix = TQt::Pixmap($cr->size); $pix->fill(this, $cr->topLeft); - my $p = Qt::Painter($pix); + my $p = TQt::Painter($pix); $p->setBrush(&blue); $p->setPen(&NoPen); $p->translate(0, $pix->height - 1); - $p->drawPie(Qt::Rect(-35, -35, 70, 70), 0, 90*16); + $p->drawPie(TQt::Rect(-35, -35, 70, 70), 0, 90*16); $p->rotate(- ang); - $p->drawRect(Qt::Rect(33, -4, 15, 8)); + $p->drawRect(TQt::Rect(33, -4, 15, 8)); $p->end; $p->begin(this); @@ -64,13 +64,13 @@ sub paintEvent { } sub cannonRect { - my $r = Qt::Rect(0, 0, 50, 50); + my $r = TQt::Rect(0, 0, 50, 50); $r->moveBottomLeft(rect()->bottomLeft); return $r; } sub sizePolicy { - Qt::SizePolicy(&Qt::SizePolicy::Expanding, &Qt::SizePolicy::Expanding); + TQt::SizePolicy(&TQt::SizePolicy::Expanding, &TQt::SizePolicy::Expanding); } 1; |