summaryrefslogtreecommitdiffstats
path: root/PerlQt/examples
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-01 18:24:37 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-01 18:24:37 -0600
commit4e997a9c6e25689dca65a2ec573a599699ef8170 (patch)
treefdb5ecac42fb8204df9fc8c9abe1c784d4719e0e /PerlQt/examples
parentbfa107694b2507a7116f8856cafe4ab1375da8a9 (diff)
downloadlibtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.tar.gz
libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.zip
Initial TQt conversion
Diffstat (limited to 'PerlQt/examples')
-rw-r--r--PerlQt/examples/aclock/AnalogClock.pm42
-rw-r--r--PerlQt/examples/aclock/aclock.pl6
-rw-r--r--PerlQt/examples/buttongroups/ButtonsGroups.pm52
-rw-r--r--PerlQt/examples/buttongroups/buttongroups.pl6
-rw-r--r--PerlQt/examples/dclock/DigitalClock.pm12
-rw-r--r--PerlQt/examples/dclock/dclock.pl6
-rw-r--r--PerlQt/examples/drawdemo/drawdemo.pl48
-rw-r--r--PerlQt/examples/drawlines/drawlines.pl20
-rw-r--r--PerlQt/examples/forever/forever.pl24
-rw-r--r--PerlQt/examples/network/httpd/httpd.pl42
-rw-r--r--PerlQt/examples/opengl/README4
-rw-r--r--PerlQt/examples/opengl/box/GLBox.pm14
-rw-r--r--PerlQt/examples/opengl/box/glbox46
-rw-r--r--PerlQt/examples/opengl/gear/gear26
-rw-r--r--PerlQt/examples/progress/progress.pl58
-rw-r--r--PerlQt/examples/richedit/imageCollection.pm26
-rw-r--r--PerlQt/examples/richedit/richedit.pl204
17 files changed, 318 insertions, 318 deletions
diff --git a/PerlQt/examples/aclock/AnalogClock.pm b/PerlQt/examples/aclock/AnalogClock.pm
index d4aeff9..0a52c44 100644
--- a/PerlQt/examples/aclock/AnalogClock.pm
+++ b/PerlQt/examples/aclock/AnalogClock.pm
@@ -1,24 +1,24 @@
package AnalogClock;
-use Qt;
-use Qt::isa qw(Qt::Widget);
-use Qt::slots
- setTime => ['const QTime&'],
- drawClock => ['QPainter*'],
+use TQt;
+use TQt::isa qw(TQt::Widget);
+use TQt::slots
+ setTime => ['const TQTime&'],
+ drawClock => ['TQPainter*'],
timeout => [];
-use Qt::attributes qw(
+use TQt::attributes qw(
clickPos
_time
);
#
-# Constructs an analog clock widget that uses an internal QTimer
+# Constructs an analog clock widget that uses an internal TQTimer
#
sub NEW {
shift->SUPER::NEW(@_);
- _time = Qt::Time::currentTime(); # get current time
- my $internalTimer = Qt::Timer(this); # create internal timer
- this->connect($internalTimer, SIGNAL('timeout()'), SLOT('timeout()'));
+ _time = TQt::Time::currentTime(); # get current time
+ my $internalTimer = TQt::Timer(this); # create internal timer
+ this->connect($internalTimer, TQT_SIGNAL('timeout()'), TQT_SLOT('timeout()'));
$internalTimer->start(5000); # emit signal every 5 seconds
}
@@ -26,11 +26,11 @@ sub mousePressEvent {
my $e = shift;
if(isTopLevel()) {
# Lack of operators is really noticable here
- my $topLeft = Qt::Point(
+ my $topLeft = TQt::Point(
geometry()->topLeft->x - frameGeometry()->topLeft->x,
geometry()->topLeft->y - frameGeometry()->topLeft->y
);
- clickPos = Qt::Point($e->pos->x + $topLeft->x,
+ clickPos = TQt::Point($e->pos->x + $topLeft->x,
$e->pos->y + $topLeft->y);
}
}
@@ -38,7 +38,7 @@ sub mousePressEvent {
sub mouseMoveEvent {
my $e = shift;
if(isTopLevel()) {
- move(Qt::Point($e->globalPos->x - clickPos->x,
+ move(TQt::Point($e->globalPos->x - clickPos->x,
$e->globalPos->y - clickPos->y));
}
}
@@ -49,11 +49,11 @@ sub setTime {
}
#
-# The QTimer::timeout() signal is received by this slot.
+# The TQTimer::timeout() signal is received by this slot.
#
sub timeout {
- my $new_time = Qt::Time::currentTime(); # get the current time
+ my $new_time = TQt::Time::currentTime(); # get the current time
_time = _time->addSecs(5);
if($new_time->minute != _time->minute) { # minute has changed
if(autoMask()) {
@@ -66,7 +66,7 @@ sub timeout {
sub paintEvent {
return if autoMask();
- my $paint = Qt::Painter(this);
+ my $paint = TQt::Painter(this);
$paint->setBrush(colorGroup()->foreground);
drawClock($paint);
}
@@ -75,10 +75,10 @@ sub paintEvent {
# instead of paintEvent()
sub updateMask { # paint clock mask
- my $bm = Qt::Bitmap(size());
+ my $bm = TQt::Bitmap(size());
$bm->fill(&color0); # transparent
- my $paint = Qt::Painter;
+ my $paint = TQt::Painter;
$paint->begin($bm, this);
$paint->setBrush(&color1); # use non-transparent color
$paint->setPen(&color1);
@@ -105,8 +105,8 @@ sub drawClock {
$paint->setViewport($v->left + ($v->width-$d)/2,
$v->top - ($v->height-$d)/2, $d, $d);
- # _time = Qt::Time::currentTime();
- my $pts = Qt::PointArray();
+ # _time = TQt::Time::currentTime();
+ my $pts = TQt::PointArray();
$paint->save;
$paint->rotate(30*(_time->hour%12-3) + _time->minute/2);
@@ -131,7 +131,7 @@ sub drawClock {
sub setAutoMask {
my $b = shift;
setBackgroundMode($b ? &PaletteForeground : &PaletteBackground);
- Qt::Widget::setAutoMask($b);
+ TQt::Widget::setAutoMask($b);
}
1;
diff --git a/PerlQt/examples/aclock/aclock.pl b/PerlQt/examples/aclock/aclock.pl
index ff59ec1..b4ae659 100644
--- a/PerlQt/examples/aclock/aclock.pl
+++ b/PerlQt/examples/aclock/aclock.pl
@@ -1,13 +1,13 @@
#!/usr/bin/perl -w
use strict;
-use Qt;
+use TQt;
use AnalogClock;
-my $a = Qt::Application(\@ARGV);
+my $a = TQt::Application(\@ARGV);
my $clock = AnalogClock;
$clock->setAutoMask(1) if @ARGV and $ARGV[0] eq '-transparent';
$clock->resize(100, 100);
$a->setMainWidget($clock);
-$clock->setCaption("PerlQt example - Analog Clock");
+$clock->setCaption("PerlTQt example - Analog Clock");
$clock->show;
exit $a->exec;
diff --git a/PerlQt/examples/buttongroups/ButtonsGroups.pm b/PerlQt/examples/buttongroups/ButtonsGroups.pm
index 0bb6c73..106cf1b 100644
--- a/PerlQt/examples/buttongroups/ButtonsGroups.pm
+++ b/PerlQt/examples/buttongroups/ButtonsGroups.pm
@@ -1,10 +1,10 @@
package ButtonsGroups;
use strict;
-use Qt;
-use Qt::isa qw(Qt::Widget);
-use Qt::slots
+use TQt;
+use TQt::isa qw(TQt::Widget);
+use TQt::slots
slotChangeGrp3State => [];
-use Qt::attributes qw(
+use TQt::attributes qw(
state
rb21
rb22
@@ -21,65 +21,65 @@ sub NEW {
shift->SUPER::NEW(@_);
# Create Widgets which allow easy layouting
- my $vbox = Qt::VBoxLayout(this);
- my $box1 = Qt::HBoxLayout($vbox);
- my $box2 = Qt::HBoxLayout($vbox);
+ my $vbox = TQt::VBoxLayout(this);
+ my $box1 = TQt::HBoxLayout($vbox);
+ my $box2 = TQt::HBoxLayout($vbox);
# ------- first group
# Create an exclusive button group
- my $bgrp1 = Qt::ButtonGroup(1, &Horizontal, "Button Group &1 (exclusive)", this);
+ my $bgrp1 = TQt::ButtonGroup(1, &Horizontal, "Button Group &1 (exclusive)", this);
$box1->addWidget($bgrp1);
$bgrp1->setExclusive(1);
# insert 3 radiobuttons
- Qt::RadioButton("R&adiobutton 2", $bgrp1);
- Qt::RadioButton("Ra&diobutton 3", $bgrp1);
+ TQt::RadioButton("R&adiobutton 2", $bgrp1);
+ TQt::RadioButton("Ra&diobutton 3", $bgrp1);
# ------- second group
# Create a non-exclusive buttongroup
- my $bgrp2 = Qt::ButtonGroup(1, &Horizontal, "Button Group &2 (non-exclusive)", this);
+ my $bgrp2 = TQt::ButtonGroup(1, &Horizontal, "Button Group &2 (non-exclusive)", this);
$box1->addWidget($bgrp2);
$bgrp2->setExclusive(0);
# insert 3 checkboxes
- Qt::CheckBox("&Checkbox 1", $bgrp2);
- my $cb12 = Qt::CheckBox("C&heckbox 2", $bgrp2);
+ TQt::CheckBox("&Checkbox 1", $bgrp2);
+ my $cb12 = TQt::CheckBox("C&heckbox 2", $bgrp2);
$cb12->setChecked(1);
- my $cb13 = Qt::CheckBox("Triple &State Button", $bgrp2);
+ my $cb13 = TQt::CheckBox("Triple &State Button", $bgrp2);
$cb13->setTristate(1);
$cb13->setChecked(1);
# ----------- third group
# create a buttongroup which is exclusive for radiobuttons and non-exclusive for all other buttons
- my $bgrp3 = Qt::ButtonGroup(1, &Horizontal, "Button Group &3 (Radiobutton-exclusive)", this);
+ my $bgrp3 = TQt::ButtonGroup(1, &Horizontal, "Button Group &3 (Radiobutton-exclusive)", this);
$box2->addWidget($bgrp3);
$bgrp3->setRadioButtonExclusive(1);
# insert three radiobuttons
- rb21 = Qt::RadioButton("Rad&iobutton 1", $bgrp3);
- rb22 = Qt::RadioButton("Radi&obutton 2", $bgrp3);
- rb23 = Qt::RadioButton("Radio&button 3", $bgrp3);
+ rb21 = TQt::RadioButton("Rad&iobutton 1", $bgrp3);
+ rb22 = TQt::RadioButton("Radi&obutton 2", $bgrp3);
+ rb23 = TQt::RadioButton("Radio&button 3", $bgrp3);
rb23->setChecked(1);
# insert a checkbox
- state = Qt::CheckBox("E&nable Radiobuttons", $bgrp3);
+ state = TQt::CheckBox("E&nable Radiobuttons", $bgrp3);
state->setChecked(1);
- # ...and connect its SIGNAL clicked() with the SLOT slotChangeGrp3State()
- this->connect(state, SIGNAL('clicked()'), SLOT('slotChangeGrp3State()'));
+ # ...and connect its TQT_SIGNAL clicked() with the TQT_SLOT slotChangeGrp3State()
+ this->connect(state, TQT_SIGNAL('clicked()'), TQT_SLOT('slotChangeGrp3State()'));
# ----------- fourth group
# create a groupbox which layouts its childs in a columns
- my $bgrp4 = Qt::ButtonGroup(1, &Horizontal, "Groupbox with &normal buttons", this);
+ my $bgrp4 = TQt::ButtonGroup(1, &Horizontal, "Groupbox with &normal buttons", this);
$box2->addWidget($bgrp4);
# insert three pushbuttons...
- Qt::PushButton("&Push Button", $bgrp4);
- my $tb2 = Qt::PushButton("&Toggle Button", $bgrp4);
- my $tb3 = Qt::PushButton("&Flat Button", $bgrp4);
+ TQt::PushButton("&Push Button", $bgrp4);
+ my $tb2 = TQt::PushButton("&Toggle Button", $bgrp4);
+ my $tb3 = TQt::PushButton("&Flat Button", $bgrp4);
# ... and make the second one a toggle button
$tb2->setToggleButton(1);
@@ -90,7 +90,7 @@ sub NEW {
}
#
-# SLOT slotChangeGrp3State()
+# TQT_SLOT slotChangeGrp3State()
#
# enables/disables the radiobuttons of the third buttongroup
#
diff --git a/PerlQt/examples/buttongroups/buttongroups.pl b/PerlQt/examples/buttongroups/buttongroups.pl
index 3fdf884..632ad43 100644
--- a/PerlQt/examples/buttongroups/buttongroups.pl
+++ b/PerlQt/examples/buttongroups/buttongroups.pl
@@ -1,13 +1,13 @@
#!/usr/bin/perl -w
use strict;
-use Qt;
+use TQt;
use ButtonsGroups;
-my $a = Qt::Application(\@ARGV);
+my $a = TQt::Application(\@ARGV);
my $buttonsgroups = ButtonsGroups;
$buttonsgroups->resize(500, 250);
-$buttonsgroups->setCaption("PerlQt Example - Buttongroups");
+$buttonsgroups->setCaption("PerlTQt Example - Buttongroups");
$a->setMainWidget($buttonsgroups);
$buttonsgroups->show;
exit $a->exec;
diff --git a/PerlQt/examples/dclock/DigitalClock.pm b/PerlQt/examples/dclock/DigitalClock.pm
index 4611272..2d25428 100644
--- a/PerlQt/examples/dclock/DigitalClock.pm
+++ b/PerlQt/examples/dclock/DigitalClock.pm
@@ -1,11 +1,11 @@
package DigitalClock;
use strict;
-use Qt;
-use Qt::isa qw(Qt::LCDNumber);
-use Qt::slots
+use TQt;
+use TQt::isa qw(TQt::LCDNumber);
+use TQt::slots
stopDate => [],
showTime => [];
-use Qt::attributes qw(
+use TQt::attributes qw(
showingColon
normalTimer
showDateTimer
@@ -56,7 +56,7 @@ sub mousePressEvent {
sub showDate {
return if showDateTimer != -1; # already showing date
- my $date = Qt::Date::currentDate();
+ my $date = TQt::Date::currentDate();
my $s = sprintf("%2d %2d", $date->month, $date->day);
display($s); # sets the LCD number/text
showDateTimer = startTimer(2000); # keep this state for 2 secs
@@ -78,7 +78,7 @@ sub stopDate {
sub showTime {
showingColon = !showingColon;
- my $s = substr(Qt::Time::currentTime()->toString, 0, 5);
+ my $s = substr(TQt::Time::currentTime()->toString, 0, 5);
$s =~ s/^0/ /;
$s =~ s/:/ / unless showingColon;
display($s);
diff --git a/PerlQt/examples/dclock/dclock.pl b/PerlQt/examples/dclock/dclock.pl
index f5820fd..57c02bd 100644
--- a/PerlQt/examples/dclock/dclock.pl
+++ b/PerlQt/examples/dclock/dclock.pl
@@ -1,12 +1,12 @@
#!/usr/bin/perl -w
use strict;
-use Qt;
+use TQt;
use DigitalClock;
-my $a = Qt::Application(\@ARGV);
+my $a = TQt::Application(\@ARGV);
my $clock = DigitalClock;
$clock->resize(170, 80);
$a->setMainWidget($clock);
-$clock->setCaption("PerlQt Example - Digital Clock");
+$clock->setCaption("PerlTQt Example - Digital Clock");
$clock->show;
exit $a->exec;
diff --git a/PerlQt/examples/drawdemo/drawdemo.pl b/PerlQt/examples/drawdemo/drawdemo.pl
index c58e10d..f119a94 100644
--- a/PerlQt/examples/drawdemo/drawdemo.pl
+++ b/PerlQt/examples/drawdemo/drawdemo.pl
@@ -1,12 +1,12 @@
#!/usr/bin/perl -w
use strict;
package DrawView;
-use Qt;
-use Qt::isa qw(Qt::Widget);
-use Qt::slots
+use TQt;
+use TQt::isa qw(TQt::Widget);
+use TQt::slots
updateIt => ['int'],
printIt => [];
-use Qt::attributes qw(
+use TQt::attributes qw(
printer
bgroup
_print
@@ -26,19 +26,19 @@ use Qt::attributes qw(
sub drawColorWheel {
my $p = shift;
- my $f = Qt::Font("times", 18, &Qt::Font::Bold);
+ my $f = TQt::Font("times", 18, &TQt::Font::Bold);
$p->setFont($f);
$p->setPen(&black);
$p->setWindow(0, 0, 500, 500); # defines coordinate system
for my $i (0..35) {
- my $matrix = Qt::WMatrix;
+ my $matrix = TQt::WMatrix;
$matrix->translate(250.0, 250.0); # move to center
$matrix->shear(0.0, 0.3); # twist it
$matrix->rotate($i*10.0); # rotate 0,10,20,.. degrees
$p->setWorldMatrix($matrix); # use this world matrix
- my $c = Qt::Color;
+ my $c = TQt::Color;
$c->setHsv($i*10, 255, 255); # rainbow effect
$p->setBrush($c); # solid fill with color $c
$p->drawRect(70, -10, 80, 10); # draw the rectangle
@@ -59,7 +59,7 @@ sub drawFonts {
my $y = 0;
for my $f (@fonts) {
for my $s (@sizes) {
- my $font = Qt::Font($f, $s);
+ my $font = TQt::Font($f, $s);
$p->setFont($font);
my $fm = $p->fontMetrics;
$y += $fm->ascent;
@@ -75,10 +75,10 @@ sub drawFonts {
sub drawShapes {
my $p = shift;
- my $b1 = Qt::Brush(&blue);
- my $b2 = Qt::Brush(&green, &Dense6Pattern); # green 12% fill
- my $b3 = Qt::Brush(&NoBrush); # void brush
- my $b4 = Qt::Brush(&CrossPattern); # black cross pattern
+ my $b1 = TQt::Brush(&blue);
+ my $b2 = TQt::Brush(&green, &Dense6Pattern); # green 12% fill
+ my $b3 = TQt::Brush(&NoBrush); # void brush
+ my $b4 = TQt::Brush(&CrossPattern); # black cross pattern
$p->setPen(&red);
$p->setBrush($b1);
@@ -105,13 +105,13 @@ our @drawFunctions = (
sub NEW {
shift->SUPER::NEW(@_);
- setCaption("PerlQt Draw Demo Application");
+ setCaption("PerlTQt Draw Demo Application");
setBackgroundColor(&white);
# Create a button group to contain all buttons
- bgroup = Qt::ButtonGroup(this);
+ bgroup = TQt::ButtonGroup(this);
bgroup->resize(200, 200);
- this->connect(bgroup, SIGNAL('clicked(int)'), SLOT('updateIt(int)'));
+ this->connect(bgroup, TQT_SIGNAL('clicked(int)'), TQT_SLOT('updateIt(int)'));
# Calculate the size for the radio buttons
my $maxwidth = 80;
@@ -128,7 +128,7 @@ sub NEW {
for my $i (0 .. $#drawFunctions) {
my $n = $drawFunctions[$i]{name};
- my $rb = Qt::RadioButton($n, bgroup);
+ my $rb = TQt::RadioButton($n, bgroup);
$rb->setGeometry(10, $i*30+10, $maxwidth, 30);
$maxheight += 30;
@@ -145,12 +145,12 @@ sub NEW {
bgroup->resize($maxwidth, $maxheight);
- printer = Qt::Printer;
+ printer = TQt::Printer;
- _print = Qt::PushButton("Print...", bgroup);
+ _print = TQt::PushButton("Print...", bgroup);
_print->resize(80, 30);
_print->move($maxwidth/2 - _print->width/2, maxindex*30+20);
- this->connect(_print, SIGNAL('clicked()'), SLOT('printIt()'));
+ this->connect(_print, TQT_SIGNAL('clicked()'), TQT_SLOT('printIt()'));
bgroup->resize($maxwidth, _print->y+_print->height+10);
@@ -172,13 +172,13 @@ sub drawIt {
sub printIt {
if(printer->setup(this)) {
- my $paint = Qt::Painter(printer);
+ my $paint = TQt::Painter(printer);
drawIt($paint);
}
}
sub paintEvent {
- my $paint = Qt::Painter(this);
+ my $paint = TQt::Painter(this);
drawIt($paint);
}
@@ -187,12 +187,12 @@ sub resizeEvent {
}
package main;
-use Qt;
+use TQt;
use DrawView;
-my $app = Qt::Application(\@ARGV);
+my $app = TQt::Application(\@ARGV);
my $draw = DrawView;
$app->setMainWidget($draw);
-$draw->setCaption("PerlQt Example - Drawdemo");
+$draw->setCaption("PerlTQt Example - Drawdemo");
$draw->show;
exit $app->exec;
diff --git a/PerlQt/examples/drawlines/drawlines.pl b/PerlQt/examples/drawlines/drawlines.pl
index 7297fa2..1d7575f 100644
--- a/PerlQt/examples/drawlines/drawlines.pl
+++ b/PerlQt/examples/drawlines/drawlines.pl
@@ -1,9 +1,9 @@
#!/usr/bin/perl -w
use strict;
package ConnectWidget;
-use Qt;
-use Qt::isa qw(Qt::Widget);
-use Qt::attributes qw(
+use TQt;
+use TQt::isa qw(TQt::Widget);
+use TQt::attributes qw(
points
colors
count
@@ -25,13 +25,13 @@ sub NEW {
points = [];
my @colors;
for(1 .. MAXCOLORS) {
- push @colors, Qt::Color(rand(255), rand(255), rand(255));
+ push @colors, TQt::Color(rand(255), rand(255), rand(255));
}
colors = \@colors;
}
sub paintEvent {
- my $paint = Qt::Painter(this);
+ my $paint = TQt::Painter(this);
for(my $i = 0; $i < count-1; $i++) {
for(my $j = $i+1; $j < count; $j++) {
$paint->setPen(colors->[rand(MAXCOLORS)]);
@@ -55,20 +55,20 @@ sub mouseReleaseEvent {
sub mouseMoveEvent {
my $e = shift;
if(down && count < MAXPOINTS) {
- my $paint = Qt::Painter(this);
- push @{this->points}, Qt::Point($e->pos);
+ my $paint = TQt::Painter(this);
+ push @{this->points}, TQt::Point($e->pos);
count++;
$paint->drawPoint($e->pos);
}
}
package main;
-use Qt;
+use TQt;
use ConnectWidget;
-my $a = Qt::Application(\@ARGV);
+my $a = TQt::Application(\@ARGV);
my $connect = ConnectWidget;
-$connect->setCaption("PerlQt Example - Draw lines");
+$connect->setCaption("PerlTQt Example - Draw lines");
$a->setMainWidget($connect);
$connect->show;
exit $a->exec;
diff --git a/PerlQt/examples/forever/forever.pl b/PerlQt/examples/forever/forever.pl
index bf6d56a..e388e44 100644
--- a/PerlQt/examples/forever/forever.pl
+++ b/PerlQt/examples/forever/forever.pl
@@ -1,11 +1,11 @@
#!/usr/bin/perl -w
use strict;
package Forever;
-use Qt;
-use Qt::isa qw(Qt::Widget);
-use Qt::slots
+use TQt;
+use TQt::isa qw(TQt::Widget);
+use TQt::slots
updateCaption => [];
-use Qt::attributes qw(
+use TQt::attributes qw(
rectangles
colors
);
@@ -15,23 +15,23 @@ sub NEW {
shift->SUPER::NEW(@_);
colors = \my @colors;
for(my $a = 0; $a < numColors; $a++) {
- push @colors, Qt::Color(rand(255), rand(255), rand(255));
+ push @colors, TQt::Color(rand(255), rand(255), rand(255));
}
rectangles = 0;
startTimer(0);
- my $counter = Qt::Timer(this);
- this->connect($counter, SIGNAL('timeout()'), SLOT('updateCaption()'));
+ my $counter = TQt::Timer(this);
+ this->connect($counter, TQT_SIGNAL('timeout()'), TQT_SLOT('updateCaption()'));
$counter->start(1000);
}
sub updateCaption {
- my $s = sprintf "PerlQt Example - Forever - %d rectangles/second", rectangles;
+ my $s = sprintf "PerlTQt Example - Forever - %d rectangles/second", rectangles;
rectangles = 0;
setCaption($s);
}
sub paintEvent {
- my $paint = Qt::Painter(this);
+ my $paint = TQt::Painter(this);
my $w = width();
my $h = height();
return if $w <= 0 || $h <= 0;
@@ -48,12 +48,12 @@ sub timerEvent {
}
package main;
-use Qt;
+use TQt;
use Forever;
-my $a = Qt::Application(\@ARGV);
+my $a = TQt::Application(\@ARGV);
my $always = Forever;
$a->setMainWidget($always);
-$always->setCaption("PerlQt Example - Forever");
+$always->setCaption("PerlTQt Example - Forever");
$always->show;
exit $a->exec;
diff --git a/PerlQt/examples/network/httpd/httpd.pl b/PerlQt/examples/network/httpd/httpd.pl
index 3f46041..a9aa0fd 100644
--- a/PerlQt/examples/network/httpd/httpd.pl
+++ b/PerlQt/examples/network/httpd/httpd.pl
@@ -1,28 +1,28 @@
#!/usr/bin/perl -w
-## This program is based on an example program for Qt. It
+## This program is based on an example program for TQt. It
## may be used, distributed and modified without limitation.
##
## Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-# When a new client connects, the server constructs a Qt::Socket and all
-# communication with the client is done over this Socket object. Qt::Socket
+# When a new client connects, the server constructs a TQt::Socket and all
+# communication with the client is done over this Socket object. TQt::Socket
# works asynchronously - this means that all the communication is done
# through the two slots readClient() and discardClient().
package HttpDaemon;
-use Qt;
-use Qt::isa qw(Qt::ServerSocket);
-use Qt::signals
+use TQt;
+use TQt::isa qw(TQt::ServerSocket);
+use TQt::signals
newConnect => [],
endConnect => [],
wroteToClient => [];
-use Qt::slots
+use TQt::slots
readClient => [],
discardClient => [];
-use Qt::attributes qw(
+use TQt::attributes qw(
sockets
);
@@ -38,9 +38,9 @@ sub NEW
sub newConnection
{
- my $s = Qt::Socket( this );
- this->connect( $s, SIGNAL 'readyRead()', this, SLOT 'readClient()' );
- this->connect( $s, SIGNAL 'delayedCloseFinished()', this, SLOT 'discardClient()' );
+ my $s = TQt::Socket( this );
+ this->connect( $s, TQT_SIGNAL 'readyRead()', this, TQT_SLOT 'readClient()' );
+ this->connect( $s, TQT_SIGNAL 'delayedCloseFinished()', this, TQT_SLOT 'discardClient()' );
$s->setSocket( shift );
sockets->{ $s } = $s;
emit newConnect();
@@ -81,13 +81,13 @@ sub discardClient
package HttpInfo;
-use Qt;
-use Qt::isa qw(Qt::VBox);
-use Qt::slots
+use TQt;
+use TQt::isa qw(TQt::VBox);
+use TQt::slots
newConnect => [],
endConnect => [],
wroteToClient => [];
-use Qt::attributes qw(
+use TQt::attributes qw(
httpd
infoText
);
@@ -106,10 +106,10 @@ sub NEW
$lb->setAlignment( &AlignHCenter );
infoText = TextView( this );
my $quit = PushButton( "quit" , this );
- this->connect( httpd, SIGNAL 'newConnect()', SLOT 'newConnect()' );
- this->connect( httpd, SIGNAL 'endConnect()', SLOT 'endConnect()' );
- this->connect( httpd, SIGNAL 'wroteToClient()', SLOT 'wroteToClient()' );
- this->connect( $quit, SIGNAL 'pressed()', Qt::app(), SLOT 'quit()' );
+ this->connect( httpd, TQT_SIGNAL 'newConnect()', TQT_SLOT 'newConnect()' );
+ this->connect( httpd, TQT_SIGNAL 'endConnect()', TQT_SLOT 'endConnect()' );
+ this->connect( httpd, TQT_SIGNAL 'wroteToClient()', TQT_SLOT 'wroteToClient()' );
+ this->connect( $quit, TQT_SIGNAL 'pressed()', TQt::app(), TQT_SLOT 'quit()' );
}
sub newConnect
@@ -130,10 +130,10 @@ sub wroteToClient
1;
package main;
-use Qt;
+use TQt;
use HttpInfo;
-my $app = Qt::Application(\@ARGV);
+my $app = TQt::Application(\@ARGV);
my $info = HttpInfo;
$app->setMainWidget($info);
$info->show;
diff --git a/PerlQt/examples/opengl/README b/PerlQt/examples/opengl/README
index 5c93086..7e2f174 100644
--- a/PerlQt/examples/opengl/README
+++ b/PerlQt/examples/opengl/README
@@ -3,9 +3,9 @@ the OpenGL module available on CPAN (http://www.cpan.org)
Latest version is 0.54, as of 09/11/02
-Both Smoke and Qt must also have been compiled with OpenGL support.
+Both Smoke and TQt must also have been compiled with OpenGL support.
-If your Qt library has OpenGL support but PerlQt complains about lacking
+If your TQt library has OpenGL support but PerlTQt complains about lacking
methods or classes, check ./configure's config.log file for any
error that might have occured while detecting your OpenGL settings.
diff --git a/PerlQt/examples/opengl/box/GLBox.pm b/PerlQt/examples/opengl/box/GLBox.pm
index dd6ceb9..1c6ceb8 100644
--- a/PerlQt/examples/opengl/box/GLBox.pm
+++ b/PerlQt/examples/opengl/box/GLBox.pm
@@ -4,13 +4,13 @@ use OpenGL qw(:all);
use strict;
-use Qt;
-use Qt::isa qw(Qt::GLWidget);
-use Qt::slots
+use TQt;
+use TQt::isa qw(TQt::GLWidget);
+use TQt::slots
setXRotation => ['int'],
setYRotation => ['int'],
setZRotation => ['int'];
-use Qt::attributes qw(
+use TQt::attributes qw(
xRot
yRot
zRot
@@ -75,7 +75,7 @@ sub makeObject
glLineWidth( 2.0 );
- glBegin( GL_QUADS );
+ glBegin( GL_TQUADS );
glVertex3f( 1.0, 0.5, -0.4 );
glVertex3f( 1.0, -0.5, -0.4 );
glVertex3f( -1.0, -0.5, -0.4 );
@@ -84,7 +84,7 @@ sub makeObject
qglColor( &blue );
- glBegin( GL_QUADS );
+ glBegin( GL_TQUADS );
glVertex3f( 1.0, 0.5, 0.4 );
glVertex3f( 1.0, -0.5, 0.4 );
glVertex3f( -1.0, -0.5, 0.4 );
@@ -93,7 +93,7 @@ sub makeObject
qglColor( &darkRed );
- glBegin( GL_QUAD_STRIP );
+ glBegin( GL_TQUAD_STRIP );
glVertex3f( 1.0, 0.5, -0.4 ); glVertex3f( 1.0, 0.5, 0.4 );
glVertex3f( 1.0, -0.5, -0.4 ); glVertex3f( 1.0, -0.5, 0.4 );
qglColor( &yellow );
diff --git a/PerlQt/examples/opengl/box/glbox b/PerlQt/examples/opengl/box/glbox
index 613a274..fed74a3 100644
--- a/PerlQt/examples/opengl/box/glbox
+++ b/PerlQt/examples/opengl/box/glbox
@@ -3,9 +3,9 @@ package GLObjectWindow;
use strict;
-use Qt;
-use Qt::isa qw(Qt::Widget);
-use Qt::attributes qw(
+use TQt;
+use TQt::isa qw(TQt::Widget);
+use TQt::attributes qw(
file
frame
menu
@@ -22,50 +22,50 @@ sub NEW
shift->SUPER::NEW(@_);
# Create a menu
- file = Qt::PopupMenu( this );
- file->insertItem( "Exit", Qt::app(), SLOT 'quit()', Qt::KeySequence(int &CTRL + &Key_Q ));
+ file = TQt::PopupMenu( this );
+ file->insertItem( "Exit", TQt::app(), TQT_SLOT 'quit()', TQt::KeySequence(int &CTRL + &Key_Q ));
# Create a menu bar
- menu = Qt::MenuBar( this );
- menu->setSeparator( &Qt::MenuBar::InWindowsStyle );
+ menu = TQt::MenuBar( this );
+ menu->setSeparator( &TQt::MenuBar::InWindowsStyle );
menu->insertItem("&File", file );
# Create a nice frame to put around the OpenGL widget
- frame = Qt::Frame( this, "frame" );
- frame->setFrameStyle( &Qt::Frame::Sunken | &Qt::Frame::Panel );
+ frame = TQt::Frame( this, "frame" );
+ frame->setFrameStyle( &TQt::Frame::Sunken | &TQt::Frame::Panel );
frame->setLineWidth( 2 );
# Create our OpenGL widget
box = GLBox( frame, "glbox");
# Create the three sliders; one for each rotation axis
- xpos = Qt::Slider ( 0, 360, 60, 0, &Qt::Slider::Vertical, this, "xsl" );
- xpos->setTickmarks( &Qt::Slider::Left );
- Qt::Object::connect( xpos, SIGNAL 'valueChanged(int)', box, SLOT 'setXRotation(int)' );
+ xpos = TQt::Slider ( 0, 360, 60, 0, &TQt::Slider::Vertical, this, "xsl" );
+ xpos->setTickmarks( &TQt::Slider::Left );
+ TQt::Object::connect( xpos, TQT_SIGNAL 'valueChanged(int)', box, TQT_SLOT 'setXRotation(int)' );
- ypos = Qt::Slider ( 0, 360, 60, 0, &Qt::Slider::Vertical, this, "ysl" );
- ypos->setTickmarks( &Qt::Slider::Left );
- Qt::Object::connect( ypos, SIGNAL 'valueChanged(int)', box, SLOT 'setYRotation(int)' );
+ ypos = TQt::Slider ( 0, 360, 60, 0, &TQt::Slider::Vertical, this, "ysl" );
+ ypos->setTickmarks( &TQt::Slider::Left );
+ TQt::Object::connect( ypos, TQT_SIGNAL 'valueChanged(int)', box, TQT_SLOT 'setYRotation(int)' );
- zpos = Qt::Slider ( 0, 360, 60, 0, &Qt::Slider::Vertical, this, "zsl" );
- zpos->setTickmarks( &Qt::Slider::Left );
- Qt::Object::connect( zpos, SIGNAL 'valueChanged(int)', box, SLOT 'setZRotation(int)' );
+ zpos = TQt::Slider ( 0, 360, 60, 0, &TQt::Slider::Vertical, this, "zsl" );
+ zpos->setTickmarks( &TQt::Slider::Left );
+ TQt::Object::connect( zpos, TQT_SIGNAL 'valueChanged(int)', box, TQT_SLOT 'setZRotation(int)' );
# Now that we have all the widgets, put them into a nice layout
# Put the sliders on top of each other
- my $vlayout = Qt::VBoxLayout( 20, "vlayout");
+ my $vlayout = TQt::VBoxLayout( 20, "vlayout");
$vlayout->addWidget( xpos );
$vlayout->addWidget( ypos );
$vlayout->addWidget( zpos );
# Put the GL widget inside the frame
- my $flayout = Qt::HBoxLayout( frame, 2, 2, "flayout");
+ my $flayout = TQt::HBoxLayout( frame, 2, 2, "flayout");
$flayout->addWidget( box, 1 );
# Top level layout, puts the sliders to the left of the frame/GL widget
- my $hlayout = Qt::HBoxLayout( this, 20, 20, "hlayout");
+ my $hlayout = TQt::HBoxLayout( this, 20, 20, "hlayout");
$hlayout->setMenuBar( menu );
$hlayout->addLayout( $vlayout );
$hlayout->addWidget( frame, 1 );
@@ -75,10 +75,10 @@ sub NEW
package main;
-use Qt;
+use TQt;
use GLObjectWindow;
-my $a = Qt::Application(\@ARGV);
+my $a = TQt::Application(\@ARGV);
my $w = GLObjectWindow;
$w->resize(350,350);
diff --git a/PerlQt/examples/opengl/gear/gear b/PerlQt/examples/opengl/gear/gear
index 2edc951..d9e4c8a 100644
--- a/PerlQt/examples/opengl/gear/gear
+++ b/PerlQt/examples/opengl/gear/gear
@@ -2,7 +2,7 @@
#
# Draws a gear.
#
-# This code is originally from Qt-1.44, by Troll Tech
+# This code is originally from TQt-1.44, by Troll Tech
#
# Portions of this code have been borrowed from Brian Paul's Mesa
# distribution.
@@ -11,8 +11,8 @@
package GearWidget;
use OpenGL qw(:all);
-use Qt;
-use Qt::attributes qw(
+use TQt;
+use TQt::attributes qw(
gear1
gear2
gear3
@@ -22,7 +22,7 @@ use Qt::attributes qw(
angle
);
-use Qt::isa qw(Qt::GLWidget);
+use TQt::isa qw(TQt::GLWidget);
#
# Draw a gear wheel. You'll probably want to call this function when
@@ -54,7 +54,7 @@ sub gear {
glNormal3f(0.0, 0.0, 1.0);
# draw front face
- glBegin(GL_QUAD_STRIP);
+ glBegin(GL_TQUAD_STRIP);
for $i (0 .. $teeth) {
$angle = $i * 2.0*$pi / $teeth;
glVertex3f($r0*cos($angle), $r0*sin($angle), $width*0.5);
@@ -65,7 +65,7 @@ sub gear {
glEnd();
# draw front sides of teeth
- glBegin(GL_QUADS);
+ glBegin(GL_TQUADS);
$da = 2.0*$pi / $teeth / 4.0;
for $i (0 .. $teeth-1) {
$angle = $i * 2.0*$pi / $teeth;
@@ -81,7 +81,7 @@ sub gear {
glNormal3f(0.0, 0.0, -1.0);
# draw back face
- glBegin(GL_QUAD_STRIP);
+ glBegin(GL_TQUAD_STRIP);
for $i (0 .. $teeth) {
$angle = $i * 2.0*$pi / $teeth;
glVertex3f($r1*cos($angle), $r1*sin($angle), -$width*0.5);
@@ -92,7 +92,7 @@ sub gear {
glEnd();
# draw back sides of teeth
- glBegin(GL_QUADS);
+ glBegin(GL_TQUADS);
$da = 2.0*$pi / $teeth / 4.0;
for $i (0 .. $teeth-1) {
$angle = $i * 2.0*$pi / $teeth;
@@ -105,7 +105,7 @@ sub gear {
glEnd();
# draw outward faces of teeth
- glBegin(GL_QUAD_STRIP);
+ glBegin(GL_TQUAD_STRIP);
for $i (0 .. $teeth-1) {
$angle = $i * 2.0*$pi / $teeth;
@@ -139,7 +139,7 @@ sub gear {
glShadeModel(GL_SMOOTH);
# draw inside radius cylinder
- glBegin(GL_QUAD_STRIP);
+ glBegin(GL_TQUAD_STRIP);
for $i (0 .. $teeth) {
$angle = $i * 2.0*$pi / $teeth;
glNormal3f(-cos($angle), -sin($angle), 0.0);
@@ -251,12 +251,12 @@ sub timerEvent {
package main;
-use Qt;
+use TQt;
use GearWidget;
-$app = Qt::Application(\@ARGV);
+$app = TQt::Application(\@ARGV);
-if(!Qt::GLFormat::hasOpenGL()) {
+if(!TQt::GLFormat::hasOpenGL()) {
warn("This system has no OpenGL support. Exiting.");
exit -1;
}
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;
diff --git a/PerlQt/examples/richedit/imageCollection.pm b/PerlQt/examples/richedit/imageCollection.pm
index 318d4e5..9ba9880 100644
--- a/PerlQt/examples/richedit/imageCollection.pm
+++ b/PerlQt/examples/richedit/imageCollection.pm
@@ -20,15 +20,15 @@
# images/undo
#
# Created: jeu jun 13 20:03:44 2002
-# by: The PerlQt User Interface Compiler (puic)
+# by: The PerlTQt User Interface Compiler (puic)
#
# WARNING! All changes made in this file will be lost!
use strict;
package DesignerMimeSourceFactory_richedit;
-use Qt;
-use Qt::isa qw(Qt::MimeSourceFactory);
+use TQt;
+use TQt::isa qw(TQt::MimeSourceFactory);
# images/editcopy
my $image_0_data = pack 'L*',
@@ -1416,9 +1416,9 @@ sub uic_findImage
{
my $name = shift;
return $images{$name} if exists $images{$name};
- return Qt::Image() unless exists $embed_images{$name};
+ return TQt::Image() unless exists $embed_images{$name};
- my $img = Qt::Image(@{$embed_images{$name}}[0..4], &Qt::Image::BigEndian);
+ my $img = TQt::Image(@{$embed_images{$name}}[0..4], &TQt::Image::BigEndian);
${$embed_images{$name}}[5] && $img->setAlphaBuffer(1);
$images{$name} = $img;
return $img;
@@ -1430,30 +1430,30 @@ sub data
my $img = uic_findImage($abs_name);
if($img->isNull())
{
- Qt::MimeSourceFactory::removeFactory(this);
- my $s = Qt::MimeSourceFactory::defaultFactory()->data($abs_name);
- Qt::MimeSourceFactory::addFactory(this);
+ TQt::MimeSourceFactory::removeFactory(this);
+ my $s = TQt::MimeSourceFactory::defaultFactory()->data($abs_name);
+ TQt::MimeSourceFactory::addFactory(this);
return $s;
}
- Qt::MimeSourceFactory::defaultFactory()->setImage($abs_name, $img);
- return Qt::MimeSourceFactory::defaultFactory()->data($abs_name);
+ TQt::MimeSourceFactory::defaultFactory()->setImage($abs_name, $img);
+ return TQt::MimeSourceFactory::defaultFactory()->data($abs_name);
}
package staticImages;
-use Qt;
+use TQt;
use DesignerMimeSourceFactory_richedit;
our %factories;
my $factory = DesignerMimeSourceFactory_richedit;
-Qt::MimeSourceFactory::defaultFactory()->addFactory($factory);
+TQt::MimeSourceFactory::defaultFactory()->addFactory($factory);
$factories{'DesignerMimeSourceFactory_richedit'} = $factory;
END
{
for( values %factories )
{
- Qt::MimeSourceFactory::defaultFactory()->removeFactory($_);
+ TQt::MimeSourceFactory::defaultFactory()->removeFactory($_);
}
%factories = ();
}
diff --git a/PerlQt/examples/richedit/richedit.pl b/PerlQt/examples/richedit/richedit.pl
index ef39e73..d2dee84 100644
--- a/PerlQt/examples/richedit/richedit.pl
+++ b/PerlQt/examples/richedit/richedit.pl
@@ -1,7 +1,7 @@
# Form implementation generated from reading ui file 'richedit.ui'
#
# Created: jeu jun 13 20:02:56 2002
-# by: The PerlQt User Interface Compiler (puic)
+# by: The PerlTQt User Interface Compiler (puic)
#
@@ -14,9 +14,9 @@ use FindBin;
use lib "$FindBin::Bin";
package EditorForm;
-use Qt;
-use Qt::isa qw(Qt::MainWindow);
-use Qt::slots
+use TQt;
+use TQt::isa qw(TQt::MainWindow);
+use TQt::slots
init => [],
fileExit => [],
fileNew => [],
@@ -26,9 +26,9 @@ use Qt::slots
helpAbout => [],
helpContents => [],
helpIndex => [],
- changeAlignment => ['QAction*'],
- saveAndContinue => ['const QString&'];
-use Qt::attributes qw(
+ changeAlignment => ['TQAction*'],
+ saveAndContinue => ['const TQString&'];
+use TQt::attributes qw(
textEdit
fontComboBox
SpinBox2
@@ -64,12 +64,12 @@ use Qt::attributes qw(
sub uic_load_pixmap_EditorForm
{
- my $pix = Qt::Pixmap();
- my $m = Qt::MimeSourceFactory::defaultFactory()->data(shift);
+ my $pix = TQt::Pixmap();
+ my $m = TQt::MimeSourceFactory::defaultFactory()->data(shift);
if($m)
{
- Qt::ImageDrag::decode($m, $pix);
+ TQt::ImageDrag::decode($m, $pix);
}
return $pix;
@@ -88,115 +88,115 @@ sub NEW
this->resize(646,436);
this->setCaption(this->trUtf8("Rich Edit"));
- this->setCentralWidget(Qt::Widget(this, "qt_central_widget"));
- my $EditorFormLayout = Qt::HBoxLayout(this->centralWidget(), 11, 6, '$EditorFormLayout');
+ this->setCentralWidget(TQt::Widget(this, "qt_central_widget"));
+ my $EditorFormLayout = TQt::HBoxLayout(this->centralWidget(), 11, 6, '$EditorFormLayout');
- textEdit = Qt::TextEdit(this->centralWidget(), "textEdit");
- textEdit->setSizePolicy(Qt::SizePolicy(7, 7, 0, 0, textEdit->sizePolicy()->hasHeightForWidth()));
- textEdit->setTextFormat(&Qt::TextEdit::RichText);
+ textEdit = TQt::TextEdit(this->centralWidget(), "textEdit");
+ textEdit->setSizePolicy(TQt::SizePolicy(7, 7, 0, 0, textEdit->sizePolicy()->hasHeightForWidth()));
+ textEdit->setTextFormat(&TQt::TextEdit::RichText);
$EditorFormLayout->addWidget(textEdit);
- fileNewAction= Qt::Action(this,"fileNewAction");
- fileNewAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("filenew")));
+ fileNewAction= TQt::Action(this,"fileNewAction");
+ fileNewAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("filenew")));
fileNewAction->setText(this->trUtf8("New"));
fileNewAction->setMenuText(this->trUtf8("&New"));
- fileNewAction->setAccel(Qt::KeySequence(int(4194382)));
- fileOpenAction= Qt::Action(this,"fileOpenAction");
- fileOpenAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("fileopen")));
+ fileNewAction->setAccel(TQt::KeySequence(int(4194382)));
+ fileOpenAction= TQt::Action(this,"fileOpenAction");
+ fileOpenAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("fileopen")));
fileOpenAction->setText(this->trUtf8("Open"));
fileOpenAction->setMenuText(this->trUtf8("&Open..."));
- fileOpenAction->setAccel(Qt::KeySequence(int(4194383)));
- fileSaveAction= Qt::Action(this,"fileSaveAction");
- fileSaveAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("filesave")));
+ fileOpenAction->setAccel(TQt::KeySequence(int(4194383)));
+ fileSaveAction= TQt::Action(this,"fileSaveAction");
+ fileSaveAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("filesave")));
fileSaveAction->setText(this->trUtf8("Save"));
fileSaveAction->setMenuText(this->trUtf8("&Save"));
- fileSaveAction->setAccel(Qt::KeySequence(int(4194387)));
- fileSaveAsAction= Qt::Action(this,"fileSaveAsAction");
+ fileSaveAction->setAccel(TQt::KeySequence(int(4194387)));
+ fileSaveAsAction= TQt::Action(this,"fileSaveAsAction");
fileSaveAsAction->setText(this->trUtf8("Save As"));
fileSaveAsAction->setMenuText(this->trUtf8("Save &As..."));
- fileSaveAsAction->setAccel(Qt::KeySequence(int(0)));
- fileExitAction= Qt::Action(this,"fileExitAction");
+ fileSaveAsAction->setAccel(TQt::KeySequence(int(0)));
+ fileExitAction= TQt::Action(this,"fileExitAction");
fileExitAction->setText(this->trUtf8("Exit"));
fileExitAction->setMenuText(this->trUtf8("E&xit"));
- fileExitAction->setAccel(Qt::KeySequence(int(0)));
- editUndoAction= Qt::Action(this,"editUndoAction");
- editUndoAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("undo")));
+ fileExitAction->setAccel(TQt::KeySequence(int(0)));
+ editUndoAction= TQt::Action(this,"editUndoAction");
+ editUndoAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("undo")));
editUndoAction->setText(this->trUtf8("Undo"));
editUndoAction->setMenuText(this->trUtf8("&Undo"));
- editUndoAction->setAccel(Qt::KeySequence(int(4194394)));
- editRedoAction= Qt::Action(this,"editRedoAction");
- editRedoAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("redo")));
+ editUndoAction->setAccel(TQt::KeySequence(int(4194394)));
+ editRedoAction= TQt::Action(this,"editRedoAction");
+ editRedoAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("redo")));
editRedoAction->setText(this->trUtf8("Redo"));
editRedoAction->setMenuText(this->trUtf8("&Redo"));
- editRedoAction->setAccel(Qt::KeySequence(int(4194393)));
- editCutAction= Qt::Action(this,"editCutAction");
- editCutAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("editcut")));
+ editRedoAction->setAccel(TQt::KeySequence(int(4194393)));
+ editCutAction= TQt::Action(this,"editCutAction");
+ editCutAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("editcut")));
editCutAction->setText(this->trUtf8("Cut"));
editCutAction->setMenuText(this->trUtf8("&Cut"));
- editCutAction->setAccel(Qt::KeySequence(int(4194392)));
- editCopyAction= Qt::Action(this,"editCopyAction");
- editCopyAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("editcopy")));
+ editCutAction->setAccel(TQt::KeySequence(int(4194392)));
+ editCopyAction= TQt::Action(this,"editCopyAction");
+ editCopyAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("editcopy")));
editCopyAction->setText(this->trUtf8("Copy"));
editCopyAction->setMenuText(this->trUtf8("C&opy"));
- editCopyAction->setAccel(Qt::KeySequence(int(4194371)));
- editPasteAction= Qt::Action(this,"editPasteAction");
- editPasteAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("editpaste")));
+ editCopyAction->setAccel(TQt::KeySequence(int(4194371)));
+ editPasteAction= TQt::Action(this,"editPasteAction");
+ editPasteAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("editpaste")));
editPasteAction->setText(this->trUtf8("Paste"));
editPasteAction->setMenuText(this->trUtf8("&Paste"));
- editPasteAction->setAccel(Qt::KeySequence(int(4194390)));
- helpContentsAction= Qt::Action(this,"helpContentsAction");
+ editPasteAction->setAccel(TQt::KeySequence(int(4194390)));
+ helpContentsAction= TQt::Action(this,"helpContentsAction");
helpContentsAction->setText(this->trUtf8("Contents"));
helpContentsAction->setMenuText(this->trUtf8("&Contents..."));
- helpContentsAction->setAccel(Qt::KeySequence(int(0)));
- helpIndexAction= Qt::Action(this,"helpIndexAction");
+ helpContentsAction->setAccel(TQt::KeySequence(int(0)));
+ helpIndexAction= TQt::Action(this,"helpIndexAction");
helpIndexAction->setText(this->trUtf8("Index"));
helpIndexAction->setMenuText(this->trUtf8("&Index..."));
- helpIndexAction->setAccel(Qt::KeySequence(int(0)));
- helpAboutAction= Qt::Action(this,"helpAboutAction");
+ helpIndexAction->setAccel(TQt::KeySequence(int(0)));
+ helpAboutAction= TQt::Action(this,"helpAboutAction");
helpAboutAction->setText(this->trUtf8("About"));
helpAboutAction->setMenuText(this->trUtf8("&About..."));
- helpAboutAction->setAccel(Qt::KeySequence(int(0)));
- boldAction= Qt::Action(this,"boldAction");
+ helpAboutAction->setAccel(TQt::KeySequence(int(0)));
+ boldAction= TQt::Action(this,"boldAction");
boldAction->setToggleAction(1);
- boldAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("textbold")));
+ boldAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textbold")));
boldAction->setText(this->trUtf8("bold"));
boldAction->setMenuText(this->trUtf8("&Bold"));
- boldAction->setAccel(Qt::KeySequence(int(272629826)));
- italicAction= Qt::Action(this,"italicAction");
+ boldAction->setAccel(TQt::KeySequence(int(272629826)));
+ italicAction= TQt::Action(this,"italicAction");
italicAction->setToggleAction(1);
- italicAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("textitalic")));
+ italicAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textitalic")));
italicAction->setText(this->trUtf8("italic"));
italicAction->setMenuText(this->trUtf8("&Italic"));
- italicAction->setAccel(Qt::KeySequence(int(272629833)));
- underlineAction= Qt::Action(this,"underlineAction");
+ italicAction->setAccel(TQt::KeySequence(int(272629833)));
+ underlineAction= TQt::Action(this,"underlineAction");
underlineAction->setToggleAction(1);
- underlineAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("textunder")));
+ underlineAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textunder")));
underlineAction->setText(this->trUtf8("underline"));
underlineAction->setMenuText(this->trUtf8("&Underline"));
- underlineAction->setAccel(Qt::KeySequence(int(272629845)));
- alignActionGroup= Qt::ActionGroup(this,"alignActionGroup");
+ underlineAction->setAccel(TQt::KeySequence(int(272629845)));
+ alignActionGroup= TQt::ActionGroup(this,"alignActionGroup");
alignActionGroup->setText(this->trUtf8("align"));
alignActionGroup->setUsesDropDown(0);
- leftAlignAction= Qt::Action(alignActionGroup,"leftAlignAction");
+ leftAlignAction= TQt::Action(alignActionGroup,"leftAlignAction");
leftAlignAction->setToggleAction(1);
- leftAlignAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("textleft")));
+ leftAlignAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textleft")));
leftAlignAction->setText(this->trUtf8("left"));
leftAlignAction->setMenuText(this->trUtf8("&Left"));
- leftAlignAction->setAccel(Qt::KeySequence(int(272629836)));
- rightAlignAction= Qt::Action(alignActionGroup,"rightAlignAction");
+ leftAlignAction->setAccel(TQt::KeySequence(int(272629836)));
+ rightAlignAction= TQt::Action(alignActionGroup,"rightAlignAction");
rightAlignAction->setToggleAction(1);
- rightAlignAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("textright")));
+ rightAlignAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textright")));
rightAlignAction->setText(this->trUtf8("right"));
rightAlignAction->setMenuText(this->trUtf8("&Right"));
- rightAlignAction->setAccel(Qt::KeySequence(int(272629842)));
- centerAlignAction= Qt::Action(alignActionGroup,"centerAlignAction");
+ rightAlignAction->setAccel(TQt::KeySequence(int(272629842)));
+ centerAlignAction= TQt::Action(alignActionGroup,"centerAlignAction");
centerAlignAction->setToggleAction(1);
- centerAlignAction->setIconSet(Qt::IconSet(uic_load_pixmap_EditorForm("textcenter")));
+ centerAlignAction->setIconSet(TQt::IconSet(uic_load_pixmap_EditorForm("textcenter")));
centerAlignAction->setText(this->trUtf8("center"));
centerAlignAction->setMenuText(this->trUtf8("&Center"));
- toolBar = Qt::ToolBar("", this, &DockTop);
+ toolBar = TQt::ToolBar("", this, &DockTop);
toolBar->setLabel(this->trUtf8("Tools"));
fileNewAction->addTo(toolBar);
@@ -208,7 +208,7 @@ sub NEW
editCutAction->addTo(toolBar);
editCopyAction->addTo(toolBar);
editPasteAction->addTo(toolBar);
- Toolbar = Qt::ToolBar("", this, &DockTop);
+ Toolbar = TQt::ToolBar("", this, &DockTop);
Toolbar->setLabel(this->trUtf8("Toolbar"));
leftAlignAction->addTo(Toolbar);
@@ -220,16 +220,16 @@ sub NEW
underlineAction->addTo(Toolbar);
Toolbar->addSeparator;
- fontComboBox = Qt::ComboBox(0, Toolbar, "fontComboBox");
+ fontComboBox = TQt::ComboBox(0, Toolbar, "fontComboBox");
- SpinBox2 = Qt::SpinBox(Toolbar, "SpinBox2");
+ SpinBox2 = TQt::SpinBox(Toolbar, "SpinBox2");
SpinBox2->setMinValue(int(6));
SpinBox2->setValue(int(10));
- menubar= Qt::MenuBar( this, "menubar");
+ menubar= TQt::MenuBar( this, "menubar");
- fileMenu= Qt::PopupMenu(this);
+ fileMenu= TQt::PopupMenu(this);
fileNewAction->addTo(fileMenu);
fileOpenAction->addTo(fileMenu);
fileSaveAction->addTo(fileMenu);
@@ -238,7 +238,7 @@ sub NEW
fileExitAction->addTo(fileMenu);
menubar->insertItem(this->trUtf8("&File"), fileMenu);
- editMenu= Qt::PopupMenu(this);
+ editMenu= TQt::PopupMenu(this);
editUndoAction->addTo(editMenu);
editRedoAction->addTo(editMenu);
editMenu->insertSeparator;
@@ -247,7 +247,7 @@ sub NEW
editPasteAction->addTo(editMenu);
menubar->insertItem(this->trUtf8("&Edit"), editMenu);
- PopupMenu_2= Qt::PopupMenu(this);
+ PopupMenu_2= TQt::PopupMenu(this);
leftAlignAction->addTo(PopupMenu_2);
rightAlignAction->addTo(PopupMenu_2);
centerAlignAction->addTo(PopupMenu_2);
@@ -257,7 +257,7 @@ sub NEW
underlineAction->addTo(PopupMenu_2);
menubar->insertItem(this->trUtf8("F&ormat"), PopupMenu_2);
- helpMenu= Qt::PopupMenu(this);
+ helpMenu= TQt::PopupMenu(this);
helpContentsAction->addTo(helpMenu);
helpIndexAction->addTo(helpMenu);
helpMenu->insertSeparator;
@@ -266,26 +266,26 @@ sub NEW
- Qt::Object::connect(fileNewAction, SIGNAL "activated()", this, SLOT "fileNew()");
- Qt::Object::connect(fileOpenAction, SIGNAL "activated()", this, SLOT "fileOpen()");
- Qt::Object::connect(fileSaveAction, SIGNAL "activated()", this, SLOT "fileSave()");
- Qt::Object::connect(fileSaveAsAction, SIGNAL "activated()", this, SLOT "fileSaveAs()");
- Qt::Object::connect(fileExitAction, SIGNAL "activated()", this, SLOT "fileExit()");
- Qt::Object::connect(helpIndexAction, SIGNAL "activated()", this, SLOT "helpIndex()");
- Qt::Object::connect(helpContentsAction, SIGNAL "activated()", this, SLOT "helpContents()");
- Qt::Object::connect(helpAboutAction, SIGNAL "activated()", this, SLOT "helpAbout()");
- Qt::Object::connect(SpinBox2, SIGNAL "valueChanged(int)", textEdit, SLOT "setPointSize(int)");
- Qt::Object::connect(editCutAction, SIGNAL "activated()", textEdit, SLOT "cut()");
- Qt::Object::connect(editPasteAction, SIGNAL "activated()", textEdit, SLOT "paste()");
- Qt::Object::connect(editCopyAction, SIGNAL "activated()", textEdit, SLOT "copy()");
- Qt::Object::connect(editRedoAction, SIGNAL "activated()", textEdit, SLOT "redo()");
- Qt::Object::connect(editUndoAction, SIGNAL "activated()", textEdit, SLOT "undo()");
- Qt::Object::connect(alignActionGroup, SIGNAL "selected(QAction*)", this, SLOT "changeAlignment(QAction*)");
- Qt::Object::connect(underlineAction, SIGNAL "toggled(bool)", textEdit, SLOT "setUnderline(bool)");
- Qt::Object::connect(italicAction, SIGNAL "toggled(bool)", textEdit, SLOT "setItalic(bool)");
- Qt::Object::connect(boldAction, SIGNAL "toggled(bool)", textEdit, SLOT "setBold(bool)");
- Qt::Object::connect(fontComboBox, SIGNAL "activated(const QString&)", textEdit, SLOT "setFamily(const QString&)");
- Qt::Object::connect(fontComboBox, SIGNAL "activated(const QString&)", textEdit, SLOT "setFocus()");
+ TQt::Object::connect(fileNewAction, TQT_SIGNAL "activated()", this, TQT_SLOT "fileNew()");
+ TQt::Object::connect(fileOpenAction, TQT_SIGNAL "activated()", this, TQT_SLOT "fileOpen()");
+ TQt::Object::connect(fileSaveAction, TQT_SIGNAL "activated()", this, TQT_SLOT "fileSave()");
+ TQt::Object::connect(fileSaveAsAction, TQT_SIGNAL "activated()", this, TQT_SLOT "fileSaveAs()");
+ TQt::Object::connect(fileExitAction, TQT_SIGNAL "activated()", this, TQT_SLOT "fileExit()");
+ TQt::Object::connect(helpIndexAction, TQT_SIGNAL "activated()", this, TQT_SLOT "helpIndex()");
+ TQt::Object::connect(helpContentsAction, TQT_SIGNAL "activated()", this, TQT_SLOT "helpContents()");
+ TQt::Object::connect(helpAboutAction, TQT_SIGNAL "activated()", this, TQT_SLOT "helpAbout()");
+ TQt::Object::connect(SpinBox2, TQT_SIGNAL "valueChanged(int)", textEdit, TQT_SLOT "setPointSize(int)");
+ TQt::Object::connect(editCutAction, TQT_SIGNAL "activated()", textEdit, TQT_SLOT "cut()");
+ TQt::Object::connect(editPasteAction, TQT_SIGNAL "activated()", textEdit, TQT_SLOT "paste()");
+ TQt::Object::connect(editCopyAction, TQT_SIGNAL "activated()", textEdit, TQT_SLOT "copy()");
+ TQt::Object::connect(editRedoAction, TQT_SIGNAL "activated()", textEdit, TQT_SLOT "redo()");
+ TQt::Object::connect(editUndoAction, TQT_SIGNAL "activated()", textEdit, TQT_SLOT "undo()");
+ TQt::Object::connect(alignActionGroup, TQT_SIGNAL "selected(TQAction*)", this, TQT_SLOT "changeAlignment(TQAction*)");
+ TQt::Object::connect(underlineAction, TQT_SIGNAL "toggled(bool)", textEdit, TQT_SLOT "setUnderline(bool)");
+ TQt::Object::connect(italicAction, TQT_SIGNAL "toggled(bool)", textEdit, TQT_SLOT "setItalic(bool)");
+ TQt::Object::connect(boldAction, TQT_SIGNAL "toggled(bool)", textEdit, TQT_SLOT "setBold(bool)");
+ TQt::Object::connect(fontComboBox, TQT_SIGNAL "activated(const TQString&)", textEdit, TQT_SLOT "setFamily(const TQString&)");
+ TQt::Object::connect(fontComboBox, TQT_SIGNAL "activated(const TQString&)", textEdit, TQT_SLOT "setFocus()");
init();
}
@@ -295,7 +295,7 @@ sub init
{
textEdit->setFocus;
- my $fonts = Qt::FontDatabase;
+ my $fonts = TQt::FontDatabase;
fontComboBox->insertStringList($fonts->families);
my $font = lc textEdit->family;
for(my $i = 0; $i < fontComboBox->count; $i++) {
@@ -349,12 +349,12 @@ sub helpIndex
sub changeAlignment
{
- print "EditorForm->changeAlignment(QAction*): Not implemented yet.\n";
+ print "EditorForm->changeAlignment(TQAction*): Not implemented yet.\n";
}
sub saveAndContinue
{
- print "EditorForm->saveAndContinue(const QString&): Not implemented yet.\n";
+ print "EditorForm->saveAndContinue(const TQString&): Not implemented yet.\n";
}
1;
@@ -362,12 +362,12 @@ sub saveAndContinue
package main;
-use Qt;
+use TQt;
use EditorForm;
use imageCollection;
-my $a = Qt::Application(\@ARGV);
-Qt::Object::connect($a, SIGNAL("lastWindowClosed()"), $a, SLOT("quit()"));
+my $a = TQt::Application(\@ARGV);
+TQt::Object::connect($a, TQT_SIGNAL("lastWindowClosed()"), $a, TQT_SLOT("quit()"));
my $w = EditorForm;
$a->setMainWidget($w);
$w->show;