diff options
Diffstat (limited to 'PerlQt/tutorials/t9')
-rw-r--r-- | PerlQt/tutorials/t9/CannonField.pm | 20 | ||||
-rw-r--r-- | PerlQt/tutorials/t9/LCDRange.pm | 18 | ||||
-rw-r--r-- | PerlQt/tutorials/t9/t9.pl | 22 |
3 files changed, 30 insertions, 30 deletions
diff --git a/PerlQt/tutorials/t9/CannonField.pm b/PerlQt/tutorials/t9/CannonField.pm index e12489a..1500480 100644 --- a/PerlQt/tutorials/t9/CannonField.pm +++ b/PerlQt/tutorials/t9/CannonField.pm @@ -1,12 +1,12 @@ 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']; -use Qt::slots +use TQt::slots setAngle => ['int']; -use Qt::attributes qw( +use TQt::attributes qw( ang ); use POSIX qw(atan); @@ -17,7 +17,7 @@ sub NEW { shift->SUPER::NEW(@_); ang = 45; - setPalette(Qt::Palette(Qt::Color(250, 250, 200))); + setPalette(TQt::Palette(TQt::Color(250, 250, 200))); } sub setAngle { @@ -31,18 +31,18 @@ sub setAngle { } sub paintEvent { - my $p = Qt::Painter(this); + my $p = TQt::Painter(this); $p->setBrush(&blue); $p->setPen(&NoPen); $p->translate(0, rect()->bottom); - $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)); } sub sizePolicy { - Qt::SizePolicy(&Qt::SizePolicy::Expanding, &Qt::SizePolicy::Expanding); + TQt::SizePolicy(&TQt::SizePolicy::Expanding, &TQt::SizePolicy::Expanding); } 1; diff --git a/PerlQt/tutorials/t9/LCDRange.pm b/PerlQt/tutorials/t9/LCDRange.pm index be0f8ec..ab63af0 100644 --- a/PerlQt/tutorials/t9/LCDRange.pm +++ b/PerlQt/tutorials/t9/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/t9/t9.pl b/PerlQt/tutorials/t9/t9.pl index 192041c..779d859 100644 --- a/PerlQt/tutorials/t9/t9.pl +++ b/PerlQt/tutorials/t9/t9.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,20 +13,20 @@ 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); 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)')); - my $grid = Qt::GridLayout(this, 2, 2, 10); + my $grid = TQt::GridLayout(this, 2, 2, 10); $grid->addWidget($quit, 0, 0); $grid->addWidget($angle, 1, 0, &AlignTop); $grid->addWidget($cannonField, 1, 1); @@ -37,11 +37,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); |