diff options
Diffstat (limited to 'PerlQt/bin')
-rwxr-xr-x | PerlQt/bin/pqtapi | 18 | ||||
-rwxr-xr-x | PerlQt/bin/pqtsh | 190 |
2 files changed, 104 insertions, 104 deletions
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", -"QtQtQ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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) }; |