diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-16 19:02:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-16 19:02:47 +0000 |
commit | e985f7e545f4739493965aad69bbecb136dc9346 (patch) | |
tree | 54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /kommander/editor/formwindow.cpp | |
parent | f7670c198945adc3b95ad69a959fe5f8ae55b493 (diff) | |
download | tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip |
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/editor/formwindow.cpp')
-rw-r--r-- | kommander/editor/formwindow.cpp | 576 |
1 files changed, 288 insertions, 288 deletions
diff --git a/kommander/editor/formwindow.cpp b/kommander/editor/formwindow.cpp index ac0712b4..2218a977 100644 --- a/kommander/editor/formwindow.cpp +++ b/kommander/editor/formwindow.cpp @@ -1,5 +1,5 @@ /********************************************************************** - This file is based on Qt Designer, Copyright (C) 2000 Trolltech AS. All rights reserved. + This file is based on TQt Designer, Copyright (C) 2000 Trolltech AS. All rights reserved. This file may be distributed and/or modified under the terms of the GNU General Public License version 2 as published by the Free Software @@ -17,7 +17,7 @@ **********************************************************************/ -// Qt includes +// TQt includes #include <tqaccel.h> #include <tqapplication.h> #include <tqbitmap.h> @@ -36,7 +36,7 @@ #include <tqpushbutton.h> #include <tqsizegrip.h> #include <tqspinbox.h> -#include <tqstatusbar.h> +#include <statusbar.h> #include <tqtimer.h> #include <tqtooltip.h> #include <tqwhatsthis.h> @@ -54,7 +54,7 @@ #include "sizehandle.h" #include "metadatabase.h" #include "resource.h" -#include "layout.h" +#include "tqlayout.h" #include "connectioneditorimpl.h" #include "widgetdatabase.h" #include "pixmapchooser.h" @@ -70,9 +70,9 @@ static void setCursorToAll(const TQCursor &c, TQWidget *start) { start->setCursor(c); - TQObjectList *l = (TQObjectList*)start->children(); - if (l) - for (TQObject *o = l->first(); o; o = l->next()) + TQObjectList l = start->childrenListObject(); + if (!l.isEmpty()) + for (TQObject *o = l.first(); o; o = l.next()) { if (o->isWidgetType() && !o->inherits("SizeHandle")) setCursorToAll(c, ((TQWidget*)o)); @@ -81,13 +81,13 @@ static void setCursorToAll(const TQCursor &c, TQWidget *start) static void restoreCursors(TQWidget *start, FormWindow *fw) { - if (fw->widgets()->find(start)) + if (fw->widgets()->tqfind(start)) start->setCursor(MetaDataBase::cursor(start)); else - start->setCursor(Qt::ArrowCursor); - TQObjectList *l = (TQObjectList*)start->children(); - if (l) - for (TQObject *o = l->first(); o; o = l->next()) + start->setCursor(TQt::ArrowCursor); + TQObjectList l = start->childrenListObject(); + if (!l.isEmpty()) + for (TQObject *o = l.first(); o; o = l.next()) { if (o->isWidgetType() && !o->inherits("SizeHandle")) restoreCursors(((TQWidget*)o), fw); @@ -110,8 +110,8 @@ static void restoreCursors(TQWidget *start, FormWindow *fw) event filter which is implemented in MainWindow::eventFilter(). */ -FormWindow::FormWindow(FormFile *f, MainWindow *mw, TQWidget *parent, const char *name) - : TQWidget(parent, name, WDestructiveClose), mainwindow(mw), +FormWindow::FormWindow(FormFile *f, MainWindow *mw, TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name, WDestructiveClose), mainwindow(mw), commands(100), pixInline(true) { ff = f; @@ -119,8 +119,8 @@ FormWindow::FormWindow(FormFile *f, MainWindow *mw, TQWidget *parent, const char initSlots(); } -FormWindow::FormWindow(FormFile *f, TQWidget *parent, const char *name) - : TQWidget(parent, name, WDestructiveClose), mainwindow(0), +FormWindow::FormWindow(FormFile *f, TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name, WDestructiveClose), mainwindow(0), commands(100), pixInline(true) { ff = f; @@ -129,7 +129,7 @@ FormWindow::FormWindow(FormFile *f, TQWidget *parent, const char *name) void FormWindow::init() { - MetaDataBase::addEntry(this); + MetaDataBase::addEntry(TQT_TQOBJECT(this)); ff->setFormWindow(this); propertyWidget = 0; toolFixed = false; @@ -140,7 +140,7 @@ void FormWindow::init() unclippedPainter = 0; widgetPressed = false; drawRubber = false; - setFocusPolicy(ClickFocus); + setFocusPolicy(TQ_ClickFocus); sizePreviewLabel = 0; checkSelectionsTimer = new TQTimer(this, "checkSelectionsTimer"); connect(checkSelectionsTimer, TQT_SIGNAL(timeout()), @@ -167,7 +167,7 @@ void FormWindow::init() TQWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName(TQFRAME_OBJECT_NAME_STRING), this); setMainContainer(w); - propertyWidget = w; + propertyWidget = TQT_TQOBJECT(w); targetContainer = 0; hadOwnPalette = false; @@ -178,7 +178,7 @@ void FormWindow::init() void FormWindow::setMainWindow(MainWindow *w) { mainwindow = w; - MetaDataBase::addEntry(this); + MetaDataBase::addEntry(TQT_TQOBJECT(this)); initSlots(); } @@ -190,7 +190,7 @@ FormWindow::~FormWindow() { if (MainWindow::self->objectHierarchy()->formWindow() == this) MainWindow::self->objectHierarchy()->setFormWindow(0, 0); - MetaDataBase::clear(this); + MetaDataBase::clear(TQT_TQOBJECT(this)); if (ff) ff->setFormWindow(0); } @@ -210,17 +210,17 @@ void FormWindow::paintGrid(TQWidget *w, TQPaintEvent *e) TQPixmap grid; TQString grid_name; grid_name.sprintf("FormWindowGrid_%d_%d", mainWindow()->grid().x(), mainWindow()->grid().y()); - if(!TQPixmapCache::find(grid_name, grid)) { + if(!TQPixmapCache::tqfind(grid_name, grid)) { grid = TQPixmap(350 + (350 % mainWindow()->grid().x()), 350 + (350 % mainWindow()->grid().y())); - grid.fill(colorGroup().color(TQColorGroup::Foreground)); - TQBitmap mask(grid.width(), grid.height()); - mask.fill(color0); - TQPainter p(&mask); + grid.fill(tqcolorGroup().color(TQColorGroup::Foreground)); + TQBitmap tqmask(grid.width(), grid.height()); + tqmask.fill(color0); + TQPainter p(&tqmask); p.setPen(color1); for (int y = 0; y < grid.width(); y += mainWindow()->grid().y()) for (int x = 0; x < grid.height(); x += mainWindow()->grid().x()) p.drawPoint(x, y); - grid.setMask(mask); + grid.setMask(tqmask); TQPixmapCache::insert(grid_name, grid); } TQPainter p(w); @@ -267,7 +267,7 @@ TQPoint FormWindow::gridPoint(const TQPoint &p) void FormWindow::drawSizePreview(const TQPoint &pos, const TQString& text) { unclippedPainter->save(); - unclippedPainter->setPen(TQPen(colorGroup().foreground(), 1 )); + unclippedPainter->setPen(TQPen(tqcolorGroup().foreground(), 1 )); unclippedPainter->setRasterOp(CopyROP); if (!sizePreviewPixmap.isNull()) unclippedPainter->drawPixmap(sizePreviewPos, sizePreviewPixmap); @@ -295,7 +295,7 @@ void FormWindow::insertWidget() return; bool useSizeHint = !oldRectValid || (currRect.width() < 2 && currRect.height() < 2); - Orientation orient = Horizontal; + Qt::Orientation orient =Qt::Horizontal; TQString n = WidgetDatabase::className(currTool); if (useSizeHint && (n == "Spacer" || n == TQSLIDER_OBJECT_NAME_STRING || n == "Line" || n == TQSCROLLBAR_OBJECT_NAME_STRING)) { TQPopupMenu m(mainWindow()); @@ -303,7 +303,7 @@ void FormWindow::insertWidget() int ver = m.insertItem(i18n("&Vertical")); int r = m.exec(TQCursor::pos()); if (r == ver) - orient = Vertical; + orient =Qt::Vertical; } TQWidget *w = WidgetFactory::create(currTool, insertParent, 0, true, &currRect, orient); @@ -312,27 +312,27 @@ void FormWindow::insertWidget() if (!savePixmapInline() && currTool == WidgetDatabase::idFromClassName("PixmapLabel")) ((TQLabel*)w)->setPixmap(PixmapChooser::loadPixmap("image.xpm")); - int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)); + int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))); if (WidgetDatabase::isCustomWidget(id)) { TQWhatsThis::add(w, i18n("<b>A %1 (custom widget)</b> " "<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> " "menu to add and change custom widgets. You can add " "properties as well as signals and slots to integrate custom widgets into " - "<i>Qt Designer</i>, and provide a pixmap which will be used to represent " + "<i>TQt Designer</i>, and provide a pixmap which will be used to represent " "the widget on the form.</p>") - .arg(WidgetDatabase::toolTip(id))); - TQToolTip::add(w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip(id))); + .tqarg(WidgetDatabase::toolTip(id))); + TQToolTip::add(w, i18n("A %1 (custom widget)").tqarg(WidgetDatabase::toolTip(id))); } else { TQString tt = WidgetDatabase::toolTip(id); TQString wt = WidgetDatabase::whatsThis(id); if (!wt.isEmpty() && !tt.isEmpty()) - TQWhatsThis::add(w, i18n("<b>A %1</b><p>%2</p>").arg(tt).arg(wt)); + TQWhatsThis::add(w, i18n("<b>A %1</b><p>%2</p>").tqarg(tt).tqarg(wt)); } TQString s = w->name(); - unify(w, s, true); + unify(TQT_TQOBJECT(w), s, true); w->setName(s); insertWidget(w); TQRect r(currRect); @@ -345,8 +345,8 @@ void FormWindow::insertWidget() r = TQRect(p, r.size()); if (useSizeHint) { - r.setWidth(w->sizeHint().width()); - r.setHeight(w->sizeHint().height()); + r.setWidth(w->tqsizeHint().width()); + r.setHeight(w->tqsizeHint().height()); } if (r.width() < 2 * grid().x()) @@ -354,18 +354,18 @@ void FormWindow::insertWidget() if (r.height() < 2 * grid().y()) r.setHeight(2 * grid().y()); - const TQObjectList *l = insertParent->children(); - TQObjectListIt it(*l); + const TQObjectList l = insertParent->childrenListObject(); + TQObjectListIt it(l); TQWidgetList lst; - if (WidgetDatabase::isContainer(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)))) + if (WidgetDatabase::isContainer(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))))) for (; it.current();) { TQObject *o = it.current(); ++it; if (o->isWidgetType() && ((TQWidget*)o)->isVisibleTo(this) && - insertedWidgets.find((TQWidget*)o) && o != w) + insertedWidgets.tqfind((TQWidget*)o) && TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(w)) { TQRect r2(((TQWidget*)o)->pos(), ((TQWidget*)o)->size()); - if (r.contains(r2)) + if (r.tqcontains(r2)) lst.append((TQWidget*)o); } } @@ -381,19 +381,19 @@ void FormWindow::insertWidget() pos -= r.topLeft(); np.append(pos); } - MoveCommand *mv = new MoveCommand(i18n("Reparent Widgets"), this, lst, op, np, insertParent, pw); + MoveCommand *mv = new MoveCommand(i18n("Retqparent Widgets"), this, lst, op, np, insertParent, pw); if (!toolFixed) mainwindow->resetTool(); else setCursorToAll(CrossCursor, w); - InsertCommand *cmd = new InsertCommand(i18n("Insert %1").arg(w->name()), this, w, r); + InsertCommand *cmd = new InsertCommand(i18n("Insert %1").tqarg(w->name()), this, w, r); TQPtrList<Command> commands; commands.append(mv); commands.append(cmd); - MacroCommand *mc = new MacroCommand(i18n("Insert %1").arg(w->name()), this, commands); + MacroCommand *mc = new MacroCommand(i18n("Insert %1").tqarg(w->name()), this, commands); commandHistory()->addCommand(mc); mc->execute(); } @@ -404,7 +404,7 @@ void FormWindow::insertWidget() else setCursorToAll(CrossCursor, w); - InsertCommand *cmd = new InsertCommand(i18n("Insert %1").arg(w->name()), this, w, r); + InsertCommand *cmd = new InsertCommand(i18n("Insert %1").tqarg(w->name()), this, w, r); commandHistory()->addCommand(cmd); cmd->execute(); } @@ -414,29 +414,29 @@ void FormWindow::insertWidget(TQWidget *w, bool checkName) { if (checkName) { TQString s = w->name(); - unify(w, s, true); + unify(TQT_TQOBJECT(w), s, true); w->setName(s); } - MetaDataBase::addEntry(w); - int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)); + MetaDataBase::addEntry(TQT_TQOBJECT(w)); + int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))); if (WidgetDatabase::isCustomWidget(id)) { TQWhatsThis::add(w, i18n("<b>A %1 (custom widget)</b> " "<p>Click <b>Edit Custom Widgets...</b> in the <b>Tools|Custom</b> " "menu to add and change custom widgets. You can add " "properties as well as signals and slots to integrate custom widgets into " - "<i>Qt Designer</i>, and provide a pixmap which will be used to represent " + "<i>TQt Designer</i>, and provide a pixmap which will be used to represent " "the widget on the form.</p>") - .arg(WidgetDatabase::toolTip(id))); - TQToolTip::add(w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip(id))); + .tqarg(WidgetDatabase::toolTip(id))); + TQToolTip::add(w, i18n("A %1 (custom widget)").tqarg(WidgetDatabase::toolTip(id))); } else { TQString tt = WidgetDatabase::toolTip(id); TQString wt = WidgetDatabase::whatsThis(id); if (!wt.isEmpty() && !tt.isEmpty()) - TQWhatsThis::add(w, i18n("<b>A %1</b><p>%2</p>").arg(tt).arg(wt)); + TQWhatsThis::add(w, i18n("<b>A %1</b><p>%2</p>").tqarg(tt).tqarg(wt)); } restoreCursors(w, this); @@ -446,7 +446,7 @@ void FormWindow::insertWidget(TQWidget *w, bool checkName) void FormWindow::removeWidget(TQWidget *w) { - MetaDataBase::removeEntry(w); + MetaDataBase::removeEntry(TQT_TQOBJECT(w)); widgets()->take(w); } @@ -454,15 +454,15 @@ void FormWindow::handleContextMenu(TQContextMenuEvent *e, TQWidget *w) { switch (currTool) { case POINTER_TOOL: - if (!isMainContainer(w) && qstrcmp(w->name(), "central widget")) + if (!isMainContainer(TQT_TQOBJECT(w)) && qstrcmp(w->name(), "central widget")) { // press on a child widget raiseChildSelections(w); // raise selections and select widget - selectWidget(w); + selectWidget(TQT_TQOBJECT(w)); // if widget is laid out, find the first non-laid out super-widget TQWidget *realWidget = w; // but store the original one - while (w->parentWidget() && (WidgetFactory::layoutType(w->parentWidget()) != - WidgetFactory::NoLayout || !insertedWidgets.find(w))) - w = w->parentWidget(); + while (w->tqparentWidget() && (WidgetFactory::tqlayoutType(w->tqparentWidget()) != + WidgetFactory::NoLayout || !insertedWidgets.tqfind(w))) + w = w->tqparentWidget(); if (mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING) && ((TQMainWindow*)mainContainer())->centralWidget() == realWidget) { @@ -500,10 +500,10 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) switch (currTool) { case POINTER_TOOL: - if (!isMainContainer(w) && qstrcmp(w->name(), "central widget") != 0) + if (!isMainContainer(TQT_TQOBJECT(w)) && qstrcmp(w->name(), "central widget") != 0) { // press on a child widget - // if the clicked widget is not in a layout, raise it - if (!w->parentWidget() || WidgetFactory::layoutType(w->parentWidget()) == WidgetFactory::NoLayout) + // if the clicked widget is not in a tqlayout, raise it + if (!w->tqparentWidget() || WidgetFactory::tqlayoutType(w->tqparentWidget()) == WidgetFactory::NoLayout) w->raise(); if ((e->state() & ControlButton)) { // with control pressed, always start rubber band selection @@ -513,16 +513,16 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) break; } - bool sel = isWidgetSelected(w); + bool sel = isWidgetSelected(TQT_TQOBJECT(w)); if (!((e->state() & ControlButton) || (e->state() & ShiftButton))) { // control not pressed... if (!sel) // ...and widget no selectted: unselect all clearSelection(false); else { // ...widget selected - // only if widget has a layout (it is a layout meta widget or a laid out container!), + // only if widget has a tqlayout (it is a tqlayout meta widget or a laid out container!), // unselect its childs - if (WidgetFactory::layoutType(w) != WidgetFactory::NoLayout) + if (WidgetFactory::tqlayoutType(w) != WidgetFactory::NoLayout) { TQObjectList *l = w->queryList(TQWIDGET_OBJECT_NAME_STRING); setPropertyShowingBlocked(true); @@ -530,60 +530,60 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) { if (!o->isWidgetType()) continue; - if (insertedWidgets.find((TQWidget*)o)) - selectWidget((TQWidget*)o, false); + if (insertedWidgets.tqfind((TQWidget*)o)) + selectWidget(TQT_TQOBJECT(o), false); } setPropertyShowingBlocked(false); delete l; } } - qApp->processEvents(); + tqApp->processEvents(); } if (((e->state() & ControlButton) || (e->state() & ShiftButton)) && - sel && e->button() == LeftButton) + sel && e->button() == Qt::LeftButton) { // control pressed and selected, unselect widget - selectWidget(w, false); + selectWidget(TQT_TQOBJECT(w), false); break; } raiseChildSelections(w); // raise selections and select widget - selectWidget(w); + selectWidget(TQT_TQOBJECT(w)); // if widget is laid out, find the first non-laid out super-widget - while (w->parentWidget() && - (WidgetFactory::layoutType(w->parentWidget()) != WidgetFactory::NoLayout - || !insertedWidgets.find(w))) - w = w->parentWidget(); + while (w->tqparentWidget() && + (WidgetFactory::tqlayoutType(w->tqparentWidget()) != WidgetFactory::NoLayout + || !insertedWidgets.tqfind(w))) + w = w->tqparentWidget(); - if (e->button() == LeftButton) - { // left button: store original geometry and more as the widget might start moving + if (e->button() == Qt::LeftButton) + { // left button: store original tqgeometry and more as the widget might start moving widgetPressed = true; widgetGeom = TQRect(w->pos(), w->size()); oldPressPos = w->mapFromGlobal(e->globalPos()); origPressPos = oldPressPos; checkedSelectionsForMove = false; moving.clear(); - if (w->parentWidget() && !isMainContainer(w->parentWidget()) && - !isCentralWidget(w->parentWidget())) + if (w->tqparentWidget() && !isMainContainer(TQT_TQOBJECT(w->tqparentWidget())) && + !isCentralWidget(TQT_TQOBJECT(w->tqparentWidget()))) { - targetContainer = w->parentWidget(); - hadOwnPalette = w->parentWidget()->ownPalette(); - restorePalette = w->parentWidget()->palette(); + targetContainer = w->tqparentWidget(); + hadOwnPalette = w->tqparentWidget()->ownPalette(); + restorePalette = w->tqparentWidget()->palette(); } } } else { // press was on the formwindow - if (e->button() == LeftButton) + if (e->button() == Qt::LeftButton) { // left button: start rubber selection and show formwindow properties drawRubber = true; if (!((e->state() & ControlButton) || (e->state() & ShiftButton))) { clearSelection(false); TQObject *opw = propertyWidget; - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if (opw->isWidgetType()) - repaintSelection((TQWidget*)opw); + tqrepaintSelection((TQWidget*)opw); } currRect = TQRect(0, 0, -1, -1); startRectDraw(mapFromGlobal(e->globalPos()), e->globalPos(), this, Rubber); @@ -591,25 +591,25 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) } break; case CONNECT_TOOL: - if (e->button() != LeftButton) + if (e->button() != Qt::LeftButton) break; saveBackground(); - mainWindow()->statusBar()->message(i18n("Connect '%1' with...").arg(w->name())); + mainWindow()->statusBar()->message(i18n("Connect '%1' with...").tqarg(w->name())); connectStartPos = mapFromGlobal(e->globalPos()); currentConnectPos = mapFromGlobal(e->globalPos()); - connectSender = designerWidget(w); - connectReceiver = connectableObject(designerWidget(w), connectReceiver); + connectSender = TQT_TQOBJECT(designerWidget(TQT_TQOBJECT(w))); + connectReceiver = connectableObject(TQT_TQOBJECT(designerWidget(TQT_TQOBJECT(w))), connectReceiver); beginUnclippedPainter(false); drawConnectLine(); break; case ORDER_TOOL: - if (!isMainContainer(w)) + if (!isMainContainer(TQT_TQOBJECT(w))) { // press on a child widget orderedWidgets.removeRef(w); orderedWidgets.append(w); for (TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev()) { - int i = stackedWidgets.findRef(wid); + int i = stackedWidgets.tqfindRef(wid); if (i != -1) { stackedWidgets.removeRef(wid); @@ -625,25 +625,25 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) } break; default: // any insert widget tool - if (e->button() == LeftButton) + if (e->button() == Qt::LeftButton) { insertParent = WidgetFactory::containerOfWidget(mainContainer()); - // default parent for new widget is the formwindow - if (!isMainContainer(w)) - { // press was not on formwindow, check if we can find another parent + // default tqparent for new widget is the formwindow + if (!isMainContainer(TQT_TQOBJECT(w))) + { // press was not on formwindow, check if we can find another tqparent TQWidget *wid = w; for (;;) { - int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(wid)); + int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(wid))); if ((WidgetDatabase::isContainer(id) || wid == mainContainer()) && !wid->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING) && !wid->inherits(TQSPLITTER_OBJECT_NAME_STRING)) { - insertParent = WidgetFactory::containerOfWidget(wid); // found another parent, store it + insertParent = WidgetFactory::containerOfWidget(wid); // found another tqparent, store it break; } else { - wid = wid->parentWidget(); + wid = wid->tqparentWidget(); if (!wid) break; } @@ -659,13 +659,13 @@ void FormWindow::handleMouseDblClick(TQMouseEvent *, TQWidget *w) { switch (currTool) { case ORDER_TOOL: - if (!isMainContainer(w)) + if (!isMainContainer(TQT_TQOBJECT(w))) { // press on a child widget orderedWidgets.clear(); orderedWidgets.append(w); for (TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev()) { - int i = stackedWidgets.findRef(wid); + int i = stackedWidgets.tqfindRef(wid); if (i != -1) { stackedWidgets.removeRef(wid); @@ -685,7 +685,7 @@ void FormWindow::handleMouseDblClick(TQMouseEvent *, TQWidget *w) void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w) { - if ((e->state() & LeftButton) != LeftButton) + if ((e->state() & Qt::LeftButton) != Qt::LeftButton) return; TQWidget *newReceiver = (TQWidget*)connectReceiver, *oldReceiver = (TQWidget*)connectReceiver, *wid; @@ -695,16 +695,16 @@ void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w) if (widgetPressed && allowMove(w)) { // we are prepated for a move // if widget is laid out, find the first non-laid out super-widget - while (w->parentWidget() && (WidgetFactory::layoutType(w->parentWidget()) != - WidgetFactory::NoLayout || !insertedWidgets.find(w))) - w = w->parentWidget(); + while (w->tqparentWidget() && (WidgetFactory::tqlayoutType(w->tqparentWidget()) != + WidgetFactory::NoLayout || !insertedWidgets.tqfind(w))) + w = w->tqparentWidget(); // calc correct position TQPoint pos = w->mapFromGlobal(e->globalPos()); // calc move distance and store it TQPoint d = oldPressPos - pos; - if (QABS(d.x()) < grid().x()) + if (TQABS(d.x()) < grid().x()) d.setX(0); - if (QABS(d.y()) < grid().y()) + if (TQABS(d.y()) < grid().y()) d.setY(0); if (d.x() == 0) pos.setX(oldPressPos.x()); @@ -724,19 +724,19 @@ void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w) { // if we actually have to move if (!checkedSelectionsForMove) { // if not checked yet, check if the correct widget are selected... - if (!isWidgetSelected(w)) + if (!isWidgetSelected(TQT_TQOBJECT(w))) { // and unselect others. Only siblings can be moved at the same time setPropertyShowingBlocked(true); - selectWidget(w); + selectWidget(TQT_TQOBJECT(w)); setPropertyShowingBlocked(false); } checkSelectionsForMove(w); } // check whether we would have to reparent the selection and - // highlight the possible new parent container + // highlight the possible new tqparent container TQMapConstIterator<ulong, TQPoint> it = moving.begin(); TQWidget* wa = containerAt(e->globalPos(), ((TQWidget*)it.key())); - if (wa && !isMainContainer(wa) && !isCentralWidget(wa)) + if (wa && !isMainContainer(TQT_TQOBJECT(wa)) && !isCentralWidget(TQT_TQOBJECT(wa))) { wa = WidgetFactory::containerOfWidget(wa); // ok, looks like we moved onto a container @@ -753,7 +753,7 @@ void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w) targetContainer = wa; hadOwnPalette = wa->ownPalette(); restorePalette = wa->palette(); - wa->setPaletteBackgroundColor(wa->colorGroup().midlight()); + wa->setPaletteBackgroundColor(wa->tqcolorGroup().midlight()); } } else if (targetContainer) @@ -767,7 +767,7 @@ void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w) // finally move the selected widgets and show/update preview label moveSelectedWidgets(x - p.x(), y - p.y()); - sizePreviewLabel->setText(TQString("%1/%2").arg(w->pos().x()).arg(w->pos().y())); + sizePreviewLabel->setText(TQString("%1/%2").tqarg(w->pos().x()).tqarg(w->pos().y())); sizePreviewLabel->adjustSize(); TQRect lg(mapFromGlobal(e->globalPos()) + TQPoint(16, 16), sizePreviewLabel->size()); checkPreviewGeometry(lg); @@ -790,24 +790,24 @@ void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w) break; case CONNECT_TOOL: restoreConnectionLine(); - wid = qApp->widgetAt(e->globalPos(), true); + wid = tqApp->widgetAt(e->globalPos(), true); if (wid) - wid = designerWidget(wid); - if (wid && (isMainContainer(wid) || insertedWidgets.find(wid)) && wid->isVisibleTo(this)) + wid = designerWidget(TQT_TQOBJECT(wid)); + if (wid && (isMainContainer(TQT_TQOBJECT(wid)) || insertedWidgets.tqfind(wid)) && wid->isVisibleTo(this)) newReceiver = wid; - if (newReceiver && (newReceiver->inherits("QLayoutWidget") + if (newReceiver && (newReceiver->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING) || newReceiver->inherits("Spacer"))) newReceiver = (TQWidget*)connectReceiver; - drawRecRect = newReceiver != connectReceiver; + drawRecRect = TQT_BASE_OBJECT(newReceiver) != TQT_BASE_OBJECT(connectReceiver); currentConnectPos = mapFromGlobal(e->globalPos()); - if (newReceiver && (isMainContainer(newReceiver) - || insertedWidgets.find(newReceiver)) && !isCentralWidget(newReceiver)) - connectReceiver = connectableObject(newReceiver, connectReceiver); - mainWindow()->statusBar()->message(i18n("Connect '%1' to '%2'").arg(connectSender->name()). + if (newReceiver && (isMainContainer(TQT_TQOBJECT(newReceiver)) + || insertedWidgets.tqfind(newReceiver)) && !isCentralWidget(TQT_TQOBJECT(newReceiver))) + connectReceiver = connectableObject(TQT_TQOBJECT(newReceiver), TQT_TQOBJECT(connectReceiver)); + mainWindow()->statusBar()->message(i18n("Connect '%1' to '%2'").tqarg(connectSender->name()). arg(connectReceiver->name())); - qApp->processEvents(); + tqApp->processEvents(); if (drawRecRect) - restoreRect(TQRect(mapToForm(((TQWidget*)oldReceiver)->parentWidget(), + restoreRect(TQRect(mapToForm(((TQWidget*)oldReceiver)->tqparentWidget(), ((TQWidget*)oldReceiver)->pos()), ((TQWidget*)oldReceiver)->size())); drawConnectLine(); break; @@ -822,7 +822,7 @@ void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w) void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w) { - if (e->button() != LeftButton) + if (e->button() != Qt::LeftButton) return; switch (currTool) @@ -832,7 +832,7 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w) { // we moved the widget sizePreviewLabel->hide(); - if (moving.isEmpty() || w->pos() == *moving.find((ulong) w)) + if (moving.isEmpty() || w->pos() == *moving.tqfind((ulong) w)) break; // restore targetContainer @@ -848,7 +848,7 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w) emitUpdateProperties(propertyWidget); TQMapConstIterator < ulong, TQPoint > it = moving.begin(); - TQWidget *oldParent = ((TQWidget *) it.key())->parentWidget(); + TQWidget *oldParent = ((TQWidget *) it.key())->tqparentWidget(); TQWidget *newParent = oldParent; // check whether we have to reparent the selection TQWidget *wa = containerAt(e->globalPos(), ((TQWidget *) it.key())); @@ -857,21 +857,21 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w) wa = WidgetFactory::containerOfWidget(wa); // ok, looks like we moved onto a container - // check whether we really have different parents. - if (wa == ((TQWidget *) it.key())->parentWidget()) + // check whether we really have different tqparents. + if (wa == ((TQWidget *) it.key())->tqparentWidget()) goto make_move_command; - // break layout if necessary - if (WidgetFactory::layoutType(wa) != WidgetFactory::NoLayout) + // break tqlayout if necessary + if (WidgetFactory::tqlayoutType(wa) != WidgetFactory::NoLayout) { if (KMessageBox::questionYesNo(mainWindow(), i18n("You tried to insert a widget into the " - "layout Container Widget '%1'.\n" + "tqlayout Container Widget '%1'.\n" "This is not possible. " - "In order to insert the widget, the layout of '%1'\n" + "In order to insert the widget, the tqlayout of '%1'\n" "must first be broken.\n" - "Break the layout or cancel the operation?"). - arg(wa->name()).arg(wa->name()), i18n("Inserting Widget"), + "Break the tqlayout or cancel the operation?"). + tqarg(wa->name()).tqarg(wa->name()), i18n("Inserting Widget"), i18n("&Break Layout"), KStdGuiItem::cancel()) == KMessageBox::No) goto make_move_command; // cancel breakLayout(wa); @@ -883,27 +883,27 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w) TQWidget *i = (TQWidget *) it.key(); if (!emitSelChanged && i->inherits(TQBUTTON_OBJECT_NAME_STRING)) { - if (i->parentWidget() && i->parentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING) || + if (i->tqparentWidget() && i->tqparentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING) || wa->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING)) emitSelChanged = true; if (!wa->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING)) { - MetaDataBase::setPropertyChanged(i, "buttonGroupId", false); - if (i->parentWidget() && i->parentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING)) - ((TQButtonGroup *) i->parentWidget())->remove((TQButton *) i); + MetaDataBase::setPropertyChanged(TQT_TQOBJECT(i), "buttonGroupId", false); + if (i->tqparentWidget() && i->tqparentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING)) + ((TQButtonGroup *) i->tqparentWidget())->remove((TQButton *) i); } } TQPoint pos = wa->mapFromGlobal(i->mapToGlobal(TQPoint(0, 0))); i->reparent(wa, pos, true); raiseSelection(i); raiseChildSelections(i); - widgetChanged(i); + widgetChanged(TQT_TQOBJECT(i)); mainWindow()->objectHierarchy()->widgetRemoved(i); mainWindow()->objectHierarchy()->widgetInserted(i); } if (emitSelChanged) { - emit showProperties(wa); + emit showProperties(TQT_TQOBJECT(wa)); emit showProperties(propertyWidget); } newParent = wa; @@ -935,13 +935,13 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w) case CONNECT_TOOL: restoreConnectionLine(); if (connectSender) - restoreRect(TQRect(mapToForm(((TQWidget *) connectSender)->parentWidget(), + restoreRect(TQRect(mapToForm(((TQWidget *) connectSender)->tqparentWidget(), ((TQWidget *) connectSender)->pos()), ((TQWidget *) connectSender)->size())); if (connectReceiver) - restoreRect(TQRect(mapToForm(((TQWidget *) connectReceiver)->parentWidget(), + restoreRect(TQRect(mapToForm(((TQWidget *) connectReceiver)->tqparentWidget(), ((TQWidget *) connectReceiver)->pos()), ((TQWidget *) connectReceiver)->size())); endUnclippedPainter(); - qApp->processEvents(); + tqApp->processEvents(); if (connectSender && connectReceiver) editConnections(); break; @@ -951,15 +951,15 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w) if (insertParent) { // we should insert the new widget now endRectDraw(); - if (WidgetFactory::layoutType(insertParent) != WidgetFactory::NoLayout) + if (WidgetFactory::tqlayoutType(insertParent) != WidgetFactory::NoLayout) { if (KMessageBox::questionYesNo(mainWindow(), i18n("You tried to insert a widget into the " - "layout Container Widget '%1'.\n" + "tqlayout Container Widget '%1'.\n" "This is not possible. " - "In order to insert the widget, the layout of '%1'\n" + "In order to insert the widget, the tqlayout of '%1'\n" "must first be broken.\n" - "Break the layout or cancel the operation?"). + "Break the tqlayout or cancel the operation?"). arg(insertParent->name()). arg(insertParent->name()), i18n("Inserting Widget"), i18n("&Break Layout"), KStdGuiItem::cancel()) == KMessageBox::Yes) @@ -1064,7 +1064,7 @@ void FormWindow::handleKeyPress(TQKeyEvent * e, TQWidget * w) TQObjectList *l = queryList(TQWIDGET_OBJECT_NAME_STRING); if (!l) return; - if (l->find(w) != -1) + if (l->tqfind(TQT_TQOBJECT(w)) != -1) e->accept(); delete l; } @@ -1086,12 +1086,12 @@ void FormWindow::selectWidget(TQObject * o, bool select) TQWidget *w = (TQWidget *) o; - if (isMainContainer(w)) + if (isMainContainer(TQT_TQOBJECT(w))) { TQObject *opw = propertyWidget; - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if (opw->isWidgetType()) - repaintSelection((TQWidget *) opw); + tqrepaintSelection((TQWidget *) opw); emitShowProperties(propertyWidget); return; } @@ -1100,25 +1100,25 @@ void FormWindow::selectWidget(TQObject * o, bool select) w == ((TQMainWindow *) mainContainer())->centralWidget()) { TQObject *opw = propertyWidget; - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if (opw->isWidgetType()) - repaintSelection((TQWidget *) opw); + tqrepaintSelection((TQWidget *) opw); emitShowProperties(propertyWidget); return; } - if (o->inherits("QDesignerToolBar") || o->inherits("QDesignerMenuBar")) + if (o->inherits("TQDesignerToolBar") || o->inherits("TQDesignerMenuBar")) return; if (select) { TQObject *opw = propertyWidget; - propertyWidget = w; + propertyWidget = TQT_TQOBJECT(w); if (opw->isWidgetType()) - repaintSelection((TQWidget *) opw); + tqrepaintSelection((TQWidget *) opw); if (!isPropertyShowingBlocked()) emitShowProperties(propertyWidget); - WidgetSelection *s = usedSelections.find(w); + WidgetSelection *s = usedSelections.tqfind(w); if (s) { s->show(); @@ -1143,16 +1143,16 @@ void FormWindow::selectWidget(TQObject * o, bool select) emitSelectionChanged(); } else { - WidgetSelection *s = usedSelections.find(w); + WidgetSelection *s = usedSelections.tqfind(w); if (s) s->setWidget(0); TQObject *opw = propertyWidget; if (!usedSelections.isEmpty()) - propertyWidget = TQPtrDictIterator < WidgetSelection > (usedSelections).current()->widget(); + propertyWidget = TQT_TQOBJECT(TQPtrDictIterator < WidgetSelection > (usedSelections).current()->widget()); else - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if (opw->isWidgetType()) - repaintSelection((TQWidget *) opw); + tqrepaintSelection((TQWidget *) opw); if (!isPropertyShowingBlocked()) emitShowProperties(propertyWidget); emitSelectionChanged(); @@ -1168,23 +1168,23 @@ TQPoint FormWindow::grid() const void FormWindow::updateSelection(TQWidget * w) { - WidgetSelection *s = usedSelections.find(w); + WidgetSelection *s = usedSelections.tqfind(w); if (!w->isVisibleTo(this)) - selectWidget(w, false); + selectWidget(TQT_TQOBJECT(w), false); else if (s) s->updateGeometry(); } void FormWindow::raiseSelection(TQWidget * w) { - WidgetSelection *s = usedSelections.find(w); + WidgetSelection *s = usedSelections.tqfind(w); if (s) s->show(); } -void FormWindow::repaintSelection(TQWidget * w) +void FormWindow::tqrepaintSelection(TQWidget * w) { - WidgetSelection *s = usedSelections.find(w); + WidgetSelection *s = usedSelections.tqfind(w); if (s) s->update(); } @@ -1199,9 +1199,9 @@ void FormWindow::clearSelection(bool changePropertyDisplay) if (changePropertyDisplay) { TQObject *opw = propertyWidget; - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if (opw->isWidgetType()) - repaintSelection((TQWidget *) opw); + tqrepaintSelection((TQWidget *) opw); emitShowProperties(propertyWidget); } emitSelectionChanged(); @@ -1239,7 +1239,7 @@ void FormWindow::continueRectDraw(const TQPoint & p, const TQPoint & global, TQW if (currRect == r) { TQString t("%1/%2"); - t = t.arg(r.width() - 1).arg(r.height() - 1); + t = t.tqarg(r.width() - 1).tqarg(r.height() - 1); drawSizePreview(pos, t); return; } @@ -1253,7 +1253,7 @@ void FormWindow::continueRectDraw(const TQPoint & p, const TQPoint & global, TQW if (t == Insert) { TQString t("%1/%2"); - t = t.arg(r.width() - 1).arg(r.height() - 1); + t = t.tqarg(r.width() - 1).tqarg(r.height() - 1); drawSizePreview(pos, t); } unclippedPainter->setClipRegion(TQRegion(rect()).subtract(TQRect(sizePreviewPos, @@ -1275,7 +1275,7 @@ void FormWindow::endRectDraw() if (oldRectValid) unclippedPainter->drawRect(currRect); - drawSizePreview(TQPoint(-1, -1), TQString::null); + drawSizePreview(TQPoint(-1, -1), TQString()); endUnclippedPainter(); } @@ -1291,8 +1291,8 @@ void FormWindow::selectWidgets() TQPoint p = ((TQWidget *) o)->mapToGlobal(TQPoint(0, 0)); p = mapFromGlobal(p); TQRect r(p, ((TQWidget *) o)->size()); - if (r.intersects(currRect) && !r.contains(currRect)) - selectWidget((TQWidget *) o); + if (r.intersects(currRect) && !r.tqcontains(currRect)) + selectWidget(TQT_TQOBJECT(o)); } } delete l; @@ -1303,8 +1303,8 @@ void FormWindow::selectWidgets() bool FormWindow::isWidgetSelected(TQObject * w) { if (w->isWidgetType()) - return usedSelections.find((TQWidget *) w) != 0; - return false; // #### do stuff for QObjects + return usedSelections.tqfind((TQWidget *) w) != 0; + return false; // #### do stuff for TQObjects } void FormWindow::moveSelectedWidgets(int dx, int dy) @@ -1314,8 +1314,8 @@ void FormWindow::moveSelectedWidgets(int dx, int dy) { WidgetSelection *s = it.current(); TQWidget *w = s->widget(); - if (w->parentWidget() - && WidgetFactory::layoutType(w->parentWidget()) != WidgetFactory::NoLayout) + if (w->tqparentWidget() + && WidgetFactory::tqlayoutType(w->tqparentWidget()) != WidgetFactory::NoLayout) continue; w->move(w->x() + dx, w->y() + dy); s->updateGeometry(); @@ -1350,7 +1350,7 @@ void FormWindow::raiseChildSelections(TQWidget * w) TQPtrDictIterator < WidgetSelection > it(usedSelections); for (; it.current(); ++it) { - if (l->findRef(it.current()->widget()) != -1) + if (l->tqfindRef(TQT_TQOBJECT(it.current()->widget())) != -1) it.current()->show(); } delete l; @@ -1363,7 +1363,7 @@ void FormWindow::updateChildSelections(TQWidget * w) { for (TQObject * o = l->first(); o; o = l->next()) { - if (o->isWidgetType() && insertedWidgets.find((TQWidget *) o)) + if (o->isWidgetType() && insertedWidgets.tqfind((TQWidget *) o)) updateSelection((TQWidget *) o); } delete l; @@ -1374,7 +1374,7 @@ void FormWindow::checkSelectionsForMove(TQWidget * w) { checkedSelectionsForMove = true; - TQObjectList *l = w->parentWidget()->queryList(TQWIDGET_OBJECT_NAME_STRING, 0, false, false); + TQObjectList *l = w->tqparentWidget()->queryList(TQWIDGET_OBJECT_NAME_STRING, 0, false, false); moving.clear(); if (l) { @@ -1385,13 +1385,13 @@ void FormWindow::checkSelectionsForMove(TQWidget * w) if (it.current()->widget() == mainContainer()) continue; ++it; - if (l->find(sel->widget()) == -1) + if (l->tqfind(TQT_TQOBJECT(sel->widget())) == -1) { - if (WidgetFactory::layoutType(w) == WidgetFactory::NoLayout) + if (WidgetFactory::tqlayoutType(w) == WidgetFactory::NoLayout) sel->setWidget(0); } else { - if (WidgetFactory::layoutType(sel->widget()->parentWidget()) == WidgetFactory::NoLayout) + if (WidgetFactory::tqlayoutType(sel->widget()->tqparentWidget()) == WidgetFactory::NoLayout) { moving.insert((ulong) sel->widget(), sel->widget()->pos()); sel->widget()->raise(); @@ -1411,10 +1411,10 @@ void FormWindow::deleteWidgets() for (; it.current(); ++it) { TQWidget *tb = 0; - if (!(tb = mainWindow()->isAToolBarChild(it.current()->widget()))) + if (!(tb = mainWindow()->isAToolBarChild(TQT_TQOBJECT(it.current()->widget())))) widgets.append(it.current()->widget()); else - ((QDesignerToolBar *) tb)->removeWidget(it.current()->widget()); + ((TQDesignerToolBar *) tb)->removeWidget(it.current()->widget()); } if (widgets.isEmpty()) @@ -1431,13 +1431,13 @@ void FormWindow::editAdjustSize() TQWidgetList widgets = selectedWidgets(); if (widgets.isEmpty()) { - TQRect oldr = geometry(); + TQRect oldr = tqgeometry(); mainContainer()->adjustSize(); resize(mainContainer()->size()); // check whether our own size constraint hit us if (size() != mainContainer()->size()) mainContainer()->resize(size()); - TQRect nr = geometry(); + TQRect nr = tqgeometry(); if (oldr != nr) { ResizeCommand *cmd = new ResizeCommand(i18n("Adjust Size"), this, this, oldr, nr); @@ -1447,12 +1447,12 @@ void FormWindow::editAdjustSize() } for (TQWidget * w = widgets.first(); w; w = widgets.next()) { - if (w->parentWidget() - && WidgetFactory::layoutType(w->parentWidget()) != WidgetFactory::NoLayout) + if (w->tqparentWidget() + && WidgetFactory::tqlayoutType(w->tqparentWidget()) != WidgetFactory::NoLayout) continue; - TQRect oldr = w->geometry(); + TQRect oldr = w->tqgeometry(); w->adjustSize(); - TQRect nr = w->geometry(); + TQRect nr = w->tqgeometry(); if (oldr != nr) commands.append(new ResizeCommand(i18n("Adjust Size"), this, w, oldr, nr)); } @@ -1500,7 +1500,7 @@ void FormWindow::invalidCheckedSelections() void FormWindow::checkPreviewGeometry(TQRect & r) { - if (rect().contains(r)) + if (TQT_TQRECT_OBJECT(rect()).tqcontains(r)) return; if (r.left() < rect().left()) r.moveTopLeft(TQPoint(0, r.top())); @@ -1527,9 +1527,9 @@ void FormWindow::focusOutEvent(TQFocusEvent *) if (propertyWidget && !isMainContainer(propertyWidget) && !isWidgetSelected(propertyWidget)) { TQObject *opw = propertyWidget; - propertyWidget = mainContainer(); + propertyWidget = TQT_TQOBJECT(mainContainer()); if (opw->isWidgetType()) - repaintSelection((TQWidget *) opw); + tqrepaintSelection((TQWidget *) opw); } } @@ -1552,8 +1552,8 @@ TQWidget *FormWindow::designerWidget(TQObject * o) const if (!o || !o->isWidgetType()) return 0; TQWidget *w = (TQWidget *) o; - while (w && !isMainContainer(w) && !insertedWidgets[(void *) w] || isCentralWidget(w)) - w = (TQWidget *) w->parent(); + while (w && !isMainContainer(TQT_TQOBJECT(w)) && !insertedWidgets[(void *) w] || isCentralWidget(TQT_TQOBJECT(w))) + w = (TQWidget *) w->tqparent(); return w; } @@ -1564,7 +1564,7 @@ void FormWindow::emitShowProperties(TQObject * w) TQObject *opw = propertyWidget; propertyWidget = w; if (opw->isWidgetType()) - repaintSelection((TQWidget *) opw); + tqrepaintSelection((TQWidget *) opw); } showPropertiesTimer->stop(); showPropertiesTimer->start(0, true); @@ -1618,10 +1618,10 @@ void FormWindow::currentToolChanged() case CONNECT_TOOL: restoreConnectionLine(); if (connectSender) - restoreRect(TQRect(mapToForm(((TQWidget *) connectSender)->parentWidget(), + restoreRect(TQRect(mapToForm(((TQWidget *) connectSender)->tqparentWidget(), ((TQWidget *) connectSender)->pos()), ((TQWidget *) connectSender)->size())); if (connectReceiver) - restoreRect(TQRect(mapToForm(((TQWidget *) connectReceiver)->parentWidget(), + restoreRect(TQRect(mapToForm(((TQWidget *) connectReceiver)->tqparentWidget(), ((TQWidget *) connectReceiver)->pos()), ((TQWidget *) connectReceiver)->size())); endUnclippedPainter(); break; @@ -1652,7 +1652,7 @@ void FormWindow::currentToolChanged() { case POINTER_TOOL: if (propertyWidget && !isMainContainer(propertyWidget) && !isWidgetSelected(propertyWidget)) - emitShowProperties(mainContainer()); + emitShowProperties(TQT_TQOBJECT(mainContainer())); restoreCursors(this, this); break; case ORDER_TOOL: @@ -1662,7 +1662,7 @@ void FormWindow::currentToolChanged() orderedWidgets.clear(); showOrderIndicators(); if (mainWindow()->formWindow() == this) - emitShowProperties(mainContainer()); + emitShowProperties(TQT_TQOBJECT(mainContainer())); setCursorToAll(ArrowCursor, this); } break; @@ -1670,14 +1670,14 @@ void FormWindow::currentToolChanged() mainWindow()->statusBar()->message(i18n("Drag a line to create a connection...")); setCursorToAll(CrossCursor, this); if (mainWindow()->formWindow() == this) - emitShowProperties(mainContainer()); + emitShowProperties(TQT_TQOBJECT(mainContainer())); break; default: mainWindow()->statusBar()->message(i18n("Click on the form to insert a %1..."). arg(WidgetDatabase::toolTip(currTool).lower())); setCursorToAll(CrossCursor, this); if (mainWindow()->formWindow() == this) - emitShowProperties(mainContainer()); + emitShowProperties(TQT_TQOBJECT(mainContainer())); break; } } @@ -1694,12 +1694,12 @@ void FormWindow::showOrderIndicators() for (TQObject * o = l->first(); o; o = l->next()) { TQWidget *w = (TQWidget *) o; - if (w->isVisibleTo(w->parentWidget()) && - insertedWidgets[(void *) w] && w->focusPolicy() != NoFocus) + if (w->isVisibleTo(w->tqparentWidget()) && + insertedWidgets[(void *) w] && w->focusPolicy() != TQ_NoFocus) { OrderIndicator *ind = new OrderIndicator(order++, w, this); orderIndicators.append(ind); - if (stackedWidgets.findRef(w) == -1) + if (stackedWidgets.tqfindRef(w) == -1) stackedWidgets.append(w); } } @@ -1743,7 +1743,7 @@ bool FormWindow::checkCustomWidgets() { if (it.current()->isA("CustomWidget")) { - TQString className = WidgetFactory::classNameOf(it.current()); + TQString className = WidgetFactory::classNameOf(TQT_TQOBJECT(it.current())); if (!MetaDataBase::hasCustomWidget(className)) missingCustomWidgets << className; } @@ -1788,14 +1788,14 @@ void FormWindow::lowerWidgets() static void find_accel(const TQString & txt, TQMap < TQChar, TQWidgetList > &accels, TQWidget * w) { - int i = txt.find("&"); + int i = txt.tqfind("&"); if (i == -1) return; TQChar c = txt[i + 1]; if (c.isNull() || c == '&') return; c = c.lower(); - TQMap < TQChar, TQWidgetList >::Iterator it = accels.find(c); + TQMap < TQChar, TQWidgetList >::Iterator it = accels.tqfind(c); if (it == accels.end()) { TQWidgetList wl; @@ -1820,11 +1820,11 @@ void FormWindow::checkAccels() { TQWidget *w = (TQWidget *) o; const TQMetaProperty *text = - w->metaObject()->property(w->metaObject()->findProperty("text", true), true); + w->tqmetaObject()->property(w->tqmetaObject()->tqfindProperty("text", true), true); const TQMetaProperty *title = - w->metaObject()->property(w->metaObject()->findProperty("title", true), true); + w->tqmetaObject()->property(w->tqmetaObject()->tqfindProperty("title", true), true); const TQMetaProperty *pageTitle = - w->metaObject()->property(w->metaObject()->findProperty("pageTitle", true), true); + w->tqmetaObject()->property(w->tqmetaObject()->tqfindProperty("pageTitle", true), true); if (text) find_accel(w->property("text").toString(), accels, w); if (title) @@ -1844,12 +1844,12 @@ void FormWindow::checkAccels() { ok = false; if (KMessageBox::questionYesNo(mainWindow(), - i18n("Accelerator '%1' is used %2 times.").arg(it.key().upper()).arg((*it).count()), + i18n("Accelerator '%1' is used %2 times.").tqarg(it.key().upper()).tqarg((*it).count()), i18n("Check Accelerators"), i18n("&Select"), KStdGuiItem::cancel()) == KMessageBox::Yes) { clearSelection(false); for (wid = (*it).first(); wid; wid = (*it).next()) - selectWidget(wid, true); + selectWidget(TQT_TQOBJECT(wid), true); } return; } @@ -1872,11 +1872,11 @@ void FormWindow::raiseWidgets() commandHistory()->addCommand(cmd); } -void FormWindow::paste(const TQString & cb, TQWidget * parent) +void FormWindow::paste(const TQString & cb, TQWidget * tqparent) { Resource resource(mainWindow()); resource.setWidget(this); - resource.paste(cb, parent); + resource.paste(cb, tqparent); } void FormWindow::selectAll() @@ -1890,7 +1890,7 @@ void FormWindow::selectAll() { if (((TQWidget *) o)->isVisibleTo(this) && insertedWidgets[(void *) o]) { - selectWidget((TQWidget *) o); + selectWidget(TQT_TQOBJECT(o)); } } delete l; @@ -1903,49 +1903,49 @@ void FormWindow::selectAll() emitSelectionChanged(); } -void FormWindow::layoutHorizontal() +void FormWindow::tqlayoutHorizontal() { TQWidgetList widgets(selectedWidgets()); - LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand(i18n("Lay Out Horizontally"), + LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand(i18n("Lay OutQt::Horizontally"), this, mainContainer(), 0, widgets); clearSelection(false); commandHistory()->addCommand(cmd); cmd->execute(); } -void FormWindow::layoutVertical() +void FormWindow::tqlayoutVertical() { TQWidgetList widgets(selectedWidgets()); - LayoutVerticalCommand *cmd = new LayoutVerticalCommand(i18n("Lay Out Vertically"), + LayoutVerticalCommand *cmd = new LayoutVerticalCommand(i18n("Lay OutQt::Vertically"), this, mainContainer(), 0, widgets); clearSelection(false); commandHistory()->addCommand(cmd); cmd->execute(); } -void FormWindow::layoutHorizontalSplit() +void FormWindow::tqlayoutHorizontalSplit() { TQWidgetList widgets(selectedWidgets()); LayoutHorizontalSplitCommand *cmd = - new LayoutHorizontalSplitCommand(i18n("Lay Out Horizontally (in splitter)"), + new LayoutHorizontalSplitCommand(i18n("Lay OutQt::Horizontally (in splitter)"), this, mainContainer(), 0, widgets); clearSelection(false); commandHistory()->addCommand(cmd); cmd->execute(); } -void FormWindow::layoutVerticalSplit() +void FormWindow::tqlayoutVerticalSplit() { TQWidgetList widgets(selectedWidgets()); LayoutVerticalSplitCommand *cmd = - new LayoutVerticalSplitCommand(i18n("Lay Out Vertically (in splitter)"), + new LayoutVerticalSplitCommand(i18n("Lay OutQt::Vertically (in splitter)"), this, mainContainer(), 0, widgets); clearSelection(false); commandHistory()->addCommand(cmd); cmd->execute(); } -void FormWindow::layoutGrid() +void FormWindow::tqlayoutGrid() { int xres = grid().x(); int yres = grid().y(); @@ -1958,63 +1958,63 @@ void FormWindow::layoutGrid() cmd->execute(); } -void FormWindow::layoutHorizontalContainer(TQWidget * w) +void FormWindow::tqlayoutHorizontalContainer(TQWidget * w) { if (w == this) w = mainContainer(); - TQObjectList *l = (TQObjectList *) WidgetFactory::containerOfWidget(w)->children(); - if (!l) + TQObjectList l = WidgetFactory::containerOfWidget(w)->childrenListObject(); + if (l.isEmpty()) return; TQWidgetList widgets; - for (TQObject * o = l->first(); o; o = l->next()) + for (TQObject * o = l.first(); o; o = l.next()) { if (o->isWidgetType() && - ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.find((TQWidget *) o)) + ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.tqfind((TQWidget *) o)) widgets.append((TQWidget *) o); } - LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand(i18n("Lay Out Children Horizontally"), + LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand(i18n("Lay Out ChildrenQt::Horizontally"), this, mainContainer(), w, widgets); clearSelection(false); commandHistory()->addCommand(cmd); cmd->execute(); } -void FormWindow::layoutVerticalContainer(TQWidget * w) +void FormWindow::tqlayoutVerticalContainer(TQWidget * w) { if (w == this) w = mainContainer(); - TQObjectList *l = (TQObjectList *) WidgetFactory::containerOfWidget(w)->children(); - if (!l) + TQObjectList l = WidgetFactory::containerOfWidget(w)->childrenListObject(); + if (l.isEmpty()) return; TQWidgetList widgets; - for (TQObject * o = l->first(); o; o = l->next()) + for (TQObject * o = l.first(); o; o = l.next()) { if (o->isWidgetType() && - ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.find((TQWidget *) o)) + ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.tqfind((TQWidget *) o)) widgets.append((TQWidget *) o); } - LayoutVerticalCommand *cmd = new LayoutVerticalCommand(i18n("Lay Out Children Vertically"), + LayoutVerticalCommand *cmd = new LayoutVerticalCommand(i18n("Lay Out ChildrenQt::Vertically"), this, mainContainer(), w, widgets); clearSelection(false); commandHistory()->addCommand(cmd); cmd->execute(); } -void FormWindow::layoutGridContainer(TQWidget * w) +void FormWindow::tqlayoutGridContainer(TQWidget * w) { if (w == this) w = mainContainer(); int xres = grid().x(); int yres = grid().y(); - TQObjectList *l = (TQObjectList *) WidgetFactory::containerOfWidget(w)->children(); - if (!l) + TQObjectList l = WidgetFactory::containerOfWidget(w)->childrenListObject(); + if (l.isEmpty()) return; TQWidgetList widgets; - for (TQObject * o = l->first(); o; o = l->next()) + for (TQObject * o = l.first(); o; o = l.next()) { if (o->isWidgetType() && - ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.find((TQWidget *) o)) + ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.tqfind((TQWidget *) o)) widgets.append((TQWidget *) o); } LayoutGridCommand *cmd = new LayoutGridCommand(i18n("Lay Out Children in a Grid"), @@ -2035,8 +2035,8 @@ void FormWindow::breakLayout(TQWidget * w) { if (!w || w == this) break; - if (WidgetFactory::layoutType(w) != WidgetFactory::NoLayout && - WidgetDatabase::isContainer(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)))) + if (WidgetFactory::tqlayoutType(w) != WidgetFactory::NoLayout && + WidgetDatabase::isContainer(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))))) { Command *cmd = breakLayoutCommand(w); if (cmd) @@ -2044,7 +2044,7 @@ void FormWindow::breakLayout(TQWidget * w) if (!w->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING) && !w->inherits(TQSPLITTER_OBJECT_NAME_STRING)) break; } - w = w->parentWidget(); + w = w->tqparentWidget(); } if (commands.isEmpty()) @@ -2058,16 +2058,16 @@ void FormWindow::breakLayout(TQWidget * w) BreakLayoutCommand *FormWindow::breakLayoutCommand(TQWidget * w) { - TQObjectList *l = (TQObjectList *) w->children(); - if (!l) + TQObjectList l = w->childrenListObject(); + if (l.isEmpty()) return 0; TQWidgetList widgets; - for (TQObject * o = l->first(); o; o = l->next()) + for (TQObject * o = l.first(); o; o = l.next()) { if (o->isWidgetType() && - !mainWindow()->isAToolBarChild((TQWidget *) o) && - ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.find((TQWidget *) o)) + !mainWindow()->isAToolBarChild(TQT_TQOBJECT(o)) && + ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.tqfind((TQWidget *) o)) widgets.append((TQWidget *) o); } return new BreakLayoutCommand(i18n("Break Layout"), this, @@ -2102,7 +2102,7 @@ bool FormWindow::hasInsertedChildren(TQWidget *w) const for (TQObject *o = l->first(); o; o = l->next()) if (o->isWidgetType() && ((TQWidget*)o)->isVisibleTo((FormWindow*)this) && - insertedWidgets.find((TQWidget*)o)) + insertedWidgets.tqfind((TQWidget*)o)) { delete l; return true; @@ -2113,13 +2113,13 @@ bool FormWindow::hasInsertedChildren(TQWidget *w) const bool FormWindow::allowMove(TQWidget *w) { - w = w->parentWidget(); + w = w->tqparentWidget(); while (w) { - if ((isMainContainer(w) || insertedWidgets.find(w)) && WidgetFactory::layoutType(w) == + if ((isMainContainer(TQT_TQOBJECT(w)) || insertedWidgets.tqfind(w)) && WidgetFactory::tqlayoutType(w) == WidgetFactory::NoLayout) return true; - w = w->parentWidget(); + w = w->tqparentWidget(); } return false; } @@ -2152,8 +2152,8 @@ void FormWindow::restoreConnectionLine() if (!unclippedPainter || !buffer) return; - int a =QABS(connectStartPos.x() - currentConnectPos.x()); - int b = QABS(connectStartPos.y() - currentConnectPos.y()); + int a =TQABS(connectStartPos.x() - currentConnectPos.x()); + int b = TQABS(connectStartPos.y() - currentConnectPos.y()); TQRect r(connectStartPos, currentConnectPos); if (a < 32 || b < 32) @@ -2197,7 +2197,7 @@ void FormWindow::restoreConnectionLine() w = h = 64; r = r.normalize(); - while (r.contains(p)) + while (r.tqcontains(p)) { unclippedPainter->drawPixmap(p, *buffer, TQRect(p, TQSize(w, h))); unclippedPainter->setPen(red); @@ -2274,7 +2274,7 @@ bool FormWindow::unify(TQObject *w, TQString &s, bool changeIt) int num = 1; TQPtrDictIterator<TQWidget> it(insertedWidgets); for (; it.current();) - if (it.current() != w && !qstrcmp(it.current()->name(), s.latin1())) + if (TQT_BASE_OBJECT(it.current()) != TQT_BASE_OBJECT(w) && !qstrcmp(it.current()->name(), s.latin1())) { found = true; if (!changeIt) @@ -2328,7 +2328,7 @@ bool FormWindow::unify(TQObject *w, TQString &s, bool changeIt) } if (!found) { - TQObjectList *l = mainContainer()->queryList("QDesignerPopupMenu", 0, true); + TQObjectList *l = mainContainer()->queryList("TQDesignerPopupMenu", 0, true); for (TQObject *o = l->first(); o; o = l->next()) if (o != w && !qstrcmp(o->name(), s.latin1())) { @@ -2351,7 +2351,7 @@ bool FormWindow::isCustomWidgetUsed(MetaDataBase::CustomWidget *w) { TQPtrDictIterator<TQWidget> it(insertedWidgets); for (; it.current(); ++it) - if (it.current()->isA("CustomWidget") && !qstrcmp(WidgetFactory::classNameOf(it.current()), + if (it.current()->isA("CustomWidget") && !qstrcmp(WidgetFactory::classNameOf(TQT_TQOBJECT(it.current())), w->className.utf8())) return true; return false; @@ -2359,14 +2359,14 @@ bool FormWindow::isCustomWidgetUsed(MetaDataBase::CustomWidget *w) bool FormWindow::isDatabaseWidgetUsed() const { -#ifndef QT_NO_SQL +#ifndef TQT_NO_SQL TQStringList dbClasses; dbClasses << TQDATATABLE_OBJECT_NAME_STRING; // add more here TQPtrDictIterator<TQWidget> it(insertedWidgets); for (; it.current(); ++it) { TQString c(it.current()->className()); - if (dbClasses.contains(c) > 0) + if (dbClasses.tqcontains(c) > 0) return true; } #endif @@ -2375,9 +2375,9 @@ bool FormWindow::isDatabaseWidgetUsed() const bool FormWindow::isDatabaseAware() const { -#ifndef QT_NO_SQL - if (TQString(mContainer->className()) == "QDesignerDataBrowser" || - TQString(mContainer->className()) == "QDesignerDataView") +#ifndef TQT_NO_SQL + if (TQString(mContainer->className()) == "TQDesignerDataBrowser" || + TQString(mContainer->className()) == "TQDesignerDataView") return true; return isDatabaseWidgetUsed(); #else @@ -2388,7 +2388,7 @@ bool FormWindow::isDatabaseAware() const void FormWindow::visibilityChanged() { if (currTool != ORDER_TOOL) - emitUpdateProperties(currentWidget()); + emitUpdateProperties(TQT_TQOBJECT(currentWidget())); else { updateOrderIndicators(); @@ -2407,10 +2407,10 @@ TQPoint FormWindow::mapToForm(const TQWidget* w, const TQPoint& pos) const { TQPoint p = pos; const TQWidget* i = w; - while (i && !i->isTopLevel() && !isMainContainer((TQWidget*)i)) + while (i && !i->isTopLevel() && !isMainContainer(TQT_TQOBJECT(const_cast<TQWidget*>(i)))) { p = i->mapToParent(p); - i = i->parentWidget(); + i = i->tqparentWidget(); } return mapFromGlobal(w->mapToGlobal(pos)); } @@ -2421,7 +2421,7 @@ static int widgetDepth(TQWidget *w) while (w && !w->isTopLevel()) { d++; - w = w->parentWidget(); + w = w->tqparentWidget(); } return d; @@ -2433,7 +2433,7 @@ static bool isChildOf(TQWidget *c, TQWidget *p) { if (c == p) return true; - c = c->parentWidget(); + c = c->tqparentWidget(); } return false; } @@ -2444,7 +2444,7 @@ TQWidget *FormWindow::containerAt(const TQPoint &pos, TQWidget *notParentOf) TQWidget *container = 0; int depth = -1; TQWidgetList selected = selectedWidgets(); - if (rect().contains(mapFromGlobal(pos))) + if (TQT_TQRECT_OBJECT(rect()).tqcontains(mapFromGlobal(pos))) { container = mainContainer(); depth = widgetDepth(container); @@ -2457,26 +2457,26 @@ TQWidget *FormWindow::containerAt(const TQPoint &pos, TQWidget *notParentOf) continue; if (!it.current()->isVisibleTo(this)) continue; - if (selected.find(it.current()) != -1) + if (selected.tqfind(it.current()) != -1) continue; if (!WidgetDatabase::isContainer(WidgetDatabase::idFromClassName( - WidgetFactory::classNameOf(it.current()))) && it.current() != mainContainer()) + WidgetFactory::classNameOf(TQT_TQOBJECT(it.current())))) && it.current() != mainContainer()) continue; // the rectangles of all ancestors of the container must contain the insert position TQWidget *w = it.current(); while (w && !w->isTopLevel()) { - if (!w->rect().contains((w->mapFromGlobal(pos)))) + if (!TQT_TQRECT_OBJECT(w->rect()).tqcontains((w->mapFromGlobal(pos)))) break; - w = w->parentWidget(); + w = w->tqparentWidget(); } if (w && !w->isTopLevel()) continue; // we did not get through the full while loop int wd = widgetDepth(it.current()); - if (wd == depth && container && ((TQObjectList*)it.current()->parentWidget()-> - children())->find(it.current()) > - ((TQObjectList*)container->parentWidget()->children())->find(container)) + if (wd == depth && container && (it.current()->tqparentWidget()-> + childrenListObject()).tqfind(TQT_TQOBJECT(it.current())) > + (container->tqparentWidget()->childrenListObject()).tqfind(TQT_TQOBJECT(container))) wd++; if (wd > depth && !isChildOf(it.current(), notParentOf)) { depth = wd; @@ -2489,7 +2489,7 @@ TQWidget *FormWindow::containerAt(const TQPoint &pos, TQWidget *notParentOf) bool FormWindow::isMainContainer(TQObject *w) const { - return w && w->isWidgetType() && (w == (TQWidget*)this || w == mainContainer()); + return w && w->isWidgetType() && (TQT_BASE_OBJECT(w) == this || TQT_BASE_OBJECT(w) == TQT_BASE_OBJECT(mainContainer())); } void FormWindow::setMainContainer(TQWidget *w) @@ -2497,20 +2497,20 @@ void FormWindow::setMainContainer(TQWidget *w) bool resetPropertyWidget = isMainContainer(propertyWidget); if (mContainer) insertedWidgets.remove(mContainer); - if (propertyWidget == mContainer) + if (TQT_BASE_OBJECT(propertyWidget) == TQT_BASE_OBJECT(mContainer)) propertyWidget = 0; delete mContainer; mContainer = w; insertedWidgets.insert(mContainer, mContainer); - delete layout(); + delete tqlayout(); TQHBoxLayout *l = new TQHBoxLayout(this); l->addWidget(w); if (resetPropertyWidget) { TQObject *opw = propertyWidget; - propertyWidget = mContainer; + propertyWidget = TQT_TQOBJECT(mContainer); if (opw && opw->isWidgetType()) - repaintSelection((TQWidget*)opw); + tqrepaintSelection((TQWidget*)opw); } } @@ -2567,7 +2567,7 @@ bool FormWindow::isCentralWidget(TQObject *w) const { if (!mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) return false; - return w == ((TQMainWindow*)mainContainer())->centralWidget(); + return TQT_BASE_OBJECT(w) == TQT_BASE_OBJECT(((TQMainWindow*)mainContainer())->centralWidget()); } TQObject *FormWindow::connectableObject(TQObject *w, TQObject *) @@ -2575,12 +2575,12 @@ TQObject *FormWindow::connectableObject(TQObject *w, TQObject *) return w; } -int FormWindow::layoutDefaultSpacing() const +int FormWindow::tqlayoutDefaultSpacing() const { return defSpacing; } -int FormWindow::layoutDefaultMargin() const +int FormWindow::tqlayoutDefaultMargin() const { return defMargin; } |