diff options
Diffstat (limited to 'PerlQt/tutorials')
31 files changed, 395 insertions, 395 deletions
diff --git a/PerlQt/tutorials/t1/t1.pl b/PerlQt/tutorials/t1/t1.pl index a1e2cd8..96c7153 100644 --- a/PerlQt/tutorials/t1/t1.pl +++ b/PerlQt/tutorials/t1/t1.pl @@ -1,11 +1,11 @@ #!/usr/bin/perl -w use strict; use blib; -use Qt; +use TQt; -my $a = Qt::Application(\@ARGV); +my $a = TQt::Application(\@ARGV); -my $hello = Qt::PushButton("Hello World!", undef); +my $hello = TQt::PushButton("Hello World!", undef); $hello->resize(100, 30); $a->setMainWidget($hello); 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); diff --git a/PerlQt/tutorials/t11/CannonField.pm b/PerlQt/tutorials/t11/CannonField.pm index 7ddfb24..0806f66 100644 --- a/PerlQt/tutorials/t11/CannonField.pm +++ b/PerlQt/tutorials/t11/CannonField.pm @@ -1,16 +1,16 @@ 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'], shoot => [], moveShot => []; -use Qt::attributes qw( +use TQt::attributes qw( ang f @@ -30,11 +30,11 @@ sub NEW { ang = 45; f = 0; timerCount = 0; - autoShootTimer = Qt::Timer(this, "movement handler"); - this->connect(autoShootTimer, SIGNAL('timeout()'), SLOT('moveShot()')); + autoShootTimer = TQt::Timer(this, "movement handler"); + this->connect(autoShootTimer, TQT_SIGNAL('timeout()'), TQT_SLOT('moveShot()')); shoot_ang = 0; shoot_f = 0; - setPalette(Qt::Palette(Qt::Color(250, 250, 200))); + setPalette(TQt::Palette(TQt::Color(250, 250, 200))); } sub setAngle { @@ -64,7 +64,7 @@ sub shoot { } sub moveShot { - my $r = Qt::Region(shotRect()); + my $r = TQt::Region(shotRect()); timerCount++; my $shotR = shotRect(); @@ -72,7 +72,7 @@ sub moveShot { if($shotR->x > width() || $shotR->y > height()) { autoShootTimer->stop; } else { - $r = $r->unite(Qt::Region($shotR)); + $r = $r->unite(TQt::Region($shotR)); } repaint($r); } @@ -80,7 +80,7 @@ sub moveShot { sub paintEvent { my $e = shift; my $updateR = $e->rect; - my $p = Qt::Painter(this); + my $p = TQt::Painter(this); paintCannon($p) if $updateR->intersects(cannonRect()); paintShot($p) if autoShootTimer->isActive and $updateR->intersects(shotRect()); @@ -93,20 +93,20 @@ sub paintShot { $p->drawRect(shotRect()); } -my $barrelRect = Qt::Rect(33, -4, 15, 8); +my $barrelRect = TQt::Rect(33, -4, 15, 8); sub paintCannon { my $p = shift; my $cr = cannonRect(); - my $pix = Qt::Pixmap($cr->size); + my $pix = TQt::Pixmap($cr->size); $pix->fill(this, $cr->topLeft); - my $tmp = Qt::Painter($pix); + my $tmp = TQt::Painter($pix); $tmp->setBrush(&blue); $tmp->setPen(&NoPen); $tmp->translate(0, $pix->height - 1); - $tmp->drawPie(Qt::Rect(-35, -35, 70, 70), 0, 90*16); + $tmp->drawPie(TQt::Rect(-35, -35, 70, 70), 0, 90*16); $tmp->rotate(- ang); $tmp->drawRect($barrelRect); $tmp->end; @@ -115,7 +115,7 @@ sub paintCannon { } sub cannonRect { - my $r = Qt::Rect(0, 0, 50, 50); + my $r = TQt::Rect(0, 0, 50, 50); $r->moveBottomLeft(rect()->bottomLeft); return $r; } @@ -134,13 +134,13 @@ sub shotRect { my $x = $x0 + $velx*$time; my $y = $y0 + $vely*$time - 0.5*$gravity*$time**2; - my $r = Qt::Rect(0, 0, 6, 6); - $r->moveCenter(Qt::Point(int($x), height() - 1 - int($y))); + my $r = TQt::Rect(0, 0, 6, 6); + $r->moveCenter(TQt::Point(int($x), height() - 1 - int($y))); 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/t11/LCDRange.pm b/PerlQt/tutorials/t11/LCDRange.pm index be0f8ec..ab63af0 100644 --- a/PerlQt/tutorials/t11/LCDRange.pm +++ b/PerlQt/tutorials/t11/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/t11/t11.pl b/PerlQt/tutorials/t11/t11.pl index 84d762d..d493b1e 100644 --- a/PerlQt/tutorials/t11/t11.pl +++ b/PerlQt/tutorials/t11/t11.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,28 +26,28 @@ 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 $shoot = Qt::PushButton('&Shoot', this, "shoot"); - $shoot->setFont(Qt::Font("Times", 18, &Qt::Font::Bold)); + my $shoot = TQt::PushButton('&Shoot', this, "shoot"); + $shoot->setFont(TQt::Font("Times", 18, &TQt::Font::Bold)); - $cannonField->connect($shoot, SIGNAL('clicked()'), SLOT('shoot()')); + $cannonField->connect($shoot, TQT_SIGNAL('clicked()'), TQT_SLOT('shoot()')); - 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); - my $topBox = Qt::HBoxLayout; + my $topBox = TQt::HBoxLayout; $grid->addLayout($topBox, 0, 1); $topBox->addWidget($shoot); $topBox->addStretch(1); @@ -58,11 +58,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); diff --git a/PerlQt/tutorials/t12/CannonField.pm b/PerlQt/tutorials/t12/CannonField.pm index df4eb96..6cc1529 100644 --- a/PerlQt/tutorials/t12/CannonField.pm +++ b/PerlQt/tutorials/t12/CannonField.pm @@ -1,18 +1,18 @@ 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 hit => [], missed => [], angleChanged => ['int'], forceChanged => ['int']; -use Qt::slots +use TQt::slots setAngle => ['int'], setForce => ['int'], shoot => [], moveShot => []; -use Qt::attributes qw( +use TQt::attributes qw( ang f @@ -34,12 +34,12 @@ sub NEW { ang = 45; f = 0; timerCount = 0; - autoShootTimer = Qt::Timer(this, "movement handler"); - this->connect(autoShootTimer, SIGNAL('timeout()'), SLOT('moveShot()')); + autoShootTimer = TQt::Timer(this, "movement handler"); + this->connect(autoShootTimer, TQT_SIGNAL('timeout()'), TQT_SLOT('moveShot()')); shoot_ang = 0; shoot_f = 0; - target = Qt::Point(0, 0); - setPalette(Qt::Palette(Qt::Color(250, 250, 200))); + target = TQt::Point(0, 0); + setPalette(TQt::Palette(TQt::Color(250, 250, 200))); newTarget(); } @@ -70,14 +70,14 @@ sub shoot { } sub newTarget { - my $r = Qt::Region(targetRect()); - target = Qt::Point(200 + int(rand(190)), + my $r = TQt::Region(targetRect()); + target = TQt::Point(200 + int(rand(190)), 10 + int(rand(255))); - repaint($r->unite(Qt::Region(targetRect()))); + repaint($r->unite(TQt::Region(targetRect()))); } sub moveShot { - my $r = Qt::Region(shotRect()); + my $r = TQt::Region(shotRect()); timerCount++; my $shotR = shotRect(); @@ -89,7 +89,7 @@ sub moveShot { autoShootTimer->stop; emit missed(); } else { - $r = $r->unite(Qt::Region($shotR)); + $r = $r->unite(TQt::Region($shotR)); } repaint($r); } @@ -97,7 +97,7 @@ sub moveShot { sub paintEvent { my $e = shift; my $updateR = $e->rect; - my $p = Qt::Painter(this); + my $p = TQt::Painter(this); paintCannon($p) if $updateR->intersects(cannonRect()); paintShot($p) if autoShootTimer->isActive and $updateR->intersects(shotRect()); @@ -118,20 +118,20 @@ sub paintTarget { $p->drawRect(targetRect()); } -my $barrelRect = Qt::Rect(33, -4, 15, 8); +my $barrelRect = TQt::Rect(33, -4, 15, 8); sub paintCannon { my $p = shift; my $cr = cannonRect(); - my $pix = Qt::Pixmap($cr->size); + my $pix = TQt::Pixmap($cr->size); $pix->fill(this, $cr->topLeft); - my $tmp = Qt::Painter($pix); + my $tmp = TQt::Painter($pix); $tmp->setBrush(&blue); $tmp->setPen(&NoPen); $tmp->translate(0, $pix->height - 1); - $tmp->drawPie(Qt::Rect(-35, -35, 70, 70), 0, 90*16); + $tmp->drawPie(TQt::Rect(-35, -35, 70, 70), 0, 90*16); $tmp->rotate(- ang); $tmp->drawRect($barrelRect); $tmp->end; @@ -140,7 +140,7 @@ sub paintCannon { } sub cannonRect { - my $r = Qt::Rect(0, 0, 50, 50); + my $r = TQt::Rect(0, 0, 50, 50); $r->moveBottomLeft(rect()->bottomLeft); return $r; } @@ -159,19 +159,19 @@ sub shotRect { my $x = $x0 + $velx*$time; my $y = $y0 + $vely*$time - 0.5*$gravity*$time**2; - my $r = Qt::Rect(0, 0, 6, 6); - $r->moveCenter(Qt::Point(int($x), height() - 1 - int($y))); + my $r = TQt::Rect(0, 0, 6, 6); + $r->moveCenter(TQt::Point(int($x), height() - 1 - int($y))); return $r; } sub targetRect { - my $r = Qt::Rect(0, 0, 20, 10); - $r->moveCenter(Qt::Point(target->x, height() - 1 - target->y)); + my $r = TQt::Rect(0, 0, 20, 10); + $r->moveCenter(TQt::Point(target->x, height() - 1 - target->y)); 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/t12/LCDRange.pm b/PerlQt/tutorials/t12/LCDRange.pm index 3562fee..d3a5166 100644 --- a/PerlQt/tutorials/t12/LCDRange.pm +++ b/PerlQt/tutorials/t12/LCDRange.pm @@ -1,14 +1,14 @@ 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'], setText => ['const char*']; -use Qt::signals +use TQt::signals valueChanged => ['int']; -use Qt::attributes qw( +use TQt::attributes qw( slider label ); @@ -25,17 +25,17 @@ sub NEW { sub init { - 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); - label = Qt::Label(" ", this, "label"); + label = TQt::Label(" ", this, "label"); label->setAlignment(&AlignCenter); - $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/t12/t12.pl b/PerlQt/tutorials/t12/t12.pl index 87c50be..e8072ef 100644 --- a/PerlQt/tutorials/t12/t12.pl +++ b/PerlQt/tutorials/t12/t12.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("ANGLE", this, "angle"); $angle->setRange(5, 70); @@ -26,28 +26,28 @@ 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 $shoot = Qt::PushButton('&Shoot', this, "shoot"); - $shoot->setFont(Qt::Font("Times", 18, &Qt::Font::Bold)); + my $shoot = TQt::PushButton('&Shoot', this, "shoot"); + $shoot->setFont(TQt::Font("Times", 18, &TQt::Font::Bold)); - $cannonField->connect($shoot, SIGNAL('clicked()'), SLOT('shoot()')); + $cannonField->connect($shoot, TQT_SIGNAL('clicked()'), TQT_SLOT('shoot()')); - 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); - my $topBox = Qt::HBoxLayout; + my $topBox = TQt::HBoxLayout; $grid->addLayout($topBox, 0, 1); $topBox->addWidget($shoot); $topBox->addStretch(1); @@ -58,11 +58,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); diff --git a/PerlQt/tutorials/t13/CannonField.pm b/PerlQt/tutorials/t13/CannonField.pm index a1475e5..ec220bc 100644 --- a/PerlQt/tutorials/t13/CannonField.pm +++ b/PerlQt/tutorials/t13/CannonField.pm @@ -1,20 +1,20 @@ 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 hit => [], missed => [], angleChanged => ['int'], forceChanged => ['int'], canShoot => ['bool']; -use Qt::slots +use TQt::slots setAngle => ['int'], setForce => ['int'], shoot => [], moveShot => [], newTarget => []; -use Qt::attributes qw( +use TQt::attributes qw( ang f @@ -39,13 +39,13 @@ sub NEW { ang = 45; f = 0; timerCount = 0; - autoShootTimer = Qt::Timer(this, "movement handler"); - this->connect(autoShootTimer, SIGNAL('timeout()'), SLOT('moveShot()')); + autoShootTimer = TQt::Timer(this, "movement handler"); + this->connect(autoShootTimer, TQT_SIGNAL('timeout()'), TQT_SLOT('moveShot()')); shoot_ang = 0; shoot_f = 0; - target = Qt::Point(0, 0); + target = TQt::Point(0, 0); gameEnded = 0; - setPalette(Qt::Palette(Qt::Color(250, 250, 200))); + setPalette(TQt::Palette(TQt::Color(250, 250, 200))); newTarget(); } @@ -77,10 +77,10 @@ sub shoot { } sub newTarget { - my $r = Qt::Region(targetRect()); - target = Qt::Point(200 + int(rand(190)), + my $r = TQt::Region(targetRect()); + target = TQt::Point(200 + int(rand(190)), 10 + int(rand(255))); - repaint($r->unite(Qt::Region(targetRect()))); + repaint($r->unite(TQt::Region(targetRect()))); } sub setGameOver { @@ -98,7 +98,7 @@ sub restartGame { } sub moveShot { - my $r = Qt::Region(shotRect()); + my $r = TQt::Region(shotRect()); timerCount++; my $shotR = shotRect(); @@ -112,7 +112,7 @@ sub moveShot { emit missed(); emit canShoot(1); } else { - $r = $r->unite(Qt::Region($shotR)); + $r = $r->unite(TQt::Region($shotR)); } repaint($r); } @@ -120,11 +120,11 @@ sub moveShot { sub paintEvent { my $e = shift; my $updateR = $e->rect; - my $p = Qt::Painter(this); + my $p = TQt::Painter(this); if(gameEnded) { $p->setPen(&black); - $p->setFont(Qt::Font("Courier", 48, &Qt::Font::Bold)); + $p->setFont(TQt::Font("Courier", 48, &TQt::Font::Bold)); $p->drawText(rect(), &AlignCenter, "Game Over"); } paintCannon($p) if $updateR->intersects(cannonRect()); @@ -146,20 +146,20 @@ sub paintTarget { $p->drawRect(targetRect()); } -my $barrelRect = Qt::Rect(33, -4, 15, 8); +my $barrelRect = TQt::Rect(33, -4, 15, 8); sub paintCannon { my $p = shift; my $cr = cannonRect(); - my $pix = Qt::Pixmap($cr->size); + my $pix = TQt::Pixmap($cr->size); $pix->fill(this, $cr->topLeft); - my $tmp = Qt::Painter($pix); + my $tmp = TQt::Painter($pix); $tmp->setBrush(&blue); $tmp->setPen(&NoPen); $tmp->translate(0, $pix->height - 1); - $tmp->drawPie(Qt::Rect(-35, -35, 70, 70), 0, 90*16); + $tmp->drawPie(TQt::Rect(-35, -35, 70, 70), 0, 90*16); $tmp->rotate(- ang); $tmp->drawRect($barrelRect); $tmp->end; @@ -168,7 +168,7 @@ sub paintCannon { } sub cannonRect { - my $r = Qt::Rect(0, 0, 50, 50); + my $r = TQt::Rect(0, 0, 50, 50); $r->moveBottomLeft(rect()->bottomLeft); return $r; } @@ -187,21 +187,21 @@ sub shotRect { my $x = $x0 + $velx*$time; my $y = $y0 + $vely*$time - 0.5*$gravity*$time**2; - my $r = Qt::Rect(0, 0, 6, 6); - $r->moveCenter(Qt::Point(int($x), height() - 1 - int($y))); + my $r = TQt::Rect(0, 0, 6, 6); + $r->moveCenter(TQt::Point(int($x), height() - 1 - int($y))); return $r; } sub targetRect { - my $r = Qt::Rect(0, 0, 20, 10); - $r->moveCenter(Qt::Point(target->x, height() - 1 - target->y)); + my $r = TQt::Rect(0, 0, 20, 10); + $r->moveCenter(TQt::Point(target->x, height() - 1 - target->y)); return $r; } sub isShooting { autoShootTimer->isActive } sub sizePolicy { - Qt::SizePolicy(&Qt::SizePolicy::Expanding, &Qt::SizePolicy::Expanding); + TQt::SizePolicy(&TQt::SizePolicy::Expanding, &TQt::SizePolicy::Expanding); } 1; diff --git a/PerlQt/tutorials/t13/GameBoard.pm b/PerlQt/tutorials/t13/GameBoard.pm index 1c4ab71..52f5e9b 100644 --- a/PerlQt/tutorials/t13/GameBoard.pm +++ b/PerlQt/tutorials/t13/GameBoard.pm @@ -1,13 +1,13 @@ package GameBoard; use strict; -use Qt; -use Qt::isa qw(Qt::Widget); -use Qt::slots +use TQt; +use TQt::isa qw(TQt::Widget); +use TQt::slots fire => [], hit => [], missed => [], newGame => []; -use Qt::attributes qw( +use TQt::attributes qw( hits shotsLeft cannonField @@ -19,10 +19,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("ANGLE", this, "angle"); $angle->setRange(5, 70); @@ -32,43 +32,43 @@ sub NEW { 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)')); - this->connect(cannonField, SIGNAL('hit()'), SLOT('hit()')); - this->connect(cannonField, SIGNAL('missed()'), SLOT('missed()')); + this->connect(cannonField, TQT_SIGNAL('hit()'), TQT_SLOT('hit()')); + this->connect(cannonField, TQT_SIGNAL('missed()'), TQT_SLOT('missed()')); - my $shoot = Qt::PushButton('&Shoot', this, "shoot"); - $shoot->setFont(Qt::Font("Times", 18, &Qt::Font::Bold)); + my $shoot = TQt::PushButton('&Shoot', this, "shoot"); + $shoot->setFont(TQt::Font("Times", 18, &TQt::Font::Bold)); - this->connect($shoot, SIGNAL('clicked()'), SLOT('fire()')); + this->connect($shoot, TQT_SIGNAL('clicked()'), TQT_SLOT('fire()')); - $shoot->connect(cannonField, SIGNAL('canShoot(bool)'), SLOT('setEnabled(bool)')); + $shoot->connect(cannonField, TQT_SIGNAL('canShoot(bool)'), TQT_SLOT('setEnabled(bool)')); - my $restart = Qt::PushButton('&New Game', this, "newgame"); - $restart->setFont(Qt::Font("Times", 18, &Qt::Font::Bold)); + my $restart = TQt::PushButton('&New Game', this, "newgame"); + $restart->setFont(TQt::Font("Times", 18, &TQt::Font::Bold)); - this->connect($restart, SIGNAL('clicked()'), SLOT('newGame()')); + this->connect($restart, TQT_SIGNAL('clicked()'), TQT_SLOT('newGame()')); - hits = Qt::LCDNumber(2, this, "hits"); - shotsLeft = Qt::LCDNumber(2, this, "shotsleft"); - my $hitsL = Qt::Label("HITS", this, "hitsLabel"); - my $shotsLeftL = Qt::Label("SHOTS LEFT", this, "shotsLeftLabel"); + hits = TQt::LCDNumber(2, this, "hits"); + shotsLeft = TQt::LCDNumber(2, this, "shotsleft"); + my $hitsL = TQt::Label("HITS", this, "hitsLabel"); + my $shotsLeftL = TQt::Label("SHOTS LEFT", this, "shotsLeftLabel"); - 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); - my $topBox = Qt::HBoxLayout; + my $topBox = TQt::HBoxLayout; $grid->addLayout($topBox, 0, 1); $topBox->addWidget($shoot); $topBox->addWidget(hits); diff --git a/PerlQt/tutorials/t13/LCDRange.pm b/PerlQt/tutorials/t13/LCDRange.pm index b08827e..1647e85 100644 --- a/PerlQt/tutorials/t13/LCDRange.pm +++ b/PerlQt/tutorials/t13/LCDRange.pm @@ -1,14 +1,14 @@ package LCDRange; use strict; -use Qt; -use Qt::isa qw(Qt::Widget); -use Qt::slots +use TQt; +use TQt::isa qw(TQt::Widget); +use TQt::slots setValue => ['int'], setRange => ['int', 'int'], setText => ['const char*']; -use Qt::signals +use TQt::signals valueChanged => ['int']; -use Qt::attributes qw( +use TQt::attributes qw( slider label ); @@ -25,21 +25,21 @@ sub NEW { sub init { - 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); - label = Qt::Label(" ", this, "label"); + label = TQt::Label(" ", this, "label"); label->setAlignment(&AlignCenter); - $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); - my $l = Qt::VBoxLayout(this); + my $l = TQt::VBoxLayout(this); $l->addWidget($lcd, 1); $l->addWidget(slider); $l->addWidget(label); diff --git a/PerlQt/tutorials/t13/t13.pl b/PerlQt/tutorials/t13/t13.pl index b0f5c25..ef412ab 100644 --- a/PerlQt/tutorials/t13/t13.pl +++ b/PerlQt/tutorials/t13/t13.pl @@ -1,11 +1,11 @@ #!/usr/bin/perl -w use strict; use blib; -use Qt; +use TQt; use GameBoard; -Qt::Application::setColorSpec(&Qt::Application::CustomColor); -my $a = Qt::Application(\@ARGV); +TQt::Application::setColorSpec(&TQt::Application::CustomColor); +my $a = TQt::Application(\@ARGV); my $gb = GameBoard; $gb->setGeometry(100, 100, 500, 355); diff --git a/PerlQt/tutorials/t14/CannonField.pm b/PerlQt/tutorials/t14/CannonField.pm index 05fdbce..cbf675d 100644 --- a/PerlQt/tutorials/t14/CannonField.pm +++ b/PerlQt/tutorials/t14/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 hit => [], missed => [], angleChanged => ['int'], forceChanged => ['int'], canShoot => ['bool']; -use Qt::slots +use TQt::slots setAngle => ['int'], setForce => ['int'], shoot => [], @@ -16,7 +16,7 @@ use Qt::slots newTarget => [], setGameOver => [], restartGame => []; -use Qt::attributes qw( +use TQt::attributes qw( ang f @@ -42,14 +42,14 @@ sub NEW { ang = 45; f = 0; timerCount = 0; - autoShootTimer = Qt::Timer(this, "movement handler"); - this->connect(autoShootTimer, SIGNAL('timeout()'), SLOT('moveShot()')); + autoShootTimer = TQt::Timer(this, "movement handler"); + this->connect(autoShootTimer, TQT_SIGNAL('timeout()'), TQT_SLOT('moveShot()')); shoot_ang = 0; shoot_f = 0; - target = Qt::Point(0, 0); + target = TQt::Point(0, 0); gameEnded = 0; barrelPressed = 0; - setPalette(Qt::Palette(Qt::Color(250, 250, 200))); + setPalette(TQt::Palette(TQt::Color(250, 250, 200))); newTarget(); } @@ -81,10 +81,10 @@ sub shoot { } sub newTarget { - my $r = Qt::Region(targetRect()); - target = Qt::Point(200 + int(rand(190)), + my $r = TQt::Region(targetRect()); + target = TQt::Point(200 + int(rand(190)), 10 + int(rand(255))); - repaint($r->unite(Qt::Region(targetRect()))); + repaint($r->unite(TQt::Region(targetRect()))); } sub setGameOver { @@ -102,7 +102,7 @@ sub restartGame { } sub moveShot { - my $r = Qt::Region(shotRect()); + my $r = TQt::Region(shotRect()); timerCount++; my $shotR = shotRect(); @@ -117,7 +117,7 @@ sub moveShot { emit missed(); emit canShoot(1); } else { - $r = $r->unite(Qt::Region($shotR)); + $r = $r->unite(TQt::Region($shotR)); } repaint($r); } @@ -146,11 +146,11 @@ sub mouseReleaseEvent { sub paintEvent { my $e = shift; my $updateR = $e->rect; - my $p = Qt::Painter(this); + my $p = TQt::Painter(this); if(gameEnded) { $p->setPen(&black); - $p->setFont(Qt::Font("Courier", 48, &Qt::Font::Bold)); + $p->setFont(TQt::Font("Courier", 48, &TQt::Font::Bold)); $p->drawText(rect(), &AlignCenter, "Game Over"); } paintCannon($p) if $updateR->intersects(cannonRect()); @@ -180,20 +180,20 @@ sub paintBarrier { $p->drawRect(barrierRect()); } -my $barrelRect = Qt::Rect(33, -4, 15, 8); +my $barrelRect = TQt::Rect(33, -4, 15, 8); sub paintCannon { my $p = shift; my $cr = cannonRect(); - my $pix = Qt::Pixmap($cr->size); + my $pix = TQt::Pixmap($cr->size); $pix->fill(this, $cr->topLeft); - my $tmp = Qt::Painter($pix); + my $tmp = TQt::Painter($pix); $tmp->setBrush(&blue); $tmp->setPen(&NoPen); $tmp->translate(0, $pix->height - 1); - $tmp->drawPie(Qt::Rect(-35, -35, 70, 70), 0, 90*16); + $tmp->drawPie(TQt::Rect(-35, -35, 70, 70), 0, 90*16); $tmp->rotate(- ang); $tmp->drawRect($barrelRect); $tmp->end; @@ -202,7 +202,7 @@ sub paintCannon { } sub cannonRect { - my $r = Qt::Rect(0, 0, 50, 50); + my $r = TQt::Rect(0, 0, 50, 50); $r->moveBottomLeft(rect()->bottomLeft); return $r; } @@ -221,24 +221,24 @@ sub shotRect { my $x = $x0 + $velx*$time; my $y = $y0 + $vely*$time - 0.5*$gravity*$time**2; - my $r = Qt::Rect(0, 0, 6, 6); - $r->moveCenter(Qt::Point(int($x), height() - 1 - int($y))); + my $r = TQt::Rect(0, 0, 6, 6); + $r->moveCenter(TQt::Point(int($x), height() - 1 - int($y))); return $r; } sub targetRect { - my $r = Qt::Rect(0, 0, 20, 10); - $r->moveCenter(Qt::Point(target->x, height() - 1 - target->y)); + my $r = TQt::Rect(0, 0, 20, 10); + $r->moveCenter(TQt::Point(target->x, height() - 1 - target->y)); return $r; } sub barrierRect { - return Qt::Rect(145, height() - 100, 15, 100); + return TQt::Rect(145, height() - 100, 15, 100); } sub barrelHit { my $p = shift; - my $mtx = Qt::WMatrix; + my $mtx = TQt::WMatrix; $mtx->translate(0, height() - 1); $mtx->rotate(- ang); $mtx = $mtx->invert; @@ -247,10 +247,10 @@ sub barrelHit { sub isShooting { autoShootTimer->isActive } -sub sizeHint { Qt::Size(400, 300) } +sub sizeHint { TQt::Size(400, 300) } sub sizePolicy { - Qt::SizePolicy(&Qt::SizePolicy::Expanding, &Qt::SizePolicy::Expanding); + TQt::SizePolicy(&TQt::SizePolicy::Expanding, &TQt::SizePolicy::Expanding); } 1; diff --git a/PerlQt/tutorials/t14/GameBoard.pm b/PerlQt/tutorials/t14/GameBoard.pm index 96f9cbb..a81deef 100644 --- a/PerlQt/tutorials/t14/GameBoard.pm +++ b/PerlQt/tutorials/t14/GameBoard.pm @@ -1,13 +1,13 @@ package GameBoard; use strict; -use Qt; -use Qt::isa qw(Qt::Widget); -use Qt::slots +use TQt; +use TQt::isa qw(TQt::Widget); +use TQt::slots fire => [], hit => [], missed => [], newGame => []; -use Qt::attributes qw( +use TQt::attributes qw( hits shotsLeft cannonField @@ -19,10 +19,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("ANGLE", this, "angle"); $angle->setRange(5, 70); @@ -30,56 +30,56 @@ sub NEW { my $force = LCDRange("FORCE", this, "force"); $force->setRange(10, 50); - my $box = Qt::VBox(this, "cannonFrame"); + my $box = TQt::VBox(this, "cannonFrame"); $box->setFrameStyle($box->WinPanel | $box->Sunken); cannonField = CannonField($box, "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)')); - this->connect(cannonField, SIGNAL('hit()'), SLOT('hit()')); - this->connect(cannonField, SIGNAL('missed()'), SLOT('missed()')); + this->connect(cannonField, TQT_SIGNAL('hit()'), TQT_SLOT('hit()')); + this->connect(cannonField, TQT_SIGNAL('missed()'), TQT_SLOT('missed()')); - my $shoot = Qt::PushButton('&Shoot', this, "shoot"); - $shoot->setFont(Qt::Font("Times", 18, &Qt::Font::Bold)); + my $shoot = TQt::PushButton('&Shoot', this, "shoot"); + $shoot->setFont(TQt::Font("Times", 18, &TQt::Font::Bold)); - this->connect($shoot, SIGNAL('clicked()'), SLOT('fire()')); + this->connect($shoot, TQT_SIGNAL('clicked()'), TQT_SLOT('fire()')); - $shoot->connect(cannonField, SIGNAL('canShoot(bool)'), SLOT('setEnabled(bool)')); + $shoot->connect(cannonField, TQT_SIGNAL('canShoot(bool)'), TQT_SLOT('setEnabled(bool)')); - my $restart = Qt::PushButton('&New Game', this, "newgame"); - $restart->setFont(Qt::Font("Times", 18, &Qt::Font::Bold)); + my $restart = TQt::PushButton('&New Game', this, "newgame"); + $restart->setFont(TQt::Font("Times", 18, &TQt::Font::Bold)); - this->connect($restart, SIGNAL('clicked()'), SLOT('newGame()')); + this->connect($restart, TQT_SIGNAL('clicked()'), TQT_SLOT('newGame()')); - hits = Qt::LCDNumber(2, this, "hits"); - shotsLeft = Qt::LCDNumber(2, this, "shotsleft"); - my $hitsL = Qt::Label("HITS", this, "hitsLabel"); - my $shotsLeftL = Qt::Label("SHOTS LEFT", this, "shotsLeftLabel"); + hits = TQt::LCDNumber(2, this, "hits"); + shotsLeft = TQt::LCDNumber(2, this, "shotsleft"); + my $hitsL = TQt::Label("HITS", this, "hitsLabel"); + my $shotsLeftL = TQt::Label("SHOTS LEFT", this, "shotsLeftLabel"); - my $accel = Qt::Accel(this); - $accel->connectItem($accel->insertItem(Qt::KeySequence(int &Key_Enter)), - this, SLOT('fire()')); - $accel->connectItem($accel->insertItem(Qt::KeySequence(int &Key_Return)), - this, SLOT('fire()')); - $accel->connectItem($accel->insertItem(Qt::KeySequence(int &CTRL+&Key_Q)), - Qt::app, SLOT('quit()')); + my $accel = TQt::Accel(this); + $accel->connectItem($accel->insertItem(TQt::KeySequence(int &Key_Enter)), + this, TQT_SLOT('fire()')); + $accel->connectItem($accel->insertItem(TQt::KeySequence(int &Key_Return)), + this, TQT_SLOT('fire()')); + $accel->connectItem($accel->insertItem(TQt::KeySequence(int &CTRL+&Key_Q)), + TQt::app, TQT_SLOT('quit()')); - my $grid = Qt::GridLayout(this, 2, 2, 10); + my $grid = TQt::GridLayout(this, 2, 2, 10); $grid->addWidget($quit, 0, 0); $grid->addWidget($box, 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); - my $topBox = Qt::HBoxLayout; + my $topBox = TQt::HBoxLayout; $grid->addLayout($topBox, 0, 1); $topBox->addWidget($shoot); $topBox->addWidget(hits); diff --git a/PerlQt/tutorials/t14/LCDRange.pm b/PerlQt/tutorials/t14/LCDRange.pm index b08827e..1647e85 100644 --- a/PerlQt/tutorials/t14/LCDRange.pm +++ b/PerlQt/tutorials/t14/LCDRange.pm @@ -1,14 +1,14 @@ package LCDRange; use strict; -use Qt; -use Qt::isa qw(Qt::Widget); -use Qt::slots +use TQt; +use TQt::isa qw(TQt::Widget); +use TQt::slots setValue => ['int'], setRange => ['int', 'int'], setText => ['const char*']; -use Qt::signals +use TQt::signals valueChanged => ['int']; -use Qt::attributes qw( +use TQt::attributes qw( slider label ); @@ -25,21 +25,21 @@ sub NEW { sub init { - 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); - label = Qt::Label(" ", this, "label"); + label = TQt::Label(" ", this, "label"); label->setAlignment(&AlignCenter); - $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); - my $l = Qt::VBoxLayout(this); + my $l = TQt::VBoxLayout(this); $l->addWidget($lcd, 1); $l->addWidget(slider); $l->addWidget(label); diff --git a/PerlQt/tutorials/t14/t14.pl b/PerlQt/tutorials/t14/t14.pl index b0f5c25..ef412ab 100644 --- a/PerlQt/tutorials/t14/t14.pl +++ b/PerlQt/tutorials/t14/t14.pl @@ -1,11 +1,11 @@ #!/usr/bin/perl -w use strict; use blib; -use Qt; +use TQt; use GameBoard; -Qt::Application::setColorSpec(&Qt::Application::CustomColor); -my $a = Qt::Application(\@ARGV); +TQt::Application::setColorSpec(&TQt::Application::CustomColor); +my $a = TQt::Application(\@ARGV); my $gb = GameBoard; $gb->setGeometry(100, 100, 500, 355); diff --git a/PerlQt/tutorials/t2/t2.pl b/PerlQt/tutorials/t2/t2.pl index 970ccb4..c7b76e4 100644 --- a/PerlQt/tutorials/t2/t2.pl +++ b/PerlQt/tutorials/t2/t2.pl @@ -1,15 +1,15 @@ #!/usr/bin/perl -w use strict; use blib; -use Qt; +use TQt; -my $a = Qt::Application(\@ARGV); +my $a = TQt::Application(\@ARGV); -my $quit = Qt::PushButton("Quit", undef); +my $quit = TQt::PushButton("Quit", undef); $quit->resize(75, 30); -$quit->setFont(Qt::Font("Times", 18, &Qt::Font::Bold)); +$quit->setFont(TQt::Font("Times", 18, &TQt::Font::Bold)); -$a->connect($quit, SIGNAL('clicked()'), SLOT('quit()')); +$a->connect($quit, TQT_SIGNAL('clicked()'), TQT_SLOT('quit()')); $a->setMainWidget($quit); $quit->show; diff --git a/PerlQt/tutorials/t3/t3.pl b/PerlQt/tutorials/t3/t3.pl index bdd27fd..24fcdf0 100644 --- a/PerlQt/tutorials/t3/t3.pl +++ b/PerlQt/tutorials/t3/t3.pl @@ -1,17 +1,17 @@ #!/usr/bin/perl -w use strict; use blib; -use Qt; +use TQt; -my $a = Qt::Application(\@ARGV); +my $a = TQt::Application(\@ARGV); -my $box = Qt::VBox; +my $box = TQt::VBox; $box->resize(200, 120); -my $quit = Qt::PushButton("Quit", $box); -$quit->setFont(Qt::Font("Times", 18, &Qt::Font::Bold)); +my $quit = TQt::PushButton("Quit", $box); +$quit->setFont(TQt::Font("Times", 18, &TQt::Font::Bold)); -$a->connect($quit, SIGNAL('clicked()'), SLOT('quit()')); +$a->connect($quit, TQT_SIGNAL('clicked()'), TQT_SLOT('quit()')); $a->setMainWidget($box); $box->show; diff --git a/PerlQt/tutorials/t4/t4.pl b/PerlQt/tutorials/t4/t4.pl index 889a96a..b4b0b1e 100644 --- a/PerlQt/tutorials/t4/t4.pl +++ b/PerlQt/tutorials/t4/t4.pl @@ -3,8 +3,8 @@ use strict; use blib; package MyWidget; -use Qt; -use Qt::isa qw(Qt::Widget); +use TQt; +use TQt::isa qw(TQt::Widget); sub NEW { shift->SUPER::NEW(@_); @@ -12,17 +12,17 @@ sub NEW { setMinimumSize(200, 120); setMaximumSize(200, 120); - my $quit = Qt::PushButton("Quit", this, "quit"); + my $quit = TQt::PushButton("Quit", this, "quit"); $quit->setGeometry(62, 40, 75, 30); - $quit->setFont(Qt::Font("Times", 18, &Qt::Font::Bold)); + $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()')); } package main; use MyWidget; -my $a = Qt::Application(\@ARGV); +my $a = TQt::Application(\@ARGV); my $w = MyWidget; $w->setGeometry(100, 100, 200, 120); diff --git a/PerlQt/tutorials/t5/t5.pl b/PerlQt/tutorials/t5/t5.pl index d2dc201..9990c3e 100644 --- a/PerlQt/tutorials/t5/t5.pl +++ b/PerlQt/tutorials/t5/t5.pl @@ -3,30 +3,30 @@ use strict; use blib; package MyWidget; -use Qt; -use Qt::isa qw(Qt::VBox); +use TQt; +use TQt::isa qw(TQt::VBox); 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 $lcd = Qt::LCDNumber(2, this, "lcd"); + my $lcd = TQt::LCDNumber(2, this, "lcd"); - my $slider = Qt::Slider(&Horizontal, this, "slider"); + my $slider = TQt::Slider(&Horizontal, this, "slider"); $slider->setRange(0, 99); $slider->setValue(0); - $lcd->connect($slider, SIGNAL('valueChanged(int)'), SLOT('display(int)')); + $lcd->connect($slider, TQT_SIGNAL('valueChanged(int)'), TQT_SLOT('display(int)')); } package main; use MyWidget; -my $a = Qt::Application(\@ARGV); +my $a = TQt::Application(\@ARGV); my $w = MyWidget; $a->setMainWidget($w); diff --git a/PerlQt/tutorials/t6/t6.pl b/PerlQt/tutorials/t6/t6.pl index 210626a..b50c415 100644 --- a/PerlQt/tutorials/t6/t6.pl +++ b/PerlQt/tutorials/t6/t6.pl @@ -3,33 +3,33 @@ use strict; use blib; package LCDRange; -use Qt; -use Qt::isa qw(Qt::VBox); +use TQt; +use TQt::isa qw(TQt::VBox); sub NEW { shift->SUPER::NEW(@_); - my $lcd = Qt::LCDNumber(2, this, "lcd"); - my $slider = Qt::Slider(&Horizontal, this, "slider"); + my $lcd = TQt::LCDNumber(2, this, "lcd"); + my $slider = TQt::Slider(&Horizontal, this, "slider"); $slider->setRange(0, 99); $slider->setValue(0); - $lcd->connect($slider, SIGNAL('valueChanged(int)'), SLOT('display(int)')); + $lcd->connect($slider, TQT_SIGNAL('valueChanged(int)'), TQT_SLOT('display(int)')); } package MyWidget; -use Qt; -use Qt::isa qw(Qt::VBox); +use TQt; +use TQt::isa qw(TQt::VBox); use LCDRange; 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 $grid = Qt::Grid(4, this); + my $grid = TQt::Grid(4, this); for(0..3) { for(0..3) { @@ -41,7 +41,7 @@ sub NEW { package main; use MyWidget; -my $a = Qt::Application(\@ARGV); +my $a = TQt::Application(\@ARGV); my $w = MyWidget; $a->setMainWidget($w); diff --git a/PerlQt/tutorials/t7/LCDRange.pm b/PerlQt/tutorials/t7/LCDRange.pm index 8a79e39..9bc48cb 100644 --- a/PerlQt/tutorials/t7/LCDRange.pm +++ b/PerlQt/tutorials/t7/LCDRange.pm @@ -1,22 +1,22 @@ package LCDRange; use strict; -use Qt; -use Qt::isa qw(Qt::VBox); -use Qt::slots setValue => ['int']; -use Qt::signals valueChanged => ['int']; -use Qt::attributes qw(slider); +use TQt; +use TQt::isa qw(TQt::VBox); +use TQt::slots setValue => ['int']; +use TQt::signals valueChanged => ['int']; +use TQt::attributes qw(slider); sub NEW { shift->SUPER::NEW(@_); - my $lcd = Qt::LCDNumber(2, this, "lcd"); + my $lcd = TQt::LCDNumber(2, this, "lcd"); - my $slider = Qt::Slider(&Horizontal, this, "slider"); + my $slider = TQt::Slider(&Horizontal, this, "slider"); slider = $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)')); } sub value { slider->value } diff --git a/PerlQt/tutorials/t7/t7.pl b/PerlQt/tutorials/t7/t7.pl index c798e28..0d0d0d2 100644 --- a/PerlQt/tutorials/t7/t7.pl +++ b/PerlQt/tutorials/t7/t7.pl @@ -3,28 +3,28 @@ use strict; use blib; package MyWidget; -use Qt; -use Qt::isa qw(Qt::VBox); +use TQt; +use TQt::isa qw(TQt::VBox); use LCDRange; 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 $grid = Qt::Grid(4, this); + my $grid = TQt::Grid(4, this); my $previous; for my $r (0..3) { for my $c (0..3) { my $lr = LCDRange($grid); $previous->connect( - $lr, SIGNAL('valueChanged(int)'), - SLOT('setValue(int)')) if $previous; + $lr, TQT_SIGNAL('valueChanged(int)'), + TQT_SLOT('setValue(int)')) if $previous; $previous = $lr; } } @@ -33,7 +33,7 @@ sub NEW { package main; use MyWidget; -my $a = Qt::Application(\@ARGV); +my $a = TQt::Application(\@ARGV); my $w = MyWidget; $a->setMainWidget($w); $w->show; diff --git a/PerlQt/tutorials/t8/CannonField.pm b/PerlQt/tutorials/t8/CannonField.pm index 28e4986..1c23244 100644 --- a/PerlQt/tutorials/t8/CannonField.pm +++ b/PerlQt/tutorials/t8/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 { @@ -32,12 +32,12 @@ sub setAngle { sub paintEvent { my $s = "Angle = " . ang; - my $p = Qt::Painter(this); + my $p = TQt::Painter(this); $p->drawText(200, 200, $s); } sub sizePolicy { - Qt::SizePolicy(&Qt::SizePolicy::Expanding, &Qt::SizePolicy::Expanding); + TQt::SizePolicy(&TQt::SizePolicy::Expanding, &TQt::SizePolicy::Expanding); } 1; diff --git a/PerlQt/tutorials/t8/LCDRange.pm b/PerlQt/tutorials/t8/LCDRange.pm index be0f8ec..ab63af0 100644 --- a/PerlQt/tutorials/t8/LCDRange.pm +++ b/PerlQt/tutorials/t8/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/t8/t8.pl b/PerlQt/tutorials/t8/t8.pl index 51967ca..620f912 100644 --- a/PerlQt/tutorials/t8/t8.pl +++ b/PerlQt/tutorials/t8/t8.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,10 +37,10 @@ sub NEW { } package main; -use Qt; +use TQt; use MyWidget; -my $a = Qt::Application(\@ARGV); +my $a = TQt::Application(\@ARGV); my $w = MyWidget; $w->setGeometry(100, 100, 500, 355); 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); |