summaryrefslogtreecommitdiffstats
path: root/kommander/editor/formwindow.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:54:04 +0000
commitdc6b8e72fed2586239e3514819238c520636c9d9 (patch)
tree88b200df0a0b7fab9d6f147596173556f1ed9a13 /kommander/editor/formwindow.cpp
parent6927d4436e54551917f600b706a8d6109e49de1c (diff)
downloadtdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz
tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/editor/formwindow.cpp')
-rw-r--r--kommander/editor/formwindow.cpp852
1 files changed, 426 insertions, 426 deletions
diff --git a/kommander/editor/formwindow.cpp b/kommander/editor/formwindow.cpp
index 0aa9b122..631def85 100644
--- a/kommander/editor/formwindow.cpp
+++ b/kommander/editor/formwindow.cpp
@@ -18,28 +18,28 @@
**********************************************************************/
// Qt includes
-#include <qaccel.h>
-#include <qapplication.h>
-#include <qbitmap.h>
-#include <qevent.h>
-#include <qfeatures.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qmap.h>
-#include <qmetaobject.h>
-#include <qobjectlist.h>
-#include <qpainter.h>
-#include <qpalette.h>
-#include <qpen.h>
-#include <qpixmapcache.h>
-#include <qpopupmenu.h>
-#include <qpushbutton.h>
-#include <qsizegrip.h>
-#include <qspinbox.h>
-#include <qstatusbar.h>
-#include <qtimer.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
+#include <tqaccel.h>
+#include <tqapplication.h>
+#include <tqbitmap.h>
+#include <tqevent.h>
+#include <tqfeatures.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqmap.h>
+#include <tqmetaobject.h>
+#include <tqobjectlist.h>
+#include <tqpainter.h>
+#include <tqpalette.h>
+#include <tqpen.h>
+#include <tqpixmapcache.h>
+#include <tqpopupmenu.h>
+#include <tqpushbutton.h>
+#include <tqsizegrip.h>
+#include <tqspinbox.h>
+#include <tqstatusbar.h>
+#include <tqtimer.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
// KDE includes
#include <klocale.h>
@@ -67,30 +67,30 @@
#include <stdlib.h>
-static void setCursorToAll(const QCursor &c, QWidget *start)
+static void setCursorToAll(const TQCursor &c, TQWidget *start)
{
start->setCursor(c);
- QObjectList *l = (QObjectList*)start->children();
+ TQObjectList *l = (TQObjectList*)start->children();
if (l)
- for (QObject *o = l->first(); o; o = l->next())
+ for (TQObject *o = l->first(); o; o = l->next())
{
if (o->isWidgetType() && !o->inherits("SizeHandle"))
- setCursorToAll(c, ((QWidget*)o));
+ setCursorToAll(c, ((TQWidget*)o));
}
}
-static void restoreCursors(QWidget *start, FormWindow *fw)
+static void restoreCursors(TQWidget *start, FormWindow *fw)
{
if (fw->widgets()->find(start))
start->setCursor(MetaDataBase::cursor(start));
else
start->setCursor(Qt::ArrowCursor);
- QObjectList *l = (QObjectList*)start->children();
+ TQObjectList *l = (TQObjectList*)start->children();
if (l)
- for (QObject *o = l->first(); o; o = l->next())
+ for (TQObject *o = l->first(); o; o = l->next())
{
if (o->isWidgetType() && !o->inherits("SizeHandle"))
- restoreCursors(((QWidget*)o), fw);
+ restoreCursors(((TQWidget*)o), fw);
}
}
@@ -110,8 +110,8 @@ static void restoreCursors(QWidget *start, FormWindow *fw)
event filter which is implemented in MainWindow::eventFilter().
*/
-FormWindow::FormWindow(FormFile *f, MainWindow *mw, QWidget *parent, const char *name)
- : QWidget(parent, name, WDestructiveClose), mainwindow(mw),
+FormWindow::FormWindow(FormFile *f, MainWindow *mw, TQWidget *parent, const char *name)
+ : TQWidget(parent, name, WDestructiveClose), mainwindow(mw),
commands(100), pixInline(true)
{
ff = f;
@@ -119,8 +119,8 @@ FormWindow::FormWindow(FormFile *f, MainWindow *mw, QWidget *parent, const char
initSlots();
}
-FormWindow::FormWindow(FormFile *f, QWidget *parent, const char *name)
- : QWidget(parent, name, WDestructiveClose), mainwindow(0),
+FormWindow::FormWindow(FormFile *f, TQWidget *parent, const char *name)
+ : TQWidget(parent, name, WDestructiveClose), mainwindow(0),
commands(100), pixInline(true)
{
ff = f;
@@ -142,30 +142,30 @@ void FormWindow::init()
drawRubber = false;
setFocusPolicy(ClickFocus);
sizePreviewLabel = 0;
- checkSelectionsTimer = new QTimer(this, "checkSelectionsTimer");
- connect(checkSelectionsTimer, SIGNAL(timeout()),
- this, SLOT(invalidCheckedSelections()));
- updatePropertiesTimer = new QTimer(this);
- connect(updatePropertiesTimer, SIGNAL(timeout()),
- this, SLOT(updatePropertiesTimerDone()));
- showPropertiesTimer = new QTimer(this);
- connect(showPropertiesTimer, SIGNAL(timeout()),
- this, SLOT(showPropertiesTimerDone()));
- selectionChangedTimer = new QTimer(this);
- connect(selectionChangedTimer, SIGNAL(timeout()),
- this, SLOT(selectionChangedTimerDone()));
+ checkSelectionsTimer = new TQTimer(this, "checkSelectionsTimer");
+ connect(checkSelectionsTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(invalidCheckedSelections()));
+ updatePropertiesTimer = new TQTimer(this);
+ connect(updatePropertiesTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(updatePropertiesTimerDone()));
+ showPropertiesTimer = new TQTimer(this);
+ connect(showPropertiesTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(showPropertiesTimerDone()));
+ selectionChangedTimer = new TQTimer(this);
+ connect(selectionChangedTimer, TQT_SIGNAL(timeout()),
+ this, TQT_SLOT(selectionChangedTimerDone()));
insertParent = 0;
- connect(&commands, SIGNAL(undoRedoChanged(bool, bool, const QString &, const QString &)),
- this, SIGNAL(undoRedoChanged(bool, bool, const QString &, const QString &)));
+ connect(&commands, TQT_SIGNAL(undoRedoChanged(bool, bool, const TQString &, const TQString &)),
+ this, TQT_SIGNAL(undoRedoChanged(bool, bool, const TQString &, const TQString &)));
propShowBlocked = false;
setIcon(PixmapChooser::loadPixmap("form.xpm", PixmapChooser::Mini));
- connect(&commands, SIGNAL(modificationChanged(bool)),
- this, SLOT(modificationChanged(bool)));
+ connect(&commands, TQT_SIGNAL(modificationChanged(bool)),
+ this, TQT_SLOT(modificationChanged(bool)));
buffer = 0;
- QWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName("QFrame"), this);
+ TQWidget *w = WidgetFactory::create(WidgetDatabase::idFromClassName("TQFrame"), this);
setMainContainer(w);
propertyWidget = w;
targetContainer = 0;
@@ -195,7 +195,7 @@ FormWindow::~FormWindow()
ff->setFormWindow(0);
}
-void FormWindow::closeEvent(QCloseEvent *e)
+void FormWindow::closeEvent(TQCloseEvent *e)
{
if (ff->closeEvent() && mainwindow->unregisterClient(this))
e->accept();
@@ -203,29 +203,29 @@ void FormWindow::closeEvent(QCloseEvent *e)
e->ignore();
}
-void FormWindow::paintGrid(QWidget *w, QPaintEvent *e)
+void FormWindow::paintGrid(TQWidget *w, TQPaintEvent *e)
{
if (!mainWindow()->showGrid())
return;
- QPixmap grid;
- QString grid_name;
+ TQPixmap grid;
+ TQString grid_name;
grid_name.sprintf("FormWindowGrid_%d_%d", mainWindow()->grid().x(), mainWindow()->grid().y());
- if(!QPixmapCache::find(grid_name, grid)) {
- grid = QPixmap(350 + (350 % mainWindow()->grid().x()), 350 + (350 % mainWindow()->grid().y()));
- grid.fill(colorGroup().color(QColorGroup::Foreground));
- QBitmap mask(grid.width(), grid.height());
+ if(!TQPixmapCache::find(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);
- QPainter p(&mask);
+ TQPainter p(&mask);
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);
- QPixmapCache::insert(grid_name, grid);
+ TQPixmapCache::insert(grid_name, grid);
}
- QPainter p(w);
+ TQPainter p(w);
p.setClipRegion(e->rect());
- p.drawTiledPixmap(QRect(0, 0, width(), height()), grid);
+ p.drawTiledPixmap(TQRect(0, 0, width(), height()), grid);
}
@@ -245,7 +245,7 @@ void FormWindow::beginUnclippedPainter(bool doNot)
clearWFlags(WPaintUnclipped);
if (doNot)
{
- unclippedPainter->setPen(QPen(color0, 2));
+ unclippedPainter->setPen(TQPen(color0, 2));
unclippedPainter->setRasterOp(NotROP);
}
}
@@ -258,32 +258,32 @@ void FormWindow::endUnclippedPainter()
unclippedPainter = 0;
}
-QPoint FormWindow::gridPoint(const QPoint &p)
+TQPoint FormWindow::gridPoint(const TQPoint &p)
{
- return QPoint((p.x() / grid().x()) * grid().x(),
+ return TQPoint((p.x() / grid().x()) * grid().x(),
(p.y() / grid().y()) * grid().y());
}
-void FormWindow::drawSizePreview(const QPoint &pos, const QString& text)
+void FormWindow::drawSizePreview(const TQPoint &pos, const TQString& text)
{
unclippedPainter->save();
- unclippedPainter->setPen(QPen(colorGroup().foreground(), 1 ));
+ unclippedPainter->setPen(TQPen(colorGroup().foreground(), 1 ));
unclippedPainter->setRasterOp(CopyROP);
if (!sizePreviewPixmap.isNull())
unclippedPainter->drawPixmap(sizePreviewPos, sizePreviewPixmap);
if (text.isNull()) {
- sizePreviewPixmap = QPixmap(); // set null again
+ sizePreviewPixmap = TQPixmap(); // set null again
unclippedPainter->restore();
return;
}
- QRect r = fontMetrics().boundingRect(0, 0, 0, 0, AlignCenter, text);
- r = QRect(pos + QPoint(10, 10), r.size() + QSize(5, 5));
+ TQRect r = fontMetrics().boundingRect(0, 0, 0, 0, AlignCenter, text);
+ r = TQRect(pos + TQPoint(10, 10), r.size() + TQSize(5, 5));
checkPreviewGeometry(r);
sizePreviewPos = r.topLeft();
- sizePreviewPixmap = QPixmap::grabWindow(winId(), r.x(), r.y(), r.width(), r.height());
- unclippedPainter->setBrush(QColor(255, 255, 128));
+ sizePreviewPixmap = TQPixmap::grabWindow(winId(), r.x(), r.y(), r.width(), r.height());
+ unclippedPainter->setBrush(TQColor(255, 255, 128));
unclippedPainter->drawRect(r);
unclippedPainter->drawText(r, AlignCenter, text);
unclippedPainter->restore();
@@ -296,53 +296,53 @@ void FormWindow::insertWidget()
bool useSizeHint = !oldRectValid || (currRect.width() < 2 && currRect.height() < 2);
Orientation orient = Horizontal;
- QString n = WidgetDatabase::className(currTool);
- if (useSizeHint && (n == "Spacer" || n == "QSlider" || n == "Line" || n == "QScrollBar")) {
- QPopupMenu m(mainWindow());
+ TQString n = WidgetDatabase::className(currTool);
+ 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(QCursor::pos());
+ int r = m.exec(TQCursor::pos());
if (r == ver)
orient = Vertical;
}
- QWidget *w = WidgetFactory::create(currTool, insertParent, 0, true, &currRect, orient);
+ TQWidget *w = WidgetFactory::create(currTool, insertParent, 0, true, &currRect, orient);
if (!w)
return;
if (!savePixmapInline() && currTool == WidgetDatabase::idFromClassName("PixmapLabel"))
- ((QLabel*)w)->setPixmap(PixmapChooser::loadPixmap("image.xpm"));
+ ((TQLabel*)w)->setPixmap(PixmapChooser::loadPixmap("image.xpm"));
int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w));
if (WidgetDatabase::isCustomWidget(id)) {
- QWhatsThis::add(w, i18n("<b>A %1 (custom widget)</b> "
+ 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 "
"the widget on the form.</p>")
.arg(WidgetDatabase::toolTip(id)));
- QToolTip::add(w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip(id)));
+ TQToolTip::add(w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip(id)));
}
else
{
- QString tt = WidgetDatabase::toolTip(id);
- QString wt = WidgetDatabase::whatsThis(id);
+ TQString tt = WidgetDatabase::toolTip(id);
+ TQString wt = WidgetDatabase::whatsThis(id);
if (!wt.isEmpty() && !tt.isEmpty())
- QWhatsThis::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>").arg(tt).arg(wt));
}
- QString s = w->name();
+ TQString s = w->name();
unify(w, s, true);
w->setName(s);
insertWidget(w);
- QRect r(currRect);
+ TQRect r(currRect);
if (!oldRectValid || (currRect.width() < 2 && currRect.height() < 2))
- r = QRect(rectAnchor, QSize(0, 0));
+ r = TQRect(rectAnchor, TQSize(0, 0));
- QPoint p = r.topLeft();
+ TQPoint p = r.topLeft();
p = mapToGlobal(p);
p = insertParent->mapFromGlobal(p);
- r = QRect(p, r.size());
+ r = TQRect(p, r.size());
if (useSizeHint)
{
r.setWidth(w->sizeHint().width());
@@ -354,30 +354,30 @@ void FormWindow::insertWidget()
if (r.height() < 2 * grid().y())
r.setHeight(2 * grid().y());
- const QObjectList *l = insertParent->children();
- QObjectListIt it(*l);
- QWidgetList lst;
+ const TQObjectList *l = insertParent->children();
+ TQObjectListIt it(*l);
+ TQWidgetList lst;
if (WidgetDatabase::isContainer(WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w))))
for (; it.current();) {
- QObject *o = it.current();
+ TQObject *o = it.current();
++it;
- if (o->isWidgetType() && ((QWidget*)o)->isVisibleTo(this) &&
- insertedWidgets.find((QWidget*)o) && o != w)
+ if (o->isWidgetType() && ((TQWidget*)o)->isVisibleTo(this) &&
+ insertedWidgets.find((TQWidget*)o) && o != w)
{
- QRect r2(((QWidget*)o)->pos(), ((QWidget*)o)->size());
+ TQRect r2(((TQWidget*)o)->pos(), ((TQWidget*)o)->size());
if (r.contains(r2))
- lst.append((QWidget*)o);
+ lst.append((TQWidget*)o);
}
}
if (!lst.isEmpty())
{
- QWidget *pw = WidgetFactory::containerOfWidget(w);
- QValueList<QPoint> op, np;
- for (QWidget *i = lst.first(); i; i = lst.next())
+ TQWidget *pw = WidgetFactory::containerOfWidget(w);
+ TQValueList<TQPoint> op, np;
+ for (TQWidget *i = lst.first(); i; i = lst.next())
{
op.append(i->pos());
- QPoint pos = pw->mapFromGlobal(i->mapToGlobal(QPoint(0, 0)));
+ TQPoint pos = pw->mapFromGlobal(i->mapToGlobal(TQPoint(0, 0)));
pos -= r.topLeft();
np.append(pos);
}
@@ -389,7 +389,7 @@ void FormWindow::insertWidget()
InsertCommand *cmd = new InsertCommand(i18n("Insert %1").arg(w->name()), this, w, r);
- QPtrList<Command> commands;
+ TQPtrList<Command> commands;
commands.append(mv);
commands.append(cmd);
@@ -410,10 +410,10 @@ void FormWindow::insertWidget()
}
}
-void FormWindow::insertWidget(QWidget *w, bool checkName)
+void FormWindow::insertWidget(TQWidget *w, bool checkName)
{
if (checkName) {
- QString s = w->name();
+ TQString s = w->name();
unify(w, s, true);
w->setName(s);
}
@@ -422,21 +422,21 @@ void FormWindow::insertWidget(QWidget *w, bool checkName)
int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w));
if (WidgetDatabase::isCustomWidget(id))
{
- QWhatsThis::add(w, i18n("<b>A %1 (custom widget)</b> "
+ 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 "
"the widget on the form.</p>")
.arg(WidgetDatabase::toolTip(id)));
- QToolTip::add(w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip(id)));
+ TQToolTip::add(w, i18n("A %1 (custom widget)").arg(WidgetDatabase::toolTip(id)));
}
else
{
- QString tt = WidgetDatabase::toolTip(id);
- QString wt = WidgetDatabase::whatsThis(id);
+ TQString tt = WidgetDatabase::toolTip(id);
+ TQString wt = WidgetDatabase::whatsThis(id);
if (!wt.isEmpty() && !tt.isEmpty())
- QWhatsThis::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>").arg(tt).arg(wt));
}
restoreCursors(w, this);
@@ -444,13 +444,13 @@ void FormWindow::insertWidget(QWidget *w, bool checkName)
w->show();
}
-void FormWindow::removeWidget(QWidget *w)
+void FormWindow::removeWidget(TQWidget *w)
{
MetaDataBase::removeEntry(w);
widgets()->take(w);
}
-void FormWindow::handleContextMenu(QContextMenuEvent *e, QWidget *w)
+void FormWindow::handleContextMenu(TQContextMenuEvent *e, TQWidget *w)
{
switch (currTool) {
case POINTER_TOOL:
@@ -459,12 +459,12 @@ void FormWindow::handleContextMenu(QContextMenuEvent *e, QWidget *w)
raiseChildSelections(w); // raise selections and select widget
selectWidget(w);
// if widget is laid out, find the first non-laid out super-widget
- QWidget *realWidget = w; // but store the original one
+ 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("QMainWindow") &&
- ((QMainWindow*)mainContainer())->centralWidget() == realWidget)
+ if (mainContainer()->inherits("TQMainWindow") &&
+ ((TQMainWindow*)mainContainer())->centralWidget() == realWidget)
{
e->accept();
mainwindow->popupFormWindowMenu(e->globalPos(), this);
@@ -487,15 +487,15 @@ void FormWindow::handleContextMenu(QContextMenuEvent *e, QWidget *w)
}
}
-void FormWindow::handleMousePress(QMouseEvent *e, QWidget *w)
+void FormWindow::handleMousePress(TQMouseEvent *e, TQWidget *w)
{
checkedSelectionsForMove = false;
checkSelectionsTimer->stop();
if (!sizePreviewLabel) {
- sizePreviewLabel = new QLabel(this);
+ sizePreviewLabel = new TQLabel(this);
sizePreviewLabel->hide();
- sizePreviewLabel->setBackgroundColor(QColor(255, 255, 128));
- sizePreviewLabel->setFrameStyle(QFrame::Plain | QFrame::Box);
+ sizePreviewLabel->setBackgroundColor(TQColor(255, 255, 128));
+ sizePreviewLabel->setFrameStyle(TQFrame::Plain | TQFrame::Box);
}
switch (currTool) {
@@ -508,7 +508,7 @@ void FormWindow::handleMousePress(QMouseEvent *e, QWidget *w)
if ((e->state() & ControlButton))
{ // with control pressed, always start rubber band selection
drawRubber = true;
- currRect = QRect(0, 0, -1, -1);
+ currRect = TQRect(0, 0, -1, -1);
startRectDraw(mapFromGlobal(e->globalPos()), e->globalPos(), this, Rubber);
break;
}
@@ -524,14 +524,14 @@ void FormWindow::handleMousePress(QMouseEvent *e, QWidget *w)
// unselect its childs
if (WidgetFactory::layoutType(w) != WidgetFactory::NoLayout)
{
- QObjectList *l = w->queryList("QWidget");
+ TQObjectList *l = w->queryList("TQWidget");
setPropertyShowingBlocked(true);
- for (QObject *o = l->first(); o; o = l->next())
+ for (TQObject *o = l->first(); o; o = l->next())
{
if (!o->isWidgetType())
continue;
- if (insertedWidgets.find((QWidget*)o))
- selectWidget((QWidget*)o, false);
+ if (insertedWidgets.find((TQWidget*)o))
+ selectWidget((TQWidget*)o, false);
}
setPropertyShowingBlocked(false);
delete l;
@@ -558,7 +558,7 @@ void FormWindow::handleMousePress(QMouseEvent *e, QWidget *w)
if (e->button() == LeftButton)
{ // left button: store original geometry and more as the widget might start moving
widgetPressed = true;
- widgetGeom = QRect(w->pos(), w->size());
+ widgetGeom = TQRect(w->pos(), w->size());
oldPressPos = w->mapFromGlobal(e->globalPos());
origPressPos = oldPressPos;
checkedSelectionsForMove = false;
@@ -580,12 +580,12 @@ void FormWindow::handleMousePress(QMouseEvent *e, QWidget *w)
if (!((e->state() & ControlButton) || (e->state() & ShiftButton)))
{
clearSelection(false);
- QObject *opw = propertyWidget;
+ TQObject *opw = propertyWidget;
propertyWidget = mainContainer();
if (opw->isWidgetType())
- repaintSelection((QWidget*)opw);
+ repaintSelection((TQWidget*)opw);
}
- currRect = QRect(0, 0, -1, -1);
+ currRect = TQRect(0, 0, -1, -1);
startRectDraw(mapFromGlobal(e->globalPos()), e->globalPos(), this, Rubber);
}
}
@@ -607,7 +607,7 @@ void FormWindow::handleMousePress(QMouseEvent *e, QWidget *w)
{ // press on a child widget
orderedWidgets.removeRef(w);
orderedWidgets.append(w);
- for (QWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev())
+ for (TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev())
{
int i = stackedWidgets.findRef(wid);
if (i != -1)
@@ -616,7 +616,7 @@ void FormWindow::handleMousePress(QMouseEvent *e, QWidget *w)
stackedWidgets.insert(0, wid);
}
}
- QWidgetList oldl = MetaDataBase::tabOrder(this);
+ TQWidgetList oldl = MetaDataBase::tabOrder(this);
TabOrderCommand *cmd = new TabOrderCommand(i18n("Change Tab Order"), this,
oldl, stackedWidgets);
cmd->execute();
@@ -631,12 +631,12 @@ void FormWindow::handleMousePress(QMouseEvent *e, QWidget *w)
// default parent for new widget is the formwindow
if (!isMainContainer(w))
{ // press was not on formwindow, check if we can find another parent
- QWidget *wid = w;
+ TQWidget *wid = w;
for (;;)
{
int id = WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(wid));
if ((WidgetDatabase::isContainer(id) || wid == mainContainer()) &&
- !wid->inherits("QLayoutWidget") && !wid->inherits("QSplitter"))
+ !wid->inherits("QLayoutWidget") && !wid->inherits("TQSplitter"))
{
insertParent = WidgetFactory::containerOfWidget(wid); // found another parent, store it
break;
@@ -655,7 +655,7 @@ void FormWindow::handleMousePress(QMouseEvent *e, QWidget *w)
}
}
-void FormWindow::handleMouseDblClick(QMouseEvent *, QWidget *w)
+void FormWindow::handleMouseDblClick(TQMouseEvent *, TQWidget *w)
{
switch (currTool) {
case ORDER_TOOL:
@@ -663,7 +663,7 @@ void FormWindow::handleMouseDblClick(QMouseEvent *, QWidget *w)
{ // press on a child widget
orderedWidgets.clear();
orderedWidgets.append(w);
- for (QWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev())
+ for (TQWidget *wid = orderedWidgets.last(); wid; wid = orderedWidgets.prev())
{
int i = stackedWidgets.findRef(wid);
if (i != -1)
@@ -672,7 +672,7 @@ void FormWindow::handleMouseDblClick(QMouseEvent *, QWidget *w)
stackedWidgets.insert(0, wid);
}
}
- QWidgetList oldl = MetaDataBase::tabOrder(this);
+ TQWidgetList oldl = MetaDataBase::tabOrder(this);
TabOrderCommand *cmd = new TabOrderCommand(i18n("Change Tab Order"), this, oldl, stackedWidgets);
cmd->execute();
commandHistory()->addCommand(cmd, true);
@@ -683,12 +683,12 @@ void FormWindow::handleMouseDblClick(QMouseEvent *, QWidget *w)
}
}
-void FormWindow::handleMouseMove(QMouseEvent *e, QWidget *w)
+void FormWindow::handleMouseMove(TQMouseEvent *e, TQWidget *w)
{
if ((e->state() & LeftButton) != LeftButton)
return;
- QWidget *newReceiver = (QWidget*)connectReceiver, *oldReceiver = (QWidget*)connectReceiver, *wid;
+ TQWidget *newReceiver = (TQWidget*)connectReceiver, *oldReceiver = (TQWidget*)connectReceiver, *wid;
bool drawRecRect;
switch (currTool) {
case POINTER_TOOL:
@@ -699,9 +699,9 @@ void FormWindow::handleMouseMove(QMouseEvent *e, QWidget *w)
WidgetFactory::NoLayout || !insertedWidgets.find(w)))
w = w->parentWidget();
// calc correct position
- QPoint pos = w->mapFromGlobal(e->globalPos());
+ TQPoint pos = w->mapFromGlobal(e->globalPos());
// calc move distance and store it
- QPoint d = oldPressPos - pos;
+ TQPoint d = oldPressPos - pos;
if (QABS(d.x()) < grid().x())
d.setX(0);
if (QABS(d.y()) < grid().y())
@@ -718,7 +718,7 @@ void FormWindow::handleMouseMove(QMouseEvent *e, QWidget *w)
int y = widgetGeom.y() - d.y();
widgetGeom.setY(y);
y = (y / grid().y()) * grid().y();
- QPoint p = w->pos();
+ TQPoint p = w->pos();
if (x - p.x() || y - p.y())
{ // if we actually have to move
@@ -734,8 +734,8 @@ void FormWindow::handleMouseMove(QMouseEvent *e, QWidget *w)
}
// check whether we would have to reparent the selection and
// highlight the possible new parent container
- QMapConstIterator<ulong, QPoint> it = moving.begin();
- QWidget* wa = containerAt(e->globalPos(), ((QWidget*)it.key()));
+ TQMapConstIterator<ulong, TQPoint> it = moving.begin();
+ TQWidget* wa = containerAt(e->globalPos(), ((TQWidget*)it.key()));
if (wa && !isMainContainer(wa) && !isCentralWidget(wa))
{
wa = WidgetFactory::containerOfWidget(wa);
@@ -767,9 +767,9 @@ void FormWindow::handleMouseMove(QMouseEvent *e, QWidget *w)
// finally move the selected widgets and show/update preview label
moveSelectedWidgets(x - p.x(), y - p.y());
- sizePreviewLabel->setText(QString("%1/%2").arg(w->pos().x()).arg(w->pos().y()));
+ sizePreviewLabel->setText(TQString("%1/%2").arg(w->pos().x()).arg(w->pos().y()));
sizePreviewLabel->adjustSize();
- QRect lg(mapFromGlobal(e->globalPos()) + QPoint(16, 16), sizePreviewLabel->size());
+ TQRect lg(mapFromGlobal(e->globalPos()) + TQPoint(16, 16), sizePreviewLabel->size());
checkPreviewGeometry(lg);
sizePreviewLabel->setGeometry(lg);
sizePreviewLabel->raise();
@@ -777,7 +777,7 @@ void FormWindow::handleMouseMove(QMouseEvent *e, QWidget *w)
}
else
{ // if we don't need to move, do some indication
- QRect lg(mapFromGlobal(e->globalPos()) + QPoint(16, 16), sizePreviewLabel->size());
+ TQRect lg(mapFromGlobal(e->globalPos()) + TQPoint(16, 16), sizePreviewLabel->size());
checkPreviewGeometry(lg);
sizePreviewLabel->move(lg.x(), lg.y());
}
@@ -797,7 +797,7 @@ void FormWindow::handleMouseMove(QMouseEvent *e, QWidget *w)
newReceiver = wid;
if (newReceiver && (newReceiver->inherits("QLayoutWidget")
|| newReceiver->inherits("Spacer")))
- newReceiver = (QWidget*)connectReceiver;
+ newReceiver = (TQWidget*)connectReceiver;
drawRecRect = newReceiver != connectReceiver;
currentConnectPos = mapFromGlobal(e->globalPos());
if (newReceiver && (isMainContainer(newReceiver)
@@ -807,8 +807,8 @@ void FormWindow::handleMouseMove(QMouseEvent *e, QWidget *w)
arg(connectReceiver->name()));
qApp->processEvents();
if (drawRecRect)
- restoreRect(QRect(mapToForm(((QWidget*)oldReceiver)->parentWidget(),
- ((QWidget*)oldReceiver)->pos()), ((QWidget*)oldReceiver)->size()));
+ restoreRect(TQRect(mapToForm(((TQWidget*)oldReceiver)->parentWidget(),
+ ((TQWidget*)oldReceiver)->pos()), ((TQWidget*)oldReceiver)->size()));
drawConnectLine();
break;
case ORDER_TOOL:
@@ -820,7 +820,7 @@ void FormWindow::handleMouseMove(QMouseEvent *e, QWidget *w)
}
}
-void FormWindow::handleMouseRelease(QMouseEvent * e, QWidget * w)
+void FormWindow::handleMouseRelease(TQMouseEvent * e, TQWidget * w)
{
if (e->button() != LeftButton)
return;
@@ -847,18 +847,18 @@ void FormWindow::handleMouseRelease(QMouseEvent * e, QWidget * w)
if (propertyWidget && propertyWidget->isWidgetType() && !isMainContainer(propertyWidget))
emitUpdateProperties(propertyWidget);
- QMapConstIterator < ulong, QPoint > it = moving.begin();
- QWidget *oldParent = ((QWidget *) it.key())->parentWidget();
- QWidget *newParent = oldParent;
+ TQMapConstIterator < ulong, TQPoint > it = moving.begin();
+ TQWidget *oldParent = ((TQWidget *) it.key())->parentWidget();
+ TQWidget *newParent = oldParent;
// check whether we have to reparent the selection
- QWidget *wa = containerAt(e->globalPos(), ((QWidget *) it.key()));
+ TQWidget *wa = containerAt(e->globalPos(), ((TQWidget *) it.key()));
if (wa)
{
wa = WidgetFactory::containerOfWidget(wa);
// ok, looks like we moved onto a container
// check whether we really have different parents.
- if (wa == ((QWidget *) it.key())->parentWidget())
+ if (wa == ((TQWidget *) it.key())->parentWidget())
goto make_move_command;
// break layout if necessary
@@ -878,22 +878,22 @@ void FormWindow::handleMouseRelease(QMouseEvent * e, QWidget * w)
}
// doesn't need to be a command, the MoveCommand does reparenting too
bool emitSelChanged = false;
- for (QMap < ulong, QPoint >::Iterator it = moving.begin(); it != moving.end(); ++it)
+ for (TQMap < ulong, TQPoint >::Iterator it = moving.begin(); it != moving.end(); ++it)
{
- QWidget *i = (QWidget *) it.key();
- if (!emitSelChanged && i->inherits("QButton"))
+ TQWidget *i = (TQWidget *) it.key();
+ if (!emitSelChanged && i->inherits("TQButton"))
{
- if (i->parentWidget() && i->parentWidget()->inherits("QButtonGroup") ||
- wa->inherits("QButtonGroup"))
+ if (i->parentWidget() && i->parentWidget()->inherits("TQButtonGroup") ||
+ wa->inherits("TQButtonGroup"))
emitSelChanged = true;
- if (!wa->inherits("QButtonGroup"))
+ if (!wa->inherits("TQButtonGroup"))
{
MetaDataBase::setPropertyChanged(i, "buttonGroupId", false);
- if (i->parentWidget() && i->parentWidget()->inherits("QButtonGroup"))
- ((QButtonGroup *) i->parentWidget())->remove((QButton *) i);
+ if (i->parentWidget() && i->parentWidget()->inherits("TQButtonGroup"))
+ ((TQButtonGroup *) i->parentWidget())->remove((TQButton *) i);
}
}
- QPoint pos = wa->mapFromGlobal(i->mapToGlobal(QPoint(0, 0)));
+ TQPoint pos = wa->mapFromGlobal(i->mapToGlobal(TQPoint(0, 0)));
i->reparent(wa, pos, true);
raiseSelection(i);
raiseChildSelections(i);
@@ -910,13 +910,13 @@ void FormWindow::handleMouseRelease(QMouseEvent * e, QWidget * w)
}
make_move_command:
- QWidgetList widgets; // collect the widgets and its old and new positions which have been moved
- QValueList < QPoint > oldPos, newPos;
+ TQWidgetList widgets; // collect the widgets and its old and new positions which have been moved
+ TQValueList < TQPoint > oldPos, newPos;
for (it = moving.begin(); it != moving.end(); ++it)
{
- widgets.append((QWidget *) it.key());
+ widgets.append((TQWidget *) it.key());
oldPos.append(*it);
- newPos.append(((QWidget *) it.key())->pos());
+ newPos.append(((TQWidget *) it.key())->pos());
}
// add move command, don't execute it, this is just a summary of the operations we did during the move-event handling
commandHistory()->addCommand(new MoveCommand(i18n("Move"),
@@ -935,11 +935,11 @@ void FormWindow::handleMouseRelease(QMouseEvent * e, QWidget * w)
case CONNECT_TOOL:
restoreConnectionLine();
if (connectSender)
- restoreRect(QRect(mapToForm(((QWidget *) connectSender)->parentWidget(),
- ((QWidget *) connectSender)->pos()), ((QWidget *) connectSender)->size()));
+ restoreRect(TQRect(mapToForm(((TQWidget *) connectSender)->parentWidget(),
+ ((TQWidget *) connectSender)->pos()), ((TQWidget *) connectSender)->size()));
if (connectReceiver)
- restoreRect(QRect(mapToForm(((QWidget *) connectReceiver)->parentWidget(),
- ((QWidget *) connectReceiver)->pos()), ((QWidget *) connectReceiver)->size()));
+ restoreRect(TQRect(mapToForm(((TQWidget *) connectReceiver)->parentWidget(),
+ ((TQWidget *) connectReceiver)->pos()), ((TQWidget *) connectReceiver)->size()));
endUnclippedPainter();
qApp->processEvents();
if (connectSender && connectReceiver)
@@ -983,7 +983,7 @@ void FormWindow::handleMouseRelease(QMouseEvent * e, QWidget * w)
buffer = 0;
}
-void FormWindow::handleKeyPress(QKeyEvent * e, QWidget * w)
+void FormWindow::handleKeyPress(TQKeyEvent * e, TQWidget * w)
{
e->ignore();
checkSelectionsTimer->stop();
@@ -991,12 +991,12 @@ void FormWindow::handleKeyPress(QKeyEvent * e, QWidget * w)
(e->key() == Key_Left ||
e->key() == Key_Right ||
e->key() == Key_Up || e->key() == Key_Down) && propertyWidget->isWidgetType())
- checkSelectionsForMove((QWidget *) propertyWidget);
+ checkSelectionsForMove((TQWidget *) propertyWidget);
checkSelectionsTimer->start(1000, true);
if (e->key() == Key_Left || e->key() == Key_Right || e->key() == Key_Up || e->key() == Key_Down)
{
- QWidgetList widgets;
- QValueList < QPoint > oldPos, newPos;
+ TQWidgetList widgets;
+ TQValueList < TQPoint > oldPos, newPos;
for (WidgetSelection * s = selections.first(); s; s = selections.next())
{
if (s->isUsed())
@@ -1048,7 +1048,7 @@ void FormWindow::handleKeyPress(QKeyEvent * e, QWidget * w)
widgets.append(s->widget());
oldPos.append(s->widget()->pos());
- newPos.append(s->widget()->pos() + QPoint(dx, dy));
+ newPos.append(s->widget()->pos() + TQPoint(dx, dy));
}
}
if (!widgets.isEmpty())
@@ -1061,7 +1061,7 @@ void FormWindow::handleKeyPress(QKeyEvent * e, QWidget * w)
}
if (!e->isAccepted())
{
- QObjectList *l = queryList("QWidget");
+ TQObjectList *l = queryList("TQWidget");
if (!l)
return;
if (l->find(w) != -1)
@@ -1071,38 +1071,38 @@ void FormWindow::handleKeyPress(QKeyEvent * e, QWidget * w)
}
-void FormWindow::handleKeyRelease(QKeyEvent * e, QWidget *)
+void FormWindow::handleKeyRelease(TQKeyEvent * e, TQWidget *)
{
e->ignore();
}
-void FormWindow::selectWidget(QObject * o, bool select)
+void FormWindow::selectWidget(TQObject * o, bool select)
{
if (!o->isWidgetType())
{
- // ########### do QObject stuff
+ // ########### do TQObject stuff
return;
}
- QWidget *w = (QWidget *) o;
+ TQWidget *w = (TQWidget *) o;
if (isMainContainer(w))
{
- QObject *opw = propertyWidget;
+ TQObject *opw = propertyWidget;
propertyWidget = mainContainer();
if (opw->isWidgetType())
- repaintSelection((QWidget *) opw);
+ repaintSelection((TQWidget *) opw);
emitShowProperties(propertyWidget);
return;
}
- if (mainContainer()->inherits("QMainWindow") &&
- w == ((QMainWindow *) mainContainer())->centralWidget())
+ if (mainContainer()->inherits("TQMainWindow") &&
+ w == ((TQMainWindow *) mainContainer())->centralWidget())
{
- QObject *opw = propertyWidget;
+ TQObject *opw = propertyWidget;
propertyWidget = mainContainer();
if (opw->isWidgetType())
- repaintSelection((QWidget *) opw);
+ repaintSelection((TQWidget *) opw);
emitShowProperties(propertyWidget);
return;
}
@@ -1112,10 +1112,10 @@ void FormWindow::selectWidget(QObject * o, bool select)
if (select)
{
- QObject *opw = propertyWidget;
+ TQObject *opw = propertyWidget;
propertyWidget = w;
if (opw->isWidgetType())
- repaintSelection((QWidget *) opw);
+ repaintSelection((TQWidget *) opw);
if (!isPropertyShowingBlocked())
emitShowProperties(propertyWidget);
WidgetSelection *s = usedSelections.find(w);
@@ -1146,27 +1146,27 @@ void FormWindow::selectWidget(QObject * o, bool select)
WidgetSelection *s = usedSelections.find(w);
if (s)
s->setWidget(0);
- QObject *opw = propertyWidget;
+ TQObject *opw = propertyWidget;
if (!usedSelections.isEmpty())
- propertyWidget = QPtrDictIterator < WidgetSelection > (usedSelections).current()->widget();
+ propertyWidget = TQPtrDictIterator < WidgetSelection > (usedSelections).current()->widget();
else
propertyWidget = mainContainer();
if (opw->isWidgetType())
- repaintSelection((QWidget *) opw);
+ repaintSelection((TQWidget *) opw);
if (!isPropertyShowingBlocked())
emitShowProperties(propertyWidget);
emitSelectionChanged();
}
}
-QPoint FormWindow::grid() const
+TQPoint FormWindow::grid() const
{
if (!mainWindow()->snapGrid())
- return QPoint(1, 1);
+ return TQPoint(1, 1);
return mainWindow()->grid();
}
-void FormWindow::updateSelection(QWidget * w)
+void FormWindow::updateSelection(TQWidget * w)
{
WidgetSelection *s = usedSelections.find(w);
if (!w->isVisibleTo(this))
@@ -1175,14 +1175,14 @@ void FormWindow::updateSelection(QWidget * w)
s->updateGeometry();
}
-void FormWindow::raiseSelection(QWidget * w)
+void FormWindow::raiseSelection(TQWidget * w)
{
WidgetSelection *s = usedSelections.find(w);
if (s)
s->show();
}
-void FormWindow::repaintSelection(QWidget * w)
+void FormWindow::repaintSelection(TQWidget * w)
{
WidgetSelection *s = usedSelections.find(w);
if (s)
@@ -1191,54 +1191,54 @@ void FormWindow::repaintSelection(QWidget * w)
void FormWindow::clearSelection(bool changePropertyDisplay)
{
- QPtrDictIterator < WidgetSelection > it(usedSelections);
+ TQPtrDictIterator < WidgetSelection > it(usedSelections);
for (; it.current(); ++it)
it.current()->setWidget(0, false);
usedSelections.clear();
if (changePropertyDisplay)
{
- QObject *opw = propertyWidget;
+ TQObject *opw = propertyWidget;
propertyWidget = mainContainer();
if (opw->isWidgetType())
- repaintSelection((QWidget *) opw);
+ repaintSelection((TQWidget *) opw);
emitShowProperties(propertyWidget);
}
emitSelectionChanged();
}
-void FormWindow::startRectDraw(const QPoint & p, const QPoint & global, QWidget *, RectType t)
+void FormWindow::startRectDraw(const TQPoint & p, const TQPoint & global, TQWidget *, RectType t)
{
- QPoint pos(p);
+ TQPoint pos(p);
pos = mapFromGlobal(global);
oldRectValid = false;
beginUnclippedPainter(true);
if (t == Rubber)
- unclippedPainter->setPen(QPen(color0, 1));
+ unclippedPainter->setPen(TQPen(color0, 1));
if (t == Insert)
rectAnchor = gridPoint(pos);
else if (t == Rubber)
rectAnchor = pos;
- currRect = QRect(rectAnchor, QPoint(0, 0));
+ currRect = TQRect(rectAnchor, TQPoint(0, 0));
if (t == Insert)
drawSizePreview(pos, i18n("Use Size Hint"));
}
-void FormWindow::continueRectDraw(const QPoint & p, const QPoint & global, QWidget *, RectType t)
+void FormWindow::continueRectDraw(const TQPoint & p, const TQPoint & global, TQWidget *, RectType t)
{
- QPoint pos = p;
+ TQPoint pos = p;
pos = mapFromGlobal(global);
- QPoint p2;
+ TQPoint p2;
if (t == Insert)
p2 = gridPoint(pos);
else if (t == Rubber)
p2 = pos;
- QRect r(rectAnchor, p2);
+ TQRect r(rectAnchor, p2);
r = r.normalize();
if (currRect == r)
{
- QString t("%1/%2");
+ TQString t("%1/%2");
t = t.arg(r.width() - 1).arg(r.height() - 1);
drawSizePreview(pos, t);
return;
@@ -1252,11 +1252,11 @@ void FormWindow::continueRectDraw(const QPoint & p, const QPoint & global, QWidg
currRect = r;
if (t == Insert)
{
- QString t("%1/%2");
+ TQString t("%1/%2");
t = t.arg(r.width() - 1).arg(r.height() - 1);
drawSizePreview(pos, t);
}
- unclippedPainter->setClipRegion(QRegion(rect()).subtract(QRect(sizePreviewPos,
+ unclippedPainter->setClipRegion(TQRegion(rect()).subtract(TQRect(sizePreviewPos,
sizePreviewPixmap.size())));
unclippedPainter->drawRect(currRect);
unclippedPainter->setClipping(false);
@@ -1275,24 +1275,24 @@ void FormWindow::endRectDraw()
if (oldRectValid)
unclippedPainter->drawRect(currRect);
- drawSizePreview(QPoint(-1, -1), QString::null);
+ drawSizePreview(TQPoint(-1, -1), TQString::null);
endUnclippedPainter();
}
void FormWindow::selectWidgets()
{
- QObjectList *l = mainContainer()->queryList("QWidget");
+ TQObjectList *l = mainContainer()->queryList("TQWidget");
if (l)
{
- for (QObject * o = l->first(); o; o = l->next())
+ for (TQObject * o = l->first(); o; o = l->next())
{
- if (((QWidget *) o)->isVisibleTo(this) && insertedWidgets[(void *) o])
+ if (((TQWidget *) o)->isVisibleTo(this) && insertedWidgets[(void *) o])
{
- QPoint p = ((QWidget *) o)->mapToGlobal(QPoint(0, 0));
+ TQPoint p = ((TQWidget *) o)->mapToGlobal(TQPoint(0, 0));
p = mapFromGlobal(p);
- QRect r(p, ((QWidget *) o)->size());
+ TQRect r(p, ((TQWidget *) o)->size());
if (r.intersects(currRect) && !r.contains(currRect))
- selectWidget((QWidget *) o);
+ selectWidget((TQWidget *) o);
}
}
delete l;
@@ -1300,20 +1300,20 @@ void FormWindow::selectWidgets()
emitSelectionChanged();
}
-bool FormWindow::isWidgetSelected(QObject * w)
+bool FormWindow::isWidgetSelected(TQObject * w)
{
if (w->isWidgetType())
- return usedSelections.find((QWidget *) w) != 0;
+ return usedSelections.find((TQWidget *) w) != 0;
return false; // #### do stuff for QObjects
}
void FormWindow::moveSelectedWidgets(int dx, int dy)
{
- QPtrDictIterator < WidgetSelection > it(usedSelections);
+ TQPtrDictIterator < WidgetSelection > it(usedSelections);
for (; it.current(); ++it)
{
WidgetSelection *s = it.current();
- QWidget *w = s->widget();
+ TQWidget *w = s->widget();
if (w->parentWidget()
&& WidgetFactory::layoutType(w->parentWidget()) != WidgetFactory::NoLayout)
continue;
@@ -1338,16 +1338,16 @@ void FormWindow::redo()
commandHistory()->redo();
}
-void FormWindow::raiseChildSelections(QWidget * w)
+void FormWindow::raiseChildSelections(TQWidget * w)
{
- QObjectList *l = w->queryList("QWidget");
+ TQObjectList *l = w->queryList("TQWidget");
if (!l || !l->first())
{
delete l;
return;
}
- QPtrDictIterator < WidgetSelection > it(usedSelections);
+ TQPtrDictIterator < WidgetSelection > it(usedSelections);
for (; it.current(); ++it)
{
if (l->findRef(it.current()->widget()) != -1)
@@ -1356,29 +1356,29 @@ void FormWindow::raiseChildSelections(QWidget * w)
delete l;
}
-void FormWindow::updateChildSelections(QWidget * w)
+void FormWindow::updateChildSelections(TQWidget * w)
{
- QObjectList *l = w->queryList("QWidget");
+ TQObjectList *l = w->queryList("TQWidget");
if (l)
{
- for (QObject * o = l->first(); o; o = l->next())
+ for (TQObject * o = l->first(); o; o = l->next())
{
- if (o->isWidgetType() && insertedWidgets.find((QWidget *) o))
- updateSelection((QWidget *) o);
+ if (o->isWidgetType() && insertedWidgets.find((TQWidget *) o))
+ updateSelection((TQWidget *) o);
}
delete l;
}
}
-void FormWindow::checkSelectionsForMove(QWidget * w)
+void FormWindow::checkSelectionsForMove(TQWidget * w)
{
checkedSelectionsForMove = true;
- QObjectList *l = w->parentWidget()->queryList("QWidget", 0, false, false);
+ TQObjectList *l = w->parentWidget()->queryList("TQWidget", 0, false, false);
moving.clear();
if (l)
{
- QPtrDictIterator < WidgetSelection > it(usedSelections);
+ TQPtrDictIterator < WidgetSelection > it(usedSelections);
WidgetSelection *sel;
while ((sel = it.current()) != 0)
{
@@ -1406,11 +1406,11 @@ void FormWindow::checkSelectionsForMove(QWidget * w)
void FormWindow::deleteWidgets()
{
- QWidgetList widgets;
- QPtrDictIterator < WidgetSelection > it(usedSelections);
+ TQWidgetList widgets;
+ TQPtrDictIterator < WidgetSelection > it(usedSelections);
for (; it.current(); ++it)
{
- QWidget *tb = 0;
+ TQWidget *tb = 0;
if (!(tb = mainWindow()->isAToolBarChild(it.current()->widget())))
widgets.append(it.current()->widget());
else
@@ -1427,17 +1427,17 @@ void FormWindow::deleteWidgets()
void FormWindow::editAdjustSize()
{
- QPtrList < Command > commands;
- QWidgetList widgets = selectedWidgets();
+ TQPtrList < Command > commands;
+ TQWidgetList widgets = selectedWidgets();
if (widgets.isEmpty())
{
- QRect oldr = geometry();
+ TQRect oldr = geometry();
mainContainer()->adjustSize();
resize(mainContainer()->size());
// check whether our own size constraint hit us
if (size() != mainContainer()->size())
mainContainer()->resize(size());
- QRect nr = geometry();
+ TQRect nr = geometry();
if (oldr != nr)
{
ResizeCommand *cmd = new ResizeCommand(i18n("Adjust Size"), this, this, oldr, nr);
@@ -1445,14 +1445,14 @@ void FormWindow::editAdjustSize()
}
return;
}
- for (QWidget * w = widgets.first(); w; w = widgets.next())
+ for (TQWidget * w = widgets.first(); w; w = widgets.next())
{
if (w->parentWidget()
&& WidgetFactory::layoutType(w->parentWidget()) != WidgetFactory::NoLayout)
continue;
- QRect oldr = w->geometry();
+ TQRect oldr = w->geometry();
w->adjustSize();
- QRect nr = w->geometry();
+ TQRect nr = w->geometry();
if (oldr != nr)
commands.append(new ResizeCommand(i18n("Adjust Size"), this, w, oldr, nr));
}
@@ -1467,28 +1467,28 @@ void FormWindow::editAdjustSize()
}
-QWidgetList FormWindow::selectedWidgets() const
+TQWidgetList FormWindow::selectedWidgets() const
{
- QWidgetList widgets;
- for (QPtrDictIterator<WidgetSelection> it(usedSelections); it.current(); ++it)
+ TQWidgetList widgets;
+ for (TQPtrDictIterator<WidgetSelection> it(usedSelections); it.current(); ++it)
widgets.append(it.current()->widget());
return widgets;
}
-void FormWindow::widgetChanged(QObject *w)
+void FormWindow::widgetChanged(TQObject *w)
{
if (w->isWidgetType())
- updateSelection((QWidget*)w);
+ updateSelection((TQWidget*)w);
}
-QLabel *FormWindow::sizePreview() const
+TQLabel *FormWindow::sizePreview() const
{
if (!sizePreviewLabel)
{
- ((FormWindow*)this)->sizePreviewLabel = new QLabel((FormWindow*)this);
+ ((FormWindow*)this)->sizePreviewLabel = new TQLabel((FormWindow*)this);
((FormWindow*)this)->sizePreviewLabel->hide();
- ((FormWindow*)this)->sizePreviewLabel->setBackgroundColor(QColor(255, 255, 128));
- ((FormWindow*)this)->sizePreviewLabel->setFrameStyle(QFrame::Plain | QFrame::Box);
+ ((FormWindow*)this)->sizePreviewLabel->setBackgroundColor(TQColor(255, 255, 128));
+ ((FormWindow*)this)->sizePreviewLabel->setFrameStyle(TQFrame::Plain | TQFrame::Box);
}
return sizePreviewLabel;
}
@@ -1498,79 +1498,79 @@ void FormWindow::invalidCheckedSelections()
checkedSelectionsForMove = false;
}
-void FormWindow::checkPreviewGeometry(QRect & r)
+void FormWindow::checkPreviewGeometry(TQRect & r)
{
if (rect().contains(r))
return;
if (r.left() < rect().left())
- r.moveTopLeft(QPoint(0, r.top()));
+ r.moveTopLeft(TQPoint(0, r.top()));
if (r.right() > rect().right())
- r.moveBottomRight(QPoint(rect().right(), r.bottom()));
+ r.moveBottomRight(TQPoint(rect().right(), r.bottom()));
if (r.top() < rect().top())
- r.moveTopLeft(QPoint(r.left(), rect().top()));
+ r.moveTopLeft(TQPoint(r.left(), rect().top()));
if (r.bottom() > rect().bottom())
- r.moveBottomRight(QPoint(r.right(), rect().bottom()));
+ r.moveBottomRight(TQPoint(r.right(), rect().bottom()));
}
-void FormWindow::focusInEvent(QFocusEvent *)
+void FormWindow::focusInEvent(TQFocusEvent *)
{
if (mContainer)
{
- QVariant prop = mContainer->property("useInternalParser");
+ TQVariant prop = mContainer->property("useInternalParser");
KommanderWidget::useInternalParser = prop.toBool();
}
}
-void FormWindow::focusOutEvent(QFocusEvent *)
+void FormWindow::focusOutEvent(TQFocusEvent *)
{
if (propertyWidget && !isMainContainer(propertyWidget) && !isWidgetSelected(propertyWidget))
{
- QObject *opw = propertyWidget;
+ TQObject *opw = propertyWidget;
propertyWidget = mainContainer();
if (opw->isWidgetType())
- repaintSelection((QWidget *) opw);
+ repaintSelection((TQWidget *) opw);
}
}
-void FormWindow::resizeEvent(QResizeEvent * e)
+void FormWindow::resizeEvent(TQResizeEvent * e)
{
- QWidget::resizeEvent(e);
+ TQWidget::resizeEvent(e);
if (currTool == ORDER_TOOL)
repositionOrderIndicators();
if (isVisible())
formFile()->setModified(true);
}
-QPtrDict < QWidget > *FormWindow::widgets()
+TQPtrDict < TQWidget > *FormWindow::widgets()
{
return &insertedWidgets;
}
-QWidget *FormWindow::designerWidget(QObject * o) const
+TQWidget *FormWindow::designerWidget(TQObject * o) const
{
if (!o || !o->isWidgetType())
return 0;
- QWidget *w = (QWidget *) o;
+ TQWidget *w = (TQWidget *) o;
while (w && !isMainContainer(w) && !insertedWidgets[(void *) w] || isCentralWidget(w))
- w = (QWidget *) w->parent();
+ w = (TQWidget *) w->parent();
return w;
}
-void FormWindow::emitShowProperties(QObject * w)
+void FormWindow::emitShowProperties(TQObject * w)
{
if (w)
{
- QObject *opw = propertyWidget;
+ TQObject *opw = propertyWidget;
propertyWidget = w;
if (opw->isWidgetType())
- repaintSelection((QWidget *) opw);
+ repaintSelection((TQWidget *) opw);
}
showPropertiesTimer->stop();
showPropertiesTimer->start(0, true);
}
-void FormWindow::emitUpdateProperties(QObject * w)
+void FormWindow::emitUpdateProperties(TQObject * w)
{
if (w == propertyWidget)
{
@@ -1618,11 +1618,11 @@ void FormWindow::currentToolChanged()
case CONNECT_TOOL:
restoreConnectionLine();
if (connectSender)
- restoreRect(QRect(mapToForm(((QWidget *) connectSender)->parentWidget(),
- ((QWidget *) connectSender)->pos()), ((QWidget *) connectSender)->size()));
+ restoreRect(TQRect(mapToForm(((TQWidget *) connectSender)->parentWidget(),
+ ((TQWidget *) connectSender)->pos()), ((TQWidget *) connectSender)->size()));
if (connectReceiver)
- restoreRect(QRect(mapToForm(((QWidget *) connectReceiver)->parentWidget(),
- ((QWidget *) connectReceiver)->pos()), ((QWidget *) connectReceiver)->size()));
+ restoreRect(TQRect(mapToForm(((TQWidget *) connectReceiver)->parentWidget(),
+ ((TQWidget *) connectReceiver)->pos()), ((TQWidget *) connectReceiver)->size()));
endUnclippedPainter();
break;
case POINTER_TOOL:
@@ -1686,14 +1686,14 @@ void FormWindow::showOrderIndicators()
{
hideOrderIndicators();
orderIndicators.setAutoDelete(true);
- QObjectList *l = mainContainer()->queryList("QWidget");
+ TQObjectList *l = mainContainer()->queryList("TQWidget");
stackedWidgets = MetaDataBase::tabOrder(this);
if (l)
{
int order = 1;
- for (QObject * o = l->first(); o; o = l->next())
+ for (TQObject * o = l->first(); o; o = l->next())
{
- QWidget *w = (QWidget *) o;
+ TQWidget *w = (TQWidget *) o;
if (w->isVisibleTo(w->parentWidget()) &&
insertedWidgets[(void *) w] && w->focusPolicy() != NoFocus)
{
@@ -1716,7 +1716,7 @@ void FormWindow::hideOrderIndicators()
void FormWindow::updateOrderIndicators()
{
int order = 1;
- for (QWidget * w = stackedWidgets.first(); w; w = stackedWidgets.next())
+ for (TQWidget * w = stackedWidgets.first(); w; w = stackedWidgets.next())
{
for (OrderIndicator * i = orderIndicators.first(); i; i = orderIndicators.next())
i->setOrder(order, w);
@@ -1737,13 +1737,13 @@ void FormWindow::updateUndoInfo()
bool FormWindow::checkCustomWidgets()
{
- QStringList missingCustomWidgets;
- QPtrDictIterator < QWidget > it(insertedWidgets);
+ TQStringList missingCustomWidgets;
+ TQPtrDictIterator < TQWidget > it(insertedWidgets);
for (; it.current(); ++it)
{
if (it.current()->isA("CustomWidget"))
{
- QString className = WidgetFactory::classNameOf(it.current());
+ TQString className = WidgetFactory::classNameOf(it.current());
if (!MetaDataBase::hasCustomWidget(className))
missingCustomWidgets << className;
}
@@ -1767,7 +1767,7 @@ int FormWindow::numSelectedWidgets() const
return usedSelections.count();
}
-QString FormWindow::copy()
+TQString FormWindow::copy()
{
Resource resource(mainWindow());
resource.setWidget(this);
@@ -1776,8 +1776,8 @@ QString FormWindow::copy()
void FormWindow::lowerWidgets()
{
- QWidgetList widgets;
- QPtrDictIterator < WidgetSelection > it(usedSelections);
+ TQWidgetList widgets;
+ TQPtrDictIterator < WidgetSelection > it(usedSelections);
for (; it.current(); ++it)
widgets.append(it.current()->widget());
@@ -1786,44 +1786,44 @@ void FormWindow::lowerWidgets()
commandHistory()->addCommand(cmd);
}
-static void find_accel(const QString & txt, QMap < QChar, QWidgetList > &accels, QWidget * w)
+static void find_accel(const TQString & txt, TQMap < TQChar, TQWidgetList > &accels, TQWidget * w)
{
int i = txt.find("&");
if (i == -1)
return;
- QChar c = txt[i + 1];
+ TQChar c = txt[i + 1];
if (c.isNull() || c == '&')
return;
c = c.lower();
- QMap < QChar, QWidgetList >::Iterator it = accels.find(c);
+ TQMap < TQChar, TQWidgetList >::Iterator it = accels.find(c);
if (it == accels.end())
{
- QWidgetList wl;
+ TQWidgetList wl;
wl.append(w);
accels.insert(c, wl);
} else
{
- QWidgetList *wl = &*it;
+ TQWidgetList *wl = &*it;
wl->append(w);
}
}
void FormWindow::checkAccels()
{
- QMap < QChar, QWidgetList > accels;
- QObjectList *l = mainContainer()->queryList("QWidget");
+ TQMap < TQChar, TQWidgetList > accels;
+ TQObjectList *l = mainContainer()->queryList("TQWidget");
if (l)
{
- for (QObject * o = l->first(); o; o = l->next())
+ for (TQObject * o = l->first(); o; o = l->next())
{
- if (((QWidget *) o)->isVisibleTo(this) && insertedWidgets[(void *) o])
+ if (((TQWidget *) o)->isVisibleTo(this) && insertedWidgets[(void *) o])
{
- QWidget *w = (QWidget *) o;
- const QMetaProperty *text =
+ TQWidget *w = (TQWidget *) o;
+ const TQMetaProperty *text =
w->metaObject()->property(w->metaObject()->findProperty("text", true), true);
- const QMetaProperty *title =
+ const TQMetaProperty *title =
w->metaObject()->property(w->metaObject()->findProperty("title", true), true);
- const QMetaProperty *pageTitle =
+ const TQMetaProperty *pageTitle =
w->metaObject()->property(w->metaObject()->findProperty("pageTitle", true), true);
if (text)
find_accel(w->property("text").toString(), accels, w);
@@ -1837,8 +1837,8 @@ void FormWindow::checkAccels()
}
bool ok = true;
- QWidget *wid;
- for (QMap < QChar, QWidgetList >::Iterator it = accels.begin(); it != accels.end(); ++it)
+ TQWidget *wid;
+ for (TQMap < TQChar, TQWidgetList >::Iterator it = accels.begin(); it != accels.end(); ++it)
{
if ((*it).count() > 1)
{
@@ -1862,8 +1862,8 @@ void FormWindow::checkAccels()
void FormWindow::raiseWidgets()
{
- QWidgetList widgets;
- QPtrDictIterator < WidgetSelection > it(usedSelections);
+ TQWidgetList widgets;
+ TQPtrDictIterator < WidgetSelection > it(usedSelections);
for (; it.current(); ++it)
widgets.append(it.current()->widget());
@@ -1872,7 +1872,7 @@ void FormWindow::raiseWidgets()
commandHistory()->addCommand(cmd);
}
-void FormWindow::paste(const QString & cb, QWidget * parent)
+void FormWindow::paste(const TQString & cb, TQWidget * parent)
{
Resource resource(mainWindow());
resource.setWidget(this);
@@ -1883,14 +1883,14 @@ void FormWindow::selectAll()
{
checkedSelectionsForMove = false;
blockSignals(true);
- QObjectList *l = mainContainer()->queryList("QWidget");
+ TQObjectList *l = mainContainer()->queryList("TQWidget");
if (l)
{
- for (QObject * o = l->first(); o; o = l->next())
+ for (TQObject * o = l->first(); o; o = l->next())
{
- if (((QWidget *) o)->isVisibleTo(this) && insertedWidgets[(void *) o])
+ if (((TQWidget *) o)->isVisibleTo(this) && insertedWidgets[(void *) o])
{
- selectWidget((QWidget *) o);
+ selectWidget((TQWidget *) o);
}
}
delete l;
@@ -1905,7 +1905,7 @@ void FormWindow::selectAll()
void FormWindow::layoutHorizontal()
{
- QWidgetList widgets(selectedWidgets());
+ TQWidgetList widgets(selectedWidgets());
LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand(i18n("Lay Out Horizontally"),
this, mainContainer(), 0, widgets);
clearSelection(false);
@@ -1915,7 +1915,7 @@ void FormWindow::layoutHorizontal()
void FormWindow::layoutVertical()
{
- QWidgetList widgets(selectedWidgets());
+ TQWidgetList widgets(selectedWidgets());
LayoutVerticalCommand *cmd = new LayoutVerticalCommand(i18n("Lay Out Vertically"),
this, mainContainer(), 0, widgets);
clearSelection(false);
@@ -1925,7 +1925,7 @@ void FormWindow::layoutVertical()
void FormWindow::layoutHorizontalSplit()
{
- QWidgetList widgets(selectedWidgets());
+ TQWidgetList widgets(selectedWidgets());
LayoutHorizontalSplitCommand *cmd =
new LayoutHorizontalSplitCommand(i18n("Lay Out Horizontally (in splitter)"),
this, mainContainer(), 0, widgets);
@@ -1936,7 +1936,7 @@ void FormWindow::layoutHorizontalSplit()
void FormWindow::layoutVerticalSplit()
{
- QWidgetList widgets(selectedWidgets());
+ TQWidgetList widgets(selectedWidgets());
LayoutVerticalSplitCommand *cmd =
new LayoutVerticalSplitCommand(i18n("Lay Out Vertically (in splitter)"),
this, mainContainer(), 0, widgets);
@@ -1950,7 +1950,7 @@ void FormWindow::layoutGrid()
int xres = grid().x();
int yres = grid().y();
- QWidgetList widgets(selectedWidgets());
+ TQWidgetList widgets(selectedWidgets());
LayoutGridCommand *cmd = new LayoutGridCommand(i18n("Lay Out in a Grid"),
this, mainContainer(), 0, widgets, xres, yres);
clearSelection(false);
@@ -1958,19 +1958,19 @@ void FormWindow::layoutGrid()
cmd->execute();
}
-void FormWindow::layoutHorizontalContainer(QWidget * w)
+void FormWindow::layoutHorizontalContainer(TQWidget * w)
{
if (w == this)
w = mainContainer();
- QObjectList *l = (QObjectList *) WidgetFactory::containerOfWidget(w)->children();
+ TQObjectList *l = (TQObjectList *) WidgetFactory::containerOfWidget(w)->children();
if (!l)
return;
- QWidgetList widgets;
- for (QObject * o = l->first(); o; o = l->next())
+ TQWidgetList widgets;
+ for (TQObject * o = l->first(); o; o = l->next())
{
if (o->isWidgetType() &&
- ((QWidget *) o)->isVisibleTo(this) && insertedWidgets.find((QWidget *) o))
- widgets.append((QWidget *) o);
+ ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.find((TQWidget *) o))
+ widgets.append((TQWidget *) o);
}
LayoutHorizontalCommand *cmd = new LayoutHorizontalCommand(i18n("Lay Out Children Horizontally"),
this, mainContainer(), w, widgets);
@@ -1979,19 +1979,19 @@ void FormWindow::layoutHorizontalContainer(QWidget * w)
cmd->execute();
}
-void FormWindow::layoutVerticalContainer(QWidget * w)
+void FormWindow::layoutVerticalContainer(TQWidget * w)
{
if (w == this)
w = mainContainer();
- QObjectList *l = (QObjectList *) WidgetFactory::containerOfWidget(w)->children();
+ TQObjectList *l = (TQObjectList *) WidgetFactory::containerOfWidget(w)->children();
if (!l)
return;
- QWidgetList widgets;
- for (QObject * o = l->first(); o; o = l->next())
+ TQWidgetList widgets;
+ for (TQObject * o = l->first(); o; o = l->next())
{
if (o->isWidgetType() &&
- ((QWidget *) o)->isVisibleTo(this) && insertedWidgets.find((QWidget *) o))
- widgets.append((QWidget *) o);
+ ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.find((TQWidget *) o))
+ widgets.append((TQWidget *) o);
}
LayoutVerticalCommand *cmd = new LayoutVerticalCommand(i18n("Lay Out Children Vertically"),
this, mainContainer(), w, widgets);
@@ -2000,22 +2000,22 @@ void FormWindow::layoutVerticalContainer(QWidget * w)
cmd->execute();
}
-void FormWindow::layoutGridContainer(QWidget * w)
+void FormWindow::layoutGridContainer(TQWidget * w)
{
if (w == this)
w = mainContainer();
int xres = grid().x();
int yres = grid().y();
- QObjectList *l = (QObjectList *) WidgetFactory::containerOfWidget(w)->children();
+ TQObjectList *l = (TQObjectList *) WidgetFactory::containerOfWidget(w)->children();
if (!l)
return;
- QWidgetList widgets;
- for (QObject * o = l->first(); o; o = l->next())
+ TQWidgetList widgets;
+ for (TQObject * o = l->first(); o; o = l->next())
{
if (o->isWidgetType() &&
- ((QWidget *) o)->isVisibleTo(this) && insertedWidgets.find((QWidget *) o))
- widgets.append((QWidget *) o);
+ ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.find((TQWidget *) o))
+ widgets.append((TQWidget *) o);
}
LayoutGridCommand *cmd = new LayoutGridCommand(i18n("Lay Out Children in a Grid"),
this, mainContainer(), w, widgets, xres, yres);
@@ -2024,12 +2024,12 @@ void FormWindow::layoutGridContainer(QWidget * w)
cmd->execute();
}
-void FormWindow::breakLayout(QWidget * w)
+void FormWindow::breakLayout(TQWidget * w)
{
if (w == this)
w = mainContainer();
w = WidgetFactory::containerOfWidget(w);
- QPtrList < Command > commands;
+ TQPtrList < Command > commands;
for (;;)
{
@@ -2041,7 +2041,7 @@ void FormWindow::breakLayout(QWidget * w)
Command *cmd = breakLayoutCommand(w);
if (cmd)
commands.insert(0, cmd);
- if (!w->inherits("QLayoutWidget") && !w->inherits("QSplitter"))
+ if (!w->inherits("QLayoutWidget") && !w->inherits("TQSplitter"))
break;
}
w = w->parentWidget();
@@ -2056,19 +2056,19 @@ void FormWindow::breakLayout(QWidget * w)
cmd->execute();
}
-BreakLayoutCommand *FormWindow::breakLayoutCommand(QWidget * w)
+BreakLayoutCommand *FormWindow::breakLayoutCommand(TQWidget * w)
{
- QObjectList *l = (QObjectList *) w->children();
+ TQObjectList *l = (TQObjectList *) w->children();
if (!l)
return 0;
- QWidgetList widgets;
- for (QObject * o = l->first(); o; o = l->next())
+ TQWidgetList widgets;
+ for (TQObject * o = l->first(); o; o = l->next())
{
if (o->isWidgetType() &&
- !mainWindow()->isAToolBarChild((QWidget *) o) &&
- ((QWidget *) o)->isVisibleTo(this) && insertedWidgets.find((QWidget *) o))
- widgets.append((QWidget *) o);
+ !mainWindow()->isAToolBarChild((TQWidget *) o) &&
+ ((TQWidget *) o)->isVisibleTo(this) && insertedWidgets.find((TQWidget *) o))
+ widgets.append((TQWidget *) o);
}
return new BreakLayoutCommand(i18n("Break Layout"), this,
WidgetFactory::widgetOfContainer(w), widgets);
@@ -2076,7 +2076,7 @@ BreakLayoutCommand *FormWindow::breakLayoutCommand(QWidget * w)
int FormWindow::numVisibleWidgets() const
{
- QPtrDictIterator < QWidget > it(insertedWidgets);
+ TQPtrDictIterator < TQWidget > it(insertedWidgets);
int visible = 0;
for (; it.current(); ++it)
{
@@ -2086,23 +2086,23 @@ int FormWindow::numVisibleWidgets() const
return visible;
}
-bool FormWindow::hasInsertedChildren(QWidget *w) const
+bool FormWindow::hasInsertedChildren(TQWidget *w) const
{
if (!w)
return false;
w = WidgetFactory::containerOfWidget(w);
if (!w)
return false;
- QObjectList *l = w->queryList("QWidget");
+ TQObjectList *l = w->queryList("TQWidget");
if (!l || !l->first())
{
delete l;
return false;
}
- for (QObject *o = l->first(); o; o = l->next())
- if (o->isWidgetType() && ((QWidget*)o)->isVisibleTo((FormWindow*)this) &&
- insertedWidgets.find((QWidget*)o))
+ for (TQObject *o = l->first(); o; o = l->next())
+ if (o->isWidgetType() && ((TQWidget*)o)->isVisibleTo((FormWindow*)this) &&
+ insertedWidgets.find((TQWidget*)o))
{
delete l;
return true;
@@ -2111,7 +2111,7 @@ bool FormWindow::hasInsertedChildren(QWidget *w) const
return false;
}
-bool FormWindow::allowMove(QWidget *w)
+bool FormWindow::allowMove(TQWidget *w)
{
w = w->parentWidget();
while (w)
@@ -2143,8 +2143,8 @@ void FormWindow::editConnections()
void FormWindow::saveBackground()
{
delete buffer;
- buffer = new QPixmap(width(), height());
- *buffer = QPixmap::grabWindow(winId());
+ buffer = new TQPixmap(width(), height());
+ *buffer = TQPixmap::grabWindow(winId());
}
void FormWindow::restoreConnectionLine()
@@ -2154,7 +2154,7 @@ void FormWindow::restoreConnectionLine()
int a =QABS(connectStartPos.x() - currentConnectPos.x());
int b = QABS(connectStartPos.y() - currentConnectPos.y());
- QRect r(connectStartPos, currentConnectPos);
+ TQRect r(connectStartPos, currentConnectPos);
if (a < 32 || b < 32)
{ // special case: vertical or horizontal line
@@ -2181,7 +2181,7 @@ void FormWindow::restoreConnectionLine()
}
int dx = 2 * w / 3;
int dy = 2 * h / 3;
- QPoint p(connectStartPos);
+ TQPoint p(connectStartPos);
if (r.x() > r.right())
{
@@ -2199,7 +2199,7 @@ void FormWindow::restoreConnectionLine()
r = r.normalize();
while (r.contains(p))
{
- unclippedPainter->drawPixmap(p, *buffer, QRect(p, QSize(w, h)));
+ unclippedPainter->drawPixmap(p, *buffer, TQRect(p, TQSize(w, h)));
unclippedPainter->setPen(red);
p.setX(p.x() + dx);
p.setY(p.y() + dy);
@@ -2209,13 +2209,13 @@ void FormWindow::restoreConnectionLine()
connectStartPos.x() - 10, connectStartPos.y() - 10, 20, 20);
}
-void FormWindow::restoreRect(const QRect &rect)
+void FormWindow::restoreRect(const TQRect &rect)
{
if (!unclippedPainter)
return;
- QRect r(rect);
+ TQRect r(rect);
r = r.normalize();
- r = QRect(r.x() + 2, r.y() + 2, r.width() - 4, r.height() - 4);
+ r = TQRect(r.x() + 2, r.y() + 2, r.width() - 4, r.height() - 4);
unclippedPainter->drawPixmap(r.x() - 2, r.y() - 2, *buffer, r.x() - 2, r.y() - 2, r.width() + 4, 4);
unclippedPainter->drawPixmap(r.x() - 2, r.y() - 2, *buffer, r.x() - 2, r.y() - 2, 4, r.height() + 4);
unclippedPainter->drawPixmap(r.x() - 2, r.y() + r.height() - 3, *buffer, r.x() - 2,
@@ -2228,32 +2228,32 @@ void FormWindow::drawConnectLine()
{
if (!unclippedPainter)
return;
- unclippedPainter->setPen(QPen(white, 2));
+ unclippedPainter->setPen(TQPen(white, 2));
unclippedPainter->drawLine(connectStartPos, currentConnectPos);
- unclippedPainter->setPen(QPen(darkCyan, 1));
+ unclippedPainter->setPen(TQPen(darkCyan, 1));
unclippedPainter->drawLine(connectStartPos, currentConnectPos);
- unclippedPainter->setPen(QPen(magenta, 1));
+ unclippedPainter->setPen(TQPen(magenta, 1));
if (connectSender)
{
- QWidget *w = (QWidget*)connectSender;
- QPoint p = mapToForm(w, QPoint(0,0));
- unclippedPainter->drawRect(QRect(p + QPoint(2, 2), w->size() - QSize(4, 4)));
+ TQWidget *w = (TQWidget*)connectSender;
+ TQPoint p = mapToForm(w, TQPoint(0,0));
+ unclippedPainter->drawRect(TQRect(p + TQPoint(2, 2), w->size() - TQSize(4, 4)));
}
if (connectReceiver)
{
- QWidget *w = (QWidget*)connectReceiver;
- QPoint p = mapToForm(w, QPoint(0,0));
- unclippedPainter->drawRect(QRect(p + QPoint(2, 2), w->size() - QSize(4, 4)));
+ TQWidget *w = (TQWidget*)connectReceiver;
+ TQPoint p = mapToForm(w, TQPoint(0,0));
+ unclippedPainter->drawRect(TQRect(p + TQPoint(2, 2), w->size() - TQSize(4, 4)));
}
}
-QString FormWindow::fileName() const
+TQString FormWindow::fileName() const
{
return ff->absFileName();
}
-void FormWindow::setFileName(const QString &fn)
+void FormWindow::setFileName(const TQString &fn)
{
ff->setFileName(fn);
emit fileNameChanged(ff->fileName(), this);
@@ -2265,21 +2265,21 @@ void FormWindow::modificationChanged(bool m)
emit modificationChanged(m, ff->fileName());
}
-bool FormWindow::unify(QObject *w, QString &s, bool changeIt)
+bool FormWindow::unify(TQObject *w, TQString &s, bool changeIt)
{
bool found = !isMainContainer(w) && !qstrcmp(name(), s.latin1());
if (!found)
{
- QString orig = s;
+ TQString orig = s;
int num = 1;
- QPtrDictIterator<QWidget> it(insertedWidgets);
+ TQPtrDictIterator<TQWidget> it(insertedWidgets);
for (; it.current();)
if (it.current() != w && !qstrcmp(it.current()->name(), s.latin1()))
{
found = true;
if (!changeIt)
break;
- s = orig + "_" + QString::number(++num);
+ s = orig + "_" + TQString::number(++num);
it.toFirst();
}
else
@@ -2287,14 +2287,14 @@ bool FormWindow::unify(QObject *w, QString &s, bool changeIt)
if (!found)
{
- QPtrList<QAction> al;
- QAction *a = 0;
+ TQPtrList<TQAction> al;
+ TQAction *a = 0;
for (a = actions.first(); a; a = actions.next())
{
- QObjectList *l = a->queryList("QAction");
+ TQObjectList *l = a->queryList("TQAction");
al.append(a);
- for (QObject *ao = l->first(); ao; ao = l->next())
- al.append((QAction*)ao);
+ for (TQObject *ao = l->first(); ao; ao = l->next())
+ al.append((TQAction*)ao);
delete l;
}
for (a = al.first(); a; a = al.next())
@@ -2304,38 +2304,38 @@ bool FormWindow::unify(QObject *w, QString &s, bool changeIt)
found = true;
if (!changeIt)
break;
- s = orig + "_" + QString::number(++num);
+ s = orig + "_" + TQString::number(++num);
a = actions.first();
}
}
}
- if (mainContainer()->inherits("QMainWindow"))
+ if (mainContainer()->inherits("TQMainWindow"))
{
if (!found)
{
- QObjectList *l = mainContainer()->queryList("QDockWindow", 0, true);
- for (QObject *o = l->first(); o; o = l->next())
+ TQObjectList *l = mainContainer()->queryList("TQDockWindow", 0, true);
+ for (TQObject *o = l->first(); o; o = l->next())
if (o != w && !qstrcmp(o->name(), s.latin1()))
{
found = true;
if (!changeIt)
break;
- s = orig + "_" + QString::number(++num);
+ s = orig + "_" + TQString::number(++num);
o = l->first();
}
delete l;
}
if (!found)
{
- QObjectList *l = mainContainer()->queryList("QDesignerPopupMenu", 0, true);
- for (QObject *o = l->first(); o; o = l->next())
+ TQObjectList *l = mainContainer()->queryList("QDesignerPopupMenu", 0, true);
+ for (TQObject *o = l->first(); o; o = l->next())
if (o != w && !qstrcmp(o->name(), s.latin1()))
{
found = true;
if (!changeIt)
break;
- s = orig + "_" + QString::number(++num);
+ s = orig + "_" + TQString::number(++num);
o = l->first();
}
delete l;
@@ -2349,7 +2349,7 @@ bool FormWindow::unify(QObject *w, QString &s, bool changeIt)
bool FormWindow::isCustomWidgetUsed(MetaDataBase::CustomWidget *w)
{
- QPtrDictIterator<QWidget> it(insertedWidgets);
+ TQPtrDictIterator<TQWidget> it(insertedWidgets);
for (; it.current(); ++it)
if (it.current()->isA("CustomWidget") && !qstrcmp(WidgetFactory::classNameOf(it.current()),
w->className.utf8()))
@@ -2360,12 +2360,12 @@ bool FormWindow::isCustomWidgetUsed(MetaDataBase::CustomWidget *w)
bool FormWindow::isDatabaseWidgetUsed() const
{
#ifndef QT_NO_SQL
- QStringList dbClasses;
- dbClasses << "QDataTable"; // add more here
- QPtrDictIterator<QWidget> it(insertedWidgets);
+ TQStringList dbClasses;
+ dbClasses << "TQDataTable"; // add more here
+ TQPtrDictIterator<TQWidget> it(insertedWidgets);
for (; it.current(); ++it)
{
- QString c(it.current()->className());
+ TQString c(it.current()->className());
if (dbClasses.contains(c) > 0)
return true;
}
@@ -2376,8 +2376,8 @@ bool FormWindow::isDatabaseWidgetUsed() const
bool FormWindow::isDatabaseAware() const
{
#ifndef QT_NO_SQL
- if (QString(mContainer->className()) == "QDesignerDataBrowser" ||
- QString(mContainer->className()) == "QDesignerDataView")
+ if (TQString(mContainer->className()) == "QDesignerDataBrowser" ||
+ TQString(mContainer->className()) == "QDesignerDataView")
return true;
return isDatabaseWidgetUsed();
#else
@@ -2403,11 +2403,11 @@ void FormWindow::visibilityChanged()
This is the equivalent to mapFromGlobal(w->mapToGlobal(pos)) but
avoids the two roundtrips to the X-Server on Unix/X11.
*/
-QPoint FormWindow::mapToForm(const QWidget* w, const QPoint& pos) const
+TQPoint FormWindow::mapToForm(const TQWidget* w, const TQPoint& pos) const
{
- QPoint p = pos;
- const QWidget* i = w;
- while (i && !i->isTopLevel() && !isMainContainer((QWidget*)i))
+ TQPoint p = pos;
+ const TQWidget* i = w;
+ while (i && !i->isTopLevel() && !isMainContainer((TQWidget*)i))
{
p = i->mapToParent(p);
i = i->parentWidget();
@@ -2415,7 +2415,7 @@ QPoint FormWindow::mapToForm(const QWidget* w, const QPoint& pos) const
return mapFromGlobal(w->mapToGlobal(pos));
}
-static int widgetDepth(QWidget *w)
+static int widgetDepth(TQWidget *w)
{
int d = -1;
while (w && !w->isTopLevel())
@@ -2427,7 +2427,7 @@ static int widgetDepth(QWidget *w)
return d;
}
-static bool isChildOf(QWidget *c, QWidget *p)
+static bool isChildOf(TQWidget *c, TQWidget *p)
{
while (c && !c->isTopLevel())
{
@@ -2438,12 +2438,12 @@ static bool isChildOf(QWidget *c, QWidget *p)
return false;
}
-QWidget *FormWindow::containerAt(const QPoint &pos, QWidget *notParentOf)
+TQWidget *FormWindow::containerAt(const TQPoint &pos, TQWidget *notParentOf)
{
- QPtrDictIterator<QWidget> it(insertedWidgets);
- QWidget *container = 0;
+ TQPtrDictIterator<TQWidget> it(insertedWidgets);
+ TQWidget *container = 0;
int depth = -1;
- QWidgetList selected = selectedWidgets();
+ TQWidgetList selected = selectedWidgets();
if (rect().contains(mapFromGlobal(pos)))
{
container = mainContainer();
@@ -2453,7 +2453,7 @@ QWidget *FormWindow::containerAt(const QPoint &pos, QWidget *notParentOf)
for (; it.current(); ++it) {
if (it.current()->inherits("QLayoutWidget"))
continue;
- if (it.current()->inherits("QSplitter"))
+ if (it.current()->inherits("TQSplitter"))
continue;
if (!it.current()->isVisibleTo(this))
continue;
@@ -2464,7 +2464,7 @@ QWidget *FormWindow::containerAt(const QPoint &pos, QWidget *notParentOf)
continue;
// the rectangles of all ancestors of the container must contain the insert position
- QWidget *w = it.current();
+ TQWidget *w = it.current();
while (w && !w->isTopLevel())
{
if (!w->rect().contains((w->mapFromGlobal(pos))))
@@ -2474,9 +2474,9 @@ QWidget *FormWindow::containerAt(const QPoint &pos, QWidget *notParentOf)
if (w && !w->isTopLevel()) continue; // we did not get through the full while loop
int wd = widgetDepth(it.current());
- if (wd == depth && container && ((QObjectList*)it.current()->parentWidget()->
+ if (wd == depth && container && ((TQObjectList*)it.current()->parentWidget()->
children())->find(it.current()) >
- ((QObjectList*)container->parentWidget()->children())->find(container))
+ ((TQObjectList*)container->parentWidget()->children())->find(container))
wd++;
if (wd > depth && !isChildOf(it.current(), notParentOf)) {
depth = wd;
@@ -2487,12 +2487,12 @@ QWidget *FormWindow::containerAt(const QPoint &pos, QWidget *notParentOf)
return container;
}
-bool FormWindow::isMainContainer(QObject *w) const
+bool FormWindow::isMainContainer(TQObject *w) const
{
- return w && w->isWidgetType() && (w == (QWidget*)this || w == mainContainer());
+ return w && w->isWidgetType() && (w == (TQWidget*)this || w == mainContainer());
}
-void FormWindow::setMainContainer(QWidget *w)
+void FormWindow::setMainContainer(TQWidget *w)
{
bool resetPropertyWidget = isMainContainer(propertyWidget);
if (mContainer)
@@ -2503,14 +2503,14 @@ void FormWindow::setMainContainer(QWidget *w)
mContainer = w;
insertedWidgets.insert(mContainer, mContainer);
delete layout();
- QHBoxLayout *l = new QHBoxLayout(this);
+ TQHBoxLayout *l = new TQHBoxLayout(this);
l->addWidget(w);
if (resetPropertyWidget)
{
- QObject *opw = propertyWidget;
+ TQObject *opw = propertyWidget;
propertyWidget = mContainer;
if (opw && opw->isWidgetType())
- repaintSelection((QWidget*)opw);
+ repaintSelection((TQWidget*)opw);
}
}
@@ -2519,7 +2519,7 @@ bool FormWindow::savePixmapInline() const
return pixInline;
}
-QString FormWindow::pixmapLoaderFunction() const
+TQString FormWindow::pixmapLoaderFunction() const
{
return pixLoader;
}
@@ -2529,48 +2529,48 @@ void FormWindow::setSavePixmapInline(bool b)
pixInline = b;
}
-void FormWindow::setPixmapLoaderFunction(const QString &func)
+void FormWindow::setPixmapLoaderFunction(const TQString &func)
{
pixLoader = func;
}
-void FormWindow::setActiveObject(QObject *o)
+void FormWindow::setActiveObject(TQObject *o)
{
emitShowProperties(o);
propertyWidget = o;
}
-QAction *FormWindow::findAction(const QString &name)
+TQAction *FormWindow::findAction(const TQString &name)
{
- for (QAction *a = actionList().first(); a; a = actionList().next())
+ for (TQAction *a = actionList().first(); a; a = actionList().next())
{
- if (QString(a->name()) == name)
+ if (TQString(a->name()) == name)
return a;
- QAction *ac = (QAction*)a->child(name.latin1(), "QAction");
+ TQAction *ac = (TQAction*)a->child(name.latin1(), "TQAction");
if (ac)
return ac;
}
return 0;
}
-void FormWindow::killAccels(QObject *top)
+void FormWindow::killAccels(TQObject *top)
{
- QObjectList *l = top->queryList("QAccel");
+ TQObjectList *l = top->queryList("TQAccel");
if (!l)
return;
- for (QObject *o = l->first(); o; o = l->next())
- ((QAccel*)o)->setEnabled(false);
+ for (TQObject *o = l->first(); o; o = l->next())
+ ((TQAccel*)o)->setEnabled(false);
delete l;
}
-bool FormWindow::isCentralWidget(QObject *w) const
+bool FormWindow::isCentralWidget(TQObject *w) const
{
- if (!mainContainer()->inherits("QMainWindow"))
+ if (!mainContainer()->inherits("TQMainWindow"))
return false;
- return w == ((QMainWindow*)mainContainer())->centralWidget();
+ return w == ((TQMainWindow*)mainContainer())->centralWidget();
}
-QObject *FormWindow::connectableObject(QObject *w, QObject *)
+TQObject *FormWindow::connectableObject(TQObject *w, TQObject *)
{
return w;
}
@@ -2604,6 +2604,6 @@ void FormWindow::setFormFile(FormFile *f)
{
ff = f;
if (ff)
- connect(this, SIGNAL(modificationChanged(bool, const QString&)), ff, SLOT(formWindowChangedSomehow()));
+ connect(this, TQT_SIGNAL(modificationChanged(bool, const TQString&)), ff, TQT_SLOT(formWindowChangedSomehow()));
}
#include "formwindow.moc"