From 4e997a9c6e25689dca65a2ec573a599699ef8170 Mon Sep 17 00:00:00 2001
From: Timothy Pearson
Germain Garand This document describes a set of Perl bindings for the Qt toolkit. Contact
+ This document describes a set of Perl bindings for the TQt toolkit. Contact
the author at <germain@ebooksfrance.com>
PerlQt-3 is Ashley Winters' full featured object oriented interface to
-Trolltech's C++ Qt toolkit v3.0. PerlTQt-3 is Ashley Winters' full featured object oriented interface to
+Trolltech's C++ TQt toolkit v3.0. It is based on the
SMOKE
-library, a language independent low-level wrapper generated from Qt headers by
+library, a language independent low-level wrapper generated from TQt headers by
Richard Dale's
kalyptus
thanks to David Faure's module. This document describes the principles of PerlQt programming.
+ This document describes the principles of PerlTQt programming.
It assumes you have some basic Perl Object Oriented programming knowledge. Some C++ knowledge is recommended but not required.
-It would mostly help you to find your way through Qt's excellent documentation which is our
+It would mostly help you to find your way through TQt's excellent documentation which is our
ultimate and only reference.
-If Qt is installed on your system, then you most probably
-also have its documentation. Try the
-
@@ -21,10 +21,10 @@
-
-
Programming PerlQt
+Programming PerlTQt
Introduction
-$QTDIR/bin/assistant program.$TQTDIR/bin/assistant program.
$QTDIR/bin/assistant program.<
To compile and use PerlQt, you'll need :
+To compile and use PerlTQt, you'll need :
Perl and Qt's installation is out of the scope of this document. Please refer +
Perl and TQt's installation is out of the scope of this document. Please refer to those projects' documentation.
PerlQt uses GNU's Autoconf framework. However, the standard ./configure script is preferably driven +
PerlTQt uses GNU's Autoconf framework. However, the standard ./configure script is preferably driven by the Makefile.PL wrapper. All options are forwarded to ./configure :
perl Makefile.PL@@ -140,7 +140,7 @@ Then : make
make install-
This will install PerlQt, Puic and Smoke (if needed), as well as the pqtsh and pqtapi utilities.
+This will install PerlTQt, Puic and Smoke (if needed), as well as the pqtsh and pqtapi utilities.
The preferred install location for SMOKE and Puic is in the KDE3 file system.
If you don't have KDE3 installed, specify a location with configure's
--prefix option. e.g:
configure
If Smoke's linking fails or your Qt library was built with very specific +
If Smoke's linking fails or your TQt library was built with very specific options, run Makefile.PL again with:
perl Makefile.PL --with-threshold=0
When building smoke, configure will check for OpenGL and try to compile -support for it if it is properly installed and supported by Qt.
+support for it if it is properly installed and supported by TQt.You may disable this checking with:
--disable-GL@@ -166,8 +166,8 @@ it, specify: --without-Mesa
-
To install PerlQt without super-user rights, simply follow this procedure:
+To install PerlTQt without super-user rights, simply follow this procedure:
- cd PerlQt + cd PerlTQt perl Makefile.PL PREFIX=~ cd ..-
Beware : this is not the same Makefile.PL as above, but the one located in the ./PerlQt +
Beware : this is not the same Makefile.PL as above, but the one located in the ./PerlTQt subdirectory
@@ -200,8 +200,8 @@ This can be done either on the command line:
A typical Qt program using GUI components is based on an event loop.
+A typical TQt program using GUI components is based on an event loop.
This basically means that such a program is no more envisioned as a straight flow where you would need to handle yourself every single events (such as a mouse click or a key press).
@@ -210,29 +210,29 @@ uses, define what objects methods need to be called when an event occurs, and then start the main event loop.That's all! -Qt will handle all events and dispatch them to the correct subroutine.
-Lets see how this process is implemented in a minimal PerlQt program.
+TQt will handle all events and dispatch them to the correct subroutine. +Lets see how this process is implemented in a minimal PerlTQt program.
- 1: use Qt;
- 2: my $a = Qt::Application(\@ARGV);
- 3: my $hello = Qt::PushButton("Hello World!", undef);
+ 1: use TQt;
+ 2: my $a = TQt::Application(\@ARGV);
+ 3: my $hello = TQt::PushButton("Hello World!", undef);
4: $hello->resize(160, 25);
5: $a->setMainWidget($hello);
6: $hello->show;
7: exit $a->exec;

