diff options
Diffstat (limited to 'PerlQt/examples/richedit/richedit.pl')
-rw-r--r-- | PerlQt/examples/richedit/richedit.pl | 204 |
1 files changed, 102 insertions, 102 deletions
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; |