diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
commit | dc6b8e72fed2586239e3514819238c520636c9d9 (patch) | |
tree | 88b200df0a0b7fab9d6f147596173556f1ed9a13 /kommander/editor/mainwindow.cpp | |
parent | 6927d4436e54551917f600b706a8d6109e49de1c (diff) | |
download | tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/editor/mainwindow.cpp')
-rw-r--r-- | kommander/editor/mainwindow.cpp | 598 |
1 files changed, 299 insertions, 299 deletions
diff --git a/kommander/editor/mainwindow.cpp b/kommander/editor/mainwindow.cpp index a90a3b07..af062f16 100644 --- a/kommander/editor/mainwindow.cpp +++ b/kommander/editor/mainwindow.cpp @@ -46,25 +46,25 @@ #include "wizardeditorimpl.h" #include "workspace.h" -#include <qaccel.h> -#include <qbuffer.h> -#include <qclipboard.h> -#include <qdir.h> -#include <qfeatures.h> -#include <qfile.h> -#include <qlabel.h> -#include <qmetaobject.h> -#include <qpixmap.h> -#include <qregexp.h> -#include <qstylefactory.h> -#include <qstyle.h> -#include <qtimer.h> -#include <qtooltip.h> -#include <qvbox.h> -#include <qwhatsthis.h> -#include <qwidget.h> -#include <qwizard.h> -#include <qworkspace.h> +#include <tqaccel.h> +#include <tqbuffer.h> +#include <tqclipboard.h> +#include <tqdir.h> +#include <tqfeatures.h> +#include <tqfile.h> +#include <tqlabel.h> +#include <tqmetaobject.h> +#include <tqpixmap.h> +#include <tqregexp.h> +#include <tqstylefactory.h> +#include <tqstyle.h> +#include <tqtimer.h> +#include <tqtooltip.h> +#include <tqvbox.h> +#include <tqwhatsthis.h> +#include <tqwidget.h> +#include <tqwizard.h> +#include <tqworkspace.h> #include "qcompletionedit.h" @@ -88,25 +88,25 @@ #include <kparts/partmanager.h> #include <kio/netaccess.h> -extern QMap<QWidget*, QString> *qwf_functions; -extern QMap<QWidget*, QString> *qwf_forms; -extern QString *qwf_language; +extern TQMap<TQWidget*, TQString> *qwf_functions; +extern TQMap<TQWidget*, TQString> *qwf_forms; +extern TQString *qwf_language; extern bool qwf_execute_code; extern bool qwf_stays_on_top; -extern void set_splash_status(const QString &txt); +extern void set_splash_status(const TQString &txt); /*### static bool tbSettingsRead = false; */ MainWindow *MainWindow::self = 0; -QString assistantPath() +TQString assistantPath() { return "assistant"; } -static QString textNoAccel(const QString& text) +static TQString textNoAccel(const TQString& text) { - QString t = text; + TQString t = text; int i; while ((i = t.find('&'))>= 0) { t.remove(i,1); @@ -121,7 +121,7 @@ MainWindow::MainWindow(bool asClient) docPath("$QTDIR/doc/html"), client(asClient), databaseAutoEdit(false), previewing(false) { m_partManager = new KParts::PartManager(this); - //connect(m_partManager, SIGNAL(activePartChanged(KParts::Part * )), this, SLOT(slotActivePartChanged(KParts::Part * ))); + //connect(m_partManager, TQT_SIGNAL(activePartChanged(KParts::Part * )), this, TQT_SLOT(slotActivePartChanged(KParts::Part * ))); init_colors(); inDebugMode = true; //debugging kommander @@ -138,7 +138,7 @@ MainWindow::MainWindow(bool asClient) wspace = 0; statusBar()->clear(); - statusBar()->addWidget(new QLabel(i18n("Welcome to the Kommander Editor"), statusBar()), 1); + statusBar()->addWidget(new TQLabel(i18n("Welcome to the Kommander Editor"), statusBar()), 1); setupMDI(); setupFileActions(); @@ -165,11 +165,11 @@ MainWindow::MainWindow(bool asClient) lastPressWidget = 0; kapp->installEventFilter(this); - QSize as(kapp->desktop()->size()); - as -= QSize(30, 30); - resize(QSize(1200, 1000).boundedTo(as)); + TQSize as(kapp->desktop()->size()); + as -= TQSize(30, 30); + resize(TQSize(1200, 1000).boundedTo(as)); - connect(kapp->clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardChanged())); + connect(kapp->clipboard(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(clipboardChanged())); clipboardChanged(); layoutChilds = false; layoutSelected = false; @@ -178,25 +178,25 @@ MainWindow::MainWindow(bool asClient) readConfig(); - // hack to make WidgetFactory happy (so it knows QWidget and QDialog for resetting properties) - QWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName("QWidget"), this, 0, false); + // hack to make WidgetFactory happy (so it knows TQWidget and TQDialog for resetting properties) + TQWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQWidget"), this, 0, false); delete w; w = WidgetFactory::create(WidgetDatabase::idFromClassName("Dialog"), this, 0, false); delete w; - w = WidgetFactory::create(WidgetDatabase::idFromClassName("QLabel"), this, 0, false); + w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQLabel"), this, 0, false); delete w; - w = WidgetFactory::create(WidgetDatabase::idFromClassName("QTabWidget"), this, 0, false); + w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQTabWidget"), this, 0, false); delete w; - w = WidgetFactory::create(WidgetDatabase::idFromClassName("QFrame"), this, 0, false); + w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQFrame"), this, 0, false); delete w; assistant = new AssistProc(this, "Internal Assistant", assistantPath()); statusBar()->setSizeGripEnabled(true); SpecialInformation::registerSpecials(); - backupTimer = new QTimer(this); - connect(backupTimer, SIGNAL(timeout()), this, SLOT(slotCreateBackups())); + backupTimer = new TQTimer(this); + connect(backupTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotCreateBackups())); backupTimer->start(1000*60*5); //fire it every five minutes //createGUI(0); @@ -209,9 +209,9 @@ MainWindow::~MainWindow() void MainWindow::setupMDI() { - KDockWidget* toolDock = createDockWidget("Workspace", QPixmap(), 0L, "main_workspace"); - QVBox *vbox = new QVBox(toolDock); - vbox->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); + KDockWidget* toolDock = createDockWidget("Workspace", TQPixmap(), 0L, "main_workspace"); + TQVBox *vbox = new TQVBox(toolDock); + vbox->setFrameStyle(TQFrame::StyledPanel | TQFrame::Sunken); vbox->setMargin(1); vbox->setLineWidth(1); @@ -221,27 +221,27 @@ void MainWindow::setupMDI() setView(toolDock); setMainDockWidget(toolDock); - qworkspace = new QWorkspace(vbox); + qworkspace = new TQWorkspace(vbox); qworkspace->setBackgroundMode(PaletteDark); qworkspace->setBackgroundPixmap(PixmapChooser::loadPixmap("background.png", PixmapChooser::NoSize)); - qworkspace->setPaletteBackgroundColor(QColor(238, 238, 238)); + qworkspace->setPaletteBackgroundColor(TQColor(238, 238, 238)); qworkspace->setScrollBarsEnabled(true); - connect(qworkspace, SIGNAL(windowActivated(QWidget *)), - this, SLOT(activeWindowChanged(QWidget *))); + connect(qworkspace, TQT_SIGNAL(windowActivated(TQWidget *)), + this, TQT_SLOT(activeWindowChanged(TQWidget *))); lastActiveFormWindow = 0; qworkspace->setAcceptDrops(true); } void MainWindow::setupPropertyEditor() { - KDockWidget *dw = createDockWidget("Property Editor", QPixmap(), 0, i18n("Properties")); + KDockWidget *dw = createDockWidget("Property Editor", TQPixmap(), 0, i18n("Properties")); propertyEditor = new PropertyEditor(dw); //addToolBar(dw, Qt::DockLeft); dw->setWidget(propertyEditor); dw->manualDock(getMainDockWidget(), KDockWidget::DockLeft, 20); dw->setCaption(i18n("Property Editor")); - QWhatsThis::add(propertyEditor, + TQWhatsThis::add(propertyEditor, i18n("<h2>The Property Editor</h2>" "<p>You can change the appearance and behavior of the selected widget in the " "property editor.</p>" @@ -265,11 +265,11 @@ void MainWindow::setupHierarchyView() { if (hierarchyView) return; - KDockWidget *dw = createDockWidget("Object Explorer", QPixmap(), 0, i18n("Widgets")); + KDockWidget *dw = createDockWidget("Object Explorer", TQPixmap(), 0, i18n("Widgets")); hierarchyView = new HierarchyView(dw); dw->setWidget(hierarchyView); dw->setCaption(i18n("Object Explorer")); - QWhatsThis::add(hierarchyView, + TQWhatsThis::add(hierarchyView, i18n("<h2>The Object Explorer</h2>" "<p>The Object Explorer provides an overview of the relationships " "between the widgets in a form. You can use the clipboard functions using " @@ -281,29 +281,29 @@ void MainWindow::setupHierarchyView() void MainWindow::setupWorkspace() { - KDockWidget *dw = createDockWidget("Dialogs", QPixmap(), 0, i18n("Dialogs")); - QVBox *vbox = new QVBox(dw); + KDockWidget *dw = createDockWidget("Dialogs", TQPixmap(), 0, i18n("Dialogs")); + TQVBox *vbox = new TQVBox(dw); QCompletionEdit *edit = new QCompletionEdit(vbox); - QToolTip::add(edit, i18n("Start typing the buffer you want to switch to here (ALT+B)")); - QAccel *a = new QAccel(this); - a->connectItem(a->insertItem(ALT + Key_B), edit, SLOT(setFocus())); + TQToolTip::add(edit, i18n("Start typing the buffer you want to switch to here (ALT+B)")); + TQAccel *a = new TQAccel(this); + a->connectItem(a->insertItem(ALT + Key_B), edit, TQT_SLOT(setFocus())); wspace = new Workspace(vbox, this); wspace->setBufferEdit(edit); dw->setWidget(vbox); dw->setCaption(i18n("Dialogs")); - QWhatsThis::add(wspace, i18n("<h2>The File Overview Window</h2>" + TQWhatsThis::add(wspace, i18n("<h2>The File Overview Window</h2>" "<p>The File Overview Window displays all open dialogs.</p>")); } void MainWindow::setupActionEditor() { - KDockWidget *dw = createDockWidget("Action Editor", QPixmap(), 0, i18n("Actions")); + KDockWidget *dw = createDockWidget("Action Editor", TQPixmap(), 0, i18n("Actions")); actionEditor = new ActionEditor(dw, "ActionEditor"); //addToolBar(dw, Qt::DockLeft); dw->setWidget(actionEditor); dw->setCaption(i18n("Action Editor")); - QWhatsThis::add(actionEditor, i18n("<b>The Action Editor</b>" + TQWhatsThis::add(actionEditor, i18n("<b>The Action Editor</b>" "<p>The Action Editor is used to add actions and action groups to " "a form, and to connect actions to slots. Actions and action " "groups can be dragged into menus and into toolbars, and may " @@ -313,7 +313,7 @@ void MainWindow::setupActionEditor() void MainWindow::setupMessageLog() { - KDockWidget *dw = createDockWidget("Message Log", QPixmap(), 0, i18n("Message Log")); + KDockWidget *dw = createDockWidget("Message Log", TQPixmap(), 0, i18n("Message Log")); messageLog = new MessageLog(dw, "MessageLog"); dw->setWidget(messageLog); dw->setCaption(i18n("Message Log")); @@ -322,7 +322,7 @@ void MainWindow::setupMessageLog() void MainWindow::setupRMBMenus() { - rmbWidgets = new QPopupMenu(this); + rmbWidgets = new TQPopupMenu(this); actionEditCut->plug(rmbWidgets); actionEditCopy->plug(rmbWidgets); actionEditPaste->plug(rmbWidgets); @@ -338,7 +338,7 @@ void MainWindow::setupRMBMenus() actionEditBreakLayout->plug(rmbWidgets); rmbWidgets->insertSeparator(); actionEditConnections->plug(rmbWidgets); - rmbFormWindow = new QPopupMenu(this); + rmbFormWindow = new TQPopupMenu(this); actionEditPaste->plug(rmbFormWindow); actionEditSelectAll->plug(rmbFormWindow); actionEditAccels->plug(rmbFormWindow); @@ -368,20 +368,20 @@ int MainWindow::currentTool() const { if (!actionCurrentTool) return POINTER_TOOL; - return QString::fromLatin1(actionCurrentTool->name()).toInt(); + return TQString::fromLatin1(actionCurrentTool->name()).toInt(); } void MainWindow::slotCreateBackups() { //create a backup of the opened forms - QWidgetList windows = qworkspace->windowList(QWorkspace::StackingOrder); + TQWidgetList windows = qworkspace->windowList(TQWorkspace::StackingOrder); for (int i = 0; i < (int)windows.count(); ++i) { FormWindow* form = dynamic_cast<FormWindow*>(windows.at(i)); if (!form || !form->formFile()) continue; - QString fileName = form->formFile()->fileName(); - QString backupName = fileName + ".backup"; + TQString fileName = form->formFile()->fileName(); + TQString backupName = fileName + ".backup"; bool modified = form->formFile()->isModified(); if (form->formFile()->hasTempFileName()) continue; //no need to create a backup @@ -410,9 +410,9 @@ void MainWindow::runForm() if (!form || !form->formFile()) return; - QObjectList *editors = queryList("AssocTextEditor"); - QObjectListIt it(*editors); - QObject *editor; + TQObjectList *editors = queryList("AssocTextEditor"); + TQObjectListIt it(*editors); + TQObject *editor; while ((editor = it.current()) != 0L) { @@ -431,7 +431,7 @@ void MainWindow::runForm() m_backupName = m_fileName + ".running"; m_modified = form->formFile()->isModified(); - bool readOnlyFile = !QFileInfo(m_fileName).isWritable(); + bool readOnlyFile = !TQFileInfo(m_fileName).isWritable(); struct stat statbuf; ::stat(m_fileName.local8Bit(), &statbuf); if (!readOnlyFile && !KIO::NetAccess::file_copy(KURL::fromPathOrURL(m_fileName), KURL::fromPathOrURL(m_backupName), statbuf.st_mode, true)) @@ -451,12 +451,12 @@ void MainWindow::runForm() ::chmod(m_fileName.local8Bit(), S_IRWXU); KProcess* process = new KProcess; process->setUseShell(true); - (*process) << "kmdr-executor" << QString("\"%1\"").arg(form->formFile()->fileName()); - connect(process, SIGNAL(receivedStdout(KProcess*, char*, int)), messageLog, - SLOT(receivedStdout(KProcess*, char*, int))); - connect(process, SIGNAL(receivedStderr(KProcess*, char*, int)), messageLog, - SLOT(receivedStderr(KProcess*, char*, int))); - connect(process, SIGNAL(processExited(KProcess*)), SLOT(closeRunningForm(KProcess*))); + (*process) << "kmdr-executor" << TQString("\"%1\"").arg(form->formFile()->fileName()); + connect(process, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), messageLog, + TQT_SLOT(receivedStdout(KProcess*, char*, int))); + connect(process, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), messageLog, + TQT_SLOT(receivedStderr(KProcess*, char*, int))); + connect(process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(closeRunningForm(KProcess*))); messageLog->clear(MessageLog::All); previewing = process->start(KProcess::NotifyOnExit, KProcess::AllOutput); } @@ -474,9 +474,9 @@ void MainWindow::runForm4() if (!form || !form->formFile()) return; - QObjectList *editors = queryList("AssocTextEditor"); - QObjectListIt it(*editors); - QObject *editor; + TQObjectList *editors = queryList("AssocTextEditor"); + TQObjectListIt it(*editors); + TQObject *editor; while ((editor = it.current()) != 0L) { @@ -495,7 +495,7 @@ void MainWindow::runForm4() m_backupName = m_fileName + ".running"; m_modified = form->formFile()->isModified(); - bool readOnlyFile = !QFileInfo(m_fileName).isWritable(); + bool readOnlyFile = !TQFileInfo(m_fileName).isWritable(); struct stat statbuf; ::stat(m_fileName.local8Bit(), &statbuf); if (!readOnlyFile && !KIO::NetAccess::file_copy(KURL::fromPathOrURL(m_fileName), KURL::fromPathOrURL(m_backupName), statbuf.st_mode, true)) @@ -515,12 +515,12 @@ void MainWindow::runForm4() ::chmod(m_fileName.local8Bit(), S_IRWXU); KProcess* process = new KProcess; process->setUseShell(true); - (*process) << "kommander" << QString("\"%1\"").arg(form->formFile()->fileName()); - connect(process, SIGNAL(receivedStdout(KProcess*, char*, int)), messageLog, - SLOT(receivedStdout(KProcess*, char*, int))); - connect(process, SIGNAL(receivedStderr(KProcess*, char*, int)), messageLog, - SLOT(receivedStderr(KProcess*, char*, int))); - connect(process, SIGNAL(processExited(KProcess*)), SLOT(closeRunningForm(KProcess*))); + (*process) << "kommander" << TQString("\"%1\"").arg(form->formFile()->fileName()); + connect(process, TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), messageLog, + TQT_SLOT(receivedStdout(KProcess*, char*, int))); + connect(process, TQT_SIGNAL(receivedStderr(KProcess*, char*, int)), messageLog, + TQT_SLOT(receivedStderr(KProcess*, char*, int))); + connect(process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(closeRunningForm(KProcess*))); messageLog->clear(MessageLog::All); previewing = process->start(KProcess::NotifyOnExit, KProcess::AllOutput); } @@ -532,7 +532,7 @@ void MainWindow::closeRunningForm(KProcess* process) previewing = false; delete process; - if (QFileInfo(m_backupName).exists()) + if (TQFileInfo(m_backupName).exists()) { struct stat statbuf; ::stat(m_fileName.local8Bit(), &statbuf); @@ -542,7 +542,7 @@ void MainWindow::closeRunningForm(KProcess* process) } } -void MainWindow::showProperties(QObject *o) +void MainWindow::showProperties(TQObject *o) { if (!o->isWidgetType()) { propertyEditor->setWidget(o, lastActiveFormWindow); @@ -552,7 +552,7 @@ void MainWindow::showProperties(QObject *o) hierarchyView->setFormWindow(0, 0); return; } - QWidget *w = (QWidget*)o; + TQWidget *w = (TQWidget*)o; setupHierarchyView(); FormWindow *fw = (FormWindow*)isAFormWindowChild(w); if (fw) { @@ -575,24 +575,24 @@ void MainWindow::resetTool() emit currentToolChanged(); } -void MainWindow::updateProperties(QObject *) +void MainWindow::updateProperties(TQObject *) { if (propertyEditor) propertyEditor->refetchData(); } -bool MainWindow::eventFilter(QObject *o, QEvent *e) +bool MainWindow::eventFilter(TQObject *o, TQEvent *e) { if (!o || !e || !o->isWidgetType()) - return QMainWindow::eventFilter(o, e); + return TQMainWindow::eventFilter(o, e); - QWidget *w = 0; + TQWidget *w = 0; bool passiveInteractor = WidgetFactory::isPassiveInteractor(o); switch (e->type()) { - case QEvent::AccelOverride: - if (((QKeyEvent*)e)->key() == Key_F1 && - (((QKeyEvent*)e)->state() & ShiftButton) != ShiftButton) { - w = (QWidget*)o; + case TQEvent::AccelOverride: + if (((TQKeyEvent*)e)->key() == Key_F1 && + (((TQKeyEvent*)e)->state() & ShiftButton) != ShiftButton) { + w = (TQWidget*)o; while (w) { if (w->inherits("PropertyList")) break; @@ -600,229 +600,229 @@ bool MainWindow::eventFilter(QObject *o, QEvent *e) } if (w) { propertyEditor->propertyList()->showCurrentWhatsThis(); - ((QKeyEvent*)e)->accept(); + ((TQKeyEvent*)e)->accept(); return true; } } break; - case QEvent::Accel: - if ((((QKeyEvent*)e)->key() == Key_A || - ((QKeyEvent*)e)->key() == Key_E) && - ((QKeyEvent*)e)->state() & ControlButton) { + case TQEvent::Accel: + if ((((TQKeyEvent*)e)->key() == Key_A || + ((TQKeyEvent*)e)->key() == Key_E) && + ((TQKeyEvent*)e)->state() & ControlButton) { if (qWorkspace()->activeWindow() && qWorkspace()->activeWindow()->inherits("SourceEditor")) { - ((QKeyEvent*)e)->ignore(); + ((TQKeyEvent*)e)->ignore(); return true; } } break; - case QEvent::MouseButtonPress: - if (((QMouseEvent*)e)->button() == MidButton && dynamic_cast<KommanderWidget *>(o)) + case TQEvent::MouseButtonPress: + if (((TQMouseEvent*)e)->button() == MidButton && dynamic_cast<KommanderWidget *>(o)) { - AssocTextEditor *editor = new AssocTextEditor((QWidget*)o, formWindow(), propertyEditor, m_partManager, + AssocTextEditor *editor = new AssocTextEditor((TQWidget*)o, formWindow(), propertyEditor, m_partManager, this, "AssocTextEditor", false); //deletes itself! editor->show(); - ((QKeyEvent*)e)->accept(); + ((TQKeyEvent*)e)->accept(); return true; } - case QEvent::ContextMenu: + case TQEvent::ContextMenu: if (o->inherits("QDesignerPopupMenu")) break; if (o && currentTool() == POINTER_TOOL && (o->inherits("QDesignerMenuBar") || o->inherits("QDesignerToolBar") || - (o->inherits("QComboBox") || o->inherits("QToolButton") || o->inherits("QDesignerToolBarSeparator")) && + (o->inherits("TQComboBox") || o->inherits("TQToolButton") || o->inherits("QDesignerToolBarSeparator")) && o->parent() && o->parent()->inherits("QDesignerToolBar"))) { - QWidget *w = (QWidget*)o; - if (w->inherits("QToolButton") || w->inherits("QComboBox") || w->inherits("QDesignerToolBarSeparator")) + TQWidget *w = (TQWidget*)o; + if (w->inherits("TQToolButton") || w->inherits("TQComboBox") || w->inherits("QDesignerToolBarSeparator")) w = w->parentWidget(); - QWidget *pw = w->parentWidget(); + TQWidget *pw = w->parentWidget(); while (pw) { if (pw->inherits("FormWindow")) { ((FormWindow*)pw)->emitShowProperties(w); if (!o->inherits("QDesignerToolBar")) - return !o->inherits("QToolButton") && !o->inherits("QMenuBar") && - !o->inherits("QComboBox") && !o->inherits("QDesignerToolBarSeparator"); + return !o->inherits("TQToolButton") && !o->inherits("TQMenuBar") && + !o->inherits("TQComboBox") && !o->inherits("QDesignerToolBarSeparator"); } pw = pw->parentWidget(); } } if (o && (o->inherits("QDesignerToolBar") || o->inherits("QDockWindowHandle")) - && e->type() == QEvent::ContextMenu) + && e->type() == TQEvent::ContextMenu) break; if (isAToolBarChild(o) && currentTool() != CONNECT_TOOL) break; - if (o && o->inherits("QSizeGrip")) + if (o && o->inherits("TQSizeGrip")) break; if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) break; if (!w->hasFocus()) w->setFocus(); if (!passiveInteractor || currentTool() != ORDER_TOOL) { - if(e->type() == QEvent::ContextMenu) { - ((FormWindow*)w)->handleContextMenu((QContextMenuEvent*)e, + if(e->type() == TQEvent::ContextMenu) { + ((FormWindow*)w)->handleContextMenu((TQContextMenuEvent*)e, ((FormWindow*)w)->designerWidget(o)); return true; } else { - ((FormWindow*)w)->handleMousePress((QMouseEvent*)e, + ((FormWindow*)w)->handleMousePress((TQMouseEvent*)e, ((FormWindow*)w)->designerWidget(o)); } } - lastPressWidget = (QWidget*)o; + lastPressWidget = (TQWidget*)o; if (passiveInteractor) - QTimer::singleShot(0, formWindow(), SLOT(visibilityChanged())); + TQTimer::singleShot(0, formWindow(), TQT_SLOT(visibilityChanged())); if (currentTool() == CONNECT_TOOL) return true; return !passiveInteractor; - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: lastPressWidget = 0; if (isAToolBarChild(o) && currentTool() != CONNECT_TOOL) break; - if (o && o->inherits("QSizeGrip")) + if (o && o->inherits("TQSizeGrip")) break; if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) break; if (!passiveInteractor) - ((FormWindow*)w)->handleMouseRelease((QMouseEvent*)e, ((FormWindow*)w)->designerWidget(o)); + ((FormWindow*)w)->handleMouseRelease((TQMouseEvent*)e, ((FormWindow*)w)->designerWidget(o)); if (passiveInteractor) { selectionChanged(); - QTimer::singleShot(0, formWindow(), SLOT(visibilityChanged())); + TQTimer::singleShot(0, formWindow(), TQT_SLOT(visibilityChanged())); } return !passiveInteractor; - case QEvent::MouseMove: + case TQEvent::MouseMove: if (isAToolBarChild(o) && currentTool() != CONNECT_TOOL) break; w = isAFormWindowChild(o); - if (lastPressWidget != (QWidget*)o && w && + if (lastPressWidget != (TQWidget*)o && w && !o->inherits("SizeHandle") && !o->inherits("OrderIndicator") && - !o->inherits("QPopupMenu") && !o->inherits("QMenuBar") && - !o->inherits("QSizeGrip")) + !o->inherits("TQPopupMenu") && !o->inherits("TQMenuBar") && + !o->inherits("TQSizeGrip")) return true; - if (o && o->inherits("QSizeGrip")) + if (o && o->inherits("TQSizeGrip")) break; - if (lastPressWidget != (QWidget*)o || + if (lastPressWidget != (TQWidget*)o || (!w || o->inherits("SizeHandle") || o->inherits("OrderIndicator"))) break; if (!passiveInteractor) - ((FormWindow*)w)->handleMouseMove((QMouseEvent*)e, ((FormWindow*)w)->designerWidget(o)); + ((FormWindow*)w)->handleMouseMove((TQMouseEvent*)e, ((FormWindow*)w)->designerWidget(o)); return !passiveInteractor; - case QEvent::KeyPress: - if (((QKeyEvent*)e)->key() == Key_Escape && currentTool() != POINTER_TOOL) { + case TQEvent::KeyPress: + if (((TQKeyEvent*)e)->key() == Key_Escape && currentTool() != POINTER_TOOL) { resetTool(); return false; } if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) break; - ((FormWindow*)w)->handleKeyPress((QKeyEvent*)e, ((FormWindow*)w)->designerWidget(o)); - if (((QKeyEvent*)e)->isAccepted()) + ((FormWindow*)w)->handleKeyPress((TQKeyEvent*)e, ((FormWindow*)w)->designerWidget(o)); + if (((TQKeyEvent*)e)->isAccepted()) return true; break; - case QEvent::MouseButtonDblClick: + case TQEvent::MouseButtonDblClick: if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) { - if (o && o->inherits("QToolButton") && ((QToolButton*)o)->isOn() && - o->parent() && o->parent()->inherits("QToolBar") && formWindow()) + if (o && o->inherits("TQToolButton") && ((TQToolButton*)o)->isOn() && + o->parent() && o->parent()->inherits("TQToolBar") && formWindow()) formWindow()->setToolFixed(); break; } if (currentTool() == ORDER_TOOL) { - ((FormWindow*)w)->handleMouseDblClick((QMouseEvent*)e, ((FormWindow*)w)->designerWidget(o)); + ((FormWindow*)w)->handleMouseDblClick((TQMouseEvent*)e, ((FormWindow*)w)->designerWidget(o)); return true; } if (!WidgetFactory::isPassiveInteractor(o)) return openEditor(((FormWindow*)w)->designerWidget(o), (FormWindow*)w); return true; - case QEvent::KeyRelease: + case TQEvent::KeyRelease: if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) break; - ((FormWindow*)w)->handleKeyRelease((QKeyEvent*)e, ((FormWindow*)w)->designerWidget(o)); - if (((QKeyEvent*)e)->isAccepted()) + ((FormWindow*)w)->handleKeyRelease((TQKeyEvent*)e, ((FormWindow*)w)->designerWidget(o)); + if (((TQKeyEvent*)e)->isAccepted()) return true; break; - case QEvent::Hide: + case TQEvent::Hide: if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) break; - if (((FormWindow*)w)->isWidgetSelected((QWidget*)o)) - ((FormWindow*)w)->selectWidget((QWidget*)o, false); + if (((FormWindow*)w)->isWidgetSelected((TQWidget*)o)) + ((FormWindow*)w)->selectWidget((TQWidget*)o, false); break; - case QEvent::Enter: - case QEvent::Leave: + case TQEvent::Enter: + case TQEvent::Leave: if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator") || o->inherits("QDesignerMenuBar")) break; return true; - case QEvent::Resize: - case QEvent::Move: + case TQEvent::Resize: + case TQEvent::Move: if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) break; - if (WidgetFactory::layoutType((QWidget*)o->parent()) != WidgetFactory::NoLayout) { - ((FormWindow*)w)->updateSelection((QWidget*)o); - if (e->type() != QEvent::Resize) - ((FormWindow*)w)->updateChildSelections((QWidget*)o); + if (WidgetFactory::layoutType((TQWidget*)o->parent()) != WidgetFactory::NoLayout) { + ((FormWindow*)w)->updateSelection((TQWidget*)o); + if (e->type() != TQEvent::Resize) + ((FormWindow*)w)->updateChildSelections((TQWidget*)o); } break; - case QEvent::Close: + case TQEvent::Close: break; - case QEvent::DragEnter: + case TQEvent::DragEnter: if (o == qWorkspace() || o == workspace() || o == workspace()->viewport()) { - workspace()->contentsDragEnterEvent((QDragEnterEvent*)e); + workspace()->contentsDragEnterEvent((TQDragEnterEvent*)e); return true; } break; - case QEvent::DragMove: + case TQEvent::DragMove: if (o == qWorkspace() || o == workspace() || o == workspace()->viewport()) { - workspace()->contentsDragMoveEvent((QDragMoveEvent*)e); + workspace()->contentsDragMoveEvent((TQDragMoveEvent*)e); return true; } break; - case QEvent::Drop: + case TQEvent::Drop: if (o == qWorkspace() || o == workspace() || o == workspace()->viewport()) { - workspace()->contentsDropEvent((QDropEvent*)e); + workspace()->contentsDropEvent((TQDropEvent*)e); return true; } break; - case QEvent::Show: + case TQEvent::Show: if (o != this) break; - if (((QShowEvent*)e)->spontaneous()) + if (((TQShowEvent*)e)->spontaneous()) break; - QApplication::sendPostedEvents(qworkspace, QEvent::ChildInserted); - showEvent((QShowEvent*)e); + TQApplication::sendPostedEvents(qworkspace, TQEvent::ChildInserted); + showEvent((TQShowEvent*)e); checkTempFiles(); return true; - case QEvent::Wheel: + case TQEvent::Wheel: if (!(w = isAFormWindowChild(o)) || o->inherits("SizeHandle") || o->inherits("OrderIndicator")) break; return true; - case QEvent::FocusIn: + case TQEvent::FocusIn: if (!o->inherits("FormWindow") && isAFormWindowChild(o)) return true; break; - case QEvent::FocusOut: + case TQEvent::FocusOut: if (!o->inherits("FormWindow") && isAFormWindowChild(o)) return true; break; default: - return QMainWindow::eventFilter(o, e); + return TQMainWindow::eventFilter(o, e); } - return QMainWindow::eventFilter(o, e); + return TQMainWindow::eventFilter(o, e); } -QWidget *MainWindow::isAFormWindowChild(QObject *o) const +TQWidget *MainWindow::isAFormWindowChild(TQObject *o) const { - if (o->parent() && o->parent()->inherits("QWizard") && !o->inherits("QPushButton")) + if (o->parent() && o->parent()->inherits("TQWizard") && !o->inherits("TQPushButton")) return 0; while (o) { if (o->inherits("FormWindow")) - return (QWidget*)o; + return (TQWidget*)o; o = o->parent(); } return 0; } -QWidget *MainWindow::isAToolBarChild(QObject *o) const +TQWidget *MainWindow::isAToolBarChild(TQObject *o) const { while (o) { if (o->inherits("QDesignerToolBar")) - return (QWidget*)o; + return (TQWidget*)o; if (o->inherits("FormWindow")) return 0; o = o->parent(); @@ -847,7 +847,7 @@ FormWindow *MainWindow::formWindow() void MainWindow::insertFormWindow(FormWindow *fw) { if (fw) - QWhatsThis::add(fw, i18n("<b>The Form Window</b>" + TQWhatsThis::add(fw, i18n("<b>The Form Window</b>" "<p>Use the various tools to add widgets or to change the layout " "and behavior of the components in the form. Select one or multiple " "widgets to move them or lay them out. If a single widget is chosen it can " @@ -859,16 +859,16 @@ void MainWindow::insertFormWindow(FormWindow *fw) "<p>You can have several forms open, and all open forms are listed " "in the <b>Form List</b>.")); - connect(fw, SIGNAL(showProperties(QObject *)), - this, SLOT(showProperties(QObject *))); - connect(fw, SIGNAL(updateProperties(QObject *)), - this, SLOT(updateProperties(QObject *))); - connect(this, SIGNAL(currentToolChanged()), - fw, SLOT(currentToolChanged())); - connect(fw, SIGNAL(selectionChanged()), - this, SLOT(selectionChanged())); - connect(fw, SIGNAL(undoRedoChanged(bool, bool, const QString &, const QString &)), - this, SLOT(updateUndoRedo(bool, bool, const QString &, const QString &))); + connect(fw, TQT_SIGNAL(showProperties(TQObject *)), + this, TQT_SLOT(showProperties(TQObject *))); + connect(fw, TQT_SIGNAL(updateProperties(TQObject *)), + this, TQT_SLOT(updateProperties(TQObject *))); + connect(this, TQT_SIGNAL(currentToolChanged()), + fw, TQT_SLOT(currentToolChanged())); + connect(fw, TQT_SIGNAL(selectionChanged()), + this, TQT_SLOT(selectionChanged())); + connect(fw, TQT_SIGNAL(undoRedoChanged(bool, bool, const TQString &, const TQString &)), + this, TQT_SLOT(updateUndoRedo(bool, bool, const TQString &, const TQString &))); fw->show(); fw->currentToolChanged(); @@ -897,9 +897,9 @@ bool MainWindow::unregisterClient(FormWindow *w) return true; } -void MainWindow::activeWindowChanged(QWidget *w) +void MainWindow::activeWindowChanged(TQWidget *w) { - QWidget *old = formWindow(); + TQWidget *old = formWindow(); if (w && w->inherits("FormWindow")) { FormWindow *fw = (FormWindow *) w; @@ -934,7 +934,7 @@ void MainWindow::activeWindowChanged(QWidget *w) emit hasActiveForm(false); propertyEditor->clear(); hierarchyView->clear(); - updateUndoRedo(false, false, QString::null, QString::null); + updateUndoRedo(false, false, TQString::null, TQString::null); } selectionChanged(); @@ -947,7 +947,7 @@ void MainWindow::activeWindowChanged(QWidget *w) void MainWindow::updateUndoRedo(bool undoAvailable, bool redoAvailable, - const QString &undoCmd, const QString &redoCmd) + const TQString &undoCmd, const TQString &redoCmd) { actionEditUndo->setEnabled(undoAvailable); actionEditRedo->setEnabled(redoAvailable); @@ -969,15 +969,15 @@ void MainWindow::updateUndoRedo(bool undoAvailable, bool redoAvailable, } } -QWorkspace *MainWindow::qWorkspace() const +TQWorkspace *MainWindow::qWorkspace() const { return qworkspace; } -void MainWindow::popupFormWindowMenu(const QPoint & gp, FormWindow *fw) +void MainWindow::popupFormWindowMenu(const TQPoint & gp, FormWindow *fw) { - QValueList<int> ids; - QMap<QString, int> commands; + TQValueList<int> ids; + TQMap<TQString, int> commands; setupRMBSpecialCommands(ids, commands, fw); setupRMBProperties(ids, commands, fw); @@ -988,14 +988,14 @@ void MainWindow::popupFormWindowMenu(const QPoint & gp, FormWindow *fw) handleRMBProperties(r, commands, fw); handleRMBSpecialCommands(r, commands, fw); - for (QValueList<int>::Iterator i = ids.begin(); i != ids.end(); ++i) + for (TQValueList<int>::Iterator i = ids.begin(); i != ids.end(); ++i) rmbFormWindow->removeItem(*i); } -void MainWindow::popupWidgetMenu(const QPoint &gp, FormWindow * /*fw*/, QWidget * w) +void MainWindow::popupWidgetMenu(const TQPoint &gp, FormWindow * /*fw*/, TQWidget * w) { - QValueList<int> ids; - QMap<QString, int> commands; + TQValueList<int> ids; + TQMap<TQString, int> commands; setupRMBSpecialCommands(ids, commands, w); setupRMBProperties(ids, commands, w); @@ -1006,25 +1006,25 @@ void MainWindow::popupWidgetMenu(const QPoint &gp, FormWindow * /*fw*/, QWidget handleRMBProperties(r, commands, w); handleRMBSpecialCommands(r, commands, w); - for (QValueList<int>::Iterator i = ids.begin(); i != ids.end(); ++i) + for (TQValueList<int>::Iterator i = ids.begin(); i != ids.end(); ++i) rmbWidgets->removeItem(*i); } -void MainWindow::setupRMBProperties(QValueList<int> &ids, QMap<QString, int> &props, QWidget *w) +void MainWindow::setupRMBProperties(TQValueList<int> &ids, TQMap<TQString, int> &props, TQWidget *w) { - const QMetaProperty* text = w->metaObject()->property(w->metaObject()->findProperty("text", true), true); - if (text && qstrcmp(text->type(), "QString") != 0) + const TQMetaProperty* text = w->metaObject()->property(w->metaObject()->findProperty("text", true), true); + if (text && qstrcmp(text->type(), "TQString") != 0) text = 0; - const QMetaProperty* title = w->metaObject()->property(w->metaObject()->findProperty("title", true), true); - if (title && qstrcmp(title->type(), "QString") != 0) + const TQMetaProperty* title = w->metaObject()->property(w->metaObject()->findProperty("title", true), true); + if (title && qstrcmp(title->type(), "TQString") != 0) title = 0; - const QMetaProperty* pagetitle = + const TQMetaProperty* pagetitle = w->metaObject()->property(w->metaObject()->findProperty("pageTitle", true), true); - if (pagetitle && qstrcmp(pagetitle->type(), "QString") != 0) + if (pagetitle && qstrcmp(pagetitle->type(), "TQString") != 0) pagetitle = 0; - const QMetaProperty* pixmap = + const TQMetaProperty* pixmap = w->metaObject()->property(w->metaObject()->findProperty("pixmap", true), true); - if (pixmap && qstrcmp(pixmap->type(), "QPixmap") != 0) + if (pixmap && qstrcmp(pixmap->type(), "TQPixmap") != 0) pixmap = 0; if (text && text->designable(w) || @@ -1038,7 +1038,7 @@ void MainWindow::setupRMBProperties(QValueList<int> &ids, QMap<QString, int> &pr ids << (id = rmbWidgets->insertItem(i18n("Choose Pixmap..."), -1, 0)); props.insert("pixmap", id); } - if (text && text->designable(w) && !w->inherits("QTextEdit")) { + if (text && text->designable(w) && !w->inherits("TQTextEdit")) { ids << (id = rmbWidgets->insertItem(i18n("Edit Text..."), -1, 0)); props.insert("text", id); } @@ -1053,7 +1053,7 @@ void MainWindow::setupRMBProperties(QValueList<int> &ids, QMap<QString, int> &pr } } -void MainWindow::setupRMBSpecialCommands(QValueList<int> &ids, QMap<QString, int> &commands, QWidget *w) +void MainWindow::setupRMBSpecialCommands(TQValueList<int> &ids, TQMap<TQString, int> &commands, TQWidget *w) { int id; // KommanderWidget doesn't derive from QObject @@ -1068,7 +1068,7 @@ void MainWindow::setupRMBSpecialCommands(QValueList<int> &ids, QMap<QString, int commands.insert("assoc", id); } - if (w->inherits("QTabWidget")) { + if (w->inherits("TQTabWidget")) { if (ids.isEmpty()) ids << rmbWidgets->insertSeparator(0); if (((QDesignerTabWidget*)w)->count() > 1) { @@ -1078,10 +1078,10 @@ void MainWindow::setupRMBSpecialCommands(QValueList<int> &ids, QMap<QString, int ids << (id = rmbWidgets->insertItem(i18n("Add Page"), -1, 0)); commands.insert("add", id); } - if (w->inherits("QToolBox")) { + if (w->inherits("TQToolBox")) { if (ids.isEmpty()) ids << rmbWidgets->insertSeparator(0); - if (((QToolBox*)w)->count() > 1) { + if (((TQToolBox*)w)->count() > 1) { ids << (id = rmbWidgets->insertItem(i18n("Delete Page"), -1, 0)); commands.insert("remove", id); } @@ -1097,7 +1097,7 @@ void MainWindow::setupRMBSpecialCommands(QValueList<int> &ids, QMap<QString, int } } -void MainWindow::setupRMBSpecialCommands(QValueList<int> &ids, QMap<QString, int> &commands, FormWindow *fw) +void MainWindow::setupRMBSpecialCommands(TQValueList<int> &ids, TQMap<TQString, int> &commands, FormWindow *fw) { int id; @@ -1113,11 +1113,11 @@ void MainWindow::setupRMBSpecialCommands(QValueList<int> &ids, QMap<QString, int commands.insert("assoc", id); } - if (fw->mainContainer()->inherits("QWizard")) { + if (fw->mainContainer()->inherits("TQWizard")) { if (ids.isEmpty()) ids << rmbFormWindow->insertSeparator(0); - if (((QWizard*)fw->mainContainer())->pageCount() > 1) { + if (((TQWizard*)fw->mainContainer())->pageCount() > 1) { ids << (id = rmbFormWindow->insertItem(i18n("Delete Page"), -1, 0)); commands.insert("remove", id); } @@ -1131,7 +1131,7 @@ void MainWindow::setupRMBSpecialCommands(QValueList<int> &ids, QMap<QString, int ids << (id = rmbFormWindow->insertItem(i18n("Edit Pages..."), -1, 0)); commands.insert("edit", id); - } else if (fw->mainContainer()->inherits("QMainWindow")) { + } else if (fw->mainContainer()->inherits("TQMainWindow")) { if (ids.isEmpty()) ids << rmbFormWindow->insertSeparator(0); ids << (id = rmbFormWindow->insertItem(i18n("Add Menu Item"), -1, 0)); @@ -1141,58 +1141,58 @@ void MainWindow::setupRMBSpecialCommands(QValueList<int> &ids, QMap<QString, int } } -void MainWindow::handleRMBProperties(int id, QMap<QString, int> &props, QWidget *w) +void MainWindow::handleRMBProperties(int id, TQMap<TQString, int> &props, TQWidget *w) { if (id == props[ "text" ]) { bool ok = false; - QString text; - if (w->inherits("QTextView") || w->inherits("QLabel")) { + TQString text; + if (w->inherits("TQTextView") || w->inherits("TQLabel")) { text = TextEditor::getText(this, w->property("text").toString()); ok = !text.isEmpty(); } else { text = KInputDialog::getText(i18n("Text"), i18n("New text:"), w->property("text").toString(), &ok, this); } if (ok) { - QString pn(i18n("Set the 'text' of '%1'").arg(w->name())); + TQString pn(i18n("Set the 'text' of '%1'").arg(w->name())); SetPropertyCommand *cmd = new SetPropertyCommand(pn, formWindow(), w, propertyEditor, "text", w->property("text"), - text, QString::null, QString::null); + text, TQString::null, TQString::null); cmd->execute(); formWindow()->commandHistory()->addCommand(cmd); MetaDataBase::setPropertyChanged(w, "text", true); } } else if (id == props[ "title" ]) { bool ok = false; - QString title = KInputDialog::getText(i18n("Title"), i18n("New title:"), w->property("title").toString(), &ok, this); + TQString title = KInputDialog::getText(i18n("Title"), i18n("New title:"), w->property("title").toString(), &ok, this); if (ok) { - QString pn(i18n("Set the 'title' of '%1'").arg(w->name())); + TQString pn(i18n("Set the 'title' of '%1'").arg(w->name())); SetPropertyCommand *cmd = new SetPropertyCommand(pn, formWindow(), w, propertyEditor, "title", w->property("title"), - title, QString::null, QString::null); + title, TQString::null, TQString::null); cmd->execute(); formWindow()->commandHistory()->addCommand(cmd); MetaDataBase::setPropertyChanged(w, "title", true); } } else if (id == props[ "pagetitle" ]) { bool ok = false; - QString text = KInputDialog::getText(i18n("Page Title"), i18n("New page title:"), w->property("pageTitle").toString(), &ok, this); + TQString text = KInputDialog::getText(i18n("Page Title"), i18n("New page title:"), w->property("pageTitle").toString(), &ok, this); if (ok) { - QString pn(i18n("Set the 'pageTitle' of '%1'").arg(w->name())); + TQString pn(i18n("Set the 'pageTitle' of '%1'").arg(w->name())); SetPropertyCommand *cmd = new SetPropertyCommand(pn, formWindow(), w, propertyEditor, "pageTitle", w->property("pageTitle"), - text, QString::null, QString::null); + text, TQString::null, TQString::null); cmd->execute(); formWindow()->commandHistory()->addCommand(cmd); MetaDataBase::setPropertyChanged(w, "pageTitle", true); } } else if (id == props[ "pixmap" ]) { - QPixmap oldPix = w->property("pixmap").toPixmap(); - QPixmap pix = qChoosePixmap(this, formWindow(), oldPix); + TQPixmap oldPix = w->property("pixmap").toPixmap(); + TQPixmap pix = qChoosePixmap(this, formWindow(), oldPix); if (!pix.isNull()) { - QString pn(i18n("Set the 'pixmap' of '%1'").arg(w->name())); + TQString pn(i18n("Set the 'pixmap' of '%1'").arg(w->name())); SetPropertyCommand *cmd = new SetPropertyCommand(pn, formWindow(), w, propertyEditor, "pixmap", w->property("pixmap"), - pix, QString::null, QString::null); + pix, TQString::null, TQString::null); cmd->execute(); formWindow()->commandHistory()->addCommand(cmd); MetaDataBase::setPropertyChanged(w, "pixmap", true); @@ -1200,7 +1200,7 @@ void MainWindow::handleRMBProperties(int id, QMap<QString, int> &props, QWidget } } -void MainWindow::handleRMBSpecialCommands(int id, QMap<QString, int> &commands, QWidget *w) +void MainWindow::handleRMBSpecialCommands(int id, TQMap<TQString, int> &commands, TQWidget *w) { // associated text menu // we assume all widgets derive from KommanderWidget [MB02] @@ -1211,8 +1211,8 @@ void MainWindow::handleRMBSpecialCommands(int id, QMap<QString, int> &commands, editor->show(); } - if (w->inherits("QTabWidget")) { - QTabWidget *tw = (QTabWidget*)w; + if (w->inherits("TQTabWidget")) { + TQTabWidget *tw = (TQTabWidget*)w; if (id == commands[ "add" ]) { AddTabPageCommand *cmd = new AddTabPageCommand(i18n("Add Page to %1").arg(tw->name()), formWindow(), tw, "Tab"); @@ -1229,8 +1229,8 @@ void MainWindow::handleRMBSpecialCommands(int id, QMap<QString, int> &commands, } } } - if (w->inherits("QToolBox")) { - QToolBox *tw = (QToolBox*)w; + if (w->inherits("TQToolBox")) { + TQToolBox *tw = (TQToolBox*)w; if (id == commands[ "add" ]) { AddToolBoxPageCommand *cmd = new AddToolBoxPageCommand(i18n("Add Page to %1").arg(tw->name()), formWindow(), tw, "Page"); @@ -1253,7 +1253,7 @@ void MainWindow::handleRMBSpecialCommands(int id, QMap<QString, int> &commands, } } -void MainWindow::handleRMBSpecialCommands(int id, QMap<QString, int> &commands, FormWindow *fw) +void MainWindow::handleRMBSpecialCommands(int id, TQMap<TQString, int> &commands, FormWindow *fw) { if(id == commands["assoc"]) @@ -1264,8 +1264,8 @@ void MainWindow::handleRMBSpecialCommands(int id, QMap<QString, int> &commands, } - if (fw->mainContainer()->inherits("QWizard")) { - QWizard *wiz = (QWizard*)fw->mainContainer(); + if (fw->mainContainer()->inherits("TQWizard")) { + TQWizard *wiz = (TQWizard*)fw->mainContainer(); if (id == commands[ "add" ]) { AddWizardPageCommand *cmd = new AddWizardPageCommand(i18n("Add Page to %1").arg(wiz->name()), formWindow(), wiz, "Page"); @@ -1288,17 +1288,17 @@ void MainWindow::handleRMBSpecialCommands(int id, QMap<QString, int> &commands, bool ok = false; QDesignerWizard *dw = (QDesignerWizard*)wiz; - QString text = KInputDialog::getText(i18n("Page Title"), i18n("New page title:"), dw->pageTitle(), &ok, this); + TQString text = KInputDialog::getText(i18n("Page Title"), i18n("New page title:"), dw->pageTitle(), &ok, this); if (ok) { - QString pn(i18n("Rename page %1 of %2").arg(dw->pageTitle()).arg(wiz->name())); + TQString pn(i18n("Rename page %1 of %2").arg(dw->pageTitle()).arg(wiz->name())); RenameWizardPageCommand *cmd = new RenameWizardPageCommand(pn, formWindow() , wiz, wiz->indexOf(wiz->currentPage()), text); formWindow()->commandHistory()->addCommand(cmd); cmd->execute(); } } - } else if (fw->mainContainer()->inherits("QMainWindow")) { - QMainWindow *mw = (QMainWindow*)fw->mainContainer(); + } else if (fw->mainContainer()->inherits("TQMainWindow")) { + TQMainWindow *mw = (TQMainWindow*)fw->mainContainer(); if (id == commands[ "add_toolbar" ]) { AddToolBarCommand *cmd = new AddToolBarCommand(i18n("Add Toolbar to '%1'").arg(formWindow()->name()), formWindow(), mw); formWindow()->commandHistory()->addCommand(cmd); @@ -1313,8 +1313,8 @@ void MainWindow::handleRMBSpecialCommands(int id, QMap<QString, int> &commands, void MainWindow::clipboardChanged() { - QString text(kapp->clipboard()->text()); - QString start("<!DOCTYPE UI-SELECTION>"); + TQString text(kapp->clipboard()->text()); + TQString start("<!DOCTYPE UI-SELECTION>"); actionEditPaste->setEnabled(text.left(start.length()) == start); } @@ -1353,11 +1353,11 @@ void MainWindow::selectionChanged() actionEditSplitVertical->setEnabled(false); enable = false; - QWidgetList widgets = formWindow()->selectedWidgets(); + TQWidgetList widgets = formWindow()->selectedWidgets(); if (selectedWidgets > 1) { int unlaidout = 0; int laidout = 0; - for (QWidget *w = widgets.first(); w; w = widgets.next()) { + for (TQWidget *w = widgets.first(); w; w = widgets.next()) { if (!w->parentWidget() || WidgetFactory::layoutType(w->parentWidget()) == WidgetFactory::NoLayout) unlaidout++; else @@ -1373,7 +1373,7 @@ void MainWindow::selectionChanged() layoutSelected = unlaidout > 1; breakLayout = laidout > 0; } else if (selectedWidgets == 1) { - QWidget *w = widgets.first(); + TQWidget *w = widgets.first(); bool isContainer = WidgetDatabase::isContainer(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w))) || w == formWindow()->mainContainer(); actionEditAdjustSize->setEnabled(!w->parentWidget() || @@ -1417,7 +1417,7 @@ void MainWindow::selectionChanged() } } else if (selectedWidgets == 0 && formWindow()) { actionEditAdjustSize->setEnabled(true); - QWidget *w = formWindow()->mainContainer(); + TQWidget *w = formWindow()->mainContainer(); if (WidgetFactory::layoutType(w) == WidgetFactory::NoLayout) { if (!formWindow()->hasInsertedChildren(w)) { actionEditHLayout->setEnabled(false); @@ -1491,7 +1491,7 @@ void MainWindow::readConfig() restoreConfig = config->readBoolEntry("RestoreWorkspace", true); splashScreen = config->readBoolEntry("SplashScreen", true); docPath = config->readEntry("DocPath", docPath); - templPath = config->readEntry("TemplatePath", QString::null); + templPath = config->readEntry("TemplatePath", TQString::null); config->setGroup("Grid"); sGrid = config->readBoolEntry("Snap", true); @@ -1503,11 +1503,11 @@ void MainWindow::readConfig() if (config->readBoolEntry("UsePixmap", true)) qworkspace->setBackgroundPixmap(PixmapChooser::loadPixmap("background.png", PixmapChooser::NoSize)); else - qworkspace->setBackgroundColor(QColor(config->readEntry("Color", "#f0f0f0")).rgb()); + qworkspace->setBackgroundColor(TQColor(config->readEntry("Color", "#f0f0f0")).rgb()); /* config->setGroup("Geometry"); - QSize winSize = size(); + TQSize winSize = size(); resize(config->readSizeEntry("MainWindow", &winSize)); if (config->readBoolEntry("MainWindowMax", false)) showMaximized(); @@ -1526,7 +1526,7 @@ void MainWindow::readConfig() KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); for(int i = 0; i < args->count(); i++) { - QFileInfo fi(args->url(i).path()); + TQFileInfo fi(args->url(i).path()); if (fi.exists() && openFormWindow(args->url(i).path())) actionRecent->addURL(args->url(i)); } @@ -1541,9 +1541,9 @@ HierarchyView *MainWindow::objectHierarchy() const return hierarchyView; } -QPopupMenu *MainWindow::setupNormalHierarchyMenu(QWidget *parent) +TQPopupMenu *MainWindow::setupNormalHierarchyMenu(TQWidget *parent) { - QPopupMenu *menu = new QPopupMenu(parent); + TQPopupMenu *menu = new TQPopupMenu(parent); actionEditCut->plug(menu); actionEditCopy->plug(menu); @@ -1553,9 +1553,9 @@ QPopupMenu *MainWindow::setupNormalHierarchyMenu(QWidget *parent) return menu; } -QPopupMenu *MainWindow::setupTabWidgetHierarchyMenu(QWidget *parent, const char *addSlot, const char *removeSlot) +TQPopupMenu *MainWindow::setupTabWidgetHierarchyMenu(TQWidget *parent, const char *addSlot, const char *removeSlot) { - QPopupMenu *menu = new QPopupMenu(parent); + TQPopupMenu *menu = new TQPopupMenu(parent); menu->insertItem(i18n("Add Page"), parent, addSlot); menu->insertItem(i18n("Delete Page"), parent, removeSlot); @@ -1568,13 +1568,13 @@ QPopupMenu *MainWindow::setupTabWidgetHierarchyMenu(QWidget *parent, const char return menu; } -void MainWindow::closeEvent(QCloseEvent *e) +void MainWindow::closeEvent(TQCloseEvent *e) { - QWidgetList windows = qWorkspace()->windowList(); - QWidgetListIt wit(windows); + TQWidgetList windows = qWorkspace()->windowList(); + TQWidgetListIt wit(windows); while (wit.current()) { - QWidget *w = wit.current(); + TQWidget *w = wit.current(); ++wit; if (w->inherits("FormWindow")) { @@ -1592,7 +1592,7 @@ void MainWindow::closeEvent(QCloseEvent *e) if (client) { - QDir home(QDir::homeDirPath()); + TQDir home(TQDir::homeDirPath()); home.remove(".designerpid"); } } @@ -1618,7 +1618,7 @@ ActionEditor *MainWindow::actioneditor() const return actionEditor; } -bool MainWindow::openEditor(QWidget* w, FormWindow*) +bool MainWindow::openEditor(TQWidget* w, FormWindow*) { if (WidgetFactory::hasSpecialEditor(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)))) { statusBar()->message(i18n("Edit %1...").arg(w->className())); @@ -1627,22 +1627,22 @@ bool MainWindow::openEditor(QWidget* w, FormWindow*) return true; } - const QMetaProperty* text = w->metaObject()->property(w->metaObject()->findProperty("text", true), true); - const QMetaProperty* title = w->metaObject()->property(w->metaObject()->findProperty("title", true), true); + const TQMetaProperty* text = w->metaObject()->property(w->metaObject()->findProperty("text", true), true); + const TQMetaProperty* title = w->metaObject()->property(w->metaObject()->findProperty("title", true), true); if (text && text->designable(w)) { bool ok = false; - QString text; - if (w->inherits("QTextView") || w->inherits("QLabel")) { + TQString text; + if (w->inherits("TQTextView") || w->inherits("TQLabel")) { text = TextEditor::getText(this, w->property("text").toString()); ok = !text.isEmpty(); } else { text = KInputDialog::getText(i18n("Text"), i18n("New text:"), w->property("text").toString(), &ok, this); } if (ok) { - QString pn(i18n("Set the 'text' of '%2'").arg(w->name())); + TQString pn(i18n("Set the 'text' of '%2'").arg(w->name())); SetPropertyCommand *cmd = new SetPropertyCommand(pn, formWindow(), w, propertyEditor, "text", w->property("text"), - text, QString::null, QString::null); + text, TQString::null, TQString::null); cmd->execute(); formWindow()->commandHistory()->addCommand(cmd); MetaDataBase::setPropertyChanged(w, "text", true); @@ -1651,13 +1651,13 @@ bool MainWindow::openEditor(QWidget* w, FormWindow*) } if (title && title->designable(w)) { bool ok = false; - QString text; + TQString text; text = KInputDialog::getText(i18n("Title"), i18n("New title:"), w->property("title").toString(), &ok, this); if (ok) { - QString pn(i18n("Set the 'title' of '%2'").arg(w->name())); + TQString pn(i18n("Set the 'title' of '%2'").arg(w->name())); SetPropertyCommand *cmd = new SetPropertyCommand(pn, formWindow(), w, propertyEditor, "title", w->property("title"), - text, QString::null, QString::null); + text, TQString::null, TQString::null); cmd->execute(); formWindow()->commandHistory()->addCommand(cmd); MetaDataBase::setPropertyChanged(w, "title", true); @@ -1668,13 +1668,13 @@ bool MainWindow::openEditor(QWidget* w, FormWindow*) return true; } -void MainWindow::setGrid(const QPoint &p) +void MainWindow::setGrid(const TQPoint &p) { if (p == grd) return; grd = p; - QWidgetList windows = qWorkspace()->windowList(); - for (QWidget *w = windows.first(); w; w = windows.next()) { + TQWidgetList windows = qWorkspace()->windowList(); + for (TQWidget *w = windows.first(); w; w = windows.next()) { if (!w->inherits("FormWindow")) continue; ((FormWindow*)w)->mainContainer()->update(); @@ -1686,8 +1686,8 @@ void MainWindow::setShowGrid(bool b) if (b == sGrid) return; sGrid = b; - QWidgetList windows = qWorkspace()->windowList(); - for (QWidget *w = windows.first(); w; w = windows.next()) { + TQWidgetList windows = qWorkspace()->windowList(); + for (TQWidget *w = windows.first(); w; w = windows.next()) { if (!w->inherits("FormWindow")) continue; ((FormWindow*)w)->mainContainer()->update(); @@ -1701,9 +1701,9 @@ void MainWindow::setSnapGrid(bool b) snGrid = b; } -QString MainWindow::documentationPath() const +TQString MainWindow::documentationPath() const { - QString result = docPath; + TQString result = docPath; if (docPath[0] == '$') { int fs = docPath.find('/'); @@ -1724,7 +1724,7 @@ QString MainWindow::documentationPath() const void MainWindow::windowsMenuActivated(int id) { - QWidget* w = qworkspace->windowList().at(id); + TQWidget* w = qworkspace->windowList().at(id); if (w) w->setFocus(); } @@ -1733,20 +1733,20 @@ void MainWindow::windowsMenuActivated(int id) void MainWindow::checkTempFiles() { - QString s = QDir::homeDirPath() + "/.designer"; - QString baseName = s+ "/saved-form-"; - if (!QFile::exists(baseName + "1.kmdr")) + TQString s = TQDir::homeDirPath() + "/.designer"; + TQString baseName = s+ "/saved-form-"; + if (!TQFile::exists(baseName + "1.kmdr")) return; - QDir d(s); + TQDir d(s); d.setNameFilter("*.kmdr"); - QStringList lst = d.entryList(); - QApplication::restoreOverrideCursor(); + TQStringList lst = d.entryList(); + TQApplication::restoreOverrideCursor(); bool load = KMessageBox::questionYesNo(this, i18n("Kommander found some temporary saved files, which were\n" "written when Kommander crashed last time. Do you want to\n" "load these files?"), i18n("Restoring Last Session"), i18n("Load"), i18n("Do Not Load")) == KMessageBox::Yes; - QApplication::setOverrideCursor(waitCursor); - for (QStringList::Iterator it = lst.begin(); it != lst.end(); ++it) { + TQApplication::setOverrideCursor(waitCursor); + for (TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it) { if (load) openFormWindow(s + "/" + *it, false); d.remove(*it); @@ -1755,10 +1755,10 @@ void MainWindow::checkTempFiles() void MainWindow::showDialogHelp() { - QWidget *w = (QWidget*)sender(); + TQWidget *w = (TQWidget*)sender(); w = w->topLevelWidget(); - QString link = "designer-manual-12.html#"; + TQString link = "designer-manual-12.html#"; if (w->inherits("NewFormBase")) link += "dialog-file-new"; @@ -1809,7 +1809,7 @@ void MainWindow::showDialogHelp() void MainWindow::fileOpenRecent(const KURL& filename) { - if (!QFile::exists(filename.path())) + if (!TQFile::exists(filename.path())) { KMessageBox::error(this, i18n("<qt>Could not open file:<br><b>%1</b><br>File does not exist.</qt>"). arg(filename.path()), i18n("Open File")); @@ -1826,9 +1826,9 @@ void MainWindow::setupPlugins() -void MainWindow::setModified(bool b, QWidget *window) +void MainWindow::setModified(bool b, TQWidget *window) { - QWidget *w = window; + TQWidget *w = window; while (w) { if (w->inherits("FormWindow")) @@ -1851,11 +1851,11 @@ void MainWindow::updateWorkspace() { } -QWidget *MainWindow::findRealForm(QWidget *wid) +TQWidget *MainWindow::findRealForm(TQWidget *wid) { - QWidgetList windows = qWorkspace()->windowList(); - for (QWidget *w = windows.first(); w; w = windows.next()) { - if (QString(w->name()) == QString(wid->name())) + TQWidgetList windows = qWorkspace()->windowList(); + for (TQWidget *w = windows.first(); w; w = windows.next()) { + if (TQString(w->name()) == TQString(wid->name())) return w; } return 0; @@ -1880,9 +1880,9 @@ int MainWindow::currentLayoutDefaultMargin() const return BOXLAYOUT_DEFAULT_MARGIN; } -QString MainWindow::whatsThisFrom(const QString&) +TQString MainWindow::whatsThisFrom(const TQString&) { - return QString::null; + return TQString::null; } void MainWindow::slotActivePartChanged(KParts::Part * part) |