diff options
Diffstat (limited to 'PerlQt/tutorials/t10')
-rw-r--r-- | PerlQt/tutorials/t10/CannonField.pm | 24 | ||||
-rw-r--r-- | PerlQt/tutorials/t10/LCDRange.pm | 18 | ||||
-rw-r--r-- | PerlQt/tutorials/t10/t10.pl | 28 |
3 files changed, 35 insertions, 35 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; diff --git a/PerlQt/tutorials/t10/LCDRange.pm b/PerlQt/tutorials/t10/LCDRange.pm index be0f8ec..ab63af0 100644 --- a/PerlQt/tutorials/t10/LCDRange.pm +++ b/PerlQt/tutorials/t10/LCDRange.pm @@ -1,26 +1,26 @@ package LCDRange; use strict; -use Qt; -use Qt::isa qw(Qt::VBox); -use Qt::slots +use TQt; +use TQt::isa qw(TQt::VBox); +use TQt::slots setValue => ['int'], setRange => ['int', 'int']; -use Qt::signals +use TQt::signals valueChanged => ['int']; -use Qt::attributes qw( +use TQt::attributes qw( slider ); sub NEW { shift->SUPER::NEW(@_); - my $lcd = Qt::LCDNumber(2, this, "lcd"); + my $lcd = TQt::LCDNumber(2, this, "lcd"); - slider = Qt::Slider(&Horizontal, this, "slider"); + slider = TQt::Slider(&Horizontal, this, "slider"); slider->setRange(0, 99); slider->setValue(0); - $lcd->connect(slider, SIGNAL('valueChanged(int)'), SLOT('display(int)')); - this->connect(slider, SIGNAL('valueChanged(int)'), SIGNAL('valueChanged(int)')); + $lcd->connect(slider, TQT_SIGNAL('valueChanged(int)'), TQT_SLOT('display(int)')); + this->connect(slider, TQT_SIGNAL('valueChanged(int)'), TQT_SIGNAL('valueChanged(int)')); setFocusProxy(slider); } diff --git a/PerlQt/tutorials/t10/t10.pl b/PerlQt/tutorials/t10/t10.pl index d9b825e..7056680 100644 --- a/PerlQt/tutorials/t10/t10.pl +++ b/PerlQt/tutorials/t10/t10.pl @@ -4,8 +4,8 @@ use blib; package MyWidget; use strict; -use Qt; -use Qt::isa qw(Qt::Widget); +use TQt; +use TQt::isa qw(TQt::Widget); use LCDRange; use CannonField; @@ -13,10 +13,10 @@ use CannonField; sub NEW { shift->SUPER::NEW(@_); - my $quit = Qt::PushButton("&Quit", this, "quit"); - $quit->setFont(Qt::Font("Times", 18, &Qt::Font::Bold)); + my $quit = TQt::PushButton("&Quit", this, "quit"); + $quit->setFont(TQt::Font("Times", 18, &TQt::Font::Bold)); - Qt::app->connect($quit, SIGNAL('clicked()'), SLOT('quit()')); + TQt::app->connect($quit, TQT_SIGNAL('clicked()'), TQT_SLOT('quit()')); my $angle = LCDRange(this, "angle"); $angle->setRange(5, 70); @@ -26,18 +26,18 @@ sub NEW { my $cannonField = CannonField(this, "cannonField"); - $cannonField->connect($angle, SIGNAL('valueChanged(int)'), SLOT('setAngle(int)')); - $angle->connect($cannonField, SIGNAL('angleChanged(int)'), SLOT('setValue(int)')); + $cannonField->connect($angle, TQT_SIGNAL('valueChanged(int)'), TQT_SLOT('setAngle(int)')); + $angle->connect($cannonField, TQT_SIGNAL('angleChanged(int)'), TQT_SLOT('setValue(int)')); - $cannonField->connect($force, SIGNAL('valueChanged(int)'), SLOT('setForce(int)')); - $force->connect($cannonField, SIGNAL('forceChanged(int)'), SLOT('setValue(int)')); + $cannonField->connect($force, TQT_SIGNAL('valueChanged(int)'), TQT_SLOT('setForce(int)')); + $force->connect($cannonField, TQT_SIGNAL('forceChanged(int)'), TQT_SLOT('setValue(int)')); - my $grid = Qt::GridLayout(this, 2, 2, 10); + my $grid = TQt::GridLayout(this, 2, 2, 10); $grid->addWidget($quit, 0, 0); $grid->addWidget($cannonField, 1, 1); $grid->setColStretch(1, 10); - my $leftBox = Qt::VBoxLayout; + my $leftBox = TQt::VBoxLayout; $grid->addLayout($leftBox, 1, 0); $leftBox->addWidget($angle); $leftBox->addWidget($force); @@ -48,11 +48,11 @@ sub NEW { } package main; -use Qt; +use TQt; use MyWidget; -Qt::Application::setColorSpec(&Qt::Application::CustomColor); -my $a = Qt::Application(\@ARGV); +TQt::Application::setColorSpec(&TQt::Application::CustomColor); +my $a = TQt::Application(\@ARGV); my $w = MyWidget; $w->setGeometry(100, 100, 500, 355); |