summaryrefslogtreecommitdiffstats
path: root/kommander/editor/formwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/formwindow.cpp')
-rw-r--r--kommander/editor/formwindow.cpp114
1 files changed, 57 insertions, 57 deletions
diff --git a/kommander/editor/formwindow.cpp b/kommander/editor/formwindow.cpp
index e6088172..590d1c47 100644
--- a/kommander/editor/formwindow.cpp
+++ b/kommander/editor/formwindow.cpp
@@ -460,9 +460,9 @@ void FormWindow::handleContextMenu(TQContextMenuEvent *e, TQWidget *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->tqparentWidget() && (WidgetFactory::tqlayoutType(w->tqparentWidget()) !=
+ while (w->parentWidget() && (WidgetFactory::layoutType(w->parentWidget()) !=
WidgetFactory::NoLayout || !insertedWidgets.tqfind(w)))
- w = w->tqparentWidget();
+ w = w->parentWidget();
if (mainContainer()->inherits(TQMAINWINDOW_OBJECT_NAME_STRING) &&
((TQMainWindow*)mainContainer())->centralWidget() == realWidget)
{
@@ -503,7 +503,7 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w)
if (!isMainContainer(TQT_TQOBJECT(w)) && qstrcmp(w->name(), "central widget") != 0)
{ // press on a child widget
// if the clicked widget is not in a tqlayout, raise it
- if (!w->tqparentWidget() || WidgetFactory::tqlayoutType(w->tqparentWidget()) == WidgetFactory::NoLayout)
+ if (!w->parentWidget() || WidgetFactory::layoutType(w->parentWidget()) == WidgetFactory::NoLayout)
w->raise();
if ((e->state() & ControlButton))
{ // with control pressed, always start rubber band selection
@@ -522,7 +522,7 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w)
{ // ...widget selected
// only if widget has a tqlayout (it is a tqlayout meta widget or a laid out container!),
// unselect its childs
- if (WidgetFactory::tqlayoutType(w) != WidgetFactory::NoLayout)
+ if (WidgetFactory::layoutType(w) != WidgetFactory::NoLayout)
{
TQObjectList *l = w->queryList(TQWIDGET_OBJECT_NAME_STRING);
setPropertyShowingBlocked(true);
@@ -550,10 +550,10 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w)
selectWidget(TQT_TQOBJECT(w));
// if widget is laid out, find the first non-laid out super-widget
- while (w->tqparentWidget() &&
- (WidgetFactory::tqlayoutType(w->tqparentWidget()) != WidgetFactory::NoLayout
+ while (w->parentWidget() &&
+ (WidgetFactory::layoutType(w->parentWidget()) != WidgetFactory::NoLayout
|| !insertedWidgets.tqfind(w)))
- w = w->tqparentWidget();
+ w = w->parentWidget();
if (e->button() == Qt::LeftButton)
{ // left button: store original tqgeometry and more as the widget might start moving
@@ -563,12 +563,12 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w)
origPressPos = oldPressPos;
checkedSelectionsForMove = false;
moving.clear();
- if (w->tqparentWidget() && !isMainContainer(TQT_TQOBJECT(w->tqparentWidget())) &&
- !isCentralWidget(TQT_TQOBJECT(w->tqparentWidget())))
+ if (w->parentWidget() && !isMainContainer(TQT_TQOBJECT(w->parentWidget())) &&
+ !isCentralWidget(TQT_TQOBJECT(w->parentWidget())))
{
- targetContainer = w->tqparentWidget();
- hadOwnPalette = w->tqparentWidget()->ownPalette();
- restorePalette = w->tqparentWidget()->palette();
+ targetContainer = w->parentWidget();
+ hadOwnPalette = w->parentWidget()->ownPalette();
+ restorePalette = w->parentWidget()->palette();
}
}
}
@@ -643,7 +643,7 @@ void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w)
}
else
{
- wid = wid->tqparentWidget();
+ wid = wid->parentWidget();
if (!wid)
break;
}
@@ -695,9 +695,9 @@ 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->tqparentWidget() && (WidgetFactory::tqlayoutType(w->tqparentWidget()) !=
+ while (w->parentWidget() && (WidgetFactory::layoutType(w->parentWidget()) !=
WidgetFactory::NoLayout || !insertedWidgets.tqfind(w)))
- w = w->tqparentWidget();
+ w = w->parentWidget();
// calc correct position
TQPoint pos = w->mapFromGlobal(e->globalPos());
// calc move distance and store it
@@ -807,7 +807,7 @@ void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w)
arg(connectReceiver->name()));
tqApp->processEvents();
if (drawRecRect)
- restoreRect(TQRect(mapToForm(((TQWidget*)oldReceiver)->tqparentWidget(),
+ restoreRect(TQRect(mapToForm(((TQWidget*)oldReceiver)->parentWidget(),
((TQWidget*)oldReceiver)->pos()), ((TQWidget*)oldReceiver)->size()));
drawConnectLine();
break;
@@ -848,7 +848,7 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w)
emitUpdateProperties(propertyWidget);
TQMapConstIterator < ulong, TQPoint > it = moving.begin();
- TQWidget *oldParent = ((TQWidget *) it.key())->tqparentWidget();
+ TQWidget *oldParent = ((TQWidget *) it.key())->parentWidget();
TQWidget *newParent = oldParent;
// check whether we have to reparent the selection
TQWidget *wa = containerAt(e->globalPos(), ((TQWidget *) it.key()));
@@ -857,12 +857,12 @@ 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 tqparents.
- if (wa == ((TQWidget *) it.key())->tqparentWidget())
+ // check whether we really have different parents.
+ if (wa == ((TQWidget *) it.key())->parentWidget())
goto make_move_command;
// break tqlayout if necessary
- if (WidgetFactory::tqlayoutType(wa) != WidgetFactory::NoLayout)
+ if (WidgetFactory::layoutType(wa) != WidgetFactory::NoLayout)
{
if (KMessageBox::questionYesNo(mainWindow(),
i18n("You tried to insert a widget into the "
@@ -883,14 +883,14 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w)
TQWidget *i = (TQWidget *) it.key();
if (!emitSelChanged && i->inherits(TQBUTTON_OBJECT_NAME_STRING))
{
- if (i->tqparentWidget() && i->tqparentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING) ||
+ if (i->parentWidget() && i->parentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING) ||
wa->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING))
emitSelChanged = true;
if (!wa->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING))
{
MetaDataBase::setPropertyChanged(TQT_TQOBJECT(i), "buttonGroupId", false);
- if (i->tqparentWidget() && i->tqparentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING))
- ((TQButtonGroup *) i->tqparentWidget())->remove((TQButton *) i);
+ if (i->parentWidget() && i->parentWidget()->inherits(TQBUTTONGROUP_OBJECT_NAME_STRING))
+ ((TQButtonGroup *) i->parentWidget())->remove((TQButton *) i);
}
}
TQPoint pos = wa->mapFromGlobal(i->mapToGlobal(TQPoint(0, 0)));
@@ -935,10 +935,10 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w)
case CONNECT_TOOL:
restoreConnectionLine();
if (connectSender)
- restoreRect(TQRect(mapToForm(((TQWidget *) connectSender)->tqparentWidget(),
+ restoreRect(TQRect(mapToForm(((TQWidget *) connectSender)->parentWidget(),
((TQWidget *) connectSender)->pos()), ((TQWidget *) connectSender)->size()));
if (connectReceiver)
- restoreRect(TQRect(mapToForm(((TQWidget *) connectReceiver)->tqparentWidget(),
+ restoreRect(TQRect(mapToForm(((TQWidget *) connectReceiver)->parentWidget(),
((TQWidget *) connectReceiver)->pos()), ((TQWidget *) connectReceiver)->size()));
endUnclippedPainter();
tqApp->processEvents();
@@ -951,7 +951,7 @@ void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w)
if (insertParent)
{ // we should insert the new widget now
endRectDraw();
- if (WidgetFactory::tqlayoutType(insertParent) != WidgetFactory::NoLayout)
+ if (WidgetFactory::layoutType(insertParent) != WidgetFactory::NoLayout)
{
if (KMessageBox::questionYesNo(mainWindow(),
i18n("You tried to insert a widget into the "
@@ -1314,8 +1314,8 @@ void FormWindow::moveSelectedWidgets(int dx, int dy)
{
WidgetSelection *s = it.current();
TQWidget *w = s->widget();
- if (w->tqparentWidget()
- && WidgetFactory::tqlayoutType(w->tqparentWidget()) != WidgetFactory::NoLayout)
+ if (w->parentWidget()
+ && WidgetFactory::layoutType(w->parentWidget()) != WidgetFactory::NoLayout)
continue;
w->move(w->x() + dx, w->y() + dy);
s->updateGeometry();
@@ -1374,7 +1374,7 @@ void FormWindow::checkSelectionsForMove(TQWidget * w)
{
checkedSelectionsForMove = true;
- TQObjectList *l = w->tqparentWidget()->queryList(TQWIDGET_OBJECT_NAME_STRING, 0, false, false);
+ TQObjectList *l = w->parentWidget()->queryList(TQWIDGET_OBJECT_NAME_STRING, 0, false, false);
moving.clear();
if (l)
{
@@ -1387,11 +1387,11 @@ void FormWindow::checkSelectionsForMove(TQWidget * w)
++it;
if (l->tqfind(TQT_TQOBJECT(sel->widget())) == -1)
{
- if (WidgetFactory::tqlayoutType(w) == WidgetFactory::NoLayout)
+ if (WidgetFactory::layoutType(w) == WidgetFactory::NoLayout)
sel->setWidget(0);
} else
{
- if (WidgetFactory::tqlayoutType(sel->widget()->tqparentWidget()) == WidgetFactory::NoLayout)
+ if (WidgetFactory::layoutType(sel->widget()->parentWidget()) == WidgetFactory::NoLayout)
{
moving.insert((ulong) sel->widget(), sel->widget()->pos());
sel->widget()->raise();
@@ -1447,8 +1447,8 @@ void FormWindow::editAdjustSize()
}
for (TQWidget * w = widgets.first(); w; w = widgets.next())
{
- if (w->tqparentWidget()
- && WidgetFactory::tqlayoutType(w->tqparentWidget()) != WidgetFactory::NoLayout)
+ if (w->parentWidget()
+ && WidgetFactory::layoutType(w->parentWidget()) != WidgetFactory::NoLayout)
continue;
TQRect oldr = w->tqgeometry();
w->adjustSize();
@@ -1618,10 +1618,10 @@ void FormWindow::currentToolChanged()
case CONNECT_TOOL:
restoreConnectionLine();
if (connectSender)
- restoreRect(TQRect(mapToForm(((TQWidget *) connectSender)->tqparentWidget(),
+ restoreRect(TQRect(mapToForm(((TQWidget *) connectSender)->parentWidget(),
((TQWidget *) connectSender)->pos()), ((TQWidget *) connectSender)->size()));
if (connectReceiver)
- restoreRect(TQRect(mapToForm(((TQWidget *) connectReceiver)->tqparentWidget(),
+ restoreRect(TQRect(mapToForm(((TQWidget *) connectReceiver)->parentWidget(),
((TQWidget *) connectReceiver)->pos()), ((TQWidget *) connectReceiver)->size()));
endUnclippedPainter();
break;
@@ -1694,7 +1694,7 @@ void FormWindow::showOrderIndicators()
for (TQObject * o = l->first(); o; o = l->next())
{
TQWidget *w = (TQWidget *) o;
- if (w->isVisibleTo(w->tqparentWidget()) &&
+ if (w->isVisibleTo(w->parentWidget()) &&
insertedWidgets[(void *) w] && w->focusPolicy() != TQ_NoFocus)
{
OrderIndicator *ind = new OrderIndicator(order++, w, this);
@@ -1903,7 +1903,7 @@ void FormWindow::selectAll()
emitSelectionChanged();
}
-void FormWindow::tqlayoutHorizontal()
+void FormWindow::layoutHorizontal()
{
TQWidgetList widgets(selectedWidgets());
LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand(i18n("Lay OutQt::Horizontally"),
@@ -1913,7 +1913,7 @@ void FormWindow::tqlayoutHorizontal()
cmd->execute();
}
-void FormWindow::tqlayoutVertical()
+void FormWindow::layoutVertical()
{
TQWidgetList widgets(selectedWidgets());
LayoutVerticalCommand *cmd = new LayoutVerticalCommand(i18n("Lay OutQt::Vertically"),
@@ -1923,7 +1923,7 @@ void FormWindow::tqlayoutVertical()
cmd->execute();
}
-void FormWindow::tqlayoutHorizontalSplit()
+void FormWindow::layoutHorizontalSplit()
{
TQWidgetList widgets(selectedWidgets());
LayoutHorizontalSplitCommand *cmd =
@@ -1934,7 +1934,7 @@ void FormWindow::tqlayoutHorizontalSplit()
cmd->execute();
}
-void FormWindow::tqlayoutVerticalSplit()
+void FormWindow::layoutVerticalSplit()
{
TQWidgetList widgets(selectedWidgets());
LayoutVerticalSplitCommand *cmd =
@@ -1945,7 +1945,7 @@ void FormWindow::tqlayoutVerticalSplit()
cmd->execute();
}
-void FormWindow::tqlayoutGrid()
+void FormWindow::layoutGrid()
{
int xres = grid().x();
int yres = grid().y();
@@ -1958,7 +1958,7 @@ void FormWindow::tqlayoutGrid()
cmd->execute();
}
-void FormWindow::tqlayoutHorizontalContainer(TQWidget * w)
+void FormWindow::layoutHorizontalContainer(TQWidget * w)
{
if (w == this)
w = mainContainer();
@@ -1979,7 +1979,7 @@ void FormWindow::tqlayoutHorizontalContainer(TQWidget * w)
cmd->execute();
}
-void FormWindow::tqlayoutVerticalContainer(TQWidget * w)
+void FormWindow::layoutVerticalContainer(TQWidget * w)
{
if (w == this)
w = mainContainer();
@@ -2000,7 +2000,7 @@ void FormWindow::tqlayoutVerticalContainer(TQWidget * w)
cmd->execute();
}
-void FormWindow::tqlayoutGridContainer(TQWidget * w)
+void FormWindow::layoutGridContainer(TQWidget * w)
{
if (w == this)
w = mainContainer();
@@ -2035,7 +2035,7 @@ void FormWindow::breakLayout(TQWidget * w)
{
if (!w || w == this)
break;
- if (WidgetFactory::tqlayoutType(w) != WidgetFactory::NoLayout &&
+ if (WidgetFactory::layoutType(w) != WidgetFactory::NoLayout &&
WidgetDatabase::isContainer(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w)))))
{
Command *cmd = breakLayoutCommand(w);
@@ -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->tqparentWidget();
+ w = w->parentWidget();
}
if (commands.isEmpty())
@@ -2113,13 +2113,13 @@ bool FormWindow::hasInsertedChildren(TQWidget *w) const
bool FormWindow::allowMove(TQWidget *w)
{
- w = w->tqparentWidget();
+ w = w->parentWidget();
while (w)
{
- if ((isMainContainer(TQT_TQOBJECT(w)) || insertedWidgets.tqfind(w)) && WidgetFactory::tqlayoutType(w) ==
+ if ((isMainContainer(TQT_TQOBJECT(w)) || insertedWidgets.tqfind(w)) && WidgetFactory::layoutType(w) ==
WidgetFactory::NoLayout)
return true;
- w = w->tqparentWidget();
+ w = w->parentWidget();
}
return false;
}
@@ -2410,7 +2410,7 @@ TQPoint FormWindow::mapToForm(const TQWidget* w, const TQPoint& pos) const
while (i && !i->isTopLevel() && !isMainContainer(TQT_TQOBJECT(const_cast<TQWidget*>(i))))
{
p = i->mapToParent(p);
- i = i->tqparentWidget();
+ i = i->parentWidget();
}
return mapFromGlobal(w->mapToGlobal(pos));
}
@@ -2421,7 +2421,7 @@ static int widgetDepth(TQWidget *w)
while (w && !w->isTopLevel())
{
d++;
- w = w->tqparentWidget();
+ w = w->parentWidget();
}
return d;
@@ -2433,7 +2433,7 @@ static bool isChildOf(TQWidget *c, TQWidget *p)
{
if (c == p)
return true;
- c = c->tqparentWidget();
+ c = c->parentWidget();
}
return false;
}
@@ -2469,14 +2469,14 @@ TQWidget *FormWindow::containerAt(const TQPoint &pos, TQWidget *notParentOf)
{
if (!TQT_TQRECT_OBJECT(w->rect()).tqcontains((w->mapFromGlobal(pos))))
break;
- w = w->tqparentWidget();
+ w = w->parentWidget();
}
if (w && !w->isTopLevel()) continue; // we did not get through the full while loop
int wd = widgetDepth(it.current());
- if (wd == depth && container && (it.current()->tqparentWidget()->
+ if (wd == depth && container && (it.current()->parentWidget()->
childrenListObject()).tqfind(TQT_TQOBJECT(it.current())) >
- (container->tqparentWidget()->childrenListObject()).tqfind(TQT_TQOBJECT(container)))
+ (container->parentWidget()->childrenListObject()).tqfind(TQT_TQOBJECT(container)))
wd++;
if (wd > depth && !isChildOf(it.current(), notParentOf)) {
depth = wd;
@@ -2575,12 +2575,12 @@ TQObject *FormWindow::connectableObject(TQObject *w, TQObject *)
return w;
}
-int FormWindow::tqlayoutDefaultSpacing() const
+int FormWindow::layoutDefaultSpacing() const
{
return defSpacing;
}
-int FormWindow::tqlayoutDefaultMargin() const
+int FormWindow::layoutDefaultMargin() const
{
return defMargin;
}