diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/formeditor/kdevelop_plugin/kfd_kdev_part.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/formeditor/kdevelop_plugin/kfd_kdev_part.cpp')
-rw-r--r-- | kexi/formeditor/kdevelop_plugin/kfd_kdev_part.cpp | 248 |
1 files changed, 124 insertions, 124 deletions
diff --git a/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.cpp b/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.cpp index c3b6e448..2c7d2f01 100644 --- a/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.cpp +++ b/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.cpp @@ -17,13 +17,13 @@ * Boston, MA 02110-1301, USA. */ -#include <qworkspace.h> -#include <qdockarea.h> -#include <qdockwindow.h> -#include <qhbox.h> -#include <qpainter.h> -#include <qevent.h> -#include <qobjectlist.h> +#include <tqworkspace.h> +#include <tqdockarea.h> +#include <tqdockwindow.h> +#include <tqhbox.h> +#include <tqpainter.h> +#include <tqevent.h> +#include <tqobjectlist.h> #include <kdeversion.h> #include <kaction.h> @@ -69,11 +69,11 @@ KFDFactory::~KFDFactory() } KParts::Part* -KFDFactory::createPartObject( QWidget *parentWidget, const char *, QObject *, const char *name, - const char *classname, const QStringList &args) +KFDFactory::createPartObject( TQWidget *tqparentWidget, const char *, TQObject *, const char *name, + const char *classname, const TQStringList &args) { bool readOnly = (classname == "KParts::ReadOnlyPart"); - KFormDesignerKDevPart *part = new KFormDesignerKDevPart(parentWidget, name, readOnly, args); + KFormDesignerKDevPart *part = new KFormDesignerKDevPart(tqparentWidget, name, readOnly, args); return part; } @@ -123,8 +123,8 @@ class KFDPart_FormManager : public KFormDesigner::FormManager KFormDesigner::WidgetLibrary* KFormDesignerKDevPart::static_formsLibrary = 0L; -KFormDesignerKDevPart::KFormDesignerKDevPart(QWidget *parent, const char *name, bool readOnly, const QStringList &args) -: Designer(parent, name), m_count(0) +KFormDesignerKDevPart::KFormDesignerKDevPart(TQWidget *tqparent, const char *name, bool readOnly, const TQStringList &args) +: Designer(tqparent, name), m_count(0) { setInstance(KFDFactory::instance()); instance()->iconLoader()->addAppDir("kexi"); @@ -138,28 +138,28 @@ KFormDesignerKDevPart::KFormDesignerKDevPart(QWidget *parent, const char *name, setUniqueFormMode(false); m_inShell = (!args.grep("shell").isEmpty()); - QHBox *container = new QHBox(parent, "kfd_container_widget"); - container->setFocusPolicy(QWidget::ClickFocus); + TQHBox *container = new TQHBox(tqparent, "kfd_container_widget"); + container->setFocusPolicy(TQ_ClickFocus); - m_workspace = new QWorkspace(container, "kfd_workspace"); + m_workspace = new TQWorkspace(container, "kfd_workspace"); m_workspace->show(); - QStringList supportedFactoryGroups; + TQStringList supportedFactoryGroups; /* @todo add configuration for supported factory groups */ static_formsLibrary = KFormDesigner::FormManager::createWidgetLibrary( new KFDPart_FormManager(this, 0, "kfd_manager"), supportedFactoryGroups ); if(!readOnly) { - QDockArea *dockArea = new QDockArea(Vertical, QDockArea::Reverse, container, "kfd_part_dockarea"); + TQDockArea *dockArea = new TQDockAreaQt::Vertical, TQDockArea::Reverse, container, "kfd_part_dockarea"); - QDockWindow *dockTree = new QDockWindow(dockArea); + TQDockWindow *dockTree = new TQDockWindow(dockArea); KFormDesigner::ObjectTreeView *view = new KFormDesigner::ObjectTreeView(dockTree); dockTree->setWidget(view); dockTree->setCaption(i18n("Objects")); dockTree->setResizeEnabled(true); dockTree->setFixedExtentWidth(256); - QDockWindow *dockEditor = new QDockWindow(dockArea); + TQDockWindow *dockEditor = new TQDockWindow(dockArea); KoProperty::Editor *editor = new KoProperty::Editor(dockEditor); dockEditor->setWidget(editor); dockEditor->setCaption(i18n("Properties")); @@ -172,21 +172,21 @@ KFormDesignerKDevPart::KFormDesignerKDevPart(QWidget *parent, const char *name, setModified(false); // action stuff - connect(KFormDesigner::FormManager::self(), SIGNAL(widgetSelected(KFormDesigner::Form*, bool)), SLOT(slotWidgetSelected(KFormDesigner::Form*, bool))); - connect(KFormDesigner::FormManager::self(), SIGNAL(formWidgetSelected(KFormDesigner::Form*)), SLOT(slotFormWidgetSelected(KFormDesigner::Form*))); - connect(KFormDesigner::FormManager::self(), SIGNAL(noFormSelected()), SLOT(slotNoFormSelected())); - connect(KFormDesigner::FormManager::self(), SIGNAL(undoEnabled(bool, const QString&)), SLOT(setUndoEnabled(bool, const QString&))); - connect(KFormDesigner::FormManager::self(), SIGNAL(redoEnabled(bool, const QString&)), SLOT(setRedoEnabled(bool, const QString&))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(widgetSelected(KFormDesigner::Form*, bool)), TQT_SLOT(slotWidgetSelected(KFormDesigner::Form*, bool))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(formWidgetSelected(KFormDesigner::Form*)), TQT_SLOT(slotFormWidgetSelected(KFormDesigner::Form*))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(noFormSelected()), TQT_SLOT(slotNoFormSelected())); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(undoEnabled(bool, const TQString&)), TQT_SLOT(setUndoEnabled(bool, const TQString&))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(redoEnabled(bool, const TQString&)), TQT_SLOT(setRedoEnabled(bool, const TQString&))); - connect(KFormDesigner::FormManager::self(), SIGNAL(dirty(KFormDesigner::Form*, bool)), this, SLOT(slotFormModified(KFormDesigner::Form*, bool))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(dirty(KFormDesigner::Form*, bool)), this, TQT_SLOT(slotFormModified(KFormDesigner::Form*, bool))); - connect(KFormDesigner::FormManager::self(), SIGNAL(createFormSlot(KFormDesigner::Form*, const QString&, const QString&)), - this, SLOT(slotCreateFormSlot(KFormDesigner::Form*, const QString&, const QString &))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(createFormSlot(KFormDesigner::Form*, const TQString&, const TQString&)), + this, TQT_SLOT(slotCreateFormSlot(KFormDesigner::Form*, const TQString&, const TQString &))); } container->show(); setWidget(container); - connect(m_workspace, SIGNAL(windowActivated(QWidget*)), KFormDesigner::FormManager::self(), SLOT(windowChanged(QWidget*))); + connect(m_workspace, TQT_SIGNAL(windowActivated(TQWidget*)), KFormDesigner::FormManager::self(), TQT_SLOT(windowChanged(TQWidget*))); slotNoFormSelected(); } @@ -198,45 +198,45 @@ KFormDesigner::WidgetLibrary* KFormDesignerKDevPart::formsLibrary() void KFormDesignerKDevPart::setupActions() { - KStdAction::open(this, SLOT(open()), actionCollection()); - KStdAction::openNew(this, SLOT(createBlankForm()), actionCollection()); - KStdAction::save(this, SLOT(save()), actionCollection()); - KStdAction::saveAs(this, SLOT(saveAs()), actionCollection()); - KStdAction::cut(KFormDesigner::FormManager::self(), SLOT(cutWidget()), actionCollection()); - KStdAction::copy(KFormDesigner::FormManager::self(), SLOT(copyWidget()), actionCollection()); - KStdAction::paste(KFormDesigner::FormManager::self(), SLOT(pasteWidget()), actionCollection()); - KStdAction::undo(KFormDesigner::FormManager::self(), SLOT(undo()), actionCollection()); - KStdAction::redo(KFormDesigner::FormManager::self(), SLOT(redo()), actionCollection()); - KStdAction::selectAll(KFormDesigner::FormManager::self(), SLOT(selectAll()), actionCollection()); - new KAction(i18n("Clear Widget Contents"), "editclear", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(clearWidgetContent()), actionCollection(), "clear_contents"); - new KAction(i18n("Delete Widget"), "editdelete", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(deleteWidget()), actionCollection(), "edit_delete"); - new KAction(i18n("Preview Form"), "filequickprint", "Ctrl+T", this, SLOT(slotPreviewForm()), actionCollection(), "preview_form"); - new KAction(i18n("Edit Tab Order"), "tab_order", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(editTabOrder()), actionCollection(), "taborder"); - new KAction(i18n("Edit Pixmap Collection"), "icons", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(editFormPixmapCollection()), actionCollection(), "pixmap_collection"); - new KAction(i18n("Edit Form Connections"), "connections", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(editConnections()), actionCollection(), "form_connections"); - - new KAction(i18n("Lay Out Widgets &Horizontally"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutHBox()), actionCollection(), "layout_hbox"); - new KAction(i18n("Lay Out Widgets &Vertically"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutVBox()), actionCollection(), "layout_vbox"); - new KAction(i18n("Lay Out Widgets in &Grid"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutGrid()), actionCollection(), "layout_grid"); - new KAction(i18n("&Break Layout"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(breakLayout()), actionCollection(), "break_layout"); - - new KAction(i18n("Bring Widget to Front"), "raise", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(bringWidgetToFront()), actionCollection(), "format_raise"); - new KAction(i18n("Send Widget to Back"), "lower", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(sendWidgetToBack()), actionCollection(), "format_lower"); + KStdAction::open(this, TQT_SLOT(open()), actionCollection()); + KStdAction::openNew(this, TQT_SLOT(createBlankForm()), actionCollection()); + KStdAction::save(this, TQT_SLOT(save()), actionCollection()); + KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection()); + KStdAction::cut(KFormDesigner::FormManager::self(), TQT_SLOT(cutWidget()), actionCollection()); + KStdAction::copy(KFormDesigner::FormManager::self(), TQT_SLOT(copyWidget()), actionCollection()); + KStdAction::paste(KFormDesigner::FormManager::self(), TQT_SLOT(pasteWidget()), actionCollection()); + KStdAction::undo(KFormDesigner::FormManager::self(), TQT_SLOT(undo()), actionCollection()); + KStdAction::redo(KFormDesigner::FormManager::self(), TQT_SLOT(redo()), actionCollection()); + KStdAction::selectAll(KFormDesigner::FormManager::self(), TQT_SLOT(selectAll()), actionCollection()); + new KAction(i18n("Clear Widget Contents"), "editclear", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(clearWidgetContent()), actionCollection(), "clear_contents"); + new KAction(i18n("Delete Widget"), "editdelete", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(deleteWidget()), actionCollection(), "edit_delete"); + new KAction(i18n("Preview Form"), "filequickprint", "Ctrl+T", this, TQT_SLOT(slotPreviewForm()), actionCollection(), "preview_form"); + new KAction(i18n("Edit Tab Order"), "tab_order", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(editTabOrder()), actionCollection(), "taborder"); + new KAction(i18n("Edit Pixmap Collection"), "icons", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(editFormPixmapCollection()), actionCollection(), "pixmap_collection"); + new KAction(i18n("Edit Form Connections"), "connections", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(editConnections()), actionCollection(), "form_connections"); + + new KAction(i18n("Lay Out Widgets &Horizontally"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutHBox()), actionCollection(), "tqlayout_hbox"); + new KAction(i18n("Lay Out Widgets &Vertically"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutVBox()), actionCollection(), "tqlayout_vbox"); + new KAction(i18n("Lay Out Widgets in &Grid"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutGrid()), actionCollection(), "tqlayout_grid"); + new KAction(i18n("&Break Layout"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(breakLayout()), actionCollection(), "break_layout"); + + new KAction(i18n("Bring Widget to Front"), "raise", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(bringWidgetToFront()), actionCollection(), "format_raise"); + new KAction(i18n("Send Widget to Back"), "lower", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(sendWidgetToBack()), actionCollection(), "format_lower"); KActionMenu *alignMenu = new KActionMenu(i18n("Align Widgets' Positions"), "aopos2grid", actionCollection(), "align_menu"); - alignMenu->insert( new KAction(i18n("To Left"), "aoleft", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToLeft()), actionCollection(), "align_to_left") ); - alignMenu->insert( new KAction(i18n("To Right"), "aoright", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToRight()), actionCollection(), "align_to_right") ); - alignMenu->insert( new KAction(i18n("To Top"), "aotop", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToTop()), actionCollection(), "align_to_top") ); - alignMenu->insert( new KAction(i18n("To Bottom"), "aobottom", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToBottom()), actionCollection(), "align_to_bottom") ); - alignMenu->insert( new KAction(i18n("To Grid"), "aopos2grid", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToGrid()), actionCollection(), "align_to_grid") ); + alignMenu->insert( new KAction(i18n("To Left"), "aoleft", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToLeft()), actionCollection(), "align_to_left") ); + alignMenu->insert( new KAction(i18n("To Right"), "aoright", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToRight()), actionCollection(), "align_to_right") ); + alignMenu->insert( new KAction(i18n("To Top"), "aotop", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToTop()), actionCollection(), "align_to_top") ); + alignMenu->insert( new KAction(i18n("To Bottom"), "aobottom", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToBottom()), actionCollection(), "align_to_bottom") ); + alignMenu->insert( new KAction(i18n("To Grid"), "aopos2grid", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToGrid()), actionCollection(), "align_to_grid") ); KActionMenu *sizeMenu = new KActionMenu(i18n("Adjust Widgets' Sizes"), "aogrid", actionCollection(), "adjust_size_menu"); - sizeMenu->insert( new KAction(i18n("To Fit"), "aofit", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustWidgetSize()), actionCollection(), "adjust_to_fit") ); - sizeMenu->insert( new KAction(i18n("To Grid"), "aogrid", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustSizeToGrid()), actionCollection(), "adjust_size_grid") ); - sizeMenu->insert( new KAction(i18n("To Shortest"), "aoshortest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustHeightToSmall()), actionCollection(), "adjust_height_small") ); - sizeMenu->insert( new KAction(i18n("To Tallest"), "aotallest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustHeightToBig()), actionCollection(), "adjust_height_big") ); - sizeMenu->insert( new KAction(i18n("To Narrowest"), "aonarrowest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustWidthToSmall()), actionCollection(), "adjust_width_small") ); - sizeMenu->insert( new KAction(i18n("To Widest"), "aowidest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustWidthToBig()), actionCollection(), "adjust_width_big") ); + sizeMenu->insert( new KAction(i18n("To Fit"), "aofit", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidgetSize()), actionCollection(), "adjust_to_fit") ); + sizeMenu->insert( new KAction(i18n("To Grid"), "aogrid", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustSizeToGrid()), actionCollection(), "adjust_size_grid") ); + sizeMenu->insert( new KAction(i18n("To Shortest"), "aoshortest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustHeightToSmall()), actionCollection(), "adjust_height_small") ); + sizeMenu->insert( new KAction(i18n("To Tallest"), "aotallest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustHeightToBig()), actionCollection(), "adjust_height_big") ); + sizeMenu->insert( new KAction(i18n("To Narrowest"), "aonarrowest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidthToSmall()), actionCollection(), "adjust_width_small") ); + sizeMenu->insert( new KAction(i18n("To Widest"), "aowidest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidthToBig()), actionCollection(), "adjust_width_big") ); if(m_inShell) setXMLFile("kformdesigner_part_shell.rc"); @@ -258,7 +258,7 @@ KFormDesignerKDevPart::createBlankForm() if(m_uniqueFormMode && KFormDesigner::FormManager::self()->activeForm() && !KFormDesigner::FormManager::self()->activeForm()->isModified() && KFormDesigner::FormManager::self()->activeForm()->filename().isNull()) return; // active form is already a blank one - QString n = i18n("Form") + QString::number(++m_count); + TQString n = i18n("Form") + TQString::number(++m_count); Form *form = new Form(formsLibrary(), n.latin1()); FormWidgetBase *w = new FormWidgetBase(this, m_workspace, n.latin1()); @@ -276,7 +276,7 @@ void KFormDesignerKDevPart::open() { m_openingFile = true; - KURL url = KFileDialog::getOpenURL("::kformdesigner", i18n("*.ui|Qt Designer UI Files"), m_workspace->topLevelWidget()); + KURL url = KFileDialog::getOpenURL("::kformdesigner", i18n("*.ui|TQt Designer UI Files"), m_workspace->tqtopLevelWidget()); if(!url.isEmpty()) ReadWritePart::openURL(url); m_openingFile = false; @@ -311,7 +311,7 @@ KFormDesignerKDevPart::saveFile() void KFormDesignerKDevPart::saveAs() { - KURL url = KFileDialog::getSaveURL("::kformdesigner", i18n("*.ui|Qt Designer UI Files"), m_workspace); + KURL url = KFileDialog::getSaveURL("::kformdesigner", i18n("*.ui|TQt Designer UI Files"), m_workspace); if(url.isEmpty()) return; else @@ -321,9 +321,9 @@ KFormDesignerKDevPart::saveAs() bool KFormDesignerKDevPart::closeForm(Form *form) { - int res = KMessageBox::warningYesNoCancel( m_workspace->topLevelWidget(), + int res = KMessageBox::warningYesNoCancel( m_workspace->tqtopLevelWidget(), i18n( "The form \"%1\" has been modified.\n" - "Do you want to save your changes or discard them?" ).arg( form->objectTree()->name() ), + "Do you want to save your changes or discard them?" ).tqarg( form->objectTree()->name() ), i18n( "Close Form" ), KStdGuiItem::save(), KStdGuiItem::discard() ); if(res == KMessageBox::Yes) @@ -335,8 +335,8 @@ KFormDesignerKDevPart::closeForm(Form *form) bool KFormDesignerKDevPart::closeForms() { - QWidgetList list = m_workspace->windowList(QWorkspace::CreationOrder); - for(QWidget *w = list.first(); w; w = list.next()) + TQWidgetList list = m_workspace->windowList(TQWorkspace::CreationOrder); + for(TQWidget *w = list.first(); w; w = list.next()) if(w->close() == false) return false; @@ -397,7 +397,7 @@ KFormDesignerKDevPart::slotWidgetSelected(Form *form, bool multiple) ENABLE_ACTION("format_raise", true); ENABLE_ACTION("format_lower", true); - // If the widgets selected is a container, we enable layout actions + // If the widgets selected is a container, we enable tqlayout actions if(!multiple) { KFormDesigner::ObjectTreeItem *item = form->objectTree()->lookup( form->selectedWidgets()->first()->name() ); @@ -405,12 +405,12 @@ KFormDesignerKDevPart::slotWidgetSelected(Form *form, bool multiple) multiple = true; } // Layout actions - ENABLE_ACTION("layout_hbox", multiple); - ENABLE_ACTION("layout_vbox", multiple); - ENABLE_ACTION("layout_grid", multiple); + ENABLE_ACTION("tqlayout_hbox", multiple); + ENABLE_ACTION("tqlayout_vbox", multiple); + ENABLE_ACTION("tqlayout_grid", multiple); KFormDesigner::Container *container = KFormDesigner::FormManager::self()->activeForm()->activeContainer(); - ENABLE_ACTION("break_layout", (container->layoutType() != KFormDesigner::Container::NoLayout)); + ENABLE_ACTION("break_layout", (container->tqlayoutType() != KFormDesigner::Container::NoLayout)); } void @@ -420,10 +420,10 @@ KFormDesignerKDevPart::slotFormWidgetSelected(Form *form) enableFormActions(); // Layout actions - ENABLE_ACTION("layout_hbox", true); - ENABLE_ACTION("layout_vbox", true); - ENABLE_ACTION("layout_grid", true); - ENABLE_ACTION("break_layout", (form->toplevelContainer()->layoutType() != KFormDesigner::Container::NoLayout)); + ENABLE_ACTION("tqlayout_hbox", true); + ENABLE_ACTION("tqlayout_vbox", true); + ENABLE_ACTION("tqlayout_grid", true); + ENABLE_ACTION("break_layout", (form->toplevelContainer()->tqlayoutType() != KFormDesigner::Container::NoLayout)); } void @@ -486,14 +486,14 @@ KFormDesignerKDevPart::disableWidgetActions() ENABLE_ACTION("format_raise", false); ENABLE_ACTION("format_lower", false); - ENABLE_ACTION("layout_hbox", false); - ENABLE_ACTION("layout_vbox", false); - ENABLE_ACTION("layout_grid", false); + ENABLE_ACTION("tqlayout_hbox", false); + ENABLE_ACTION("tqlayout_vbox", false); + ENABLE_ACTION("tqlayout_grid", false); ENABLE_ACTION("break_layout", false); } void -KFormDesignerKDevPart::setUndoEnabled(bool enabled, const QString &text) +KFormDesignerKDevPart::setUndoEnabled(bool enabled, const TQString &text) { KAction *undoAction = actionCollection()->action("edit_undo"); if(undoAction) @@ -505,7 +505,7 @@ KFormDesignerKDevPart::setUndoEnabled(bool enabled, const QString &text) } void -KFormDesignerKDevPart::setRedoEnabled(bool enabled, const QString &text) +KFormDesignerKDevPart::setRedoEnabled(bool enabled, const TQString &text) { KAction *redoAction = actionCollection()->action("edit_redo"); if(redoAction) @@ -517,14 +517,14 @@ KFormDesignerKDevPart::setRedoEnabled(bool enabled, const QString &text) } void -KFormDesignerKDevPart::slotCreateFormSlot(Form *form, const QString &widget, const QString &signal) +KFormDesignerKDevPart::slotCreateFormSlot(Form *form, const TQString &widget, const TQString &signal) { Function f; f.returnType = "void"; f.function = widget + "_" + signal; f.specifier = "non virtual"; f.access = "public"; - f.type = ftQtSlot; + f.type = ftTQtSlot; emit addedFunction(designerType(), form->objectTree()->name(), f); } @@ -535,39 +535,39 @@ KFormDesignerKDevPart::~KFormDesignerKDevPart() ////// FormWidgetBase : helper widget to draw rects on top of widgets -//repaint all children widgets -static void repaintAll(QWidget *w) +//tqrepaint all tqchildren widgets +static void tqrepaintAll(TQWidget *w) { - QObjectList *list = w->queryList("QWidget"); - QObjectListIt it(*list); - for (QObject *obj; (obj=it.current()); ++it ) { - static_cast<QWidget*>(obj)->repaint(); + TQObjectList *list = w->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectListIt it(*list); + for (TQObject *obj; (obj=it.current()); ++it ) { + static_cast<TQWidget*>(obj)->tqrepaint(); } delete list; } void -FormWidgetBase::drawRects(const QValueList<QRect> &list, int type) +FormWidgetBase::drawRects(const TQValueList<TQRect> &list, int type) { - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); if (prev_rect.isValid()) { //redraw prev. selection's rectangle - p.drawPixmap( QPoint(prev_rect.x()-2, prev_rect.y()-2), buffer, QRect(prev_rect.x()-2, prev_rect.y()-2, prev_rect.width()+4, prev_rect.height()+4)); + p.drawPixmap( TQPoint(prev_rect.x()-2, prev_rect.y()-2), buffer, TQRect(prev_rect.x()-2, prev_rect.y()-2, prev_rect.width()+4, prev_rect.height()+4)); } - p.setBrush(QBrush::NoBrush); + p.setBrush(TQBrush::NoBrush); if(type == 1) // selection rect - p.setPen(QPen(white, 1, Qt::DotLine)); + p.setPen(TQPen(white, 1, TQt::DotLine)); else if(type == 2) // insert rect - p.setPen(QPen(white, 2)); + p.setPen(TQPen(white, 2)); p.setRasterOp(XorROP); - prev_rect = QRect(); - QValueList<QRect>::ConstIterator endIt = list.constEnd(); - for(QValueList<QRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) { + prev_rect = TQRect(); + TQValueList<TQRect>::ConstIterator endIt = list.constEnd(); + for(TQValueList<TQRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) { p.drawRect(*it); prev_rect = prev_rect.unite(*it); } @@ -578,9 +578,9 @@ FormWidgetBase::drawRects(const QValueList<QRect> &list, int type) } void -FormWidgetBase::drawRect(const QRect& r, int type) +FormWidgetBase::drawRect(const TQRect& r, int type) { - QValueList<QRect> l; + TQValueList<TQRect> l; l.append(r); drawRects(l, type); } @@ -588,58 +588,58 @@ FormWidgetBase::drawRect(const QRect& r, int type) void FormWidgetBase::initRect() { - repaintAll(this); + tqrepaintAll(this); buffer.resize( width(), height() ); - buffer = QPixmap::grabWindow( winId() ); - prev_rect = QRect(); + buffer = TQPixmap::grabWindow( winId() ); + prev_rect = TQRect(); } void FormWidgetBase::clearRect() { - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); //redraw entire form surface - p.drawPixmap( QPoint(0,0), buffer, QRect(0,0,buffer.width(), buffer.height()) ); + p.drawPixmap( TQPoint(0,0), buffer, TQRect(0,0,buffer.width(), buffer.height()) ); if (!unclipped) clearWFlags( WPaintUnclipped ); p.end(); - repaintAll(this); + tqrepaintAll(this); } void -FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &point) +FormWidgetBase::highlightWidgets(TQWidget *from, TQWidget *to)//, const TQPoint &point) { - QPoint fromPoint, toPoint; - if(from && from->parentWidget() && (from != this)) - fromPoint = from->parentWidget()->mapTo(this, from->pos()); - if(to && to->parentWidget() && (to != this)) - toPoint = to->parentWidget()->mapTo(this, to->pos()); + TQPoint fromPoint, toPoint; + if(from && from->tqparentWidget() && (from != this)) + fromPoint = from->tqparentWidget()->mapTo(this, from->pos()); + if(to && to->tqparentWidget() && (to != this)) + toPoint = to->tqparentWidget()->mapTo(this, to->pos()); - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); if (prev_rect.isValid()) { //redraw prev. selection's rectangle - p.drawPixmap( QPoint(prev_rect.x(), prev_rect.y()), buffer, QRect(prev_rect.x(), prev_rect.y(), prev_rect.width(), prev_rect.height())); + p.drawPixmap( TQPoint(prev_rect.x(), prev_rect.y()), buffer, TQRect(prev_rect.x(), prev_rect.y(), prev_rect.width(), prev_rect.height())); } - p.setPen( QPen(Qt::red, 2) ); + p.setPen( TQPen(TQt::red, 2) ); if(to) { - QPixmap pix1 = QPixmap::grabWidget(from); - QPixmap pix2 = QPixmap::grabWidget(to); + TQPixmap pix1 = TQPixmap::grabWidget(from); + TQPixmap pix2 = TQPixmap::grabWidget(to); if((from != this) && (to != this)) - p.drawLine( from->parentWidget()->mapTo(this, from->geometry().center()), to->parentWidget()->mapTo(this, to->geometry().center()) ); + p.drawLine( from->tqparentWidget()->mapTo(this, from->tqgeometry().center()), to->tqparentWidget()->mapTo(this, to->tqgeometry().center()) ); p.drawPixmap(fromPoint.x(), fromPoint.y(), pix1); p.drawPixmap(toPoint.x(), toPoint.y(), pix2); @@ -656,7 +656,7 @@ FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po p.drawRoundRect(fromPoint.x(), fromPoint.y(), from->width(), from->height(), 5, 5); if((to == this) || (from == this)) - prev_rect = QRect(0, 0, buffer.width(), buffer.height()); + prev_rect = TQRect(0, 0, buffer.width(), buffer.height()); else if(to) { prev_rect.setX( (fromPoint.x() < toPoint.x()) ? (fromPoint.x() - 5) : (toPoint.x() - 5) ); @@ -665,7 +665,7 @@ FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po prev_rect.setBottom( (fromPoint.y() < toPoint.y()) ? (toPoint.y() + to->height() + 10) : (fromPoint.y() + from->height() + 10) ) ; } else - prev_rect = QRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10); + prev_rect = TQRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10); if (!unclipped) clearWFlags( WPaintUnclipped ); @@ -673,7 +673,7 @@ FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po } void -FormWidgetBase::closeEvent(QCloseEvent *ev) +FormWidgetBase::closeEvent(TQCloseEvent *ev) { Form *form = KFormDesigner::FormManager::self()->formForWidget(this); if(!form || !form->isModified() || !form->objectTree()) // == preview form |