This program first loads the Qt interface [line 1] and creates the application +

This program first loads the TQt interface [line 1] and creates the application
object, passing it a reference to the command line arguments array @ARGV
[l.2].
This application object is unique, and may later be accessed from
-anywhere through the Qt::app() pointer.
At line 3, we create a PushButton, which has no parent (i.e : it won't be contained nor owned by another widget). Therefore, we pass to the constructor an undef value for the parent argument, -which is PerlQt's way of passing a Null pointer.
+which is PerlTQt's way of passing a Null pointer.After some layouting at [l.4], we tell the application object that our main widget is this PushButton [l.5]... that way, it will know that closing the window associated with this widget means : quit the application.
@@ -242,39 +242,39 @@ to start the application loop [l.7].Syntax elements summary :
You don't need to say new Qt::Foo or Qt::Foo->new() as most Perl
+
You don't need to say new TQt::Foo or TQt::Foo->new() as most Perl
programmers would have expected.
Instead, you just say :
- my $object = Qt::<classname>(arg_1, ..., arg_n);+ my $object = TQt::<classname>(arg_1, ..., arg_n);
If you don't need to pass any argument to the constructor, simply say :
- my $object = Qt::<classname>;+ my $object = TQt::<classname>; Whenever you need to pass a Null pointer as an argument, use Perl's undef keyword. Do not pass zero. - Beware: this is by far the most common error in PerlQt programs. + Beware: this is by far the most common error in PerlTQt programs.
Pointers are arguments preceded by an *
-character in Qt's documentation (e.g: ``QWidget * widget'').
TQWidget * widget'').
Before we can discuss how Perl subroutines can be called back from Qt, we need -to introduce PerlQt's inheritance mechanism.
-PerlQt was designed to couple as tightly as possible Qt's simplicity and Perl's +
Before we can discuss how Perl subroutines can be called back from TQt, we need +to introduce PerlTQt's inheritance mechanism.
+PerlTQt was designed to couple as tightly as possible TQt's simplicity and Perl's power and flexibility.
In order to achieve that goal, the classical Object Oriented Perl paradigm had -to be extended, much in the same way than Qt itself +to be extended, much in the same way than TQt itself had to extend C++'s paradigm with metaobjects.
@@ -285,8 +285,8 @@ of PushButton: 1: use strict; 2: 3: package Button; - 4: use Qt; - 5: use Qt::isa qw(Qt::PushButton); + 4: use TQt; + 5: use TQt::isa qw(TQt::PushButton); 6: 7: sub NEW 8: { @@ -298,25 +298,25 @@ of PushButton: 14: 15: package main; 16: - 17: use Qt; + 17: use TQt; 18: use Button; 19: - 20: my $a = Qt::Application(\@ARGV); + 20: my $a = TQt::Application(\@ARGV); 21: my $w = Button("Hello World!", undef); 22: $a->setMainWidget($w); 23: $w->show; 24: exit $a->exec;
Here, we want to create our own version of the PushButton widget. -Therefore, we create a new package for it [l.3] and import Qt [l.4].
+Therefore, we create a new package for it [l.3] and import TQt [l.4].We now want to declare our widget as subclassing PushButton.
-This is done through the use of the Qt::isa pragma [l.5], which accepts a
-list of one or more parent Qt classes.
TQt::isa pragma [l.5], which accepts a
+list of one or more parent TQt classes.
It is now time to create a constructor for our new widget. This is done by creating a subroutine called NEW (note the capitalized -form, which differentate it from the usual ``new'' constructor. PerlQt's NEW +form, which differentate it from the usual ``new'' constructor. PerlTQt's NEW constructor is called implicitly as can be seen on line 21).
Since we want our widget to call its parent's constructor first, we call the -superclass's constructor (here: Qt::PushButton) on line 9, passing it all +superclass's constructor (here: TQt::PushButton) on line 9, passing it all arguments we received.
At this time, a class instance has been created and stored into a special
object holder named this (not $this but really just this).
method() or this->method();
When building a new composite widget, you may just create its different parts inside my variables, since widgets are only deleted by their parents and not necessarily when their container goes out of scope.
-In other words, PerlQt performs clever reference counting to prevent +
In other words, PerlTQt performs clever reference counting to prevent indesirable deletion of objects.
Now, you'll often want to keep an access to those parts from anywhere inside your package. @@ -337,15 +337,15 @@ but that isn't really convenient and you don't have any compile time checking...
Here come Attributes. Attributes are data holders where you can store any kind of properties for your object.
-Declaring new attributes is done through the use Qt::attributes pragma, as is
+
Declaring new attributes is done through the use TQt::attributes pragma, as is
demonstrated in the following package implementation :
1: use strict;
2:
3: package Button;
- 4: use Qt;
- 5: use Qt::isa qw(Qt::PushButton);
- 6: use Qt::attributes qw(
+ 4: use TQt;
+ 5: use TQt::isa qw(TQt::PushButton);
+ 6: use TQt::attributes qw(
7: itsTime
8: pData
9: );
@@ -353,7 +353,7 @@ demonstrated in the following package implementation :
11: sub NEW
12: {
13: shift->SUPER::NEW(@_[0..2]);
- 14: itsTime = Qt::Time;
+ 14: itsTime = TQt::Time;
15: itsTime->start;
16: pData = " Foo ";
17: }
@@ -366,7 +366,7 @@ demonstrated in the following package implementation :
24:
25: 1;

An attribute itsTime is declared at line 7, and loaded with a Qt::Time object
+

An attribute itsTime is declared at line 7, and loaded with a TQt::Time object
at line 14.
Since we reimplement the virtual function ``resizeEvent'' [l.19]. each time the main widget is resized, this function will be triggered and @@ -375,13 +375,13 @@ attributes we defined [l.22].
Recapitulation
use Qt::isa pragma.
+In order to inherit a TQt class, a package must contain a
+use TQt::isa pragma.
e.g:
- use Qt::isa "Qt::widget";+ use TQt::isa "TQt::widget"; The object constructor is named NEW and is implicitly called. @@ -432,7 +432,7 @@ you'd use the specal attribute SUPER : Whenever you need to store a contained object in your package, you may define it as an Attribute :
- use Qt::attributes qw(
+ use TQt::attributes qw(
firstAttribute
...
lastAttribute);
@@ -444,18 +444,18 @@ as an Attribute :
To reimplement a virtual function, simply create a sub with the
same name in your object.
-Existing virtual functions are marked as such in Qt's documentation +
Existing virtual functions are marked as such in TQt's documentation (they are prefixed with the ``virtual'' keyword).
-You can inspect what virtual function names are being called by Qt at runtime by
-putting a use Qt::debug qw( virtual ) statement at the top of your program.
You can inspect what virtual function names are being called by TQt at runtime by
+putting a use TQt::debug qw( virtual ) statement at the top of your program.
We'll now learn how Qt objects can communicate with each other, +
We'll now learn how TQt objects can communicate with each other, allowing an event occuring, for instance, in a given widget to trigger the execution of one or several subroutines anywhere inside your program.
-Most other toolkits use callbacks for that purpose, but Qt has a much more +
Most other toolkits use callbacks for that purpose, but TQt has a much more powerful and flexible mechanism called Signals and Slots.
Signals and slots are used for communication between objects.
This can be thought off as something similar to the wiring between several Hi-fI @@ -464,18 +464,18 @@ emitted wether a listening device is connected to them or not. Also, a tape recorder deck can start to record when it receives a signal wired to it's input slot, and it doesn't need to know that this signal is also received by a CD recorder device, or listened through headphones.
-A Qt component behaves just like that. It has several output Signals and +
A TQt component behaves just like that. It has several output Signals and several input Slots - and each signal can be connected to an unlimited number of listening slots of the same type, wether they are inside or outside the component.
The general syntax of this connection process is either :
-Qt::Object::connect( sender, SIGNAL 'mysignal(arg_type)', -receiver, SLOT 'myslot(arg_type)');
+TQt::Object::connect( sender, TQT_SIGNAL 'mysignal(arg_type)', +receiver, TQT_SLOT 'myslot(arg_type)');
or
-myObject->connect( sender, SIGNAL 'mysignal(arg_type)', SLOT +
myObject->connect( sender, TQT_SIGNAL 'mysignal(arg_type)', TQT_SLOT 'myslot(arg_type)');
This mechanism can be extended at will by the declaration of custom Signals and
-Slots, through the use Qt::signals and use Qt::slots pragma
+Slots, through the use TQt::signals and use TQt::slots pragma
(see also the other syntax, later on).
Each declared slot will call the corresponding subroutine in your object, each declared signal can be raised through the emit keyword.
@@ -484,22 +484,22 @@ each declared signal can be raised through the emit keyword.emit keyword.In this package, we define two extra slots and one extra signal.
-We know from the Qt Documentation that a clicked PushButton emits a clicked()
+
We know from the TQt Documentation that a clicked PushButton emits a clicked()
signal, so we connect it to our new slot at line 18.
We also connect our signal changeIt to our own change slot- which is
quite stupid, but as an example.
wasClicked() slot. wasClicked then proceeds to emit
the changeIt(int,int) signal [l.27], hence triggering the change(int,int)
slot with two arguments.
-Finally, since PerlQt-3.008, an alternative syntax can be used to declare Signals and Slots:
+Finally, since PerlTQt-3.008, an alternative syntax can be used to declare Signals and Slots:
- sub a_slot : SLOT(int, QString)
+ sub a_slot : TQT_SLOT(int, TQString)
{
$int = shift;
$string = shift;
@@ -536,40 +536,40 @@ slot with two arguments.
}
and
- sub a_signal : SIGNAL(QString);+ sub a_signal : TQT_SIGNAL(TQString);
This syntax is perfectly compatible with the traditional
-use Qt::signals and use Qt::slots declarations.
use TQt::signals and use TQt::slots declarations.
Eventually, it can prove good programming practice to mix both syntaxes, by first declaring
-Signals/Slots with use Qt::slots/signals, then repeat this declaration
+Signals/Slots with use TQt::slots/signals, then repeat this declaration
in the actual implementation with the second syntax.
Declarations will be checked for consistency at compile time, and any mismatch in arguments would trigger a warning.
As efficient and intuitive as Qt can be, building a complete GUI from scratch +
As efficient and intuitive as TQt can be, building a complete GUI from scratch is often a tedious task.
-Hopefully, Qt comes with a very sophisticated GUI Builder named Qt +
Hopefully, TQt comes with a very sophisticated GUI Builder named TQt Designer, which is close to a complete integrated development environment. It features Project management, drag'n drop GUI building, a complete object browser, graphical interconnection of signals and slots, and much much more.
-Qt Designer's output is XML which can be parsed by several command line tools, -among whose is puic (the PerlQt User Interface Compiler).
+TQt Designer's output is XML which can be parsed by several command line tools, +among whose is puic (the PerlTQt User Interface Compiler).
Assuming you have already built an interface file with the Designer, -translating it to a PerlQt program is simply a matter of issuing +translating it to a PerlTQt program is simply a matter of issuing one command :
puic -x -o program.pl program.ui@@ -589,7 +589,7 @@ program.
puic -o Collection.pm -embed unique_identifier image-1 ... image-n
Then add a use Collection.pm statement to your program's main package.
If you've created a project file in Qt Designer, and added all images +
If you've created a project file in TQt Designer, and added all images you want to group (through ``Project->Image Collection''), you'll find all those images inside the directory where your project file (*.pro) is stored, under /images. @@ -619,7 +619,7 @@ up doing lot of copy-paste.
PerlQt comes bundled with two simple programs that can help you to find your way through -the Qt API:
+PerlTQt comes bundled with two simple programs that can help you to find your way through +the TQt API:
e.g:
$>pqtapi -ir 'setpoint.* int' - void QCanvasLine::setPoints(int, int, int, int) - void QPointArray::setPoint(uint, int, int)+ void TQCanvasLine::setPoints(int, int, int, int) + void TQPointArray::setPoint(uint, int, int)
Help-&g
Credits
-PerlQt-3 is (c) 2002 Ashley Winters (and (c) 2003 Germain Garand)
+PerlTQt-3 is (c) 2002 Ashley Winters (and (c) 2003 Germain Garand)
Kalyptus and the Smoke generation engine are (c) David Faure and Richard Dale
Puic is (c) TrollTech AS., Phil Thompson and Germain Garand,
The mentioned software is released under the GNU Public Licence v.2 or later.
@@ -724,31 +724,31 @@ It is fairly self explanatory and includes an interactive example (Help-&g
Appendix 1 : C++ conventions and their Perl counterpart
-Whenever you want to use a class/method described in Qt's
-documentation (see also the 'assistant' program bundled with Qt)
-from PerlQt, you need to follow some simple translation rules.
+Whenever you want to use a class/method described in TQt's
+documentation (see also the 'assistant' program bundled with TQt)
+from PerlTQt, you need to follow some simple translation rules.
- Classnames
-All classnames are changed from a Q prefix in Qt to a Qt:: prefix
+All classnames are changed from a Q prefix in TQt to a TQt:: prefix
in Perl.
-e.g: QComboBox is named Qt::ComboBox within PerlQt.
+e.g: TQComboBox is named TQt::ComboBox within PerlTQt.
- Functions
Functions referenced as static are accessed directly, and not through
-an object. Thus the static function Foo in class QBar would be accessed from
-PerlQt as
+an object. Thus the static function Foo in class TQBar would be accessed from
+PerlTQt as
- Qt::Bar::Foo( arg-1,...,arg-n);
+ TQt::Bar::Foo( arg-1,...,arg-n);
The only notable exceptions are :
- qApp() will map to Qt::app()
- qVersion() will map to Qt::version() # not really needed anymore: we have qVersion(). See Global Functions below.
+ qApp() will map to TQt::app()
+ qVersion() will map to TQt::version() # not really needed anymore: we have qVersion(). See Global Functions below.
Functions referenced as members or Signals are accessed through an object
@@ -756,7 +756,7 @@ with the -> operator.
e.g:
$widget->show;
-There are no fundamental differences between methods and signals, however PerlQt
+
There are no fundamental differences between methods and signals, however PerlTQt
provides the emit keyword as a convenient mnemonic, so that it is clear you
are emitting a signal :
@@ -768,14 +768,14 @@ are emitting a signal :
By value
When an argument isn't preceded by the & or * character, it is passed by
-value. For all basic types such as int, char, float and double, PerlQt will
+value. For all basic types such as int, char, float and double, PerlTQt will
automatically convert litteral and scalar values to the corresponding C++ type.
Thus for a constructor prototype written as follow in the documentation :
- QSize ( int w, int h )
+ TQSize ( int w, int h )
You'd say :
- Qt::Size(8, 12);
+ TQt::Size(8, 12);
By reference
@@ -783,12 +783,12 @@ When an argument is preceded by the & character, it means a
object or to a type is expected. You may either provide a variable name or a
temporary object :
- $keyseq = Qt::keySequence( &Qt::CTRL + &Qt::F3 );
+ $keyseq = TQt::keySequence( &TQt::CTRL + &TQt::F3 );
$widget->setAccel( $keyseq );
or
- $widget->setAccel(Qt::keySequence( &Qt::CTRL + &Qt::F3 );
+ $widget->setAccel(TQt::keySequence( &TQt::CTRL + &TQt::F3 );
If the argument isn't qualified as const (constant), it means the passed
object may be altered during the process - you must then provide a variable.
@@ -819,7 +819,7 @@ remember otherwise.
and 2).
-Access to enumerations values in Perl Qt is very similar to a static function
+
Access to enumerations values in Perl TQt is very similar to a static function
call. In fact, it is a static function call.
@@ -830,22 +830,22 @@ recommend the use of the alternate function call syntax : &functionLets now go back to our Strange example.
-If its definition was encountered in the class QFruits, you'd write from
-PerlQt :
+If its definition was encountered in the class TQFruits, you'd write from
+PerlTQt :
- $apple_plus_orange = &Qt::Fruit::Apple + &Qt::Fruit::Orange;
+ $apple_plus_orange = &TQt::Fruit::Apple + &TQt::Fruit::Orange;
Operators
-Within PerlQt, operators overloading works transparently.
-If a given operator is overloaded in a Qt class (which means using it triggers a custom method)
-it will behave identically in PerlQt.
+Within PerlTQt, operators overloading works transparently.
+If a given operator is overloaded in a TQt class (which means using it triggers a custom method)
+it will behave identically in PerlTQt.
Beware though that due to limitations of the Smoke binding library, not all overloaded operators are
-available in PerlQt.
+available in PerlTQt.
You can check the availability of a given operator by using the pqtapi program.
Also, due to outstanding differences between C++'s and Perl's object paradigm, the copy constructor operator (a.k.a '=')
has been disabled.
@@ -855,62 +855,62 @@ has been disabled.
- $p1 = Qt::Point(10, 10)
- $p2 = Qt::Point(30,40)
+ $p1 = TQt::Point(10, 10)
+ $p2 = TQt::Point(30,40)
$p2 += $p1; # $p2 becomes (40,50)
e.g-2: '<<' overload
- $f = Qt::File("example");
+ $f = TQt::File("example");
$f->open( IO_WriteOnly ); # see 'Constants' below
- $s = Qt::TextStream( $f );
+ $s = TQt::TextStream( $f );
$s << "What can I do with " << 12 << " apples?";
Constants
-Qt doesn't use many constants, but there is at least one place where they are used : for setting
+TQt doesn't use many constants, but there is at least one place where they are used : for setting
Input/Output flags on files.
-In order to avoid the namespace pollution induced by global constants, PerlQt group them in the Qt::constants module.
+In order to avoid the namespace pollution induced by global constants, PerlTQt group them in the TQt::constants module.
For instance, requesting the importation of all IO constants into the current namespace would be done with:
- use Qt::constants;
+ use TQt::constants;
You may also import specific symbols:
- use Qt::constants qw( IO_ReadOnly IO_WriteOnly );
+ use TQt::constants qw( IO_ReadOnly IO_WriteOnly );
Global Functions
-Qt has also some utilitarian functions such as bitBlt, qCompress, etc.
+TQt has also some utilitarian functions such as bitBlt, qCompress, etc.
Those were global scope functions and have been grouped in a common namespace:
-Qt::GlobalSpace.
+TQt::GlobalSpace.
Hence, you shall access this namespace either with a fully qualified call:
- Qt::GlobalSpace::qUncompress( $buffer )
+ TQt::GlobalSpace::qUncompress( $buffer )
Or directly, after importation in the current namespace:
- use Qt::GlobalSpace;
+ use TQt::GlobalSpace;
qUncompress( $buffer )
@@ -918,47 +918,47 @@ Qt has also some utilitarian functions such as bitBlt, qCompress, etc.
- use Qt::GlobalSpace qw( qUncompress bitBlt )
+ use TQt::GlobalSpace qw( qUncompress bitBlt )
Note: GlobalSpace has also operators, such has the one performing an addition on two
-Qt::Point(). Those operators are called automatically.
+TQt::Point(). Those operators are called automatically.
e.g:
- $p1 = Qt::Point(10, 10) + Qt::Point(20, 20)
+ $p1 = TQt::Point(10, 10) + TQt::Point(20, 20)
Appendix 2 : Internationalization
-PerlQt handles internationalization by always converting QString back to utf8 in Perl.
-Conversions from Perl strings to QStrings are made according to context :
+PerlTQt handles internationalization by always converting TQString back to utf8 in Perl.
+Conversions from Perl strings to TQStrings are made according to context :
- If the Perl string is already utf8-encoded
-then the string will be converted straight to QString.
+then the string will be converted straight to TQString.
This is the most convenient and seemless way of internationalizing your application. Typically, one would just enable
the use of utf8 in source code with the use utf8 pragma and write its application with an utf8 aware editor.
- If the string isn't tagged as utf8, and the use locale pragma is not set
-then the string will be converted to QString's utf8 from ISO-Latin-1.
+then the string will be converted to TQString's utf8 from ISO-Latin-1.
- If the string isn't tagged as utf8 and the use locale pragma is set
-then the string will be converted to QString's utf8 according to the currently set locale.
+then the string will be converted to TQString's utf8 according to the currently set locale.
Once a string contains utf8, you can convert it back to any locale by setting up converters :
- $tr1=Qt::TextCodec::codecForLocale(); # this one will use current locale
- $tr2=Qt::TextCodec::codecForName("KOI8-R"); # that one forces a specific locale (Russian)
+ $tr1=TQt::TextCodec::codecForLocale(); # this one will use current locale
+ $tr2=TQt::TextCodec::codecForName("KOI8-R"); # that one forces a specific locale (Russian)
- print $tr1->fromUnicode(Qt::DateTime::currentDateTime()->toString)."\n\n";
+ print $tr1->fromUnicode(TQt::DateTime::currentDateTime()->toString)."\n\n";
print $tr2->fromUnicode($my_utf8_string);
Or, with Perl >= 5.8.0, you may use Perl's Encode modules (see perldoc Encode).
@@ -966,19 +966,19 @@ then the string will be converted to QString's utf8 according to the currently s
disabling utf-8
Developers who don't want to use UTF-8 or want to temporarily disable UTF-8 marshalling
for handling legacy programs may use the use bytes pragma (and the corresponding no bytes).
-Within the scope of this pragma, QStrings are marshalled back to ISO-Latin1 (default) or to your locale
+
Within the scope of this pragma, TQStrings are marshalled back to ISO-Latin1 (default) or to your locale
(if use locale has been set).
Frivole use of this pragma is strongly discouraged as it ruins worldwide standardization efforts.
Appendix 3 : Debugging Channels
-The Qt::debug module offers various debugging channels/features.
+The TQt::debug module offers various debugging channels/features.
- use Qt::debug;
+ use TQt::debug;
- use Qt::debug qw|calls autoload verbose|;
-With the simple use Qt::debug statement, the verbose and ambiguous channels are activated.
+ use TQt::debug qw|calls autoload verbose|;
+
With the simple use TQt::debug statement, the verbose and ambiguous channels are activated.
If you specify a list of channels within the use statement, then only the specified channels will be enabled.
Available channels :
@@ -994,33 +994,33 @@ Enable more verbose debugging.
a method or function call fails.
e.g:
- use Qt;
- use Qt::debug;
- $a= Qt::Application(\@ARGV);
+ use TQt;
+ use TQt::debug;
+ $a= TQt::Application(\@ARGV);
$a->libraryPath("foo");
--- No method to call for :
- QApplication::libraryPath('foo')
+ TQApplication::libraryPath('foo')
Closer candidates are :
- static void QApplication::addLibraryPath(const QString&)
- static QStringList QApplication::libraryPaths()
- static void QApplication::removeLibraryPath(const QString&)
- static void QApplication::setLibraryPaths(const QStringList&)
+ static void TQApplication::addLibraryPath(const TQString&)
+ static TQStringList TQApplication::libraryPaths()
+ static void TQApplication::removeLibraryPath(const TQString&)
+ static void TQApplication::setLibraryPaths(const TQStringList&)
calls
-For every call, tell what corresponding Qt method is called
+For every call, tell what corresponding TQt method is called
(detailing the arguments if verbose is on).
autoload
Track the intermediate code between a method invocation in Perl
-and its resolution to either a Qt or Perl call.
+and its resolution to either a TQt or Perl call.
gc
Give informations about garbage collection
-whenever a Qt object is deleted and/or a Perl object is destroyed
+whenever a TQt object is deleted and/or a Perl object is destroyed
virtual
@@ -1036,43 +1036,43 @@ Enable all channels
Appendix 4 : Marshallers
A marshaller is a piece of ``glue code'' translating a given datatype to another.
-Within PerlQt, most Qt objects keep their object nature, so that one may invoke methods on them.
+
Within PerlTQt, most TQt objects keep their object nature, so that one may invoke methods on them.
However, some classes and datatypes map so naturally to some Perl types that keeping their object nature would
would feel unnatural and clumsy.
-For instance, instead of returning a Qt::StringList object, which would require an iterator to retrieve its content,
-PerlQt will translate it to an array reference containing all the object's strings.
-In the other way, instead of providing a Qt::StringList object as an argument of a method, one would simply
+
For instance, instead of returning a TQt::StringList object, which would require an iterator to retrieve its content,
+PerlTQt will translate it to an array reference containing all the object's strings.
+In the other way, instead of providing a TQt::StringList object as an argument of a method, one would simply
provide the reference to an array of Perl strings.
-Here is the list of Marshallers as of PerlQt-3.008 :
+Here is the list of Marshallers as of PerlTQt-3.008 :
-----------------------------------------------------------------
float, double <=> Perl real (NV)
char, uchar, int, uint, enum
long, ulong, short, ushort <=> Perl integer (IV)
- QString, -&, -* => Perl string (utf8)
- QString, -&, -* <= Perl string (utf8 or iso-latin1 or locale)
- QCString, -&, -* <=> Perl string (utf8 or bytes, according to content or "bytes" pragma)
- QByteArray, -&, -* <=> Perl string (bytes)
- QStringList, -&, -* => Reference to an array of Perl strings (utf8)
- QString, -&, -* => Perl string (utf8 or iso-latin1 or locale)
+ TQString, -&, -* => Perl string (utf8)
+ TQString, -&, -* <= Perl string (utf8 or iso-latin1 or locale)
+ TQCString, -&, -* <=> Perl string (utf8 or bytes, according to content or "bytes" pragma)
+ TQByteArray, -&, -* <=> Perl string (bytes)
+ TQStringList, -&, -* => Reference to an array of Perl strings (utf8)
+ TQString, -&, -* => Perl string (utf8 or iso-latin1 or locale)
int&, -* <=> Perl integer (IV)
bool&, -* <=> Perl boolean
char* <=> Perl string (bytes)
char** <= Reference to an array of Perl strings (bytes)
uchar* <= Perl string (bytes)
- QRgb* <= Reference to an array of Perl integers (IV)
- QCOORD* <= Reference to an array of Perl integers (IV)
+ TQRgb* <= Reference to an array of Perl integers (IV)
+ TQCOORD* <= Reference to an array of Perl integers (IV)
void* <=> Reference to a Perl integer (IV)
- QValueList<int>, - *, - & <=> Reference to an array of Perl integers (IV)
- QCanvasItemList, - *, - & => Reference to an array of Qt::CanvasItem
- QWidgetList, - *, - & <=> Reference to an array of Qt::Widget
- QObjectList, - *, - & <=> Reference to an array of Qt::Object
- QFileInfoList, - *, - & <=> Reference to an array of Qt::FileInfo
- QPtrList<QTab>, - *, - & <=> Reference to an array of Qt::Tab
- QPtrList<QToolBar>, - *, - & <=> Reference to an array of Qt::ToolBar
- QPtrList<QNetworkOperation>, - *, - & <=> Reference to an array of Qt::NetworkOperation
- QPtrList<QDockWindow>, - *, - & <=> Reference to an array of Qt::DockWindow
- (QUObject*)
+ TQValueList<int>, - *, - & <=> Reference to an array of Perl integers (IV)
+ TQCanvasItemList, - *, - & => Reference to an array of TQt::CanvasItem
+ TQWidgetList, - *, - & <=> Reference to an array of TQt::Widget
+ TQObjectList, - *, - & <=> Reference to an array of TQt::Object
+ TQFileInfoList, - *, - & <=> Reference to an array of TQt::FileInfo
+ TQPtrList<TQTab>, - *, - & <=> Reference to an array of TQt::Tab
+ TQPtrList<TQToolBar>, - *, - & <=> Reference to an array of TQt::ToolBar
+ TQPtrList<TQNetworkOperation>, - *, - & <=> Reference to an array of TQt::NetworkOperation
+ TQPtrList<TQDockWindow>, - *, - & <=> Reference to an array of TQt::DockWindow
+ (TQUObject*)
--
cgit v1.2.3