summaryrefslogtreecommitdiffstats
path: root/PerlQt/t
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-01-01 18:24:37 -0600
committerTimothy Pearson <[email protected]>2012-01-01 18:24:37 -0600
commit4e997a9c6e25689dca65a2ec573a599699ef8170 (patch)
treefdb5ecac42fb8204df9fc8c9abe1c784d4719e0e /PerlQt/t
parentbfa107694b2507a7116f8856cafe4ab1375da8a9 (diff)
downloadlibtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.tar.gz
libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.zip
Initial TQt conversion
Diffstat (limited to 'PerlQt/t')
-rw-r--r--PerlQt/t/Foo/SubCodec.pm4
-rw-r--r--PerlQt/t/My/Codec.pm4
-rw-r--r--PerlQt/t/My/SubCodec.pm4
-rw-r--r--PerlQt/t/a_loading.t2
-rw-r--r--PerlQt/t/b_nogui.t18
-rw-r--r--PerlQt/t/c_qapp.t12
-rw-r--r--PerlQt/t/ca_i18n.t10
-rw-r--r--PerlQt/t/d_sigslot.t22
-rw-r--r--PerlQt/t/e_sigslot_inherit.t22
-rw-r--r--PerlQt/t/f_import.t2
-rw-r--r--PerlQt/t/g_gui.t62
11 files changed, 81 insertions, 81 deletions
diff --git a/PerlQt/t/Foo/SubCodec.pm b/PerlQt/t/Foo/SubCodec.pm
index 15ce08a..9d79fba 100644
--- a/PerlQt/t/Foo/SubCodec.pm
+++ b/PerlQt/t/Foo/SubCodec.pm
@@ -1,7 +1,7 @@
package Foo::SubCodec;
-use Qt;
+use TQt;
use My::Codec;
-use Qt::isa qw( My::Codec );
+use TQt::isa qw( My::Codec );
sub NEW
diff --git a/PerlQt/t/My/Codec.pm b/PerlQt/t/My/Codec.pm
index 93e1d01..f853f5d 100644
--- a/PerlQt/t/My/Codec.pm
+++ b/PerlQt/t/My/Codec.pm
@@ -1,6 +1,6 @@
package My::Codec;
-use Qt;
-use Qt::isa qw( Qt::TextCodec );
+use TQt;
+use TQt::isa qw( TQt::TextCodec );
sub NEW
{
diff --git a/PerlQt/t/My/SubCodec.pm b/PerlQt/t/My/SubCodec.pm
index 58f8987..35e2b0c 100644
--- a/PerlQt/t/My/SubCodec.pm
+++ b/PerlQt/t/My/SubCodec.pm
@@ -1,8 +1,8 @@
package My::SubCodec;
-use Qt;
+use TQt;
use My::Codec;
-use Qt::isa qw( My::Codec );
+use TQt::isa qw( My::Codec );
sub NEW
diff --git a/PerlQt/t/a_loading.t b/PerlQt/t/a_loading.t
index 4a9f4a1..1cffc31 100644
--- a/PerlQt/t/a_loading.t
+++ b/PerlQt/t/a_loading.t
@@ -1,6 +1,6 @@
BEGIN { print "1..1\n" }
-use Qt;
+use TQt;
print "ok 1\n"
diff --git a/PerlQt/t/b_nogui.t b/PerlQt/t/b_nogui.t
index 23bdd72..cd28260 100644
--- a/PerlQt/t/b_nogui.t
+++ b/PerlQt/t/b_nogui.t
@@ -1,19 +1,19 @@
BEGIN { print "1..6\n" }
-use Qt;
-use Qt::constants;
+use TQt;
+use TQt::constants;
-eval {my $c = Qt::TextCodec::codecForLocale()};
+eval {my $c = TQt::TextCodec::codecForLocale()};
print +$@ ? "not ok\n" : "ok 1\n";
-eval {my $s = Qt::Variant( Qt::DateTime::currentDateTime() ) };
+eval {my $s = TQt::Variant( TQt::DateTime::currentDateTime() ) };
print +$@ ? "not ok\n" : "ok 2\n";
my $ret;
-eval {$ret = Qt::Point(20,20); $ret += Qt::Point(10,10); $ret *= 2 ; $ret /= 3 };
+eval {$ret = TQt::Point(20,20); $ret += TQt::Point(10,10); $ret *= 2 ; $ret /= 3 };
print +$@ ? "not ok\n" : "ok 3\n";
@@ -21,7 +21,7 @@ eval { $ret = ($ret->x != 20 or $ret->y != 20) ? 1 : 0 };
print +($@ || $ret) ? "not ok\n" : "ok 4\n";
-eval { my $z = Qt::GlobalSpace::qVersion() };
+eval { my $z = TQt::GlobalSpace::qVersion() };
if( $@ )
{
@@ -30,8 +30,8 @@ if( $@ )
}
else
{
- eval{ my $p = Qt::Point( 20, 20 );
- my $p2 = Qt::Point( 30, 30 );
+ eval{ my $p = TQt::Point( 20, 20 );
+ my $p2 = TQt::Point( 30, 30 );
$p = $p + $p2 + $p;
$p2 = $p * 2;
$p2 = -$p2;
@@ -41,7 +41,7 @@ else
eval {
$str = "Fooooooooooo";
- $ts = Qt::TextStream( $str, IO_WriteOnly );
+ $ts = TQt::TextStream( $str, IO_WriteOnly );
$ts << "pi = " << 3.14;
};
print +($str eq "pi = 3.14ooo") ? "ok 6\n":"not ok\n";
diff --git a/PerlQt/t/c_qapp.t b/PerlQt/t/c_qapp.t
index ee28266..01d6b39 100644
--- a/PerlQt/t/c_qapp.t
+++ b/PerlQt/t/c_qapp.t
@@ -1,23 +1,23 @@
BEGIN { print "1..3\n" }
-use Qt;
+use TQt;
$a=0;
-# testing if the Qt::Application ctor works
+# testing if the TQt::Application ctor works
-eval { $a=Qt::Application(\@ARGV) };
+eval { $a=TQt::Application(\@ARGV) };
print +$@ ? "not ok\n" : "ok 1\n";
# testing wether the global object is properly setup
-eval { Qt::app()->libraryPaths() };
+eval { TQt::app()->libraryPaths() };
print +$@ ? "not ok\n" : "ok 2\n";
# one second test of the event loop
-Qt::Timer::singleShot( 300, Qt::app(), SLOT "quit()" );
+TQt::Timer::singleShot( 300, TQt::app(), TQT_SLOT "quit()" );
-print Qt::app()->exec ? "not ok\n" : "ok 3\n";
+print TQt::app()->exec ? "not ok\n" : "ok 3\n";
diff --git a/PerlQt/t/ca_i18n.t b/PerlQt/t/ca_i18n.t
index fddbff7..1e71c29 100644
--- a/PerlQt/t/ca_i18n.t
+++ b/PerlQt/t/ca_i18n.t
@@ -1,21 +1,21 @@
BEGIN { print "1..1\n" }
-use Qt;
+use TQt;
-$a = Qt::Application();
-$pb=Qt::PushButton("Foooo", undef);
+$a = TQt::Application();
+$pb=TQt::PushButton("Foooo", undef);
{
use bytes;
$pb->setText( "�l�gant" );
$b = $pb->text();
- $b2 = Qt::Widget::tr("�l�gant");
+ $b2 = TQt::Widget::tr("�l�gant");
}
$c = $pb->text();
-$c2= Qt::Widget::tr("�l�gant");
+$c2= TQt::Widget::tr("�l�gant");
{
use bytes;
diff --git a/PerlQt/t/d_sigslot.t b/PerlQt/t/d_sigslot.t
index 1b455e1..acd3c4a 100644
--- a/PerlQt/t/d_sigslot.t
+++ b/PerlQt/t/d_sigslot.t
@@ -1,24 +1,24 @@
BEGIN { print "1..3\n" }
package MyApp;
-use Qt;
-use Qt::isa qw(Qt::Application);
-use Qt::slots
+use TQt;
+use TQt::isa qw(TQt::Application);
+use TQt::slots
foo => ['int'],
baz => [];
-use Qt::signals
+use TQt::signals
bar => ['int'];
sub NEW {
shift->SUPER::NEW(@_);
- # 1) testing correct subclassing of Qt::Application and this pointer
+ # 1) testing correct subclassing of TQt::Application and this pointer
print +(ref(this) eq " MyApp")? "ok 1\n" : "not ok\n";
- this->connect(this, SIGNAL 'bar(int)', SLOT 'foo(int)');
+ this->connect(this, TQT_SIGNAL 'bar(int)', TQT_SLOT 'foo(int)');
- # 3) automatic quitting will test Qt sig to custom slot
- this->connect(this, SIGNAL 'aboutToQuit()', SLOT 'baz()');
+ # 3) automatic quitting will test TQt sig to custom slot
+ this->connect(this, TQT_SIGNAL 'aboutToQuit()', TQT_SLOT 'baz()');
# 2) testing custom sig to custom slot
emit bar(3);
@@ -38,12 +38,12 @@ sub baz
package main;
-use Qt;
+use TQt;
use MyApp;
$a = 0;
$a = MyApp(\@ARGV);
-Qt::Timer::singleShot( 300, Qt::app(), SLOT "quit()" );
+TQt::Timer::singleShot( 300, TQt::app(), TQT_SLOT "quit()" );
-exit Qt::app()->exec;
+exit TQt::app()->exec;
diff --git a/PerlQt/t/e_sigslot_inherit.t b/PerlQt/t/e_sigslot_inherit.t
index aa3bd76..338a405 100644
--- a/PerlQt/t/e_sigslot_inherit.t
+++ b/PerlQt/t/e_sigslot_inherit.t
@@ -1,19 +1,19 @@
BEGIN { print "1..6\n" }
package MyApp;
-use Qt;
-use Qt::isa('Qt::Application');
-use Qt::slots
+use TQt;
+use TQt::isa('TQt::Application');
+use TQt::slots
foo => ['int'],
baz => [];
-use Qt::signals
+use TQt::signals
bar => ['int'];
sub NEW
{
shift->SUPER::NEW(@_);
- this->connect(this, SIGNAL 'bar(int)', SLOT 'foo(int)');
- this->connect(this, SIGNAL 'aboutToQuit()', SLOT 'baz()');
+ this->connect(this, TQT_SIGNAL 'bar(int)', TQT_SLOT 'foo(int)');
+ this->connect(this, TQT_SIGNAL 'aboutToQuit()', TQT_SLOT 'baz()');
}
sub foo
@@ -36,8 +36,8 @@ sub coincoin
1;
package MySubApp;
-use Qt;
-use Qt::isa('MyApp');
+use TQt;
+use TQt::isa('MyApp');
sub NEW
@@ -61,12 +61,12 @@ sub baz
package main;
-use Qt;
+use TQt;
use MySubApp;
$a = 0;
$a = MySubApp(\@ARGV);
-Qt::Timer::singleShot( 300, Qt::app(), SLOT "quit()" );
+TQt::Timer::singleShot( 300, TQt::app(), TQT_SLOT "quit()" );
-exit Qt::app()->exec;
+exit TQt::app()->exec;
diff --git a/PerlQt/t/f_import.t b/PerlQt/t/f_import.t
index c6467a3..9f8977c 100644
--- a/PerlQt/t/f_import.t
+++ b/PerlQt/t/f_import.t
@@ -2,7 +2,7 @@ BEGIN { push @INC, "./t" ; print "1..1\n" }
package main;
-use Qt;
+use TQt;
use My::SubCodec;
use Foo::SubCodec;
diff --git a/PerlQt/t/g_gui.t b/PerlQt/t/g_gui.t
index b47c0c0..f3a7d05 100644
--- a/PerlQt/t/g_gui.t
+++ b/PerlQt/t/g_gui.t
@@ -3,11 +3,11 @@ BEGIN { print "1..1\n" }
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
@@ -24,65 +24,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);
@@ -93,7 +93,7 @@ sub NEW {
}
#
-# SLOT slotChangeGrp3State()
+# TQT_SLOT slotChangeGrp3State()
#
# enables/disables the radiobuttons of the third buttongroup
#
@@ -108,20 +108,20 @@ sub slotChangeGrp3State {
package main;
-use Qt;
+use TQt;
use ButtonsGroups;
-Qt::StyleFactory::keys(); # disable style plugins (hacky)
+TQt::StyleFactory::keys(); # disable style plugins (hacky)
-my $a = Qt::Application(\@ARGV);
+my $a = TQt::Application(\@ARGV);
my $buttonsgroups = ButtonsGroups;
$buttonsgroups->resize(500, 250);
-$buttonsgroups->setCaption("PerlQt Test - Please wait");
+$buttonsgroups->setCaption("PerlTQt Test - Please wait");
$a->setMainWidget($buttonsgroups);
$buttonsgroups->show;
-Qt::Timer::singleShot( 2000, Qt::app(), SLOT "quit()" );
+TQt::Timer::singleShot( 2000, TQt::app(), TQT_SLOT "quit()" );
my $r = $a->exec;
print +$r?"not ok\n" : "ok 1\n";
exit $r;