diff options
Diffstat (limited to 'kommander/editor/formwindow.cpp')
-rw-r--r-- | kommander/editor/formwindow.cpp | 272 |
1 files changed, 136 insertions, 136 deletions
diff --git a/kommander/editor/formwindow.cpp b/kommander/editor/formwindow.cpp index 70796291..81489695 100644 --- a/kommander/editor/formwindow.cpp +++ b/kommander/editor/formwindow.cpp @@ -129,7 +129,7 @@ FormWindow::FormWindow(FormFile *f, TQWidget *parent, const char *name) void FormWindow::init() { - MetaDataBase::addEntry(TQT_TQOBJECT(this)); + MetaDataBase::addEntry(this); ff->setFormWindow(this); propertyWidget = 0; toolFixed = false; @@ -140,34 +140,34 @@ void FormWindow::init() unclippedPainter = 0; widgetPressed = false; drawRubber = false; - setFocusPolicy(TQ_ClickFocus); + setFocusPolicy(TQWidget::ClickFocus); sizePreviewLabel = 0; checkSelectionsTimer = new TQTimer(this, "checkSelectionsTimer"); - connect(checkSelectionsTimer, TQT_SIGNAL(timeout()), - this, TQT_SLOT(invalidCheckedSelections())); + connect(checkSelectionsTimer, TQ_SIGNAL(timeout()), + this, TQ_SLOT(invalidCheckedSelections())); updatePropertiesTimer = new TQTimer(this); - connect(updatePropertiesTimer, TQT_SIGNAL(timeout()), - this, TQT_SLOT(updatePropertiesTimerDone())); + connect(updatePropertiesTimer, TQ_SIGNAL(timeout()), + this, TQ_SLOT(updatePropertiesTimerDone())); showPropertiesTimer = new TQTimer(this); - connect(showPropertiesTimer, TQT_SIGNAL(timeout()), - this, TQT_SLOT(showPropertiesTimerDone())); + connect(showPropertiesTimer, TQ_SIGNAL(timeout()), + this, TQ_SLOT(showPropertiesTimerDone())); selectionChangedTimer = new TQTimer(this); - connect(selectionChangedTimer, TQT_SIGNAL(timeout()), - this, TQT_SLOT(selectionChangedTimerDone())); + connect(selectionChangedTimer, TQ_SIGNAL(timeout()), + this, TQ_SLOT(selectionChangedTimerDone())); insertParent = 0; - connect(&commands, TQT_SIGNAL(undoRedoChanged(bool, bool, const TQString &, const TQString &)), - this, TQT_SIGNAL(undoRedoChanged(bool, bool, const TQString &, const TQString &))); + connect(&commands, TQ_SIGNAL(undoRedoChanged(bool, bool, const TQString &, const TQString &)), + this, TQ_SIGNAL(undoRedoChanged(bool, bool, const TQString &, const TQString &))); propShowBlocked = false; setIcon(PixmapChooser::loadPixmap("form.xpm", PixmapChooser::Mini)); - connect(&commands, TQT_SIGNAL(modificationChanged(bool)), - this, TQT_SLOT(modificationChanged(bool))); + connect(&commands, TQ_SIGNAL(modificationChanged(bool)), + this, TQ_SLOT(modificationChanged(bool))); buffer = 0; - TQWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName(TQFRAME_OBJECT_NAME_STRING), this); + TQWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQFrame"), this); setMainContainer(w); - propertyWidget = TQT_TQOBJECT(w); + propertyWidget = w; targetContainer = 0; hadOwnPalette = false; @@ -178,7 +178,7 @@ void FormWindow::init() void FormWindow::setMainWindow(MainWindow *w) { mainwindow = w; - MetaDataBase::addEntry(TQT_TQOBJECT(this)); + MetaDataBase::addEntry(this); initSlots(); } @@ -190,7 +190,7 @@ FormWindow::~FormWindow() { if (MainWindow::self->objectHierarchy()->formWindow() == this) MainWindow::self->objectHierarchy()->setFormWindow(0, 0); - MetaDataBase::clear(TQT_TQOBJECT(this)); + MetaDataBase::clear(this); if (ff) ff->setFormWindow(0); } @@ -295,15 +295,15 @@ void FormWindow::insertWidget() return; bool useSizeHint = !oldRectValid || (currRect.width() < 2 && currRect.height() < 2); - Qt::Orientation orient =Qt::Horizontal; + TQt::Orientation orient =TQt::Horizontal; TQString n = WidgetDatabase::className(currTool); - if (useSizeHint && (n == "Spacer" || n == TQSLIDER_OBJECT_NAME_STRING || n == "Line" || n == TQSCROLLBAR_OBJECT_NAME_STRING)) { + if (useSizeHint && (n == "Spacer" || n == "TQSlider" || n == "Line" || n == "TQScrollBar")) { TQPopupMenu m(mainWindow()); m.insertItem(i18n("&Horizontal")); int ver = m.insertItem(i18n("&Vertical")); int r = m.exec(TQCursor::pos()); if (r == ver) - orient =Qt::Vertical; + orient =TQt::Vertical; } TQWidget *w = WidgetFactory::create(currTool, insertParent, 0, true, &currRect, orient); @@ -312,7 +312,7 @@ void FormWindow::insertWidget() if (!savePixmapInline() && currTool == WidgetDatabase::idFromClassName("PixmapLabel")) ((TQLabel*)w)->setPixmap(PixmapChooser::loadPixmap("image.xpm")); - int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))); + int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(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> " @@ -332,8 +332,8 @@ void FormWindow::insertWidget() } TQString s = w->name(); - unify(TQT_TQOBJECT(w), s, true); - w->setName(s); + unify(w, s, true); + w->setName(s.utf8()); insertWidget(w); TQRect r(currRect); if (!oldRectValid || (currRect.width() < 2 && currRect.height() < 2)) @@ -357,12 +357,12 @@ void FormWindow::insertWidget() const TQObjectList l = insertParent->childrenListObject(); TQObjectListIt it(l); TQWidgetList lst; - if (WidgetDatabase::isContainer(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))))) + if (WidgetDatabase::isContainer(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)))) for (; it.current();) { TQObject *o = it.current(); ++it; if (o->isWidgetType() && ((TQWidget*)o)->isVisibleTo(this) && - insertedWidgets.find((TQWidget*)o) && TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(w)) + insertedWidgets.find((TQWidget*)o) && o != w) { TQRect r2(((TQWidget*)o)->pos(), ((TQWidget*)o)->size()); if (r.contains(r2)) @@ -414,12 +414,12 @@ void FormWindow::insertWidget(TQWidget *w, bool checkName) { if (checkName) { TQString s = w->name(); - unify(TQT_TQOBJECT(w), s, true); - w->setName(s); + unify(w, s, true); + w->setName(s.utf8()); } - MetaDataBase::addEntry(TQT_TQOBJECT(w)); - int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))); + MetaDataBase::addEntry(w); + int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)); if (WidgetDatabase::isCustomWidget(id)) { TQWhatsThis::add(w, i18n("<b>A %1 (custom widget)</b> " @@ -446,7 +446,7 @@ void FormWindow::insertWidget(TQWidget *w, bool checkName) void FormWindow::removeWidget(TQWidget *w) { - MetaDataBase::removeEntry(TQT_TQOBJECT(w)); + MetaDataBase::removeEntry(w); widgets()->take(w); } @@ -454,16 +454,16 @@ void FormWindow::handleContextMenu(TQContextMenuEvent *e, TQWidget *w) { switch (currTool) { case POINTER_TOOL: - if (!isMainContainer(TQT_TQOBJECT(w)) && qstrcmp(w->name(), "central widget")) + if (!isMainContainer(w) && qstrcmp(w->name(), "central widget")) { // press on a child widget raiseChildSelections(w); // raise selections and select widget - selectWidget(TQT_TQOBJECT(w)); + selectWidget(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(); - if (mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING) && + if (mainContainer()->inherits("TQMainWindow") && ((TQMainWindow*)mainContainer())->centralWidget() == realWidget) { e->accept(); @@ -500,7 +500,7 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) switch (currTool) { case POINTER_TOOL: - if (!isMainContainer(TQT_TQOBJECT(w)) && qstrcmp(w->name(), "central widget") != 0) + if (!isMainContainer(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) @@ -513,7 +513,7 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) break; } - bool sel = isWidgetSelected(TQT_TQOBJECT(w)); + bool sel = isWidgetSelected(w); if (!((e->state() & ControlButton) || (e->state() & ShiftButton))) { // control not pressed... if (!sel) // ...and widget no selectted: unselect all @@ -524,14 +524,14 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) // unselect its childs if (WidgetFactory::layoutType(w) != WidgetFactory::NoLayout) { - TQObjectList *l = w->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectList *l = w->queryList("TQWidget"); setPropertyShowingBlocked(true); for (TQObject *o = l->first(); o; o = l->next()) { if (!o->isWidgetType()) continue; if (insertedWidgets.find((TQWidget*)o)) - selectWidget(TQT_TQOBJECT(o), false); + selectWidget(o, false); } setPropertyShowingBlocked(false); delete l; @@ -540,14 +540,14 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) tqApp->processEvents(); } if (((e->state() & ControlButton) || (e->state() & ShiftButton)) && - sel && e->button() == Qt::LeftButton) + sel && e->button() == TQt::LeftButton) { // control pressed and selected, unselect widget - selectWidget(TQT_TQOBJECT(w), false); + selectWidget(w, false); break; } raiseChildSelections(w); // raise selections and select widget - selectWidget(TQT_TQOBJECT(w)); + selectWidget(w); // if widget is laid out, find the first non-laid out super-widget while (w->parentWidget() && @@ -555,7 +555,7 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) || !insertedWidgets.find(w))) w = w->parentWidget(); - if (e->button() == Qt::LeftButton) + if (e->button() == TQt::LeftButton) { // left button: store original geometry and more as the widget might start moving widgetPressed = true; widgetGeom = TQRect(w->pos(), w->size()); @@ -563,8 +563,8 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) origPressPos = oldPressPos; checkedSelectionsForMove = false; moving.clear(); - if (w->parentWidget() && !isMainContainer(TQT_TQOBJECT(w->parentWidget())) && - !isCentralWidget(TQT_TQOBJECT(w->parentWidget()))) + if (w->parentWidget() && !isMainContainer(w->parentWidget()) && + !isCentralWidget(w->parentWidget())) { targetContainer = w->parentWidget(); hadOwnPalette = w->parentWidget()->ownPalette(); @@ -574,14 +574,14 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) } else { // press was on the formwindow - if (e->button() == Qt::LeftButton) + if (e->button() == TQt::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 = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if (opw->isWidgetType()) repaintSelection((TQWidget*)opw); } @@ -591,19 +591,19 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) } break; case CONNECT_TOOL: - if (e->button() != Qt::LeftButton) + if (e->button() != TQt::LeftButton) break; saveBackground(); mainWindow()->statusBar()->message(i18n("Connect '%1' with...").arg(w->name())); connectStartPos = mapFromGlobal(e->globalPos()); currentConnectPos = mapFromGlobal(e->globalPos()); - connectSender = TQT_TQOBJECT(designerWidget(TQT_TQOBJECT(w))); - connectReceiver = connectableObject(TQT_TQOBJECT(designerWidget(TQT_TQOBJECT(w))), connectReceiver); + connectSender = designerWidget(w); + connectReceiver = connectableObject(designerWidget(w), connectReceiver); beginUnclippedPainter(false); drawConnectLine(); break; case ORDER_TOOL: - if (!isMainContainer(TQT_TQOBJECT(w))) + if (!isMainContainer(w)) { // press on a child widget orderedWidgets.removeRef(w); orderedWidgets.append(w); @@ -625,18 +625,18 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w) } break; default: // any insert widget tool - if (e->button() == Qt::LeftButton) + if (e->button() == TQt::LeftButton) { insertParent = WidgetFactory::containerOfWidget(mainContainer()); // default parent for new widget is the formwindow - if (!isMainContainer(TQT_TQOBJECT(w))) + if (!isMainContainer(w)) { // press was not on formwindow, check if we can find another parent TQWidget *wid = w; for (;;) { - int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(wid))); + int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(wid)); if ((WidgetDatabase::isContainer(id) || wid == mainContainer()) && - !wid->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING) && !wid->inherits(TQSPLITTER_OBJECT_NAME_STRING)) + !wid->inherits("TQLayoutWidget") && !wid->inherits("TQSplitter")) { insertParent = WidgetFactory::containerOfWidget(wid); // found another parent, store it break; @@ -659,7 +659,7 @@ void FormWindow::handleMouseDblClick(TQMouseEvent *, TQWidget *w) { switch (currTool) { case ORDER_TOOL: - if (!isMainContainer(TQT_TQOBJECT(w))) + if (!isMainContainer(w)) { // press on a child widget orderedWidgets.clear(); orderedWidgets.append(w); @@ -685,7 +685,7 @@ void FormWindow::handleMouseDblClick(TQMouseEvent *, TQWidget *w) void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w) { - if ((e->state() & Qt::LeftButton) != Qt::LeftButton) + if ((e->state() & TQt::LeftButton) != TQt::LeftButton) return; TQWidget *newReceiver = (TQWidget*)connectReceiver, *oldReceiver = (TQWidget*)connectReceiver, *wid; @@ -724,10 +724,10 @@ 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(TQT_TQOBJECT(w))) + if (!isWidgetSelected(w)) { // and unselect others. Only siblings can be moved at the same time setPropertyShowingBlocked(true); - selectWidget(TQT_TQOBJECT(w)); + selectWidget(w); setPropertyShowingBlocked(false); } checkSelectionsForMove(w); @@ -736,7 +736,7 @@ void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w) // highlight the possible new parent container TQMapConstIterator<ulong, TQPoint> it = moving.begin(); TQWidget* wa = containerAt(e->globalPos(), ((TQWidget*)it.key())); - if (wa && !isMainContainer(TQT_TQOBJECT(wa)) && !isCentralWidget(TQT_TQOBJECT(wa))) + if (wa && !isMainContainer(wa) && !isCentralWidget(wa)) { wa = WidgetFactory::containerOfWidget(wa); // ok, looks like we moved onto a container @@ -792,17 +792,17 @@ void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w) restoreConnectionLine(); wid = tqApp->widgetAt(e->globalPos(), true); if (wid) - wid = designerWidget(TQT_TQOBJECT(wid)); - if (wid && (isMainContainer(TQT_TQOBJECT(wid)) || insertedWidgets.find(wid)) && wid->isVisibleTo(this)) + wid = designerWidget(wid); + if (wid && (isMainContainer(wid) || insertedWidgets.find(wid)) && wid->isVisibleTo(this)) newReceiver = wid; - if (newReceiver && (newReceiver->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING) + if (newReceiver && (newReceiver->inherits("TQLayoutWidget") || newReceiver->inherits("Spacer"))) newReceiver = (TQWidget*)connectReceiver; - drawRecRect = TQT_BASE_OBJECT(newReceiver) != TQT_BASE_OBJECT(connectReceiver); + drawRecRect = newReceiver != connectReceiver; currentConnectPos = mapFromGlobal(e->globalPos()); - if (newReceiver && (isMainContainer(TQT_TQOBJECT(newReceiver)) - || insertedWidgets.find(newReceiver)) && !isCentralWidget(TQT_TQOBJECT(newReceiver))) - connectReceiver = connectableObject(TQT_TQOBJECT(newReceiver), TQT_TQOBJECT(connectReceiver)); + if (newReceiver && (isMainContainer(newReceiver) + || insertedWidgets.find(newReceiver)) && !isCentralWidget(newReceiver)) + connectReceiver = connectableObject(newReceiver, connectReceiver); mainWindow()->statusBar()->message(i18n("Connect '%1' to '%2'").arg(connectSender->name()). arg(connectReceiver->name())); tqApp->processEvents(); @@ -822,7 +822,7 @@ void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w) void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w) { - if (e->button() != Qt::LeftButton) + if (e->button() != TQt::LeftButton) return; switch (currTool) @@ -881,15 +881,15 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w) for (TQMap < ulong, TQPoint >::Iterator it = moving.begin(); it != moving.end(); ++it) { TQWidget *i = (TQWidget *) it.key(); - if (!emitSelChanged && i->inherits(TQBUTTON_OBJECT_NAME_STRING)) + if (!emitSelChanged && i->inherits("TQButton")) { - if (i->parentWidget() && i->parentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING) || - wa->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING)) + if (i->parentWidget() && i->parentWidget()->inherits("TQButtonGroup") || + wa->inherits("TQButtonGroup")) emitSelChanged = true; - if (!wa->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING)) + if (!wa->inherits("TQButtonGroup")) { - MetaDataBase::setPropertyChanged(TQT_TQOBJECT(i), "buttonGroupId", false); - if (i->parentWidget() && i->parentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING)) + MetaDataBase::setPropertyChanged(i, "buttonGroupId", false); + if (i->parentWidget() && i->parentWidget()->inherits("TQButtonGroup")) ((TQButtonGroup *) i->parentWidget())->remove((TQButton *) i); } } @@ -897,13 +897,13 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w) i->reparent(wa, pos, true); raiseSelection(i); raiseChildSelections(i); - widgetChanged(TQT_TQOBJECT(i)); + widgetChanged(i); mainWindow()->objectHierarchy()->widgetRemoved(i); mainWindow()->objectHierarchy()->widgetInserted(i); } if (emitSelChanged) { - emit showProperties(TQT_TQOBJECT(wa)); + emit showProperties(wa); emit showProperties(propertyWidget); } newParent = wa; @@ -1061,10 +1061,10 @@ void FormWindow::handleKeyPress(TQKeyEvent * e, TQWidget * w) } if (!e->isAccepted()) { - TQObjectList *l = queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectList *l = queryList("TQWidget"); if (!l) return; - if (l->find(TQT_TQOBJECT(w)) != -1) + if (l->find(w) != -1) e->accept(); delete l; } @@ -1086,21 +1086,21 @@ void FormWindow::selectWidget(TQObject * o, bool select) TQWidget *w = (TQWidget *) o; - if (isMainContainer(TQT_TQOBJECT(w))) + if (isMainContainer(w)) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if (opw->isWidgetType()) repaintSelection((TQWidget *) opw); emitShowProperties(propertyWidget); return; } - if (mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING) && + if (mainContainer()->inherits("TQMainWindow") && w == ((TQMainWindow *) mainContainer())->centralWidget()) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if (opw->isWidgetType()) repaintSelection((TQWidget *) opw); emitShowProperties(propertyWidget); @@ -1113,7 +1113,7 @@ void FormWindow::selectWidget(TQObject * o, bool select) if (select) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(w); + propertyWidget = w; if (opw->isWidgetType()) repaintSelection((TQWidget *) opw); if (!isPropertyShowingBlocked()) @@ -1148,9 +1148,9 @@ void FormWindow::selectWidget(TQObject * o, bool select) s->setWidget(0); TQObject *opw = propertyWidget; if (!usedSelections.isEmpty()) - propertyWidget = TQT_TQOBJECT(TQPtrDictIterator < WidgetSelection > (usedSelections).current()->widget()); + propertyWidget = TQPtrDictIterator < WidgetSelection > (usedSelections).current()->widget(); else - propertyWidget = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if (opw->isWidgetType()) repaintSelection((TQWidget *) opw); if (!isPropertyShowingBlocked()) @@ -1170,7 +1170,7 @@ void FormWindow::updateSelection(TQWidget * w) { WidgetSelection *s = usedSelections.find(w); if (!w->isVisibleTo(this)) - selectWidget(TQT_TQOBJECT(w), false); + selectWidget(w, false); else if (s) s->updateGeometry(); } @@ -1199,7 +1199,7 @@ void FormWindow::clearSelection(bool changePropertyDisplay) if (changePropertyDisplay) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if (opw->isWidgetType()) repaintSelection((TQWidget *) opw); emitShowProperties(propertyWidget); @@ -1281,7 +1281,7 @@ void FormWindow::endRectDraw() void FormWindow::selectWidgets() { - TQObjectList *l = mainContainer()->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectList *l = mainContainer()->queryList("TQWidget"); if (l) { for (TQObject * o = l->first(); o; o = l->next()) @@ -1292,7 +1292,7 @@ void FormWindow::selectWidgets() p = mapFromGlobal(p); TQRect r(p, ((TQWidget *) o)->size()); if (r.intersects(currRect) && !r.contains(currRect)) - selectWidget(TQT_TQOBJECT(o)); + selectWidget(o); } } delete l; @@ -1340,7 +1340,7 @@ void FormWindow::redo() void FormWindow::raiseChildSelections(TQWidget * w) { - TQObjectList *l = w->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectList *l = w->queryList("TQWidget"); if (!l || !l->first()) { delete l; @@ -1350,7 +1350,7 @@ void FormWindow::raiseChildSelections(TQWidget * w) TQPtrDictIterator < WidgetSelection > it(usedSelections); for (; it.current(); ++it) { - if (l->findRef(TQT_TQOBJECT(it.current()->widget())) != -1) + if (l->findRef(it.current()->widget()) != -1) it.current()->show(); } delete l; @@ -1358,7 +1358,7 @@ void FormWindow::raiseChildSelections(TQWidget * w) void FormWindow::updateChildSelections(TQWidget * w) { - TQObjectList *l = w->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectList *l = w->queryList("TQWidget"); if (l) { for (TQObject * o = l->first(); o; o = l->next()) @@ -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->parentWidget()->queryList("TQWidget", 0, false, false); moving.clear(); if (l) { @@ -1385,7 +1385,7 @@ void FormWindow::checkSelectionsForMove(TQWidget * w) if (it.current()->widget() == mainContainer()) continue; ++it; - if (l->find(TQT_TQOBJECT(sel->widget())) == -1) + if (l->find(sel->widget()) == -1) { if (WidgetFactory::layoutType(w) == WidgetFactory::NoLayout) sel->setWidget(0); @@ -1411,7 +1411,7 @@ void FormWindow::deleteWidgets() for (; it.current(); ++it) { TQWidget *tb = 0; - if (!(tb = mainWindow()->isAToolBarChild(TQT_TQOBJECT(it.current()->widget())))) + if (!(tb = mainWindow()->isAToolBarChild(it.current()->widget()))) widgets.append(it.current()->widget()); else ((QDesignerToolBar *) tb)->removeWidget(it.current()->widget()); @@ -1500,7 +1500,7 @@ void FormWindow::invalidCheckedSelections() void FormWindow::checkPreviewGeometry(TQRect & r) { - if (TQT_TQRECT_OBJECT(rect()).contains(r)) + if (rect().contains(r)) return; if (r.left() < rect().left()) r.moveTopLeft(TQPoint(0, r.top())); @@ -1527,7 +1527,7 @@ void FormWindow::focusOutEvent(TQFocusEvent *) if (propertyWidget && !isMainContainer(propertyWidget) && !isWidgetSelected(propertyWidget)) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(mainContainer()); + propertyWidget = mainContainer(); if (opw->isWidgetType()) repaintSelection((TQWidget *) opw); } @@ -1552,7 +1552,7 @@ TQWidget *FormWindow::designerWidget(TQObject * o) const if (!o || !o->isWidgetType()) return 0; TQWidget *w = (TQWidget *) o; - while (w && !isMainContainer(TQT_TQOBJECT(w)) && !insertedWidgets[(void *) w] || isCentralWidget(TQT_TQOBJECT(w))) + while (w && !isMainContainer(w) && !insertedWidgets[(void *) w] || isCentralWidget(w)) w = (TQWidget *) w->parent(); return w; } @@ -1652,7 +1652,7 @@ void FormWindow::currentToolChanged() { case POINTER_TOOL: if (propertyWidget && !isMainContainer(propertyWidget) && !isWidgetSelected(propertyWidget)) - emitShowProperties(TQT_TQOBJECT(mainContainer())); + emitShowProperties(mainContainer()); restoreCursors(this, this); break; case ORDER_TOOL: @@ -1662,7 +1662,7 @@ void FormWindow::currentToolChanged() orderedWidgets.clear(); showOrderIndicators(); if (mainWindow()->formWindow() == this) - emitShowProperties(TQT_TQOBJECT(mainContainer())); + emitShowProperties(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(TQT_TQOBJECT(mainContainer())); + emitShowProperties(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(TQT_TQOBJECT(mainContainer())); + emitShowProperties(mainContainer()); break; } } @@ -1686,7 +1686,7 @@ void FormWindow::showOrderIndicators() { hideOrderIndicators(); orderIndicators.setAutoDelete(true); - TQObjectList *l = mainContainer()->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectList *l = mainContainer()->queryList("TQWidget"); stackedWidgets = MetaDataBase::tabOrder(this); if (l) { @@ -1695,7 +1695,7 @@ void FormWindow::showOrderIndicators() { TQWidget *w = (TQWidget *) o; if (w->isVisibleTo(w->parentWidget()) && - insertedWidgets[(void *) w] && w->focusPolicy() != TQ_NoFocus) + insertedWidgets[(void *) w] && w->focusPolicy() != TQWidget::NoFocus) { OrderIndicator *ind = new OrderIndicator(order++, w, this); orderIndicators.append(ind); @@ -1743,7 +1743,7 @@ bool FormWindow::checkCustomWidgets() { if (it.current()->isA("CustomWidget")) { - TQString className = WidgetFactory::classNameOf(TQT_TQOBJECT(it.current())); + TQString className = WidgetFactory::classNameOf(it.current()); if (!MetaDataBase::hasCustomWidget(className)) missingCustomWidgets << className; } @@ -1811,7 +1811,7 @@ static void find_accel(const TQString & txt, TQMap < TQChar, TQWidgetList > &acc void FormWindow::checkAccels() { TQMap < TQChar, TQWidgetList > accels; - TQObjectList *l = mainContainer()->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectList *l = mainContainer()->queryList("TQWidget"); if (l) { for (TQObject * o = l->first(); o; o = l->next()) @@ -1849,7 +1849,7 @@ void FormWindow::checkAccels() { clearSelection(false); for (wid = (*it).first(); wid; wid = (*it).next()) - selectWidget(TQT_TQOBJECT(wid), true); + selectWidget(wid, true); } return; } @@ -1883,14 +1883,14 @@ void FormWindow::selectAll() { checkedSelectionsForMove = false; blockSignals(true); - TQObjectList *l = mainContainer()->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectList *l = mainContainer()->queryList("TQWidget"); if (l) { for (TQObject * o = l->first(); o; o = l->next()) { if (((TQWidget *) o)->isVisibleTo(this) && insertedWidgets[(void *) o]) { - selectWidget(TQT_TQOBJECT(o)); + selectWidget(o); } } delete l; @@ -2036,12 +2036,12 @@ void FormWindow::breakLayout(TQWidget * w) if (!w || w == this) break; if (WidgetFactory::layoutType(w) != WidgetFactory::NoLayout && - WidgetDatabase::isContainer(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))))) + WidgetDatabase::isContainer(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)))) { Command *cmd = breakLayoutCommand(w); if (cmd) commands.insert(0, cmd); - if (!w->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING) && !w->inherits(TQSPLITTER_OBJECT_NAME_STRING)) + if (!w->inherits("TQLayoutWidget") && !w->inherits("TQSplitter")) break; } w = w->parentWidget(); @@ -2066,7 +2066,7 @@ BreakLayoutCommand *FormWindow::breakLayoutCommand(TQWidget * w) for (TQObject * o = l.first(); o; o = l.next()) { if (o->isWidgetType() && - !mainWindow()->isAToolBarChild(TQT_TQOBJECT(o)) && + !mainWindow()->isAToolBarChild(o) && ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.find((TQWidget *) o)) widgets.append((TQWidget *) o); } @@ -2093,7 +2093,7 @@ bool FormWindow::hasInsertedChildren(TQWidget *w) const w = WidgetFactory::containerOfWidget(w); if (!w) return false; - TQObjectList *l = w->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectList *l = w->queryList("TQWidget"); if (!l || !l->first()) { delete l; @@ -2116,7 +2116,7 @@ bool FormWindow::allowMove(TQWidget *w) w = w->parentWidget(); while (w) { - if ((isMainContainer(TQT_TQOBJECT(w)) || insertedWidgets.find(w)) && WidgetFactory::layoutType(w) == + if ((isMainContainer(w) || insertedWidgets.find(w)) && WidgetFactory::layoutType(w) == WidgetFactory::NoLayout) return true; w = w->parentWidget(); @@ -2274,7 +2274,7 @@ bool FormWindow::unify(TQObject *w, TQString &s, bool changeIt) int num = 1; TQPtrDictIterator<TQWidget> it(insertedWidgets); for (; it.current();) - if (TQT_BASE_OBJECT(it.current()) != TQT_BASE_OBJECT(w) && !qstrcmp(it.current()->name(), s.latin1())) + if (it.current() != w && !qstrcmp(it.current()->name(), s.latin1())) { found = true; if (!changeIt) @@ -2291,7 +2291,7 @@ bool FormWindow::unify(TQObject *w, TQString &s, bool changeIt) TQAction *a = 0; for (a = actions.first(); a; a = actions.next()) { - TQObjectList *l = a->queryList(TQACTION_OBJECT_NAME_STRING); + TQObjectList *l = a->queryList("TQAction"); al.append(a); for (TQObject *ao = l->first(); ao; ao = l->next()) al.append((TQAction*)ao); @@ -2310,11 +2310,11 @@ bool FormWindow::unify(TQObject *w, TQString &s, bool changeIt) } } - if (mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) + if (mainContainer()->inherits("TQMainWindow")) { if (!found) { - TQObjectList *l = mainContainer()->queryList(TQDOCKWINDOW_OBJECT_NAME_STRING, 0, true); + TQObjectList *l = mainContainer()->queryList("TQDockWindow", 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(TQT_TQOBJECT(it.current())), + if (it.current()->isA("CustomWidget") && !qstrcmp(WidgetFactory::classNameOf(it.current()), w->className.utf8())) return true; return false; @@ -2361,7 +2361,7 @@ bool FormWindow::isDatabaseWidgetUsed() const { #ifndef TQT_NO_SQL TQStringList dbClasses; - dbClasses << TQDATATABLE_OBJECT_NAME_STRING; // add more here + dbClasses << "TQDataTable"; // add more here TQPtrDictIterator<TQWidget> it(insertedWidgets); for (; it.current(); ++it) { @@ -2388,7 +2388,7 @@ bool FormWindow::isDatabaseAware() const void FormWindow::visibilityChanged() { if (currTool != ORDER_TOOL) - emitUpdateProperties(TQT_TQOBJECT(currentWidget())); + emitUpdateProperties(currentWidget()); else { updateOrderIndicators(); @@ -2407,7 +2407,7 @@ TQPoint FormWindow::mapToForm(const TQWidget* w, const TQPoint& pos) const { TQPoint p = pos; const TQWidget* i = w; - while (i && !i->isTopLevel() && !isMainContainer(TQT_TQOBJECT(const_cast<TQWidget*>(i)))) + while (i && !i->isTopLevel() && !isMainContainer(const_cast<TQWidget*>(i))) { p = i->mapToParent(p); i = i->parentWidget(); @@ -2444,30 +2444,30 @@ TQWidget *FormWindow::containerAt(const TQPoint &pos, TQWidget *notParentOf) TQWidget *container = 0; int depth = -1; TQWidgetList selected = selectedWidgets(); - if (TQT_TQRECT_OBJECT(rect()).contains(mapFromGlobal(pos))) + if (rect().contains(mapFromGlobal(pos))) { container = mainContainer(); depth = widgetDepth(container); } for (; it.current(); ++it) { - if (it.current()->inherits(TQLAYOUTWIDGET_OBJECT_NAME_STRING)) + if (it.current()->inherits("TQLayoutWidget")) continue; - if (it.current()->inherits(TQSPLITTER_OBJECT_NAME_STRING)) + if (it.current()->inherits("TQSplitter")) continue; if (!it.current()->isVisibleTo(this)) continue; if (selected.find(it.current()) != -1) continue; if (!WidgetDatabase::isContainer(WidgetDatabase::idFromClassName( - WidgetFactory::classNameOf(TQT_TQOBJECT(it.current())))) && it.current() != mainContainer()) + WidgetFactory::classNameOf(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 (!TQT_TQRECT_OBJECT(w->rect()).contains((w->mapFromGlobal(pos)))) + if (!w->rect().contains((w->mapFromGlobal(pos)))) break; w = w->parentWidget(); } @@ -2475,8 +2475,8 @@ TQWidget *FormWindow::containerAt(const TQPoint &pos, TQWidget *notParentOf) int wd = widgetDepth(it.current()); if (wd == depth && container && (it.current()->parentWidget()-> - childrenListObject()).find(TQT_TQOBJECT(it.current())) > - (container->parentWidget()->childrenListObject()).find(TQT_TQOBJECT(container))) + childrenListObject()).find(it.current()) > + (container->parentWidget()->childrenListObject()).find(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() && (TQT_BASE_OBJECT(w) == this || TQT_BASE_OBJECT(w) == TQT_BASE_OBJECT(mainContainer())); + return w && w->isWidgetType() && (w == this || w == mainContainer()); } void FormWindow::setMainContainer(TQWidget *w) @@ -2497,7 +2497,7 @@ void FormWindow::setMainContainer(TQWidget *w) bool resetPropertyWidget = isMainContainer(propertyWidget); if (mContainer) insertedWidgets.remove(mContainer); - if (TQT_BASE_OBJECT(propertyWidget) == TQT_BASE_OBJECT(mContainer)) + if (propertyWidget == mContainer) propertyWidget = 0; delete mContainer; mContainer = w; @@ -2508,7 +2508,7 @@ void FormWindow::setMainContainer(TQWidget *w) if (resetPropertyWidget) { TQObject *opw = propertyWidget; - propertyWidget = TQT_TQOBJECT(mContainer); + propertyWidget = mContainer; if (opw && opw->isWidgetType()) repaintSelection((TQWidget*)opw); } @@ -2546,7 +2546,7 @@ TQAction *FormWindow::findAction(const TQString &name) { if (TQString(a->name()) == name) return a; - TQAction *ac = (TQAction*)a->child(name.latin1(), TQACTION_OBJECT_NAME_STRING); + TQAction *ac = (TQAction*)a->child(name.latin1(), "TQAction"); if (ac) return ac; } @@ -2555,7 +2555,7 @@ TQAction *FormWindow::findAction(const TQString &name) void FormWindow::killAccels(TQObject *top) { - TQObjectList *l = top->queryList(TQACCEL_OBJECT_NAME_STRING); + TQObjectList *l = top->queryList("TQAccel"); if (!l) return; for (TQObject *o = l->first(); o; o = l->next()) @@ -2565,9 +2565,9 @@ void FormWindow::killAccels(TQObject *top) bool FormWindow::isCentralWidget(TQObject *w) const { - if (!mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) + if (!mainContainer()->inherits("TQMainWindow")) return false; - return TQT_BASE_OBJECT(w) == TQT_BASE_OBJECT(((TQMainWindow*)mainContainer())->centralWidget()); + return w == ((TQMainWindow*)mainContainer())->centralWidget(); } TQObject *FormWindow::connectableObject(TQObject *w, TQObject *) @@ -2604,6 +2604,6 @@ void FormWindow::setFormFile(FormFile *f) { ff = f; if (ff) - connect(this, TQT_SIGNAL(modificationChanged(bool, const TQString&)), ff, TQT_SLOT(formWindowChangedSomehow())); + connect(this, TQ_SIGNAL(modificationChanged(bool, const TQString&)), ff, TQ_SLOT(formWindowChangedSomehow())); } #include "formwindow.moc" |