diff options
author | Timothy Pearson <[email protected]> | 2012-01-01 18:24:37 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-01-01 18:24:37 -0600 |
commit | 4e997a9c6e25689dca65a2ec573a599699ef8170 (patch) | |
tree | fdb5ecac42fb8204df9fc8c9abe1c784d4719e0e /PerlQt | |
parent | bfa107694b2507a7116f8856cafe4ab1375da8a9 (diff) | |
download | libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.tar.gz libtqt-perl-4e997a9c6e25689dca65a2ec573a599699ef8170.zip |
Initial TQt conversion
Diffstat (limited to 'PerlQt')
79 files changed, 1525 insertions, 1525 deletions
diff --git a/PerlQt/INSTALL b/PerlQt/INSTALL index bd4a724..bad4e4a 100644 --- a/PerlQt/INSTALL +++ b/PerlQt/INSTALL @@ -1,22 +1,22 @@ -PerlQt is distributed under the GPL. Development is coordinated on the +PerlTQt is distributed under the GPL. Development is coordinated on the [email protected] mailing-list. To subscribe, visit http://mail.kde.org/mailman/listinfo/kde-perl or send a subscribe message to [email protected]. Please send patches and bug reports to the mailing-list. -This file contains instructions for downloading and building the SmokeQt -library and PerlQt. PerlQt is not a direct Perl interface to the Qt -library, but is rather an interface to the SmokeQt library generated by +This file contains instructions for downloading and building the SmokeTQt +library and PerlTQt. PerlTQt is not a direct Perl interface to the TQt +library, but is rather an interface to the SmokeTQt library generated by Kalyptus. The programs+version I use, but not necessarily required: Linux (oddly enough, most of the developers use Mandrake) Perl-5.6.0 or above (tested up to 5.8.0-RC1) -Qt-3.0.1 or above (untested with 3.0.0, should work though) +TQt-3.0.1 or above (untested with 3.0.0, should work though) automake-1.5 (KDE requires recent automake) autoconf-2.53 (KDE requires recent autoconf) -Make sure your $QTDIR environment-variable is set. +Make sure your $TQTDIR environment-variable is set. I'm sorry for all the requirements, but you *are* getting this from CVS. Release versions will be much easier and more independant. @@ -33,15 +33,15 @@ $ cd kdebindings # kdebindings/ $ cvs co admin # get kde build tools At this point, you now have the full smokeqt environment. The -pre-generated smoke library is based off KDE's copy of Qt-3.0.4. I have -Qt-3.0.1, so I have to re-generate the files to match my installed -version of Qt. Here's how to do it. +pre-generated smoke library is based off KDE's copy of TQt-3.0.4. I have +TQt-3.0.1, so I have to re-generate the files to match my installed +version of TQt. Here's how to do it. $ cd smoke/qt # kdebindings/smoke/qt/ -$ perl ./qtguess.pl # simple script to find disabled Qt features +$ perl ./qtguess.pl # simple script to find disabled TQt features $ perl ./generate.pl # calls kalyptus which generates code -Now you have the SmokeQt source-code generated for your personal Qt +Now you have the SmokeTQt source-code generated for your personal TQt configuration. Here's how to compile. $ cd ../.. # kdebindings/ @@ -52,12 +52,12 @@ $ make # this should succeed $ make install # will install to --prefix from configure Okay, you now have libsmokeqt installed on your system. You can now -compile PerlQt. First, get the latest version of PerlQt-3. +compile PerlTQt. First, get the latest version of PerlTQt-3. $ export CVSROOT=:pserver:[email protected]:/cvsroot/perlqt $ cvs login # no password -$ cvs co PerlQt-3 -$ cd PerlQt-3 # PerlQt-3/ +$ cvs co PerlTQt-3 +$ cd PerlTQt-3 # PerlTQt-3/ If you installed libsmokeqt in a non-standard library path, you will need to edit Makefile.PL and add -L/your/lib/path to the LIBS @@ -67,14 +67,14 @@ your system, you will need to change it now. $ perl Makefile.PL $ make -Now PerlQt is built on your system. To test it out: +Now PerlTQt is built on your system. To test it out: -$ cd tutorials # PerlQt-3/tutorials/ +$ cd tutorials # PerlTQt-3/tutorials/ $ perl runall.pl All 14 tutorials should run in order. As you close one program out by clicking Quit or the window close button, the next should start. If all 14 -tutorials run without error and work like the C++ version, PerlQt is built +tutorials run without error and work like the C++ version, PerlTQt is built correctly and you can make install if you wish. If an error occurs which you can't fix, contact the kde-perl mailing list and make a bug report. diff --git a/PerlQt/MANIFEST b/PerlQt/MANIFEST index d52681c..53d07ac 100644 --- a/PerlQt/MANIFEST +++ b/PerlQt/MANIFEST @@ -1,9 +1,9 @@ INSTALL MANIFEST Makefile.PL.in -Qt.pm -Qt.xs -Qt.pod +TQt.pm +TQt.xs +TQt.pod bin/pqtapi bin/pqtsh examples/aclock/AnalogClock.pm @@ -24,15 +24,15 @@ examples/progress/progress.pl examples/richedit/imageCollection.pm examples/richedit/richedit.pl handlers.cpp -lib/Qt/attributes.pm -lib/Qt/debug.pm -lib/Qt/enumerations.pm -lib/Qt/isa.pm -lib/Qt/constants.pm -lib/Qt/properties.pm -lib/Qt/signals.pm -lib/Qt/slots.pm -lib/Qt/GlobalSpace.pm +lib/TQt/attributes.pm +lib/TQt/debug.pm +lib/TQt/enumerations.pm +lib/TQt/isa.pm +lib/TQt/constants.pm +lib/TQt/properties.pm +lib/TQt/signals.pm +lib/TQt/slots.pm +lib/TQt/GlobalSpace.pm marshall.h perlqt.h smokeperl.cpp diff --git a/PerlQt/Makefile.PL.in b/PerlQt/Makefile.PL.in index e848160..e4009db 100644 --- a/PerlQt/Makefile.PL.in +++ b/PerlQt/Makefile.PL.in @@ -21,7 +21,7 @@ $x{'X_PRE_LIBS'} = '@X_PRE_LIBS@'; interpolate('LIB_X11', 'exec_prefix', 'libdir', 'datadir'); -my $objects='Qt$(OBJ_EXT) handlers$(OBJ_EXT)'; +my $objects='TQt$(OBJ_EXT) handlers$(OBJ_EXT)'; my $qtlib ='@LIB_QT@'; interpolate(\$qtlib); @@ -81,12 +81,12 @@ my $localsmoke = File::Spec->catdir($abs_topdir,"smoke","qt",".libs"); # the contents of the Makefile that is written. WriteMakefile( - 'NAME' => 'Qt', - 'VERSION_FROM' => 'Qt.pm', # finds $VERSION - 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1, + 'NAME' => 'TQt', + 'VERSION_FROM' => 'TQt.pm', # finds $VERSION + 'PRERETTQ_PM' => {}, # e.g., Module::Name => 1.1, 'INC' => '@all_includes@ -I. -I../smoke', 'LIBS' => ['@all_libraries@'." -L$localsmoke -lsmokeqt ".'@LIBCRYPT@'." $qtlib"], -# 'XS' => {'Qt.xs' => 'Qt.cpp'}, # does not work ... still expects Qt.c +# 'XS' => {'TQt.xs' => 'TQt.cpp'}, # does not work ... still expects TQt.c 'XSOPT' => "-C++", 'OBJECT' => "$objects", # Object files 'CC' => '@CXX@', @@ -97,7 +97,7 @@ WriteMakefile( 'INST_BIN' => './bin', 'DEFINE' => $cxxflags, 'H' => ["marshall.h", "perlqt.h", "smokeperl.h"], - 'ABSTRACT' => "An OO interface to Trolltech's Qt toolkit", + 'ABSTRACT' => "An OO interface to Trolltech's TQt toolkit", 'dynamic_lib' => {'OTHERLDFLAGS' => $rpath}, ($] >= 5.005 ? ## Add these new keywords supported since 5.005 ( @@ -174,16 +174,16 @@ for my $s( @scripts ) chmod 0755, $s; } -open(IN, ">Qt.pod") or die "couldn't write Qt.pod: $!\n"; +open(IN, ">TQt.pod") or die "couldn't write TQt.pod: $!\n"; print IN <<STOP; =head1 NAME -PerlQt - Perl interface to the Qt GUI Widget toolkit +PerlTQt - Perl interface to the TQt GUI Widget toolkit -=head1 Qt +=head1 TQt -Given the huge size of the Qt module +Given the huge size of the TQt module (more than 400 classes and 13000 methods) it doesn't have any formal documentation. @@ -193,17 +193,17 @@ Instead, it provides two introspection tools =item * pqtapi: -a command line PerlQt API introspector +a command line PerlTQt API introspector =item * pqtsh: -a graphical PerlQt shell +a graphical PerlTQt shell =back and a detailed B<tutorial> with comprehensive explanations. -This is where anyone new to PerlQt +This is where anyone new to PerlTQt should start. The tutorial has been originally installed @@ -213,9 +213,9 @@ B<HTML> format. For a complete IDE allowing RAD and visual programming, check the pqt-designer package. ---- The PerlQt team +--- The PerlTQt team -http://perlqt.sf.net - PerlQt Project Homepage +http://perlqt.sf.net - PerlTQt Project Homepage =cut STOP diff --git a/PerlQt/Qt.pm b/PerlQt/Qt.pm index 01a08e8..69bcbca 100644 --- a/PerlQt/Qt.pm +++ b/PerlQt/Qt.pm @@ -1,4 +1,4 @@ -package Qt::base; +package TQt::base; use strict; sub this () {} @@ -8,394 +8,394 @@ sub new { my $t = this; shift->NEW(@_); my $ret = this; - Qt::_internal::setThis($t); + TQt::_internal::setThis($t); return $ret; } -package Qt::base::_overload; +package TQt::base::_overload; use strict; no strict 'refs'; use overload "fallback" => 1, - "==" => "Qt::base::_overload::op_equal", - "!=" => "Qt::base::_overload::op_not_equal", - "+=" => "Qt::base::_overload::op_plus_equal", - "-=" => "Qt::base::_overload::op_minus_equal", - "*=" => "Qt::base::_overload::op_mul_equal", - "/=" => "Qt::base::_overload::op_div_equal", - ">>" => "Qt::base::_overload::op_shift_right", - "<<" => "Qt::base::_overload::op_shift_left", - "<=" => "Qt::base::_overload::op_lesser_equal", - ">=" => "Qt::base::_overload::op_greater_equal", - "^=" => "Qt::base::_overload::op_xor_equal", - "|=" => "Qt::base::_overload::op_or_equal", - ">" => "Qt::base::_overload::op_greater", - "<" => "Qt::base::_overload::op_lesser", - "+" => "Qt::base::_overload::op_plus", - "-" => "Qt::base::_overload::op_minus", - "*" => "Qt::base::_overload::op_mul", - "/" => "Qt::base::_overload::op_div", - "^" => "Qt::base::_overload::op_xor", - "|" => "Qt::base::_overload::op_or", - "--" => "Qt::base::_overload::op_decrement", - "++" => "Qt::base::_overload::op_increment", - "neg"=> "Qt::base::_overload::op_negate"; + "==" => "TQt::base::_overload::op_equal", + "!=" => "TQt::base::_overload::op_not_equal", + "+=" => "TQt::base::_overload::op_plus_equal", + "-=" => "TQt::base::_overload::op_minus_equal", + "*=" => "TQt::base::_overload::op_mul_equal", + "/=" => "TQt::base::_overload::op_div_equal", + ">>" => "TQt::base::_overload::op_shift_right", + "<<" => "TQt::base::_overload::op_shift_left", + "<=" => "TQt::base::_overload::op_lesser_equal", + ">=" => "TQt::base::_overload::op_greater_equal", + "^=" => "TQt::base::_overload::op_xor_equal", + "|=" => "TQt::base::_overload::op_or_equal", + ">" => "TQt::base::_overload::op_greater", + "<" => "TQt::base::_overload::op_lesser", + "+" => "TQt::base::_overload::op_plus", + "-" => "TQt::base::_overload::op_minus", + "*" => "TQt::base::_overload::op_mul", + "/" => "TQt::base::_overload::op_div", + "^" => "TQt::base::_overload::op_xor", + "|" => "TQt::base::_overload::op_or", + "--" => "TQt::base::_overload::op_decrement", + "++" => "TQt::base::_overload::op_increment", + "neg"=> "TQt::base::_overload::op_negate"; sub op_equal { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator=='; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator=='; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator=='; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator=='; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_not_equal { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator!='; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator!='; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator!='; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator!='; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_plus_equal { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator+='; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator+='; my $autoload = ref($_[0])."::_UTOLOAD"; my $err; - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return ($_[2] ? $_[1] : $_[0]) unless $err = $@; my $ret; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator+='; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator+='; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_minus_equal { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator-='; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator-='; my $autoload = ref($_[0])."::_UTOLOAD"; my $err; - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return ($_[2] ? $_[1] : $_[0]) unless $err = $@; my $ret; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator-='; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator-='; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_mul_equal { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator*='; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator*='; my $autoload = ref($_[0])."::_UTOLOAD"; my $err; - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return ($_[2] ? $_[1] : $_[0]) unless $err = $@; my $ret; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator*='; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator*='; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_div_equal { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator/='; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator/='; my $autoload = ref($_[0])."::_UTOLOAD"; my $err; - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return ($_[2] ? $_[1] : $_[0]) unless $err = $@; my $ret; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator/='; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator/='; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_shift_right { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator>>'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator>>'; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator>>'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator>>'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_shift_left { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator<<'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator<<'; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator<<'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator<<'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_lesser_equal { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator<='; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator<='; my $autoload = ref($_[0])."::_UTOLOAD"; my $err; - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; return ($_[2] ? $_[1] : $_[0]) unless $err = $@; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; my $ret; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator<='; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator<='; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_greater_equal { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator>='; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator>='; my $autoload = ref($_[0])."::_UTOLOAD"; my $err; - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return ($_[2] ? $_[1] : $_[0]) unless $err = $@; my $ret; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator>='; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator>='; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_xor_equal { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator^='; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator^='; my $autoload = ref($_[0])."::_UTOLOAD"; my $err; - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return ($_[2] ? $_[1] : $_[0]) unless $err = $@; my $ret; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator^='; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator^='; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_or_equal { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator|='; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator|='; my $autoload = ref($_[0])."::_UTOLOAD"; my $err; - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return ($_[2] ? $_[1] : $_[0]) unless $err = $@; my $ret; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator|='; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator|='; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_greater { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator>'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator>'; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator>'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator>'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_lesser { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator<'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator<'; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator<'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator<'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_plus { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator+'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator+'; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator+'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator+'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_minus { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator-'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator-'; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator-'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator-'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_mul { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator*'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator*'; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator*'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator*'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_div { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator/'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator/'; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator/'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator/'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_negate { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator-'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator-'; my $autoload = ref($_[0])."::AUTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->($_[0]) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator-'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator-'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload($_[0]) }; die $err.$@ if $@; $ret } sub op_xor { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator^'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator^'; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator^'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator^'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_or { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator|'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator|'; my $autoload = ref($_[0])."::_UTOLOAD"; my ($ret, $err); - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $ret = $autoload->(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $ret unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator|'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator|'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; $ret = &$autoload(($_[2] ? (@_)[1,0] : (@_)[0,1])) }; die $err.$@ if $@; $ret } sub op_increment { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator++'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator++'; my $autoload = ref($_[0])."::_UTOLOAD"; my $err; - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $autoload->($_[0]) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $_[0] unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator++'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator++'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; &$autoload($_[0]) }; die $err.$@ if $@; $_[0] } sub op_decrement { - $Qt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator--'; + $TQt::AutoLoad::AUTOLOAD = ref($_[0]).'::operator--'; my $autoload = ref($_[0])."::_UTOLOAD"; my $err; - $Qt::_internal::strictArgMatch = 1; + $TQt::_internal::strictArgMatch = 1; eval { local $SIG{'__DIE__'}; $autoload->($_[0]) }; - $Qt::_internal::strictArgMatch = 0; + $TQt::_internal::strictArgMatch = 0; return $_[0] unless $err = $@; - $Qt::AutoLoad::AUTOLOAD = 'Qt::GlobalSpace::operator--'; - $autoload = "Qt::GlobalSpace::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GlobalSpace::operator--'; + $autoload = "TQt::GlobalSpace::_UTOLOAD"; eval { local $SIG{'__DIE__'}; &$autoload($_[0]) }; die $err.$@ if $@; $_[0] } -package Qt::_internal; +package TQt::_internal; use strict; @@ -414,41 +414,41 @@ sub init_class { no strict 'refs'; my $c = shift; my $class = $c; - $class =~ s/^Q(?=[A-Z])/Qt::/; - my $classId = Qt::_internal::idClass($c); + $class =~ s/^Q(?=[A-Z])/TQt::/; + my $classId = TQt::_internal::idClass($c); insert_pclassid($class, $classId); $IdClass[$classId] = $class; $CppName{$class} = $c; - Qt::_internal::installautoload("$class"); + TQt::_internal::installautoload("$class"); { - package Qt::AutoLoad; # this package holds $AUTOLOAD + package TQt::AutoLoad; # this package holds $AUTOLOAD my $closure = \&{ "$class\::_UTOLOAD" }; *{ $class . "::AUTOLOAD" } = sub{ &$closure }; } - my @isa = Qt::_internal::getIsa($classId); + my @isa = TQt::_internal::getIsa($classId); for my $super (@isa) { - $super =~ s/^Q(?=[A-Z])/Qt::/; + $super =~ s/^Q(?=[A-Z])/TQt::/; } - # the general base class is Qt::base. + # the general base class is TQt::base. # implicit new(@_) calls are forwarded there. - @isa = ("Qt::base") unless @isa; + @isa = ("TQt::base") unless @isa; *{ "$class\::ISA" } = \@isa; - Qt::_internal::installautoload(" $class"); + TQt::_internal::installautoload(" $class"); { - package Qt::AutoLoad; + package TQt::AutoLoad; # do lookup at compile-time my $autosub = \&{ " $class\::_UTOLOAD" }; *{ " $class\::AUTOLOAD" } = sub { &$autosub }; } - *{ " $class\::ISA" } = ["Qt::base::_overload"]; + *{ " $class\::ISA" } = ["TQt::base::_overload"]; *{ "$class\::NEW" } = sub { my $class = shift; - $Qt::AutoLoad::AUTOLOAD = "$class\::$c"; + $TQt::AutoLoad::AUTOLOAD = "$class\::$c"; my $autoload = " $class\::_UTOLOAD"; { no warnings; @@ -482,9 +482,9 @@ sub argmatch { $match{$method} = [0,$methix]; } } elsif($argtype eq 's') { - if($typename =~ /^(?:(?:const )?u?char\*|(?:const )?(?:(Q(C?)String)|QByteArray)[*&]?)$/) { + if($typename =~ /^(?:(?:const )?u?char\*|(?:const )?(?:(Q(C?)String)|TQByteArray)[*&]?)$/) { # the below read as: is it a (Q(C)String) ? ->priority 1 - # is it a (QString) ? -> priority 2 + # is it a (TQString) ? -> priority 2 # neither: normal priority # Watch the capturing parens vs. non-capturing (?:) $match{$method}[0] = defined $2 && $2 ? 1 : ( defined $1 ? 2 : 0 ); @@ -493,13 +493,13 @@ sub argmatch { } elsif($argtype eq 'a') { # FIXME: shouldn't be hardcoded. Installed handlers should tell what perl type they expect. if($typename =~ /^(?: - const\ QCOORD\*| + const\ TQCOORD\*| (?:const\ )? (?: Q(?:String|Widget|Object|FileInfo|CanvasItem)List[\*&]?| - QValueList<int>[\*&]?| - QPtrList<Q(?:Tab|ToolBar|DockWindow|NetworkOperation)>| - QRgb\*| + TQValueList<int>[\*&]?| + TQPtrList<Q(?:Tab|ToolBar|DockWindow|NetworkOperation)>| + TQRgb\*| char\*\* ) )$/x) { @@ -553,8 +553,8 @@ sub do_autoload { } } my @methodids = map { findMethod($class, $_) } @methods; -# @methodids = map { findMethod('QGlobalSpace', $_) } @methods -# if (!@methodids and $withObject || $class eq 'Qt'); +# @methodids = map { findMethod('TQGlobalSpace', $_) } @methods +# if (!@methodids and $withObject || $class eq 'TQt'); if(@methodids > 1) { # ghetto method resolution @@ -567,11 +567,11 @@ sub do_autoload { my $c = ($method eq $class)? 4:2; warn "Ambiguous method call for :\n". "\t${class}::${method}(".catArguments(\@_).")". - ((debug() && (debug() & $Qt::debug::channel{'verbose'})) ? + ((debug() && (debug() & $TQt::debug::channel{'verbose'})) ? "\nCandidates are:\n".dumpCandidates(\@methodids). "\nTaking first one...\nat " : ""). (caller($c))[1]." line ".(caller($c))[2].".\n" - } if debug() && @methodids > 1 && (debug() & $Qt::debug::channel{'ambiguous'}); + } if debug() && @methodids > 1 && (debug() & $TQt::debug::channel{'ambiguous'}); } elsif( @methodids == 1 and @_ ) { @@ -585,17 +585,17 @@ sub do_autoload { my $c = ($method eq $class)? 4:2; warn "Lookup for ${class}::${method}(".catArguments(\@_). ")\ndid not yeld any result.\n". - ((debug() && (debug() & $Qt::debug::channel{'verbose'})) ? + ((debug() && (debug() & $TQt::debug::channel{'verbose'})) ? "Might be a call for an enumerated value (enum).\n":""). "Trying ${class}::${method}() with no arguments\nat ". (caller($c))[1]." line ".(caller($c))[2].".\n" - } if debug() && @_ > 1 && (debug() & $Qt::debug::channel{'ambiguous'}); + } if debug() && @_ > 1 && (debug() & $TQt::debug::channel{'ambiguous'}); @_ = () } if @methodids; } do{ my $verbose = ""; - if(debug() && (debug() & $Qt::debug::channel{'verbose'})) { + if(debug() && (debug() & $TQt::debug::channel{'verbose'})) { my $alt = findAllMethods( $classId ); getAllParents($classId, \my @sup); for my $s(@sup) @@ -627,7 +627,7 @@ sub do_autoload { sub init { no warnings; installthis(__PACKAGE__); - installthis("Qt::base"); + installthis("TQt::base"); $Classes = getClassList(); for my $c (@$Classes) { init_class($c); @@ -673,19 +673,19 @@ sub getSubName return ( $glob =~ /^.*::(.*)$/ )[0]; } -sub Qt::Application::NEW { +sub TQt::Application::NEW { my $class = shift; my $argv = shift; unshift @$argv, $0; my $count = scalar @$argv; - setThis( bless Qt::Application::QApplication($count, $argv, @_), " $class" ); + setThis( bless TQt::Application::TQApplication($count, $argv, @_), " $class" ); mapObject(this); setAllocated(this, 1); setqapp(this); shift @$argv; } -sub Qt::Image::NEW { +sub TQt::Image::NEW { no strict 'refs'; # another ugly hack, whee my $class = shift; @@ -696,8 +696,8 @@ sub Qt::Image::NEW { } # FIXME: this is evil - $Qt::AutoLoad::AUTOLOAD = 'Qt::Image::QImage'; - my $autoload = " Qt::Image::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::Image::TQImage'; + my $autoload = " TQt::Image::_UTOLOAD"; dontRecurse(); setThis( $autoload->(@_) ); setAllocated(this, 1); @@ -710,19 +710,19 @@ sub makeMetaData { my @params; my $argcnt = scalar @{ $entry->{arguments} }; for my $arg (@{ $entry->{arguments} }) { - push @params, make_QUParameter($arg->{name}, $arg->{type}, 0, 1); + push @params, make_TQUParameter($arg->{name}, $arg->{type}, 0, 1); } - my $method = make_QUMethod($entry->{name}, \@params); - push @tbl, make_QMetaData($entry->{prototype}, $method); + my $method = make_TQUMethod($entry->{name}, \@params); + push @tbl, make_TQMetaData($entry->{prototype}, $method); } my $count = scalar @tbl; - my $metadata = make_QMetaData_tbl(\@tbl); + my $metadata = make_TQMetaData_tbl(\@tbl); return ($metadata, $count); } # This is the key function for signal/slots... -# All META hash entries have been defined by /lib/Qt/slots.pm and /lib/Qt/signals.pm -# Thereafter, /lib/Qt/isa.pm build the MetaObject by calling this function +# All META hash entries have been defined by /lib/TQt/slots.pm and /lib/TQt/signals.pm +# Thereafter, /lib/TQt/isa.pm build the MetaObject by calling this function # Here is the structure of the META hash: # META { 'slot' => { $slotname-1 => { name => $slotname-1, # arguments => xxx, @@ -750,7 +750,7 @@ sub getMetaObject { inheritSuperSigSlots($class); my($slot_tbl, $slot_tbl_count) = makeMetaData($meta->{slots}); my($signal_tbl, $signal_tbl_count) = makeMetaData($meta->{signals}); - $meta->{object} = make_metaObject($class, Qt::this()->staticMetaObject, + $meta->{object} = make_metaObject($class, TQt::this()->staticMetaObject, $slot_tbl, $slot_tbl_count, $signal_tbl, $signal_tbl_count); $meta->{changed} = 0; @@ -759,11 +759,11 @@ sub getMetaObject { sub updateSigSlots { - require Qt::signals; - require Qt::slots; + require TQt::signals; + require TQt::slots; for my $i (@sigslots) { no strict 'refs'; - my $mod = "Qt::" . lc($$i[0]) . ( substr($$i[0], 0, 1) eq 'S' ? 's' : '' ) . "::import"; + my $mod = "TQt::" . lc($$i[0]) . ( substr($$i[0], 0, 1) eq 'S' ? 's' : '' ) . "::import"; $mod->( $$i[1], getSubName($$i[2]) => $$i[3] ); } @sigslots = (); @@ -790,12 +790,12 @@ sub inheritSuperSigSlots { push @{$meta->{signals}}, \%ss; $meta->{signal}->{$ssn} = \%ss; $ss{index} = $#{ $meta->{signals} }; - Qt::_internal::installsignal("$class\::$ssn"); + TQt::_internal::installsignal("$class\::$ssn"); } } - Qt::_internal::installqt_invoke($class . '::qt_invoke') + TQt::_internal::installqt_invoke($class . '::qt_invoke') if( !defined &{ $class. '::qt_invoke' } && exists $meta->{slots} && @{ $meta->{slots} }); - Qt::_internal::installqt_invoke($class . '::qt_emit') + TQt::_internal::installqt_invoke($class . '::qt_emit') if( !defined &{ $class. '::qt_emit' } && exists $meta->{signals} && @{ $meta->{signals} }); } } @@ -805,46 +805,46 @@ sub getAllParents { my $classId = shift; my $res = shift; - my @classes = Qt::_internal::getIsa( $classId ); + my @classes = TQt::_internal::getIsa( $classId ); for my $s( @classes ) { - my $c = Qt::_internal::idClass($s); + my $c = TQt::_internal::idClass($s); push @{ $res }, $c; getAllParents($c, $res) } } -sub Qt::PointArray::setPoints { +sub TQt::PointArray::setPoints { my $points = $_[0]; no strict 'refs'; # what a horrible, horrible way to do this - $Qt::AutoLoad::AUTOLOAD = 'Qt::PointArray::setPoints'; - my $autoload = " Qt::PointArray::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::PointArray::setPoints'; + my $autoload = " TQt::PointArray::_UTOLOAD"; dontRecurse(); $autoload->(scalar(@$points)/2, $points); } -sub Qt::GridLayout::addMultiCellLayout { - # yet another hack. Turnaround for a bug in Qt < 3.1 - # (addMultiCellLayout doesn't reparent its QLayout argument) +sub TQt::GridLayout::addMultiCellLayout { + # yet another hack. Turnaround for a bug in TQt < 3.1 + # (addMultiCellLayout doesn't reparent its TQLayout argument) no strict 'refs'; if(!defined $_[0]->{'has been hidden'}) { push @{ this()->{'hidden children'} }, $_[0]; $_[0]->{'has been hidden'} = 1; } - $Qt::AutoLoad::AUTOLOAD = 'Qt::GridLayout::addMultiCellLayout'; - my $autoload = " Qt::GridLayout::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::GridLayout::addMultiCellLayout'; + my $autoload = " TQt::GridLayout::_UTOLOAD"; dontRecurse(); $autoload->(@_); } -package Qt::Object; +package TQt::Object; use strict; sub MODIFY_CODE_ATTRIBUTES { - package Qt::_internal; + package TQt::_internal; my ($package, $coderef, @attrs ) = @_; my @reject; foreach my $attr( @attrs ) @@ -866,7 +866,7 @@ sub MODIFY_CODE_ATTRIBUTES return @reject; } -package Qt; +package TQt; use 5.006; use strict; @@ -877,22 +877,22 @@ require Exporter; our $VERSION = '3.008'; -our @EXPORT = qw(&SIGNAL &SLOT &CAST &emit &min &max); +our @EXPORT = qw(&TQT_SIGNAL &TQT_SLOT &CAST &emit &min &max); -XSLoader::load 'Qt', $VERSION; +XSLoader::load 'TQt', $VERSION; # try to avoid KDE's buggy malloc # only works for --enable-fast-malloc, # not when --enable-fast-malloc=full $ENV{'KDE_MALLOC'} = 0; -Qt::_internal::init(); +TQt::_internal::init(); # In general, I'm not a fan of prototypes. # However, I'm also not a fan of parentheses -sub SIGNAL ($) { '2' . $_[0] } -sub SLOT ($) { '1' . $_[0] } +sub TQT_SIGNAL ($) { '2' . $_[0] } +sub TQT_SLOT ($) { '1' . $_[0] } sub CAST ($$) { bless $_[0], " $_[1]" } sub emit (@) { pop @_ } sub min ($$) { $_[0] < $_[1] ? $_[0] : $_[1] } @@ -900,11 +900,11 @@ sub max ($$) { $_[0] > $_[1] ? $_[0] : $_[1] } sub import { goto &Exporter::import } -sub Qt::base::ON_DESTROY { 0 }; +sub TQt::base::ON_DESTROY { 0 }; -sub Qt::Object::ON_DESTROY +sub TQt::Object::ON_DESTROY { - package Qt::_internal; + package TQt::_internal; my $parent = this()->parent; if( $parent ) { @@ -915,18 +915,18 @@ sub Qt::Object::ON_DESTROY return 0 } -sub Qt::Application::ON_DESTROY { 0 } +sub TQt::Application::ON_DESTROY { 0 } -# we need to solve an ambiguity for Q*Items: they aren't QObjects, +# we need to solve an ambiguity for Q*Items: they aren't TQObjects, # and are meant to be created on the heap / destroyed manually. -# On the one hand, we don't want to delete them if they are still owned by a QObject hierarchy +# On the one hand, we don't want to delete them if they are still owned by a TQObject hierarchy # but on the other hand, what can we do if the user DOES need to destroy them? # # So the solution adopted here is to use the takeItem() method when it exists # to lower the refcount and allow explicit destruction/removal. -sub Qt::ListViewItem::ON_DESTROY { - package Qt::_internal; +sub TQt::ListViewItem::ON_DESTROY { + package TQt::_internal; my $parent = this()->listView(); if( $parent ) { @@ -939,35 +939,35 @@ sub Qt::ListViewItem::ON_DESTROY { return 0 } -sub Qt::ListViewItem::takeItem +sub TQt::ListViewItem::takeItem { - package Qt::_internal; + package TQt::_internal; delete ${ this()->{"hidden children"} } { sv_to_ptr($_[0]) }; delete $_[0]->{"has been hidden"}; setAllocated( $_[0], 1 ); no strict 'refs'; - $Qt::AutoLoad::AUTOLOAD = 'Qt::ListViewItem::takeItem'; - my $autoload = " Qt::ListViewItem::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::ListViewItem::takeItem'; + my $autoload = " TQt::ListViewItem::_UTOLOAD"; dontRecurse(); $autoload->( $_[0] ); } -sub Qt::ListView::takeItem +sub TQt::ListView::takeItem { - package Qt::_internal; + package TQt::_internal; delete ${ this()->{"hidden children"} } { sv_to_ptr($_[0]) }; delete $_[0]->{"has been hidden"}; setAllocated( $_[0], 1 ); no strict 'refs'; - $Qt::AutoLoad::AUTOLOAD = 'Qt::ListView::takeItem'; - my $autoload = " Qt::ListView::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::ListView::takeItem'; + my $autoload = " TQt::ListView::_UTOLOAD"; dontRecurse(); $autoload->( $_[0] ); } -sub Qt::IconViewItem::ON_DESTROY +sub TQt::IconViewItem::ON_DESTROY { - package Qt::_internal; + package TQt::_internal; my $parent = this()->iconView; if( $parent ) { @@ -980,23 +980,23 @@ sub Qt::IconViewItem::ON_DESTROY return 0 } -sub Qt::IconView::takeItem +sub TQt::IconView::takeItem { - package Qt::_internal; + package TQt::_internal; delete ${ this()->{"hidden children"} } { sv_to_ptr($_[0]) }; delete $_[0]->{"has been hidden"}; setAllocated( $_[0], 1 ); no strict 'refs'; - $Qt::AutoLoad::AUTOLOAD = 'Qt::IconView::takeItem'; - my $autoload = " Qt::IconView::_UTOLOAD"; - Qt::_internal::dontRecurse(); + $TQt::AutoLoad::AUTOLOAD = 'TQt::IconView::takeItem'; + my $autoload = " TQt::IconView::_UTOLOAD"; + TQt::_internal::dontRecurse(); $autoload->( $_[0] ); } -sub Qt::ListBoxItem::ON_DESTROY +sub TQt::ListBoxItem::ON_DESTROY { - package Qt::_internal; + package TQt::_internal; my $parent = this()->listBox(); if( $parent ) { @@ -1009,24 +1009,24 @@ sub Qt::ListBoxItem::ON_DESTROY return 0 } -sub Qt::ListBox::takeItem +sub TQt::ListBox::takeItem { # Unfortunately, takeItem() won't reset the Item's listBox() pointer to 0. - # That's a Qt bug (I reported it and it got fixed as of Qt 3.2b2) - package Qt::_internal; + # That's a TQt bug (I reported it and it got fixed as of TQt 3.2b2) + package TQt::_internal; delete ${ this()->{"hidden children"} } { sv_to_ptr($_[0]) }; delete $_[0]->{"has been hidden"}; setAllocated( $_[0], 1 ); no strict 'refs'; - $Qt::Autoload::AUTOLOAD = 'Qt::ListBox::takeItem'; - my $autoload = " Qt::ListBox::_UTOLOAD"; + $TQt::Autoload::AUTOLOAD = 'TQt::ListBox::takeItem'; + my $autoload = " TQt::ListBox::_UTOLOAD"; dontRecurse(); $autoload->( $_[0] ); } -sub Qt::TableItem::ON_DESTROY +sub TQt::TableItem::ON_DESTROY { - package Qt::_internal; + package TQt::_internal; my $parent = this()->table; if( $parent ) { @@ -1039,22 +1039,22 @@ sub Qt::TableItem::ON_DESTROY return 0 } -sub Qt::Table::takeItem +sub TQt::Table::takeItem { - package Qt::_internal; + package TQt::_internal; delete ${ this()->{"hidden children"} } { sv_to_ptr($_[0]) }; delete $_[0]->{"has been hidden"}; setAllocated( $_[0], 1 ); no strict 'refs'; - $Qt::AutoLoad::AUTOLOAD = 'Qt::Table::takeItem'; - my $autoload = " Qt::Table::_UTOLOAD"; + $TQt::AutoLoad::AUTOLOAD = 'TQt::Table::takeItem'; + my $autoload = " TQt::Table::_UTOLOAD"; dontRecurse(); $autoload->( $_[0] ); } -sub Qt::LayoutItem::ON_DESTROY +sub TQt::LayoutItem::ON_DESTROY { - package Qt::_internal; + package TQt::_internal; my $parent = this()->widget() || this()->layout(); if( $parent ) { @@ -1069,9 +1069,9 @@ sub Qt::LayoutItem::ON_DESTROY return 1 } -sub Qt::Layout::ON_DESTROY +sub TQt::Layout::ON_DESTROY { - package Qt::_internal; + package TQt::_internal; my $parent = this()->mainWidget() || this()->parent(); if( $parent ) { @@ -1082,9 +1082,9 @@ sub Qt::Layout::ON_DESTROY return 0 } -sub Qt::StyleSheetItem::ON_DESTROY +sub TQt::StyleSheetItem::ON_DESTROY { - package Qt::_internal; + package TQt::_internal; my $parent = this()->styleSheet(); if( $parent ) { @@ -1097,9 +1097,9 @@ sub Qt::StyleSheetItem::ON_DESTROY return 0 } -sub Qt::SqlCursor::ON_DESTROY +sub TQt::SqlCursor::ON_DESTROY { - package Qt::_internal; + package TQt::_internal; push @PersistentObjects, this(); this()->{"has been hidden"} = 1; setAllocated( this(), 0 ); diff --git a/PerlQt/Qt.pod b/PerlQt/Qt.pod index 94503ba..2feceeb 100644 --- a/PerlQt/Qt.pod +++ b/PerlQt/Qt.pod @@ -1,11 +1,11 @@ =head1 NAME -PerlQt - Perl interface to the Qt GUI Widget toolkit +PerlTQt - Perl interface to the TQt GUI Widget toolkit -=head1 Qt +=head1 TQt -Given the huge size of the Qt module +Given the huge size of the TQt module (more than 400 classes and 13000 methods) it doesn't have any formal documentation. @@ -15,17 +15,17 @@ Instead, it provides two introspection tools =item * pqtapi: -a command line PerlQt API introspector +a command line PerlTQt API introspector =item * pqtsh: -a graphical PerlQt shell +a graphical PerlTQt shell =back and a detailed B<tutorial> with comprehensive explanations. -This is where anyone new to PerlQt +This is where anyone new to PerlTQt should start. The tutorial has been originally installed @@ -35,8 +35,8 @@ B<HTML> format. For a complete IDE allowing RAD and visual programming, check the pqt-designer package. ---- The PerlQt team +--- The PerlTQt team -http://perlqt.sf.net - PerlQt Project Homepage +http://perlqt.sf.net - PerlTQt Project Homepage =cut diff --git a/PerlQt/Qt.xs b/PerlQt/Qt.xs index e72bffd..22a66de 100644 --- a/PerlQt/Qt.xs +++ b/PerlQt/Qt.xs @@ -23,8 +23,8 @@ #include "perl.h" #include "XSUB.h" -#ifndef QT_VERSION_STR -#define QT_VERSION_STR "Unknown" +#ifndef TQT_VERSION_STR +#define TQT_VERSION_STR "Unknown" #endif #undef free @@ -54,8 +54,8 @@ void *_current_object = 0; // TODO: ask myself if this is stupid bool temporary_virtual_function_success = false; -static QAsciiDict<Smoke::Index> *methcache = 0; -static QAsciiDict<Smoke::Index> *classcache = 0; +static TQAsciiDict<Smoke::Index> *methcache = 0; +static TQAsciiDict<Smoke::Index> *classcache = 0; SV *sv_this = 0; @@ -65,7 +65,7 @@ Smoke::Index _current_method = 0; * Type handling by moc is simple. * * If the type name matches /^(?:const\s+)?\Q$types\E&?$/, use the - * static_QUType, where $types is join('|', qw(bool int double char* QString); + * static_TQUType, where $types is join('|', qw(bool int double char* TQString); * * Everything else is passed as a pointer! There are types which aren't * Smoke::tf_ptr but will have to be passed as a pointer. Make sure to keep @@ -86,7 +86,7 @@ enum MocArgumentType { xmoc_int, xmoc_double, xmoc_charstar, - xmoc_QString + xmoc_TQString }; struct MocArgument { @@ -96,7 +96,7 @@ struct MocArgument { }; -extern TypeHandler Qt_handlers[]; +extern TypeHandler TQt_handlers[]; void install_handlers(TypeHandler *); void *sv_to_ptr(SV *sv) { // ptr on success, null on fail @@ -104,13 +104,13 @@ void *sv_to_ptr(SV *sv) { // ptr on success, null on fail return o ? o->ptr : 0; } -bool isQObject(Smoke *smoke, Smoke::Index classId) { - if(!strcmp(smoke->classes[classId].className, "QObject")) +bool isTQObject(Smoke *smoke, Smoke::Index classId) { + if(!strcmp(smoke->classes[classId].className, "TQObject")) return true; for(Smoke::Index *p = smoke->inheritanceList + smoke->classes[classId].parents; *p; p++) { - if(isQObject(smoke, *p)) + if(isTQObject(smoke, *p)) return true; } return false; @@ -174,7 +174,7 @@ void unmapPointer(smokeperl_object *o, Smoke::Index classId, void *lastptr) { } } -// Store pointer in pointer_map hash : "pointer_to_Qt_object" => weak ref to associated Perl object +// Store pointer in pointer_map hash : "pointer_to_TQt_object" => weak ref to associated Perl object // Recurse to store it also as casted to its parent classes. void mapPointer(SV *obj, smokeperl_object *o, HV *hv, Smoke::Index classId, void *lastptr) { @@ -390,14 +390,14 @@ public: bool cleanup() { return true; } }; -class UnencapsulatedQObject : public QObject { +class UnencapsulatedTQObject : public TQObject { public: - QConnectionList *public_receivers(int signal) const { return receivers(signal); } - void public_activate_signal(QConnectionList *clist, QUObject *o) { activate_signal(clist, o); } + TQConnectionList *public_receivers(int signal) const { return receivers(signal); } + void public_activate_signal(TQConnectionList *clist, TQUObject *o) { activate_signal(clist, o); } }; class EmitSignal : public Marshall { - UnencapsulatedQObject *_qobj; + UnencapsulatedTQObject *_qobj; int _id; MocArgument *_args; SV **_sp; @@ -406,8 +406,8 @@ class EmitSignal : public Marshall { Smoke::Stack _stack; bool _called; public: - EmitSignal(QObject *qobj, int id, int items, MocArgument *args, SV **sp) : - _qobj((UnencapsulatedQObject*)qobj), _id(id), _items(items), _args(args), + EmitSignal(TQObject *qobj, int id, int items, MocArgument *args, SV **sp) : + _qobj((UnencapsulatedTQObject*)qobj), _id(id), _items(items), _args(args), _sp(sp), _cur(-1), _called(false) { _stack = new Smoke::StackItem[_items]; } @@ -427,28 +427,28 @@ public: if(_called) return; _called = true; - QConnectionList *clist = _qobj->public_receivers(_id); + TQConnectionList *clist = _qobj->public_receivers(_id); if(!clist) return; - QUObject *o = new QUObject[_items + 1]; + TQUObject *o = new TQUObject[_items + 1]; for(int i = 0; i < _items; i++) { - QUObject *po = o + i + 1; + TQUObject *po = o + i + 1; Smoke::StackItem *si = _stack + i; switch(_args[i].argType) { case xmoc_bool: - static_QUType_bool.set(po, si->s_bool); + static_TQUType_bool.set(po, si->s_bool); break; case xmoc_int: - static_QUType_int.set(po, si->s_int); + static_TQUType_int.set(po, si->s_int); break; case xmoc_double: - static_QUType_double.set(po, si->s_double); + static_TQUType_double.set(po, si->s_double); break; case xmoc_charstar: - static_QUType_charstar.set(po, (char*)si->s_voidp); + static_TQUType_charstar.set(po, (char*)si->s_voidp); break; - case xmoc_QString: - static_QUType_QString.set(po, *(QString*)si->s_voidp); + case xmoc_TQString: + static_TQUType_TQString.set(po, *(TQString*)si->s_voidp); break; default: { @@ -511,7 +511,7 @@ public: p = 0; break; } - static_QUType_ptr.set(po, p); + static_TQUType_ptr.set(po, p); } } } @@ -536,11 +536,11 @@ public: }; class InvokeSlot : public Marshall { - QObject *_qobj; + TQObject *_qobj; GV *_gv; int _items; MocArgument *_args; - QUObject *_o; + TQUObject *_o; int _cur; bool _called; SV **_sp; @@ -558,27 +558,27 @@ public: } void copyArguments() { for(int i = 0; i < _items; i++) { - QUObject *o = _o + i + 1; + TQUObject *o = _o + i + 1; switch(_args[i].argType) { case xmoc_bool: - _stack[i].s_bool = static_QUType_bool.get(o); + _stack[i].s_bool = static_TQUType_bool.get(o); break; case xmoc_int: - _stack[i].s_int = static_QUType_int.get(o); + _stack[i].s_int = static_TQUType_int.get(o); break; case xmoc_double: - _stack[i].s_double = static_QUType_double.get(o); + _stack[i].s_double = static_TQUType_double.get(o); break; case xmoc_charstar: - _stack[i].s_voidp = static_QUType_charstar.get(o); + _stack[i].s_voidp = static_TQUType_charstar.get(o); break; - case xmoc_QString: - _stack[i].s_voidp = &static_QUType_QString.get(o); + case xmoc_TQString: + _stack[i].s_voidp = &static_TQUType_TQString.get(o); break; default: // case xmoc_ptr: { const SmokeType &t = _args[i].st; - void *p = static_QUType_ptr.get(o); + void *p = static_TQUType_ptr.get(o); switch(t.elem()) { case Smoke::t_bool: _stack[i].s_bool = *(bool*)p; @@ -661,7 +661,7 @@ public: invokeSlot(); _cur = oldcur; } - InvokeSlot(QObject *qobj, GV *gv, int items, MocArgument *args, QUObject *o) : + InvokeSlot(TQObject *qobj, GV *gv, int items, MocArgument *args, TQUObject *o) : _qobj(qobj), _gv(gv), _items(items), _args(args), _o(o), _cur(-1), _called(false) { dSP; ENTER; @@ -681,9 +681,9 @@ public: }; -class QtSmokeBinding : public SmokeBinding { +class TQtSmokeBinding : public SmokeBinding { public: - QtSmokeBinding(Smoke *s) : SmokeBinding(s) {} + TQtSmokeBinding(Smoke *s) : SmokeBinding(s) {} void deleted(Smoke::Index classId, void *ptr) { SV *obj = getPointerObject(ptr); smokeperl_object *o = sv_obj_info(obj); @@ -727,7 +727,7 @@ public: char *className(Smoke::Index classId) { const char *className = smoke->className(classId); char *buf = new char[strlen(className) + 6]; - strcpy(buf, " Qt::"); + strcpy(buf, " TQt::"); strcat(buf, className + 1); return buf; } @@ -885,7 +885,7 @@ XS(XS_super) { //---------- XS Autoload (for all functions except fully qualified statics & enums) --------- -static inline bool isQt(char *p) { +static inline bool isTQt(char *p) { return (p[0] == 'Q' && p[1] && p[1] == 't' && ((p[2] && p[2] == ':') || !p[2])); } @@ -893,7 +893,7 @@ bool avoid_fetchmethod = false; XS(XS_AUTOLOAD) { // Err, XS autoload is borked. Lets try... dXSARGS; - SV *sv = get_sv("Qt::AutoLoad::AUTOLOAD", TRUE); + SV *sv = get_sv("TQt::AutoLoad::AUTOLOAD", TRUE); char *package = SvPV_nolen(sv); char *method = 0; for(char *s = package; *s ; s++) @@ -912,7 +912,7 @@ XS(XS_AUTOLOAD) { strcat(super, "::SUPER"); package = super; } - } else if( isQt(package) ) + } else if( isTQt(package) ) avoid_fetchmethod = true; HV *stash = gv_stashpv(package, TRUE); @@ -1012,7 +1012,7 @@ XS(XS_AUTOLOAD) { fprintf(stderr, "Increasing refcount in DESTROY for %s=%p (still has a parent)\n", package, o->ptr); } else { - if( items > 18 ) XSRETURN_NO; // current max number of args in Qt is 13. + if( items > 18 ) XSRETURN_NO; // current max number of args in TQt is 13. // save the stack -- we'll need it SV **savestack = new SV*[items+1]; @@ -1021,7 +1021,7 @@ XS(XS_AUTOLOAD) { Copy(SP - items + 1 + withObject, savestack, items-withObject, SV*); - // Get the classid (eventually converting SUPER to the right Qt class) + // Get the classid (eventually converting SUPER to the right TQt class) Smoke::Index cid = package_classid(package); // Look in the cache char *cname = (char*)qt_Smoke->className(cid); @@ -1068,7 +1068,7 @@ XS(XS_AUTOLOAD) { old_this = sv_this; sv_this = newSVsv(saveobj); } - call_pv("Qt::_internal::do_autoload", G_DISCARD|G_EVAL); + call_pv("TQt::_internal::do_autoload", G_DISCARD|G_EVAL); FREETMPS; LEAVE; @@ -1145,7 +1145,7 @@ MocArgument *getmetainfo(GV *gv, const char *name, int &offset, int &index, int if(!svp) return 0; smokeperl_object *ometa = sv_obj_info(*svp); if(!ometa) return 0; - QMetaObject *metaobject = (QMetaObject*)ometa->ptr; + TQMetaObject *metaobject = (TQMetaObject*)ometa->ptr; offset = metaobject->signalOffset(); @@ -1194,7 +1194,7 @@ MocArgument *getslotinfo(GV *gv, int id, char *&slotname, int &index, int &argcn if(!svp) return 0; smokeperl_object *ometa = sv_obj_info(*svp); if(!ometa) return 0; - QMetaObject *metaobject = (QMetaObject*)ometa->ptr; + TQMetaObject *metaobject = (TQMetaObject*)ometa->ptr; int offset = isSignal ? metaobject->signalOffset() : metaobject->slotOffset(); @@ -1229,10 +1229,10 @@ XS(XS_signal) { dXSARGS; smokeperl_object *o = sv_obj_info(sv_this); - QObject *qobj = (QObject*)o->smoke->cast( + TQObject *qobj = (TQObject*)o->smoke->cast( o->ptr, o->classId, - o->smoke->idClass("QObject") + o->smoke->idClass("TQObject") ); if(qobj->signalsBlocked()) XSRETURN_UNDEF; @@ -1256,15 +1256,15 @@ XS(XS_signal) { XS(XS_qt_invoke) { dXSARGS; - // Arguments: int id, QUObject *o + // Arguments: int id, TQUObject *o int id = SvIV(ST(0)); - QUObject *_o = (QUObject*)SvIV(SvRV(ST(1))); + TQUObject *_o = (TQUObject*)SvIV(SvRV(ST(1))); smokeperl_object *o = sv_obj_info(sv_this); - QObject *qobj = (QObject*)o->smoke->cast( + TQObject *qobj = (TQObject*)o->smoke->cast( o->ptr, o->classId, - o->smoke->idClass("QObject") + o->smoke->idClass("TQObject") ); // Now, I need to find out if this means me @@ -1290,7 +1290,7 @@ XS(XS_qt_invoke) { // ------------------- Tied types ------------------------ -MODULE = Qt PACKAGE = Qt::_internal::QString +MODULE = TQt PACKAGE = TQt::_internal::TQString PROTOTYPES: DISABLE SV* @@ -1300,7 +1300,7 @@ FETCH(obj) if (!SvROK(obj)) croak("?"); IV tmp = SvIV((SV*)SvRV(obj)); - QString *s = (QString*) tmp; + TQString *s = (TQString*) tmp; RETVAL = newSV(0); if( s ) { @@ -1327,15 +1327,15 @@ STORE(obj,what) if (!SvROK(obj)) croak("?"); IV tmp = SvIV((SV*)SvRV(obj)); - QString *s = (QString*) tmp; + TQString *s = (TQString*) tmp; s->truncate(0); if(SvOK(what)) { if(SvUTF8(what)) - s->append(QString::fromUtf8(SvPV_nolen(what))); + s->append(TQString::fromUtf8(SvPV_nolen(what))); else if(IN_LOCALE) - s->append(QString::fromLocal8Bit(SvPV_nolen(what))); + s->append(TQString::fromLocal8Bit(SvPV_nolen(what))); else - s->append(QString::fromLatin1(SvPV_nolen(what))); + s->append(TQString::fromLatin1(SvPV_nolen(what))); } void @@ -1345,10 +1345,10 @@ DESTROY(obj) if (!SvROK(obj)) croak("?"); IV tmp = SvIV((SV*)SvRV(obj)); - QString *s = (QString*) tmp; + TQString *s = (TQString*) tmp; delete s; -MODULE = Qt PACKAGE = Qt::_internal::QByteArray +MODULE = TQt PACKAGE = TQt::_internal::TQByteArray PROTOTYPES: DISABLE SV* @@ -1358,7 +1358,7 @@ FETCH(obj) if (!SvROK(obj)) croak("?"); IV tmp = SvIV((SV*)SvRV(obj)); - QByteArray *s = (QByteArray*) tmp; + TQByteArray *s = (TQByteArray*) tmp; RETVAL = newSV(0); if( s ) { @@ -1377,7 +1377,7 @@ STORE(obj,what) if (!SvROK(obj)) croak("?"); IV tmp = SvIV((SV*)SvRV(obj)); - QByteArray *s = (QByteArray*) tmp; + TQByteArray *s = (TQByteArray*) tmp; if(SvOK(what)) { STRLEN len; @@ -1394,10 +1394,10 @@ DESTROY(obj) if (!SvROK(obj)) croak("?"); IV tmp = SvIV((SV*)SvRV(obj)); - QByteArray *s = (QByteArray*) tmp; + TQByteArray *s = (TQByteArray*) tmp; delete s; -MODULE = Qt PACKAGE = Qt::_internal::QRgbStar +MODULE = TQt PACKAGE = TQt::_internal::TQRgbStar PROTOTYPES: DISABLE SV* @@ -1407,7 +1407,7 @@ FETCH(obj) if (!SvROK(obj)) croak("?"); IV tmp = SvIV((SV*)SvRV(obj)); - QRgb *s = (QRgb*) tmp; + TQRgb *s = (TQRgb*) tmp; AV* ar = newAV(); RETVAL = newRV_noinc((SV*)ar); for(int i=0; s[i] ; i++) @@ -1427,17 +1427,17 @@ STORE(obj,sv) if (!SvROK(obj)) croak("?"); IV tmp = SvIV((SV*)SvRV(obj)); - QRgb *s = (QRgb*) tmp; + TQRgb *s = (TQRgb*) tmp; if(!SvROK(sv) || SvTYPE(SvRV(sv)) != SVt_PVAV || av_len((AV*)SvRV(sv)) < 0) { - s = new QRgb[1]; + s = new TQRgb[1]; s[0] = 0; - sv_setref_pv(obj, "Qt::_internal::QRgbStar", (void*)s); + sv_setref_pv(obj, "TQt::_internal::TQRgbStar", (void*)s); return; } AV *list = (AV*)SvRV(sv); int count = av_len(list); - s = new QRgb[count + 2]; + s = new TQRgb[count + 2]; int i; for(i = 0; i <= count; i++) { SV **item = av_fetch(list, i, 0); @@ -1448,7 +1448,7 @@ STORE(obj,sv) s[i] = SvIV(*item); } s[i] = 0; - sv_setref_pv(obj, "Qt::_internal::QRgbStar", (void*)s); + sv_setref_pv(obj, "TQt::_internal::TQRgbStar", (void*)s); void DESTROY(obj) @@ -1457,13 +1457,13 @@ DESTROY(obj) if (!SvROK(obj)) croak("?"); IV tmp = SvIV((SV*)SvRV(obj)); - QRgb *s = (QRgb*) tmp; + TQRgb *s = (TQRgb*) tmp; delete[] s; -# --------------- XSUBS for Qt::_internal::* helpers ---------------- +# --------------- XSUBS for TQt::_internal::* helpers ---------------- -MODULE = Qt PACKAGE = Qt::_internal +MODULE = TQt PACKAGE = TQt::_internal PROTOTYPES: DISABLE void @@ -1526,8 +1526,8 @@ setMocType(ptr, idx, name, static_type) arg[idx].argType = xmoc_double; else if(!strcmp(static_type, "char*")) arg[idx].argType = xmoc_charstar; - else if(!strcmp(static_type, "QString")) - arg[idx].argType = xmoc_QString; + else if(!strcmp(static_type, "TQString")) + arg[idx].argType = xmoc_TQString; XSRETURN_YES; void @@ -1624,28 +1624,28 @@ getSVt(sv) RETVAL void * -make_QUParameter(name, type, extra, inout) +make_TQUParameter(name, type, extra, inout) char *name char *type SV *extra int inout CODE: - QUParameter *p = new QUParameter; + TQUParameter *p = new TQUParameter; p->name = new char[strlen(name) + 1]; strcpy((char*)p->name, name); if(!strcmp(type, "bool")) - p->type = &static_QUType_bool; + p->type = &static_TQUType_bool; else if(!strcmp(type, "int")) - p->type = &static_QUType_int; + p->type = &static_TQUType_int; else if(!strcmp(type, "double")) - p->type = &static_QUType_double; + p->type = &static_TQUType_double; else if(!strcmp(type, "char*") || !strcmp(type, "const char*")) - p->type = &static_QUType_charstar; - else if(!strcmp(type, "QString") || !strcmp(type, "QString&") || - !strcmp(type, "const QString") || !strcmp(type, "const QString&")) - p->type = &static_QUType_QString; + p->type = &static_TQUType_charstar; + else if(!strcmp(type, "TQString") || !strcmp(type, "TQString&") || + !strcmp(type, "const TQString") || !strcmp(type, "const TQString&")) + p->type = &static_TQUType_TQString; else - p->type = &static_QUType_ptr; + p->type = &static_TQUType_ptr; // Lacking support for several types. Evil. p->inOut = inout; p->typeExtra = 0; @@ -1654,25 +1654,25 @@ make_QUParameter(name, type, extra, inout) RETVAL void * -make_QMetaData(name, method) +make_TQMetaData(name, method) char *name void *method CODE: - QMetaData *m = new QMetaData; // will be deleted + TQMetaData *m = new TQMetaData; // will be deleted m->name = new char[strlen(name) + 1]; strcpy((char*)m->name, name); - m->method = (QUMethod*)method; - m->access = QMetaData::Public; + m->method = (TQUMethod*)method; + m->access = TQMetaData::Public; RETVAL = m; OUTPUT: RETVAL void * -make_QUMethod(name, params) +make_TQUMethod(name, params) char *name SV *params CODE: - QUMethod *m = new QUMethod; // permanent memory allocation + TQUMethod *m = new TQUMethod; // permanent memory allocation m->name = new char[strlen(name) + 1]; // this too strcpy((char*)m->name, name); m->count = 0; @@ -1681,14 +1681,14 @@ make_QUMethod(name, params) AV *av = (AV*)SvRV(params); m->count = av_len(av) + 1; if(m->count > 0) { - m->parameters = new QUParameter[m->count]; + m->parameters = new TQUParameter[m->count]; for(int i = 0; i < m->count; i++) { SV *sv = av_shift(av); if(!SvOK(sv)) - croak("Invalid paramater for QUMethod\n"); - QUParameter *p = (QUParameter*)SvIV(sv); + croak("Invalid paramater for TQUMethod\n"); + TQUParameter *p = (TQUParameter*)SvIV(sv); SvREFCNT_dec(sv); - ((QUParameter*)m->parameters)[i] = *p; + ((TQUParameter*)m->parameters)[i] = *p; delete p; } } else @@ -1699,19 +1699,19 @@ make_QUMethod(name, params) RETVAL void * -make_QMetaData_tbl(list) +make_TQMetaData_tbl(list) SV *list CODE: RETVAL = 0; if(SvOK(list) && SvRV(list)) { AV *av = (AV*)SvRV(list); int count = av_len(av) + 1; - QMetaData *m = new QMetaData[count]; + TQMetaData *m = new TQMetaData[count]; for(int i = 0; i < count; i++) { SV *sv = av_shift(av); if(!SvOK(sv)) croak("Invalid metadata\n"); - QMetaData *old = (QMetaData*)SvIV(sv); + TQMetaData *old = (TQMetaData*)SvIV(sv); SvREFCNT_dec(sv); m[i] = *old; delete old; @@ -1732,10 +1732,10 @@ make_metaObject(className, parent, slot_tbl, slot_count, signal_tbl, signal_coun CODE: smokeperl_object *po = sv_obj_info(parent); if(!po || !po->ptr) croak("Cannot create metaObject\n"); - QMetaObject *meta = QMetaObject::new_metaobject( - className, (QMetaObject*)po->ptr, - (const QMetaData*)slot_tbl, slot_count, // slots - (const QMetaData*)signal_tbl, signal_count, // signals + TQMetaObject *meta = TQMetaObject::new_metaobject( + className, (TQMetaObject*)po->ptr, + (const TQMetaData*)slot_tbl, slot_count, // slots + (const TQMetaData*)signal_tbl, signal_count, // signals 0, 0, // properties 0, 0, // enums 0, 0); @@ -1746,7 +1746,7 @@ make_metaObject(className, parent, slot_tbl, slot_count, signal_tbl, signal_coun smokeperl_object o; o.smoke = qt_Smoke; - o.classId = qt_Smoke->idClass("QMetaObject"); + o.classId = qt_Smoke->idClass("TQMetaObject"); o.ptr = meta; o.allocated = true; sv_magic((SV*)hv, sv_qapp, '~', (char*)&o, sizeof(o)); @@ -1796,7 +1796,7 @@ setqapp(obj) SV *obj CODE: if(!obj || !SvROK(obj)) - croak("Invalid Qt::Application object. Couldn't set Qt::app()\n"); + croak("Invalid TQt::Application object. Couldn't set TQt::app()\n"); sv_qapp = SvRV(obj); void @@ -1811,7 +1811,7 @@ deleteObject(obj) CODE: smokeperl_object *o = sv_obj_info(obj); if(!o) { XSRETURN_EMPTY; } - QObject *qobj = (QObject*)o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("QObject")); + TQObject *qobj = (TQObject*)o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQObject")); delete qobj; void @@ -1828,12 +1828,12 @@ mapObject(obj) mapPointer(obj, o, pointer_map, o->classId, 0); bool -isQObject(obj) +isTQObject(obj) SV *obj CODE: RETVAL = 0; smokeperl_object *o = sv_obj_info(obj); - if(o && isQObject(o->smoke, o->classId)) + if(o && isTQObject(o->smoke, o->classId)) RETVAL = 1; OUTPUT: RETVAL @@ -2161,9 +2161,9 @@ installautoload(package) newXS(autoload, XS_AUTOLOAD, file); delete[] autoload; -# ----------------- XSUBS for Qt:: ----------------- +# ----------------- XSUBS for TQt:: ----------------- -MODULE = Qt PACKAGE = Qt +MODULE = TQt PACKAGE = TQt SV * this() @@ -2182,17 +2182,17 @@ app() SV * version() CODE: - RETVAL = newSVpv(QT_VERSION_STR,0); + RETVAL = newSVpv(TQT_VERSION_STR,0); OUTPUT: RETVAL BOOT: init_qt_Smoke(); - qt_Smoke->binding = new QtSmokeBinding(qt_Smoke); - install_handlers(Qt_handlers); + qt_Smoke->binding = new TQtSmokeBinding(qt_Smoke); + install_handlers(TQt_handlers); pointer_map = newHV(); sv_this = newSV(0); - methcache = new QAsciiDict<Smoke::Index>(1187); - classcache = new QAsciiDict<Smoke::Index>(827); + methcache = new TQAsciiDict<Smoke::Index>(1187); + classcache = new TQAsciiDict<Smoke::Index>(827); methcache->setAutoDelete(1); classcache->setAutoDelete(1); diff --git a/PerlQt/bin/pqtapi b/PerlQt/bin/pqtapi index 9c5eadf..338d600 100755 --- a/PerlQt/bin/pqtapi +++ b/PerlQt/bin/pqtapi @@ -1,6 +1,6 @@ #!/usr/bin/perl -# Note: this program is part of PerlQt and makes use of its internal functions. +# Note: this program is part of PerlTQt and makes use of its internal functions. # You should not rely on those in your own programs. use Getopt::Std; @@ -9,17 +9,17 @@ use strict 'vars'; our (%o, @x, $h); getopts('r:hvimp', \%o); -package Qt::_internal; -use Qt; +package TQt::_internal; +use TQt; -exists $o{'v'} and do{ print "PerlQt-$Qt::VERSION using Qt-".&Qt::version."\n" and exit 0 }; +exists $o{'v'} and do{ print "PerlTQt-$TQt::VERSION using TQt-".&TQt::version."\n" and exit 0 }; exists $o{'h'} and do{ print $h and exit 0 }; -exists $o{'m'} and do{ # interactive mode for driving the Qt Designer Plugin +exists $o{'m'} and do{ # interactive mode for driving the TQt Designer Plugin select(STDOUT); $| = 1; # unbuffered while(<STDIN>) { chomp; - s/^Q(?=[A-Z])/Qt::/; + s/^Q(?=[A-Z])/TQt::/; my $i = find_pclassid( $_ ); print "__START__\n"; if ($i) @@ -38,7 +38,7 @@ exists $o{'m'} and do{ # interactive mode for driving the Qt Designer Plugi print "__END__\n"; } }; -(my $c = $ARGV[0]) =~ s/^Q(?=[A-Z])/Qt::/; +(my $c = $ARGV[0]) =~ s/^Q(?=[A-Z])/TQt::/; my $i = $c ? find_pclassid( $c ) : 1; my $r = exists $o{'r'} ? (exists $o{'i'} ? qr|$o{'r'}|i : qr|$o{'r'}|) : 0; my $d = ""; @@ -71,12 +71,12 @@ while ($i) } BEGIN { - $h = "pqtapi - a PerlQt introspection tool\t(c) Germain Garand 2003 <germain\@ebooksfrance.org>\n\n". + $h = "pqtapi - a PerlTQt introspection tool\t(c) Germain Garand 2003 <germain\@ebooksfrance.org>\n\n". "usage: pqtapi [-r <re>] [<class>]\n\n". "options:\n". "\t-r <re> : find all functions matching regular expression/keyword <re>\n". "\t-i : together with -r, performs a case insensitive search\n". "\t-p : display also inherited methods for <class>.\n". - "\t-v : print PerlQt and Qt versions\n". + "\t-v : print PerlTQt and TQt versions\n". "\t-h : print this help message\n"; } diff --git a/PerlQt/bin/pqtsh b/PerlQt/bin/pqtsh index 11a9e64..ec44e43 100755 --- a/PerlQt/bin/pqtsh +++ b/PerlQt/bin/pqtsh @@ -1,6 +1,6 @@ #!/usr/bin/perl -# pqtsh : a graphical shell for PerlQt. +# pqtsh : a graphical shell for PerlTQt. # # author: Germain Garand <[email protected]> # license: GNU Public License v2 @@ -9,20 +9,20 @@ use utf8; use strict 'vars'; -package QtShellControl; +package TQtShellControl; -use Qt; -use Qt::isa qw(Qt::MainWindow); -use Qt::slots +use TQt; +use TQt::isa qw(TQt::MainWindow); +use TQt::slots fileOpen => [], fileSave => [], fileSaveAs => [], filePrint => [], fileExit => [], helpExample => []; -use Qt::signals - fileNeedsEval => [QString]; -use Qt::attributes qw( +use TQt::signals + fileNeedsEval => [TQString]; +use TQt::attributes qw( menubar fileMenu helpMenu @@ -134,7 +134,7 @@ our $image2_data = our $image3_data = ["22 22 88 2", -"Qt c None", +"TQt c None", ".2 c #000000", ".S c #08ff08", "#v c #100810", @@ -222,18 +222,18 @@ our $image3_data = ".e c #eeeeee", ".W c #f6f6f6", ".P c #ffffff", -"QtQtQtQtQtQt.#.a.b.b.b.b.c.c.a.a.d.aQtQtQtQt", -"QtQtQtQtQtQt.a.e.f.f.f.f.f.e.e.e.g.aQtQtQtQt", -"QtQtQtQtQtQt.a.c.c.c.b.b.c.c.c.c.a.cQtQtQtQt", -"QtQtQtQtQtQt.#.a.a.a.a.#.a.a.#.#.d.aQtQtQtQt", -"QtQtQtQtQt.c.d.c.a.c.c.c.a.a.a.c.#QtQtQtQtQt", -"QtQtQtQtQt.a.a.#.a.a.a.a.a.a.c.c.#QtQtQtQtQt", -"QtQtQtQtQt.a.#.c.a.a.a.a.a.c.a.c.dQtQtQtQtQt", -"QtQtQtQtQt.c.a.a.a.a.a.a.a.a.a.a.#QtQtQtQtQt", -"QtQtQtQtQt.d.b.f.g.g.g.g.g.g.h.g.i.i.jQtQtQt", -"QtQtQt.a.k.l.#.h.b.h.b.h.b.h.g.g.m.n.o.p.#Qt", -"QtQt.a.q.r.s.t.t.t.t.t.t.t.u.v.w.x.y.z.A.o.i", -"Qt.a.k.B.C.D.B.E.E.E.E.F.G.H.I.J.K.o.L.L.M.y", +"TQtTQtTQtTQtTQtTQt.#.a.b.b.b.b.c.c.a.a.d.aTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQt.a.e.f.f.f.f.f.e.e.e.g.aTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQt.a.c.c.c.b.b.c.c.c.c.a.cTQtTQtTQtTQt", +"TQtTQtTQtTQtTQtTQt.#.a.a.a.a.#.a.a.#.#.d.aTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.c.d.c.a.c.c.c.a.a.a.c.#TQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.a.a.#.a.a.a.a.a.a.c.c.#TQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.a.#.c.a.a.a.a.a.c.a.c.dTQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.c.a.a.a.a.a.a.a.a.a.a.#TQtTQtTQtTQtTQt", +"TQtTQtTQtTQtTQt.d.b.f.g.g.g.g.g.g.h.g.i.i.jTQtTQtTQt", +"TQtTQtTQt.a.k.l.#.h.b.h.b.h.b.h.g.g.m.n.o.p.#TQt", +"TQtTQt.a.q.r.s.t.t.t.t.t.t.t.u.v.w.x.y.z.A.o.i", +"TQt.a.k.B.C.D.B.E.E.E.E.F.G.H.I.J.K.o.L.L.M.y", ".a.N.O.P.P.P.P.P.P.P.P.P.Q.R.S.R.b.v.T.A.U.L", ".V.W.P.P.P.P.P.P.P.P.P.P.X.Y.Z.0.P.1.t.A.2.L", ".3.E.4.5.4.h.E.E.g.6.D.B.D.E.7.F.4.5.8.M.2.A", @@ -241,22 +241,22 @@ our $image3_data = ".m.j.j#..3.K.K.K.N.K.N.N.N.N#a#d#d.w#b#c.2#e", "#f#.#..K.N.K.N.N.N#a.k#a#d#d#d#a.m#g#b.M.2#h", ".m.3.K.K#a.k#a#d#a.k#a#d#a#d.q.m.8#i.x#c#e.d", -"#f#g#i.w#j.w#i.8.w#i.8.8.m.8.m#k.8.w#b#e#fQt", -".#.l.z.A#l.z#m#m#m#n#o#o#p#p#q#q#p#o#p#fQtQt", -"QtQt.d#r#s#s#t#p.T.T.T#u#u.z#e#e#v.o.kQtQtQt"]; +"#f#g#i.w#j.w#i.8.w#i.8.8.m.8.m#k.8.w#b#e#fTQt", +".#.l.z.A#l.z#m#m#m#n#o#o#p#p#q#q#p#o#p#fTQtTQt", +"TQtTQt.d#r#s#s#t#p.T.T.T#u#u.z#e#e#v.o.kTQtTQtTQt"]; sub NEW { shift->SUPER::NEW(@_); - my $image0 = Qt::Pixmap($image0_data); - my $image1 = Qt::Pixmap($image1_data); - my $image2 = Qt::Pixmap($image2_data); - my $image3 = Qt::Pixmap($image3_data); + my $image0 = TQt::Pixmap($image0_data); + my $image1 = TQt::Pixmap($image1_data); + my $image2 = TQt::Pixmap($image2_data); + my $image3 = TQt::Pixmap($image3_data); my $box = VBox(this); sessionLog = TextEdit($box, "sessionLog"); - sessionLog->setTextFormat(Qt::RichText()); + sessionLog->setTextFormat(TQt::RichText()); sessionLog->setReadOnly(1); comboBox = ComboBox($box, "comboBox"); comboBox->setEditable(1); @@ -264,42 +264,42 @@ sub NEW this->setCentralWidget($box); comboBox->setFocus; this->resize(500,300); - setCaption("PerlQt Shell"); -# fileNewAction= Qt::Action(this, "fileNewAction"); -# fileNewAction->setIconSet(Qt::IconSet($image0)); + setCaption("PerlTQt Shell"); +# fileNewAction= TQt::Action(this, "fileNewAction"); +# fileNewAction->setIconSet(TQt::IconSet($image0)); # fileNewAction->setText(trUtf8("New")); # fileNewAction->setMenuText(trUtf8("&New")); # fileNewAction->setAccel(KeySequence(trUtf8("Ctrl+N"))); - fileOpenAction= Qt::Action(this, "fileOpenAction"); - fileOpenAction->setIconSet(Qt::IconSet($image1)); + fileOpenAction= TQt::Action(this, "fileOpenAction"); + fileOpenAction->setIconSet(TQt::IconSet($image1)); fileOpenAction->setText(trUtf8("Open")); fileOpenAction->setMenuText(trUtf8("&Open...")); fileOpenAction->setAccel(KeySequence(trUtf8("Ctrl+O"))); - fileSaveAction= Qt::Action(this, "fileSaveAction"); - fileSaveAction->setIconSet(Qt::IconSet($image2)); + fileSaveAction= TQt::Action(this, "fileSaveAction"); + fileSaveAction->setIconSet(TQt::IconSet($image2)); fileSaveAction->setText(trUtf8("Save")); fileSaveAction->setMenuText(trUtf8("&Save")); fileSaveAction->setAccel(KeySequence(trUtf8("Ctrl+S"))); - fileSaveAsAction= Qt::Action(this, "fileSaveAsAction"); + fileSaveAsAction= TQt::Action(this, "fileSaveAsAction"); fileSaveAsAction->setText(trUtf8("Save As")); fileSaveAsAction->setMenuText(trUtf8("Save &As...")); fileSaveAsAction->setAccel(KeySequence(trUtf8("Ctrl+A"))); - filePrintAction= Qt::Action(this, "filePrintAction"); - filePrintAction->setIconSet(Qt::IconSet($image3)); + filePrintAction= TQt::Action(this, "filePrintAction"); + filePrintAction->setIconSet(TQt::IconSet($image3)); filePrintAction->setText(trUtf8("Print")); filePrintAction->setMenuText(trUtf8("&Print...")); filePrintAction->setAccel(KeySequence(trUtf8("Ctrl+P"))); - fileExitAction= Qt::Action(this, "fileExitAction"); + fileExitAction= TQt::Action(this, "fileExitAction"); fileExitAction->setText(trUtf8("Exit")); fileExitAction->setMenuText(trUtf8("E&xit")); fileExitAction->setAccel(KeySequence(trUtf8("Ctrl+E"))); - helpExampleAction= Qt::Action(this, "helpExampleAction"); + helpExampleAction= TQt::Action(this, "helpExampleAction"); helpExampleAction->setText(trUtf8("Example")); helpExampleAction->setMenuText(trUtf8("Examp&le")); helpExampleAction->setAccel(KeySequence(trUtf8("Ctrl+L"))); - toolBar = Qt::ToolBar("", this, DockTop()); + toolBar = TQt::ToolBar("", this, DockTop()); toolBar->setLabel(trUtf8("Tools")); fileOpenAction->addTo(toolBar); @@ -307,9 +307,9 @@ sub NEW filePrintAction->addTo(toolBar); - 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); @@ -322,17 +322,17 @@ sub NEW menubar->insertSeparator; - helpMenu= Qt::PopupMenu(this); + helpMenu= TQt::PopupMenu(this); helpExampleAction->addTo(helpMenu); menubar->insertItem(trUtf8("&Help"), helpMenu); -# 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(filePrintAction, SIGNAL "activated()", this, SLOT "filePrint()"); - Qt::Object::connect(fileExitAction, SIGNAL "activated()", this, SLOT "fileExit()"); - Qt::Object::connect(helpExampleAction, SIGNAL "activated()", this, SLOT "helpExample()"); +# 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(filePrintAction, TQT_SIGNAL "activated()", this, TQT_SLOT "filePrint()"); + TQt::Object::connect(fileExitAction, TQT_SIGNAL "activated()", this, TQT_SLOT "fileExit()"); + TQt::Object::connect(helpExampleAction, TQT_SIGNAL "activated()", this, TQT_SLOT "helpExample()"); executedLines = []; @@ -345,7 +345,7 @@ sub NEW sub fileOpen { - my $fn = Qt::FileDialog::getOpenFileName( + my $fn = TQt::FileDialog::getOpenFileName( ".", "Pqtsh Session (*.pqts)", this, @@ -358,7 +358,7 @@ sub fileOpen sub getFileName { - fileName = Qt::FileDialog::getSaveFileName( + fileName = TQt::FileDialog::getSaveFileName( ".", "Pqtsh Session (*.pqts)", this, @@ -373,12 +373,12 @@ sub save { my $fn = shift; open( OUT, ">$fn") or do { - Qt::MessageBox::critical( + TQt::MessageBox::critical( this, "Error" , "Couldn't open $fn for writing: $!", - &Qt::MessageBox::Ok, - &Qt::MessageBox::NoButton ); + &TQt::MessageBox::Ok, + &TQt::MessageBox::NoButton ); return }; for (@{ &executedLines }) @@ -411,17 +411,17 @@ sub fileSaveAs if( -e $fn ) { $cond++; - $doit = Qt::MessageBox::warning( + $doit = TQt::MessageBox::warning( this, "Warning" , "File exists, overwrite ?", - &Qt::MessageBox::Yes, - &Qt::MessageBox::No ); + &TQt::MessageBox::Yes, + &TQt::MessageBox::No ); } else { $cond = 0 } } - goto AGAIN if $cond and $doit == &Qt::MessageBox::No; + goto AGAIN if $cond and $doit == &TQt::MessageBox::No; save($fn) } @@ -430,10 +430,10 @@ sub filePrint my $Margin = 10; my $pageNo = 1; emptySession() and return; - printer = Qt::Printer unless printer; + printer = TQt::Printer unless printer; if ( printer->setup(this) ) { statusBar()->message( "Printing..." ); - my $p = Qt::Painter; + my $p = TQt::Painter; if( !$p->begin( printer ) ) { statusBar()->message( "An error occured..." ); @@ -443,7 +443,7 @@ sub filePrint $p->setFont( sessionLog->font() ); my $yPos = 0; my $fm = $p->fontMetrics; - my $metrics = Qt::PaintDeviceMetrics( printer ); + my $metrics = TQt::PaintDeviceMetrics( printer ); for( my $i = 0 ; $i < @{ &executedLines } ; $i++ ) { if ( $Margin + $yPos > $metrics->height() - $Margin ) { @@ -467,7 +467,7 @@ sub filePrint sub fileExit { - emit Qt::app()->quit() if confirmExit(); + emit TQt::app()->quit() if confirmExit(); } sub closeEvent @@ -488,17 +488,17 @@ sub confirmExit my $doit; if(@{ &executedLines }) { - $doit = Qt::MessageBox::warning( + $doit = TQt::MessageBox::warning( this, "Warning" , "A session is opened, quit anyway ?", - &Qt::MessageBox::Yes, - &Qt::MessageBox::No ); + &TQt::MessageBox::Yes, + &TQt::MessageBox::No ); } else { return 1 } - return (($doit == &Qt::MessageBox::No) ? 0 : 1); + return (($doit == &TQt::MessageBox::No) ? 0 : 1); } sub emptySession @@ -518,23 +518,23 @@ sub helpExample 1; -package QtShell; +package TQtShell; -use Qt; -use Qt::isa qw(Qt::MainWindow); -use Qt::slots +use TQt; +use TQt::isa qw(TQt::MainWindow); +use TQt::slots evalInput=>[], - evalFile=>[QString]; -use Qt::attributes qw( + evalFile=>[TQString]; +use TQt::attributes qw( shellWindow ); -use QtShellControl; +use TQtShellControl; sub NEW { shift->SUPER::NEW(@_); - shellWindow = QtShellControl(undef, "shellWindow"); + shellWindow = TQtShellControl(undef, "shellWindow"); this->resize(350,350); this->move(Point(10,10)); shellWindow->move(Point(300,200)); @@ -542,11 +542,11 @@ sub NEW shellWindow->show; - this->connect(shellWindow->comboBox->lineEdit, SIGNAL 'returnPressed()', SLOT 'evalInput()'); + this->connect(shellWindow->comboBox->lineEdit, TQT_SIGNAL 'returnPressed()', TQT_SLOT 'evalInput()'); this->{'prompt'} = '<b><font color="blue">$></font></b>'; setCaption("MainWindow - this"); shellWindow->sessionLog->setText("Ready.<br>"); - Qt::Object::connect(shellWindow, SIGNAL 'fileNeedsEval(QString)', this, SLOT 'evalFile(QString)'); + TQt::Object::connect(shellWindow, TQT_SIGNAL 'fileNeedsEval(TQString)', this, TQT_SLOT 'evalFile(TQString)'); } sub logAppend @@ -599,12 +599,12 @@ sub evalFile else { open($fh, $fn) or do { - Qt::MessageBox::warning ( + TQt::MessageBox::warning ( this, "Error" , "Couldn't open $fn: $!", - &Qt::MessageBox::Ok, - &Qt::MessageBox::NoButton ); + &TQt::MessageBox::Ok, + &TQt::MessageBox::NoButton ); return }; } @@ -617,7 +617,7 @@ sub evalFile 1; -package Qt::TextHandle; +package TQt::TextHandle; sub TIEHANDLE { my ( $classnm, $widg, $color) = @_; my $h = { widg => $widg, color => $color}; @@ -645,31 +645,31 @@ sub UNTIE { } package main; use strict; -use Qt; -use QtShell; -use Qt::debug; +use TQt; +use TQtShell; +use TQt::debug; -my $app = Qt::Application(\@ARGV); -my $w = QtShell(undef, "mainWindow"); +my $app = TQt::Application(\@ARGV); +my $w = TQtShell(undef, "mainWindow"); my $shw = $w->shellWindow; $app->setMainWidget($shw); -tie *STDOUT, 'Qt::TextHandle', $shw->sessionLog, 'black'; -tie *STDERR, 'Qt::TextHandle', $shw->sessionLog, 'red'; +tie *STDOUT, 'TQt::TextHandle', $shw->sessionLog, 'black'; +tie *STDERR, 'TQt::TextHandle', $shw->sessionLog, 'red'; exit $app->exec; __DATA__ statusBar()->message("Hello World !"); -use Qt::attributes qw|datetime button textedit sample vbox| ; +use TQt::attributes qw|datetime button textedit sample vbox| ; vbox = VBox(this); datetime = DateTimeEdit(vbox); -textedit = Qt::TextEdit(vbox); +textedit = TQt::TextEdit(vbox); button = PushButton("Hello World!", vbox) ; this->setCentralWidget(vbox); resize(220,240); vbox->show; -sample = Qt::PopupMenu( this ); -use Qt::slots 'there' => []; -sample->insertItem("&There", this, SLOT 'there()'); +sample = TQt::PopupMenu( this ); +use TQt::slots 'there' => []; +sample->insertItem("&There", this, TQT_SLOT 'there()'); menuBar()->insertItem("&Here", sample); sub there { statusBar()->message("There...", 2000) }; 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; diff --git a/PerlQt/handlers.cpp b/PerlQt/handlers.cpp index da0278c..395298f 100644 --- a/PerlQt/handlers.cpp +++ b/PerlQt/handlers.cpp @@ -46,8 +46,8 @@ #endif extern HV* pointer_map; -static QIntDict<Smoke::Index> *dtorcache= 0; -static QIntDict<Smoke::Index> *cctorcache= 0; +static TQIntDict<Smoke::Index> *dtorcache= 0; +static TQIntDict<Smoke::Index> *cctorcache= 0; int smokeperl_free(pTHX_ SV *sv, MAGIC *mg) { smokeperl_object *o = (smokeperl_object*)mg->mg_ptr; @@ -355,7 +355,7 @@ static void marshall_basetype(Marshall *m) { } HV *hv = newHV(); obj = newRV_noinc((SV*)hv); - // TODO: Generic mapping from C++ classname to Qt classname + // TODO: Generic mapping from C++ classname to TQt classname smokeperl_object o; o.smoke = m->smoke(); @@ -445,22 +445,22 @@ void marshall_ucharP(Marshall *m) { case Marshall::FromSV: { SV* sv = m->var(); - QByteArray *s = 0; + TQByteArray *s = 0; MAGIC* mg = 0; bool hasMagic = false; if(SvOK(sv)) { if( SvTYPE(sv) == SVt_PVMG && (mg = mg_find(sv, PERL_MAGIC_tiedscalar)) - && sv_derived_from(mg->mg_obj, "Qt::_internal::QByteArray") ) { - s = (QByteArray*)SvIV((SV*)SvRV(mg->mg_obj)); + && sv_derived_from(mg->mg_obj, "TQt::_internal::TQByteArray") ) { + s = (TQByteArray*)SvIV((SV*)SvRV(mg->mg_obj)); hasMagic = true; } else { STRLEN len; char* tmp = SvPV(sv, len); - s = new QByteArray(len); + s = new TQByteArray(len); Copy((void*)tmp, (void*)s->data(), len, char); if( !m->type().isConst() && !SvREADONLY(sv) ) { SV* rv = newSV(0); - sv_setref_pv(rv, "Qt::_internal::QByteArray", (void*)s); + sv_setref_pv(rv, "TQt::_internal::TQByteArray", (void*)s); sv_magic(sv, rv, PERL_MAGIC_tiedscalar, Nullch, 0); hasMagic = true; } @@ -471,16 +471,16 @@ void marshall_ucharP(Marshall *m) { m->item().s_voidp = 0; break; } - s = new QByteArray(0); + s = new TQByteArray(0); if( !SvREADONLY(sv) ) { SV* rv = newSV(0); sv_setpv_mg(sv, ""); - sv_setref_pv(rv, "Qt::_internal::QByteArray", s); + sv_setref_pv(rv, "TQt::_internal::TQByteArray", s); sv_magic(sv, rv, PERL_MAGIC_tiedscalar, Nullch, 0); hasMagic = true; } } else - s = new QByteArray(0); + s = new TQByteArray(0); } m->item().s_voidp = s->data(); m->next(); @@ -494,30 +494,30 @@ void marshall_ucharP(Marshall *m) { } } -static void marshall_QString(Marshall *m) { +static void marshall_TQString(Marshall *m) { switch(m->action()) { case Marshall::FromSV: { SV* sv = m->var(); - QString *s = 0; + TQString *s = 0; MAGIC* mg = 0; bool hasMagic = false; if(SvOK(sv) || m->type().isStack()) { if( SvTYPE(sv) == SVt_PVMG && (mg = mg_find(sv, PERL_MAGIC_tiedscalar)) - && sv_derived_from(mg->mg_obj, "Qt::_internal::QString") ) { - s = (QString*)SvIV((SV*)SvRV(mg->mg_obj)); + && sv_derived_from(mg->mg_obj, "TQt::_internal::TQString") ) { + s = (TQString*)SvIV((SV*)SvRV(mg->mg_obj)); hasMagic = true; } else { COP *cop = cxstack[cxstack_ix].blk_oldcop; if(SvUTF8(sv)) - s = new QString(QString::fromUtf8(SvPV_nolen(sv))); + s = new TQString(TQString::fromUtf8(SvPV_nolen(sv))); else if(cop->op_private & HINT_LOCALE) - s = new QString(QString::fromLocal8Bit(SvPV_nolen(sv))); + s = new TQString(TQString::fromLocal8Bit(SvPV_nolen(sv))); else - s = new QString(QString::fromLatin1(SvPV_nolen(sv))); + s = new TQString(TQString::fromLatin1(SvPV_nolen(sv))); if( !m->type().isConst() && !m->type().isStack() && !SvREADONLY(sv)) { SV* rv = newSV(0); - sv_setref_pv(rv, "Qt::_internal::QString", (void*)s); + sv_setref_pv(rv, "TQt::_internal::TQString", (void*)s); sv_magic(sv, rv, PERL_MAGIC_tiedscalar, Nullch, 0); hasMagic = true; } @@ -528,16 +528,16 @@ static void marshall_QString(Marshall *m) { m->item().s_voidp = 0; break; } - s = new QString; + s = new TQString; if( !SvREADONLY(sv) ) { SV* rv = newSV(0); sv_setpv_mg(sv, ""); - sv_setref_pv(rv, "Qt::_internal::QString", s); + sv_setref_pv(rv, "TQt::_internal::TQString", s); sv_magic(sv, rv, PERL_MAGIC_tiedscalar, Nullch, 0); hasMagic = true; } } else - s = new QString; + s = new TQString; } m->item().s_voidp = s; m->next(); @@ -547,7 +547,7 @@ static void marshall_QString(Marshall *m) { break; case Marshall::ToSV: { - QString *s = (QString*)m->item().s_voidp; + TQString *s = (TQString*)m->item().s_voidp; if(s) { COP *cop = cxstack[cxstack_ix].blk_oldcop; if(!(cop->op_private & HINT_BYTES)) @@ -572,28 +572,28 @@ static void marshall_QString(Marshall *m) { } } -static void marshall_QByteArray(Marshall *m) { +static void marshall_TQByteArray(Marshall *m) { switch(m->action()) { case Marshall::FromSV: { SV* sv = m->var(); - QByteArray *s = 0; + TQByteArray *s = 0; MAGIC* mg = 0; bool hasMagic = false; if(SvOK(sv) || m->type().isStack()) { if( SvTYPE(sv) == SVt_PVMG && (mg = mg_find(sv, PERL_MAGIC_tiedscalar)) - && sv_derived_from(mg->mg_obj, "Qt::_internal::QByteArray") ) { - s = (QByteArray*)SvIV((SV*)SvRV(mg->mg_obj)); + && sv_derived_from(mg->mg_obj, "TQt::_internal::TQByteArray") ) { + s = (TQByteArray*)SvIV((SV*)SvRV(mg->mg_obj)); hasMagic = true; } else { STRLEN len; char* tmp = SvPV(sv, len); - s = new QByteArray(len); + s = new TQByteArray(len); Copy((void*)tmp, (void*)s->data(), len, char); - if( !m->type().isConst() && !SvREADONLY(sv) ) { // we tie also stack because of the funny QDataStream behaviour + if( !m->type().isConst() && !SvREADONLY(sv) ) { // we tie also stack because of the funny TQDataStream behaviour // fprintf(stderr, "Tying\n"); SV* rv = newSV(0); - sv_setref_pv(rv, "Qt::_internal::QByteArray", (void*)s); + sv_setref_pv(rv, "TQt::_internal::TQByteArray", (void*)s); sv_magic(sv, rv, PERL_MAGIC_tiedscalar, Nullch, 0); hasMagic = true; } @@ -604,16 +604,16 @@ static void marshall_QByteArray(Marshall *m) { m->item().s_voidp = 0; break; } - s = new QByteArray(0); + s = new TQByteArray(0); if( !SvREADONLY(sv) ) { SV* rv = newSV(0); sv_setpv_mg(sv, ""); - sv_setref_pv(rv, "Qt::_internal::QByteArray", s); + sv_setref_pv(rv, "TQt::_internal::TQByteArray", s); sv_magic(sv, rv, PERL_MAGIC_tiedscalar, Nullch, 0); hasMagic = true; } } else - s = new QByteArray(0); + s = new TQByteArray(0); } m->item().s_voidp = s; m->next(); @@ -626,11 +626,11 @@ static void marshall_QByteArray(Marshall *m) { { bool hasMagic = false; SV *sv = m->var(); - QByteArray *s = (QByteArray*)m->item().s_voidp; + TQByteArray *s = (TQByteArray*)m->item().s_voidp; if(s) { if( !m->type().isConst() && !m->type().isStack() && !SvREADONLY(sv)) { SV* rv = newSV(0); - sv_setref_pv(rv, "Qt::_internal::QByteArray", (void*)s); + sv_setref_pv(rv, "TQt::_internal::TQByteArray", (void*)s); sv_magic(sv, rv, PERL_MAGIC_tiedscalar, Nullch, 0); // err, is a previous magic auto-untied here? hasMagic = true; } else @@ -660,13 +660,13 @@ static const char *not_ascii(const char *s, uint &len) return r ? s : 0L; } -static void marshall_QCString(Marshall *m) { +static void marshall_TQCString(Marshall *m) { switch(m->action()) { case Marshall::FromSV: { - QCString *s = 0; + TQCString *s = 0; if(SvOK(m->var()) || m->type().isStack()) - s = new QCString(SvPV_nolen(m->var())); + s = new TQCString(SvPV_nolen(m->var())); m->item().s_voidp = s; m->next(); if(s && m->cleanup()) @@ -675,7 +675,7 @@ static void marshall_QCString(Marshall *m) { break; case Marshall::ToSV: { - QCString *s = (QCString*)m->item().s_voidp; + TQCString *s = (TQCString*)m->item().s_voidp; if(s) { sv_setpv_mg(m->var(), (const char *)*s); const char * p = (const char *)*s; @@ -684,7 +684,7 @@ static void marshall_QCString(Marshall *m) { if(!(cop->op_private & HINT_BYTES) && not_ascii(p,len)) { #if PERL_VERSION == 6 && PERL_SUBVERSION == 0 - QTextCodec* c = QTextCodec::codecForMib(106); // utf8 + TQTextCodec* c = TQTextCodec::codecForMib(106); // utf8 if(c->heuristicContentMatch(p,len) >= 0) #else if(is_utf8_string((U8 *)p,len)) @@ -705,7 +705,7 @@ static void marshall_QCString(Marshall *m) { } } -static void marshall_QCOORD_array(Marshall *m) { +static void marshall_TQCOORD_array(Marshall *m) { switch(m->action()) { case Marshall::FromSV: { @@ -717,7 +717,7 @@ static void marshall_QCOORD_array(Marshall *m) { } AV *av = (AV*)SvRV(sv); int count = av_len(av); - QCOORD *coord = new QCOORD[count + 2]; + TQCOORD *coord = new TQCOORD[count + 2]; for(int i = 0; i <= count; i++) { SV **svp = av_fetch(av, i, 0); coord[i] = svp ? SvIV(*svp) : 0; @@ -862,7 +862,7 @@ static void marshall_charP_array(Marshall *m) { } } -static void marshall_QStringList(Marshall *m) { +static void marshall_TQStringList(Marshall *m) { switch(m->action()) { case Marshall::FromSV: { @@ -874,23 +874,23 @@ static void marshall_QStringList(Marshall *m) { } AV *list = (AV*)SvRV(sv); int count = av_len(list); - QStringList *stringlist = new QStringList; + TQStringList *stringlist = new TQStringList; int i; COP *cop = cxstack[cxstack_ix].blk_oldcop; bool lc = cop->op_private & HINT_LOCALE; for(i = 0; i <= count; i++) { SV **item = av_fetch(list, i, 0); if(!item || !SvOK(*item)) { - stringlist->append(QString()); + stringlist->append(TQString()); continue; } if(SvUTF8(*item)) - stringlist->append(QString::fromUtf8(SvPV_nolen(*item))); + stringlist->append(TQString::fromUtf8(SvPV_nolen(*item))); else if(lc) - stringlist->append(QString::fromLocal8Bit(SvPV_nolen(*item))); + stringlist->append(TQString::fromLocal8Bit(SvPV_nolen(*item))); else - stringlist->append(QString::fromLatin1(SvPV_nolen(*item))); + stringlist->append(TQString::fromLatin1(SvPV_nolen(*item))); } m->item().s_voidp = stringlist; @@ -898,7 +898,7 @@ static void marshall_QStringList(Marshall *m) { if(m->cleanup()) { av_clear(list); - for(QStringList::Iterator it = stringlist->begin(); + for(TQStringList::Iterator it = stringlist->begin(); it != stringlist->end(); ++it) av_push(list, newSVpv((const char *)*it, 0)); @@ -908,7 +908,7 @@ static void marshall_QStringList(Marshall *m) { break; case Marshall::ToSV: { - QStringList *stringlist = (QStringList*)m->item().s_voidp; + TQStringList *stringlist = (TQStringList*)m->item().s_voidp; if(!stringlist) { sv_setsv_mg(m->var(), &PL_sv_undef); break; @@ -922,7 +922,7 @@ static void marshall_QStringList(Marshall *m) { } COP *cop = cxstack[cxstack_ix].blk_oldcop; if(!(cop->op_private & HINT_BYTES)) - for(QStringList::Iterator it = stringlist->begin(); + for(TQStringList::Iterator it = stringlist->begin(); it != stringlist->end(); ++it) { SV *sv = newSVpv((const char *)(*it).utf8(), 0); @@ -930,14 +930,14 @@ static void marshall_QStringList(Marshall *m) { av_push(av, sv); } else if(cop->op_private & HINT_LOCALE) - for(QStringList::Iterator it = stringlist->begin(); + for(TQStringList::Iterator it = stringlist->begin(); it != stringlist->end(); ++it) { SV *sv = newSVpv((const char *)(*it).local8Bit(), 0); av_push(av, sv); } else - for(QStringList::Iterator it = stringlist->begin(); + for(TQStringList::Iterator it = stringlist->begin(); it != stringlist->end(); ++it) { SV *sv = newSVpv((const char *)(*it).latin1(), 0); @@ -953,7 +953,7 @@ static void marshall_QStringList(Marshall *m) { } } -static void marshall_QValueListInt(Marshall *m) { +static void marshall_TQValueListInt(Marshall *m) { switch(m->action()) { case Marshall::FromSV: { @@ -965,7 +965,7 @@ static void marshall_QValueListInt(Marshall *m) { } AV *list = (AV*)SvRV(sv); int count = av_len(list); - QValueList<int> *valuelist = new QValueList<int>; + TQValueList<int> *valuelist = new TQValueList<int>; int i; for(i = 0; i <= count; i++) { SV **item = av_fetch(list, i, 0); @@ -982,7 +982,7 @@ static void marshall_QValueListInt(Marshall *m) { if(m->cleanup()) { av_clear(list); - for(QValueListIterator<int> it = valuelist->begin(); + for(TQValueListIterator<int> it = valuelist->begin(); it != valuelist->end(); ++it) av_push(list, newSViv((int)*it)); @@ -992,7 +992,7 @@ static void marshall_QValueListInt(Marshall *m) { break; case Marshall::ToSV: { - QValueList<int> *valuelist = (QValueList<int>*)m->item().s_voidp; + TQValueList<int> *valuelist = (TQValueList<int>*)m->item().s_voidp; if(!valuelist) { sv_setsv_mg(m->var(), &PL_sv_undef); break; @@ -1005,7 +1005,7 @@ static void marshall_QValueListInt(Marshall *m) { SvREFCNT_dec(rv); } - for(QValueListIterator<int> it = valuelist->begin(); + for(TQValueListIterator<int> it = valuelist->begin(); it != valuelist->end(); ++it) av_push(av, newSViv((int)*it)); @@ -1044,16 +1044,16 @@ void marshall_voidP(Marshall *m) { } } -void marshall_QRgb_array(Marshall *m) { +void marshall_TQRgb_array(Marshall *m) { switch(m->action()) { case Marshall::FromSV: { SV* sv = m->var(); - QRgb* s = 0; + TQRgb* s = 0; MAGIC* mg = 0; if( SvOK(sv) && SvTYPE(sv) == SVt_PVMG && (mg = mg_find(sv, PERL_MAGIC_tiedscalar)) - && sv_derived_from(mg->mg_obj, "Qt::_internal::QRgbStar") ) { - s = (QRgb*)SvIV((SV*)SvRV(mg->mg_obj)); + && sv_derived_from(mg->mg_obj, "TQt::_internal::TQRgbStar") ) { + s = (TQRgb*)SvIV((SV*)SvRV(mg->mg_obj)); } else if(!SvROK(sv) || SvREADONLY(sv) || SvTYPE(SvRV(sv)) != SVt_PVAV || av_len((AV*)SvRV(sv)) < 0) { m->item().s_voidp = 0; @@ -1061,7 +1061,7 @@ void marshall_QRgb_array(Marshall *m) { } else { AV *list = (AV*)SvRV(sv); int count = av_len(list); - s = new QRgb[count + 2]; + s = new TQRgb[count + 2]; int i; for(i = 0; i <= count; i++) { SV **item = av_fetch(list, i, 0); @@ -1073,7 +1073,7 @@ void marshall_QRgb_array(Marshall *m) { } s[i] = 0; SV* rv = newSV(0); - sv_setref_pv(rv, "Qt::_internal::QRgbStar", (void*)s); + sv_setref_pv(rv, "TQt::_internal::TQRgbStar", (void*)s); sv_magic(sv, rv, PERL_MAGIC_tiedscalar, Nullch, 0); } m->item().s_voidp = s; @@ -1123,7 +1123,7 @@ void marshall_QRgb_array(Marshall *m) { -#define MARSHALL_QPTRLIST( FNAME, TMPLNAME, CCLASSNAME, PCLASSNAME, IS_STACK ) \ +#define MARSHALL_TQPTRLIST( FNAME, TMPLNAME, CCLASSNAME, PCLASSNAME, IS_STACK ) \ static void marshall_ ## FNAME (Marshall *m) { \ switch(m->action()) { \ case Marshall::FromSV: \ @@ -1202,20 +1202,20 @@ static void marshall_ ## FNAME (Marshall *m) { } \ } -MARSHALL_QPTRLIST( QPtrListQNetworkOperation, QPtrList<QNetworkOperation>, QNetworkOperation, " Qt::NetworkOperation", FALSE ) -MARSHALL_QPTRLIST( QPtrListQToolBar, QPtrList<QToolBar>, QToolBar, " Qt::ToolBar", FALSE ) -MARSHALL_QPTRLIST( QPtrListQTab, QPtrList<QTab>, QTab, " Qt::Tab", FALSE ) -MARSHALL_QPTRLIST( QPtrListQDockWindow, QPtrList<QDockWindow>, QDockWindow, " Qt::DockWindow", FALSE ) -MARSHALL_QPTRLIST( QWidgetList, QWidgetList, QWidget, " Qt::Widget", FALSE ) -MARSHALL_QPTRLIST( QObjectList, QObjectList, QObject, " Qt::Object", FALSE ) -MARSHALL_QPTRLIST( QFileInfoList, QFileInfoList, QFileInfo, " Qt::FileInfo", FALSE ) +MARSHALL_TQPTRLIST( TQPtrListTQNetworkOperation, TQPtrList<TQNetworkOperation>, TQNetworkOperation, " TQt::NetworkOperation", FALSE ) +MARSHALL_TQPTRLIST( TQPtrListTQToolBar, TQPtrList<TQToolBar>, TQToolBar, " TQt::ToolBar", FALSE ) +MARSHALL_TQPTRLIST( TQPtrListTQTab, TQPtrList<TQTab>, TQTab, " TQt::Tab", FALSE ) +MARSHALL_TQPTRLIST( TQPtrListTQDockWindow, TQPtrList<TQDockWindow>, TQDockWindow, " TQt::DockWindow", FALSE ) +MARSHALL_TQPTRLIST( TQWidgetList, TQWidgetList, TQWidget, " TQt::Widget", FALSE ) +MARSHALL_TQPTRLIST( TQObjectList, TQObjectList, TQObject, " TQt::Object", FALSE ) +MARSHALL_TQPTRLIST( TQFileInfoList, TQFileInfoList, TQFileInfo, " TQt::FileInfo", FALSE ) -void marshall_QCanvasItemList(Marshall *m) { +void marshall_TQCanvasItemList(Marshall *m) { switch(m->action()) { case Marshall::ToSV: { - QCanvasItemList *cilist = (QCanvasItemList*)m->item().s_voidp; + TQCanvasItemList *cilist = (TQCanvasItemList*)m->item().s_voidp; if(!cilist) { sv_setsv_mg(m->var(), &PL_sv_undef); break; @@ -1228,12 +1228,12 @@ void marshall_QCanvasItemList(Marshall *m) { SvREFCNT_dec(rv); } - int ix = m->smoke()->idClass( "QCanvasItem" ); - for(QValueListIterator<QCanvasItem*> it = cilist->begin(); + int ix = m->smoke()->idClass( "TQCanvasItem" ); + for(TQValueListIterator<TQCanvasItem*> it = cilist->begin(); it != cilist->end(); ++it){ - QCanvasItem* t= *it; - GET_PERL_OBJECT( QCanvasItem, " Qt::CanvasItem", FALSE ) + TQCanvasItem* t= *it; + GET_PERL_OBJECT( TQCanvasItem, " TQt::CanvasItem", FALSE ) av_push(av, ret); } if(m->cleanup()) @@ -1248,22 +1248,22 @@ void marshall_QCanvasItemList(Marshall *m) { -TypeHandler Qt_handlers[] = { - { "QString", marshall_QString }, - { "QString&", marshall_QString }, - { "QString*", marshall_QString }, - { "const QString", marshall_QString }, - { "const QString&", marshall_QString }, - { "const QString*", marshall_QString }, - { "QCString", marshall_QCString }, - { "QCString&", marshall_QCString }, - { "QCString*", marshall_QCString }, - { "const QCString", marshall_QCString }, - { "const QCString&", marshall_QCString }, - { "const QCString*", marshall_QCString }, - { "QStringList", marshall_QStringList }, - { "QStringList&", marshall_QStringList }, - { "QStringList*", marshall_QStringList }, +TypeHandler TQt_handlers[] = { + { "TQString", marshall_TQString }, + { "TQString&", marshall_TQString }, + { "TQString*", marshall_TQString }, + { "const TQString", marshall_TQString }, + { "const TQString&", marshall_TQString }, + { "const TQString*", marshall_TQString }, + { "TQCString", marshall_TQCString }, + { "TQCString&", marshall_TQCString }, + { "TQCString*", marshall_TQCString }, + { "const TQCString", marshall_TQCString }, + { "const TQCString&", marshall_TQCString }, + { "const TQCString*", marshall_TQCString }, + { "TQStringList", marshall_TQStringList }, + { "TQStringList&", marshall_TQStringList }, + { "TQStringList*", marshall_TQStringList }, { "int&", marshall_intR }, { "int*", marshall_intR }, { "bool&", marshall_boolR }, @@ -1272,40 +1272,40 @@ TypeHandler Qt_handlers[] = { { "const char*", marshall_charP }, { "char**", marshall_charP_array }, { "uchar*", marshall_ucharP }, - { "QRgb*", marshall_QRgb_array }, - { "QUObject*", marshall_voidP }, - { "const QCOORD*", marshall_QCOORD_array }, + { "TQRgb*", marshall_TQRgb_array }, + { "TQUObject*", marshall_voidP }, + { "const TQCOORD*", marshall_TQCOORD_array }, { "void", marshall_void }, - { "QByteArray", marshall_QByteArray }, - { "QByteArray&", marshall_QByteArray }, - { "QByteArray*", marshall_QByteArray }, - { "QValueList<int>", marshall_QValueListInt }, - { "QValueList<int>*", marshall_QValueListInt }, - { "QValueList<int>&", marshall_QValueListInt }, - { "QCanvasItemList", marshall_QCanvasItemList }, - { "QCanvasItemList*", marshall_QCanvasItemList }, - { "QCanvasItemList&", marshall_QCanvasItemList }, - { "QWidgetList", marshall_QWidgetList }, - { "QWidgetList*", marshall_QWidgetList }, - { "QWidgetList&", marshall_QWidgetList }, - { "QObjectList", marshall_QObjectList }, - { "QObjectList*", marshall_QObjectList }, - { "QObjectList&", marshall_QObjectList }, - { "QFileInfoList", marshall_QFileInfoList }, - { "QFileInfoList*", marshall_QFileInfoList }, - { "QFileInfoList&", marshall_QFileInfoList }, - { "QPtrList<QToolBar>", marshall_QPtrListQToolBar }, - { "QPtrList<QToolBar>*", marshall_QPtrListQToolBar }, - { "QPtrList<QToolBar>&", marshall_QPtrListQToolBar }, - { "QPtrList<QTab>", marshall_QPtrListQTab }, - { "QPtrList<QTab>*", marshall_QPtrListQTab }, - { "QPtrList<QTab>&", marshall_QPtrListQTab }, - { "QPtrList<QDockWindow>", marshall_QPtrListQDockWindow }, - { "QPtrList<QDockWindow>*", marshall_QPtrListQDockWindow }, - { "QPtrList<QDockWindow>&", marshall_QPtrListQDockWindow }, - { "QPtrList<QNetworkOperation>", marshall_QPtrListQNetworkOperation }, - { "QPtrList<QNetworkOperation>*", marshall_QPtrListQNetworkOperation }, - { "QPtrList<QNetworkOperation>&", marshall_QPtrListQNetworkOperation }, + { "TQByteArray", marshall_TQByteArray }, + { "TQByteArray&", marshall_TQByteArray }, + { "TQByteArray*", marshall_TQByteArray }, + { "TQValueList<int>", marshall_TQValueListInt }, + { "TQValueList<int>*", marshall_TQValueListInt }, + { "TQValueList<int>&", marshall_TQValueListInt }, + { "TQCanvasItemList", marshall_TQCanvasItemList }, + { "TQCanvasItemList*", marshall_TQCanvasItemList }, + { "TQCanvasItemList&", marshall_TQCanvasItemList }, + { "TQWidgetList", marshall_TQWidgetList }, + { "TQWidgetList*", marshall_TQWidgetList }, + { "TQWidgetList&", marshall_TQWidgetList }, + { "TQObjectList", marshall_TQObjectList }, + { "TQObjectList*", marshall_TQObjectList }, + { "TQObjectList&", marshall_TQObjectList }, + { "TQFileInfoList", marshall_TQFileInfoList }, + { "TQFileInfoList*", marshall_TQFileInfoList }, + { "TQFileInfoList&", marshall_TQFileInfoList }, + { "TQPtrList<TQToolBar>", marshall_TQPtrListTQToolBar }, + { "TQPtrList<TQToolBar>*", marshall_TQPtrListTQToolBar }, + { "TQPtrList<TQToolBar>&", marshall_TQPtrListTQToolBar }, + { "TQPtrList<TQTab>", marshall_TQPtrListTQTab }, + { "TQPtrList<TQTab>*", marshall_TQPtrListTQTab }, + { "TQPtrList<TQTab>&", marshall_TQPtrListTQTab }, + { "TQPtrList<TQDockWindow>", marshall_TQPtrListTQDockWindow }, + { "TQPtrList<TQDockWindow>*", marshall_TQPtrListTQDockWindow }, + { "TQPtrList<TQDockWindow>&", marshall_TQPtrListTQDockWindow }, + { "TQPtrList<TQNetworkOperation>", marshall_TQPtrListTQNetworkOperation }, + { "TQPtrList<TQNetworkOperation>*", marshall_TQPtrListTQNetworkOperation }, + { "TQPtrList<TQNetworkOperation>&", marshall_TQPtrListTQNetworkOperation }, { 0, 0 } }; @@ -1318,11 +1318,11 @@ void install_handlers(TypeHandler *h) { h++; } if(!dtorcache){ - dtorcache = new QIntDict<Smoke::Index>(113); + dtorcache = new TQIntDict<Smoke::Index>(113); dtorcache->setAutoDelete(1); } if(!cctorcache) { - cctorcache = new QIntDict<Smoke::Index>(113); + cctorcache = new TQIntDict<Smoke::Index>(113); cctorcache->setAutoDelete(1); } } diff --git a/PerlQt/lib/Qt/GlobalSpace.pm b/PerlQt/lib/Qt/GlobalSpace.pm index 65e481a..75f30a2 100644 --- a/PerlQt/lib/Qt/GlobalSpace.pm +++ b/PerlQt/lib/Qt/GlobalSpace.pm @@ -1,11 +1,11 @@ -package Qt::GlobalSpace; +package TQt::GlobalSpace; use strict; -require Qt; +require TQt; require Exporter; our @ISA = qw(Exporter); our @EXPORT; -our $allMeth = Qt::_internal::findAllMethods( Qt::_internal::idClass("QGlobalSpace") ); +our $allMeth = TQt::_internal::findAllMethods( TQt::_internal::idClass("TQGlobalSpace") ); no strict 'refs'; for my $proto( keys %$allMeth ) @@ -14,8 +14,8 @@ for my $proto( keys %$allMeth ) $proto =~ s/[\#\$\?]+$//; *{ $proto } = sub { - $Qt::_internal::autoload::AUTOLOAD = "Qt::GlobalSpace\::$proto"; - goto &Qt::GlobalSpace::AUTOLOAD + $TQt::_internal::autoload::AUTOLOAD = "TQt::GlobalSpace\::$proto"; + goto &TQt::GlobalSpace::AUTOLOAD } unless defined &$proto; push @EXPORT, $proto; } diff --git a/PerlQt/lib/Qt/attributes.pm b/PerlQt/lib/Qt/attributes.pm index 3a25487..4398fa5 100644 --- a/PerlQt/lib/Qt/attributes.pm +++ b/PerlQt/lib/Qt/attributes.pm @@ -1,10 +1,10 @@ -package Qt::attributes; +package TQt::attributes; # # I plan to support public/protected/private attributes. here goes. # Attributes default to protected. # # package MyBase; -# use Qt::attributes qw( +# use TQt::attributes qw( # private: # foo # protected: @@ -14,7 +14,7 @@ package Qt::attributes; # ); # # package MyDerived; -# use Qt::isa qw(MyBase); +# use TQt::isa qw(MyBase); # # sub foo { # # 1 way to access private attributes from derived class @@ -43,7 +43,7 @@ sub import { for my $attribute (@_) { exists ${ ${$caller . '::META'}{'attributes'} }{$attribute} and next; - Qt::_internal::installattribute($caller, $attribute); + TQt::_internal::installattribute($caller, $attribute); ${ ${$caller . '::META'}{'attributes'} }{$attribute} = 1; } } diff --git a/PerlQt/lib/Qt/constants.pm b/PerlQt/lib/Qt/constants.pm index 9c7081c..5bdeed0 100644 --- a/PerlQt/lib/Qt/constants.pm +++ b/PerlQt/lib/Qt/constants.pm @@ -1,4 +1,4 @@ -package Qt::constants; +package TQt::constants; require Exporter; diff --git a/PerlQt/lib/Qt/debug.pm b/PerlQt/lib/Qt/debug.pm index 28c0a43..a0f4e19 100644 --- a/PerlQt/lib/Qt/debug.pm +++ b/PerlQt/lib/Qt/debug.pm @@ -1,5 +1,5 @@ -package Qt::debug; -use Qt; +package TQt::debug; +use TQt; our %channel = ( 'ambiguous' => 0x01, @@ -23,14 +23,14 @@ sub import { $usage++; } } - Qt::_internal::setDebug($db); + TQt::_internal::setDebug($db); print "Available channels: \n\t". join("\n\t", sort keys %channel). "\n" if $usage; } sub unimport { - Qt::_internal::setDebug(0); + TQt::_internal::setDebug(0); } 1;
\ No newline at end of file diff --git a/PerlQt/lib/Qt/enumerations.pm b/PerlQt/lib/Qt/enumerations.pm index 003b65b..9fea98f 100644 --- a/PerlQt/lib/Qt/enumerations.pm +++ b/PerlQt/lib/Qt/enumerations.pm @@ -1,15 +1,15 @@ -package Qt::enumerations; +package TQt::enumerations; # # Proposed usage: # # package MyWidget; # -# use Qt::enumerations MyInfo => { +# use TQt::enumerations MyInfo => { # Foo => 1, # Bar => 10, # Baz => 64 # }; # -# use Qt::enumerations MyInfo => [qw(Foo Bar Baz)]; +# use TQt::enumerations MyInfo => [qw(Foo Bar Baz)]; # 1; diff --git a/PerlQt/lib/Qt/isa.pm b/PerlQt/lib/Qt/isa.pm index fb4b646..71e9391 100644 --- a/PerlQt/lib/Qt/isa.pm +++ b/PerlQt/lib/Qt/isa.pm @@ -1,4 +1,4 @@ -package Qt::isa; +package TQt::isa; use strict; sub import { @@ -10,12 +10,12 @@ sub import { my $pm = $caller . ".pm"; $pm =~ s!::!/!g; unless(exists $::INC{$pm}) { - $::INC{$pm} = $::INC{"Qt/isa.pm"}; + $::INC{$pm} = $::INC{"TQt/isa.pm"}; } for my $super (@_) { push @{ $caller . '::ISA' }, $super; - push @{ ${$caller . '::META'}{'superClass'} }, $super; # if isa(QObject)? + push @{ ${$caller . '::META'}{'superClass'} }, $super; # if isa(TQObject)? } *{ $caller . '::className' } = sub { # closure on $caller @@ -23,10 +23,10 @@ sub import { }; ${ $caller. '::_INTERNAL_STATIC_'}{'SUPER'} = bless {}, " $caller"; - Qt::_internal::installsuper($caller) unless defined &{ $caller.'::SUPER' }; + TQt::_internal::installsuper($caller) unless defined &{ $caller.'::SUPER' }; *{ $caller . '::metaObject' } = sub { - Qt::_internal::getMetaObject($caller); + TQt::_internal::getMetaObject($caller); }; *{ $caller . '::import' } = sub { @@ -53,18 +53,18 @@ sub import { { if(! defined &{$incaller.'::'.$attribute }) { - Qt::_internal::installattribute($incaller, $attribute); + TQt::_internal::installattribute($incaller, $attribute); ${ ${$incaller .'::META'}{'attributes'} }{$attribute} = 1; } } } }; - Qt::_internal::installautoload(" $caller"); - Qt::_internal::installautoload(" $caller"); - Qt::_internal::installautoload($caller); + TQt::_internal::installautoload(" $caller"); + TQt::_internal::installautoload(" $caller"); + TQt::_internal::installautoload($caller); { - package Qt::AutoLoad; + package TQt::AutoLoad; my $autosub = \&{ " $caller\::_UTOLOAD" }; *{ " $caller\::AUTOLOAD" } = sub { &$autosub }; $autosub = \&{ " $caller\::_UTOLOAD" }; @@ -72,10 +72,10 @@ sub import { $autosub = \&{ "$caller\::_UTOLOAD" }; *{ "$caller\::AUTOLOAD" } = sub { &$autosub }; } - Qt::_internal::installthis($caller); + TQt::_internal::installthis($caller); # operator overloading - *{ " $caller\::ISA" } = ["Qt::base::_overload"]; + *{ " $caller\::ISA" } = ["TQt::base::_overload"]; } 1; diff --git a/PerlQt/lib/Qt/properties.pm b/PerlQt/lib/Qt/properties.pm index 5dfcdb7..951cdb6 100644 --- a/PerlQt/lib/Qt/properties.pm +++ b/PerlQt/lib/Qt/properties.pm @@ -1,8 +1,8 @@ -package Qt::properties; +package TQt::properties; # # Proposed usage: # -# use Qt::properties foo => { +# use TQt::properties foo => { # TYPE => 'bool', # READ => 'getFoo', # WRITE => 'setFoo', diff --git a/PerlQt/lib/Qt/signals.pm b/PerlQt/lib/Qt/signals.pm index 00aa061..1f454c1 100644 --- a/PerlQt/lib/Qt/signals.pm +++ b/PerlQt/lib/Qt/signals.pm @@ -1,11 +1,11 @@ -package Qt::signals; +package TQt::signals; use Carp; # # Proposed usage: # -# use Qt::signals fooActivated => ['int']; +# use TQt::signals fooActivated => ['int']; # -# use Qt::signals fooActivated => { +# use TQt::signals fooActivated => { # name => 'fooActivated(int)', # args => ['int'] # }; @@ -16,21 +16,21 @@ use Carp; sub import { no strict 'refs'; my $self = shift; - my $caller = $self eq "Qt::signals" ? (caller)[0] : $self; + my $caller = $self eq "TQt::signals" ? (caller)[0] : $self; my $parent = ${ $caller . '::ISA' }[0]; my $parent_qt_emit = $parent . '::qt_emit'; - Qt::_internal::installqt_invoke($caller . '::qt_emit') unless defined &{ $caller. '::qt_emit' }; + TQt::_internal::installqt_invoke($caller . '::qt_emit') unless defined &{ $caller. '::qt_emit' }; # *{ $caller . '::qt_emit' } = sub { # my $meta = \%{ $caller . '::META' }; # die unless $meta->{object}; # my $offset = $_[0] - $meta->{object}->signalOffset; # if($offset >= 0) { -# Qt::_internal::invoke(Qt::this(), $meta->{signals}[$offset], $_[1]); +# TQt::_internal::invoke(TQt::this(), $meta->{signals}[$offset], $_[1]); # return 1; # } else { -# Qt::this()->$parent_qt_emit(@_); +# TQt::this()->$parent_qt_emit(@_); # } # } unless defined &{ $caller . '::qt_emit' }; @@ -49,17 +49,17 @@ sub import { my $signal_index = $#{ $meta->{signals} }; my $argcnt = scalar @$args; - my $mocargs = Qt::_internal::allocateMocArguments($argcnt); + my $mocargs = TQt::_internal::allocateMocArguments($argcnt); my $i = 0; for my $arg (@$args) { my $a = $arg; $a =~ s/^const\s+//; - if($a =~ /^(bool|int|double|char\*|QString)&?$/) { + if($a =~ /^(bool|int|double|char\*|TQString)&?$/) { $a = $1; } else { $a = 'ptr'; } - my $valid = Qt::_internal::setMocType($mocargs, $i, $arg, $a); + my $valid = TQt::_internal::setMocType($mocargs, $i, $arg, $a); die "Invalid type for signal argument ($arg)\n" unless $valid; $i++; } @@ -69,7 +69,7 @@ sub import { $signal->{mocargs} = $mocargs; $signal->{argcnt} = $argcnt; - Qt::_internal::installsignal("$caller\::$signalname"); + TQt::_internal::installsignal("$caller\::$signalname"); } @_ and $meta->{changed} = 1; } diff --git a/PerlQt/lib/Qt/slots.pm b/PerlQt/lib/Qt/slots.pm index 5d1daf6..c12990e 100644 --- a/PerlQt/lib/Qt/slots.pm +++ b/PerlQt/lib/Qt/slots.pm @@ -1,11 +1,11 @@ -package Qt::slots; +package TQt::slots; use Carp; # # Proposed usage: # -# use Qt::slots changeSomething => ['int']; +# use TQt::slots changeSomething => ['int']; # -# use Qt::slots 'changeSomething(int)' => { +# use TQt::slots 'changeSomething(int)' => { # args => ['int'], # call => 'changeSomething' # }; @@ -14,21 +14,21 @@ use Carp; sub import { no strict 'refs'; my $self = shift; - my $caller = $self eq "Qt::slots" ? (caller)[0] : $self; + my $caller = $self eq "TQt::slots" ? (caller)[0] : $self; my $parent = ${ $caller . '::ISA' }[0]; my $parent_qt_invoke = $parent . '::qt_invoke'; - Qt::_internal::installqt_invoke($caller . '::qt_invoke') unless defined &{ $caller. '::qt_invoke' }; + TQt::_internal::installqt_invoke($caller . '::qt_invoke') unless defined &{ $caller. '::qt_invoke' }; # *{ $caller . '::qt_invoke' } = sub { # my $meta = \%{ $caller . '::META' }; # die unless $meta->{object}; # my $offset = $_[0] - $meta->{object}->slotOffset; # if($offset >= 0) { -# Qt::_internal::invoke(Qt::this(), $meta->{slots}[$offset], $_[1]); +# TQt::_internal::invoke(TQt::this(), $meta->{slots}[$offset], $_[1]); # return 1; # } else { -# Qt::this()->$parent_qt_invoke(@_); +# TQt::this()->$parent_qt_invoke(@_); # } # } unless defined &{ $caller . '::qt_invoke' }; @@ -58,17 +58,17 @@ sub import { my $slot_index = $#{ $meta->{slots} }; my $argcnt = scalar @$args; - my $mocargs = Qt::_internal::allocateMocArguments($argcnt); + my $mocargs = TQt::_internal::allocateMocArguments($argcnt); my $i = 0; for my $arg (@$args) { my $a = $arg; $a =~ s/^const\s+//; - if($a =~ /^(bool|int|double|char\*|QString)&?$/) { + if($a =~ /^(bool|int|double|char\*|TQString)&?$/) { $a = $1; } else { $a = 'ptr'; } - my $valid = Qt::_internal::setMocType($mocargs, $i, $arg, $a); + my $valid = TQt::_internal::setMocType($mocargs, $i, $arg, $a); die "Invalid type for slot argument ($arg)\n" unless $valid; $i++; } diff --git a/PerlQt/perlqt.h b/PerlQt/perlqt.h index e4a2c33..7eb240a 100644 --- a/PerlQt/perlqt.h +++ b/PerlQt/perlqt.h @@ -1,5 +1,5 @@ -#ifndef PERLQT_H -#define PERLQT_H +#ifndef PERLTQT_H +#define PERLTQT_H #include "marshall.h" @@ -19,9 +19,9 @@ extern int do_debug; // evil extern SV *sv_qapp; extern int object_count; -// keep this enum in sync with lib/Qt/debug.pm +// keep this enum in sync with lib/TQt/debug.pm -enum QtDebugChannel { +enum TQtDebugChannel { qtdb_none = 0x00, qtdb_ambiguous = 0x01, qtdb_autoload = 0x02, @@ -51,4 +51,4 @@ inline smokeperl_object *sv_obj_info(SV *sv) { // ptr on success, null on fail return o; } -#endif // PERLQT_H +#endif // PERLTQT_H diff --git a/PerlQt/smokeperl.cpp b/PerlQt/smokeperl.cpp index 12b6700..1998c85 100644 --- a/PerlQt/smokeperl.cpp +++ b/PerlQt/smokeperl.cpp @@ -1,9 +1,9 @@ #include "smokeperl.h" -class SmokePerlQt : public SmokePerl { +class SmokePerlTQt : public SmokePerl { public: - SmokePerlQt(); - virtual ~SmokePerlQt(); + SmokePerlTQt(); + virtual ~SmokePerlTQt(); void registerSmoke(const char *name, Smoke *smoke); Smoke *getSmoke(const char *name); @@ -41,11 +41,11 @@ private: } HV *package(const SmokeClass &c) { - // for now, we cheat on the class names by assuming they're all Qt:: - if(!strcmp(c.className(), "Qt")) + // for now, we cheat on the class names by assuming they're all TQt:: + if(!strcmp(c.className(), "TQt")) return gv_stashpv(c.className(), TRUE); - SV *name = newSVpv("Qt::", 0); + SV *name = newSVpv("TQt::", 0); sv_catpv(name, c.className() + 1); HV *stash = gv_stashpv(SvPV_nolen(name), TRUE); SvREFCNT_dec(name); @@ -257,10 +257,10 @@ public: bool cleanup() { return true; } }; -class SmokeBindingQt : public SmokeBinding { - SmokePerlQt *_smokeperl; +class SmokeBindingTQt : public SmokeBinding { + SmokePerlTQt *_smokeperl; public: - SmokeBindingQt(Smoke *s, SmokePerlQt *smokeperl) : + SmokeBindingTQt(Smoke *s, SmokePerlTQt *smokeperl) : SmokeBinding(s), _smokeperl(smokeperl) {} void deleted(Smoke::Index classId, void *ptr) { if(do_debug) printf("%p->~%s()\n", ptr, smoke->className(classId)); @@ -305,46 +305,46 @@ public: char *className(Smoke::Index classId) { const char *className = smoke->className(classId); char *buf = new char[strlen(className) + 6]; - strcpy(buf, " Qt::"); + strcpy(buf, " TQt::"); strcat(buf, className + 1); return buf; } }; -SmokePerlQt::SmokePerlQt() { +SmokePerlTQt::SmokePerlTQt() { _registered_smoke = newHV(); _registered_handlers = newHV(); _remembered_pointers = newHV(); } -SmokePerlQt::~SmokePerlQt() { +SmokePerlTQt::~SmokePerlTQt() { SvREFCNT_dec((SV*)_registered_smoke); SvREFCNT_dec((SV*)_registered_handlers); SvREFCNT_dec((SV*)_remembered_pointers); } -void SmokePerlQt::registerSmoke(const char *name, Smoke *smoke) { +void SmokePerlTQt::registerSmoke(const char *name, Smoke *smoke) { hv_store(_registered_smoke, name, strlen(name), newSViv((IV)smoke), 0); // This will also need to handle the per-class initialization - smoke->binding = new SmokeBindingQt(smoke, this); + smoke->binding = new SmokeBindingTQt(smoke, this); } -Smoke *SmokePerlQt::getSmoke(const char *name) { +Smoke *SmokePerlTQt::getSmoke(const char *name) { SV **svp = hv_fetch(_registered_smoke, name, strlen(name), 0); if(svp && SvOK(*svp)) return (Smoke*)SvIV(*svp); return 0; } -void SmokePerlQt::registerHandlers(TypeHandler *h) { +void SmokePerlTQt::registerHandlers(TypeHandler *h) { while(h->name) { hv_store(_registered_handlers, h->name, strlen(h->name), newSViv((IV)h->fn), 0); h++; } } -SmokeObject SmokePerlQt::createObject(void *p, const SmokeClass &c) { +SmokeObject SmokePerlTQt::createObject(void *p, const SmokeClass &c) { HV *hv = newHV(); SV *obj = newRV_noinc((SV*)hv); @@ -364,7 +364,7 @@ SmokeObject SmokePerlQt::createObject(void *p, const SmokeClass &c) { return o; } -SmokeObject SmokePerlQt::newObject(void *p, const SmokeClass &c) { +SmokeObject SmokePerlTQt::newObject(void *p, const SmokeClass &c) { SmokeObject o = createObject(p, c); if(c.isVirtual()) @@ -374,12 +374,12 @@ SmokeObject SmokePerlQt::newObject(void *p, const SmokeClass &c) { return o; } -SmokeObject SmokePerlQt::wrapObject(void *p, const SmokeClass &c) { +SmokeObject SmokePerlTQt::wrapObject(void *p, const SmokeClass &c) { SmokeObject o = createObject(p, c); return o; } -void SmokePerlQt::rememberPointer(SmokeObject &o, const SmokeClass &c, bool remember, void *lastptr) { +void SmokePerlTQt::rememberPointer(SmokeObject &o, const SmokeClass &c, bool remember, void *lastptr) { void *ptr = o.cast(c); if(ptr != lastptr) { SV *keysv = newSViv((IV)o.ptr()); @@ -400,21 +400,21 @@ void SmokePerlQt::rememberPointer(SmokeObject &o, const SmokeClass &c, bool reme rememberPointer(o, SmokeClass(c.smoke(), *i), remember, ptr); } -void SmokePerlQt::rememberPointer(SmokeObject &o) { +void SmokePerlTQt::rememberPointer(SmokeObject &o) { rememberPointer(o, o.c(), true); } -void SmokePerlQt::forgetPointer(SmokeObject &o) { +void SmokePerlTQt::forgetPointer(SmokeObject &o) { rememberPointer(o, o.c(), false); } -SmokeObject SmokePerlQt::getObject(SV *sv) { +SmokeObject SmokePerlTQt::getObject(SV *sv) { MAGIC *mg = mg_find(SvRV(sv), '~'); Smoke_MAGIC *m = (Smoke_MAGIC*)mg->mg_ptr; return SmokeObject(sv, m); } -SmokeObject SmokePerlQt::getObject(void *p) { +SmokeObject SmokePerlTQt::getObject(void *p) { SV *keysv = newSViv((IV)p); STRLEN klen; char *key = SvPV(keysv, klen); 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; 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); |