diff options
Diffstat (limited to 'kexi/formeditor/commands.cpp')
-rw-r--r-- | kexi/formeditor/commands.cpp | 514 |
1 files changed, 257 insertions, 257 deletions
diff --git a/kexi/formeditor/commands.cpp b/kexi/formeditor/commands.cpp index ca4f0f20..d628d53f 100644 --- a/kexi/formeditor/commands.cpp +++ b/kexi/formeditor/commands.cpp @@ -17,12 +17,12 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include <qdom.h> -#include <qwidget.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qsplitter.h> -#include <qmetaobject.h> +#include <tqdom.h> +#include <tqwidget.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqsplitter.h> +#include <tqmetaobject.h> #include <kdebug.h> #include <klocale.h> @@ -59,15 +59,15 @@ Command::~Command() // PropertyCommand -PropertyCommand::PropertyCommand(WidgetPropertySet *set, const QCString &wname, - const QVariant &oldValue, const QVariant &value, const QCString &property) +PropertyCommand::PropertyCommand(WidgetPropertySet *set, const TQCString &wname, + const TQVariant &oldValue, const TQVariant &value, const TQCString &property) : Command(), m_propSet(set), m_value(value), m_property(property) { m_oldvalues.insert(wname, oldValue); } -PropertyCommand::PropertyCommand(WidgetPropertySet *set, const QMap<QCString, QVariant> &oldvalues, - const QVariant &value, const QCString &property) +PropertyCommand::PropertyCommand(WidgetPropertySet *set, const TQMap<TQCString, TQVariant> &oldvalues, + const TQVariant &value, const TQCString &property) : Command(), m_propSet(set), m_value(value), m_oldvalues(oldvalues), m_property(property) { } @@ -84,7 +84,7 @@ MultiCommandGroup::addSubCommand(PropertyCommand* subCommand) */ void -PropertyCommand::setValue(const QVariant &value) +PropertyCommand::setValue(const TQVariant &value) { m_value = value; emit FormManager::self()->dirty(FormManager::self()->activeForm()); @@ -96,8 +96,8 @@ PropertyCommand::execute() FormManager::self()->activeForm()->selectFormWidget(); m_propSet->setUndoing(true); - QMap<QCString, QVariant>::ConstIterator endIt = m_oldvalues.constEnd(); - for(QMap<QCString, QVariant>::ConstIterator it = m_oldvalues.constBegin(); it != endIt; ++it) + TQMap<TQCString, TQVariant>::ConstIterator endIt = m_oldvalues.constEnd(); + for(TQMap<TQCString, TQVariant>::ConstIterator it = m_oldvalues.constBegin(); it != endIt; ++it) { ObjectTreeItem* item = FormManager::self()->activeForm()->objectTree()->lookup(it.key()); if (item) {//we're checking for item!=0 because the name could be of a form widget @@ -115,19 +115,19 @@ PropertyCommand::unexecute() FormManager::self()->activeForm()->selectFormWidget(); m_propSet->setUndoing(true); - QMap<QCString, QVariant>::ConstIterator endIt = m_oldvalues.constEnd(); - for(QMap<QCString, QVariant>::ConstIterator it = m_oldvalues.constBegin(); it != endIt; ++it) + TQMap<TQCString, TQVariant>::ConstIterator endIt = m_oldvalues.constEnd(); + for(TQMap<TQCString, TQVariant>::ConstIterator it = m_oldvalues.constBegin(); it != endIt; ++it) { ObjectTreeItem* item = FormManager::self()->activeForm()->objectTree()->lookup(it.key()); if (!item) continue; //better this than a crash - QWidget *widg = item->widget(); + TQWidget *widg = item->widget(); FormManager::self()->activeForm()->setSelectedWidget(widg, true); //m_propSet->setSelectedWidget(widg, true); WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(widg); - QWidget *subWidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : widg; - if (-1!=subWidget->metaObject()->findProperty( m_property, true )) + TQWidget *subWidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : widg; + if (-1!=subWidget->tqmetaObject()->tqfindProperty( m_property, true )) subWidget->setProperty(m_property, it.data()); } @@ -135,13 +135,13 @@ PropertyCommand::unexecute() m_propSet->setUndoing(false); } -QString +TQString PropertyCommand::name() const { if(m_oldvalues.count() >= 2) - return i18n("Change \"%1\" property for multiple widgets" ).arg(m_property); + return i18n("Change \"%1\" property for multiple widgets" ).tqarg(TQString(m_property)); else - return i18n("Change \"%1\" property for widget \"%2\"" ).arg(m_property).arg(m_oldvalues.begin().key()); + return i18n("Change \"%1\" property for widget \"%2\"" ).tqarg(TQString(m_property)).tqarg(TQString(m_oldvalues.begin().key())); } void @@ -154,7 +154,7 @@ PropertyCommand::debug() // GeometryPropertyCommand (for multiples widgets) GeometryPropertyCommand::GeometryPropertyCommand(WidgetPropertySet *set, - const QStringList &names, const QPoint& oldPos) + const TQStringList &names, const TQPoint& oldPos) : Command(), m_propSet(set), m_names(names), m_oldPos(oldPos) { } @@ -166,14 +166,14 @@ GeometryPropertyCommand::execute() int dx = m_pos.x() - m_oldPos.x(); int dy = m_pos.y() - m_oldPos.y(); - QStringList::ConstIterator endIt = m_names.constEnd(); + TQStringList::ConstIterator endIt = m_names.constEnd(); // We move every widget in our list by (dx, dy) - for(QStringList::ConstIterator it = m_names.constBegin(); it != endIt; ++it) + for(TQStringList::ConstIterator it = m_names.constBegin(); it != endIt; ++it) { ObjectTreeItem* item = FormManager::self()->activeForm()->objectTree()->lookup(*it); if (!item) continue; //better this than a crash - QWidget *w = item->widget(); + TQWidget *w = item->widget(); w->move(w->x() + dx, w->y() + dy); } m_propSet->setUndoing(false); @@ -186,27 +186,27 @@ GeometryPropertyCommand::unexecute() int dx = m_pos.x() - m_oldPos.x(); int dy = m_pos.y() - m_oldPos.y(); - QStringList::ConstIterator endIt = m_names.constEnd(); + TQStringList::ConstIterator endIt = m_names.constEnd(); // We move every widget in our list by (-dx, -dy) to undo the move - for(QStringList::ConstIterator it = m_names.constBegin(); it != endIt; ++it) + for(TQStringList::ConstIterator it = m_names.constBegin(); it != endIt; ++it) { ObjectTreeItem* item = FormManager::self()->activeForm()->objectTree()->lookup(*it); if (!item) continue; //better this than a crash - QWidget *w = item->widget(); + TQWidget *w = item->widget(); w->move(w->x() - dx, w->y() - dy); } m_propSet->setUndoing(false); } void -GeometryPropertyCommand::setPos(const QPoint& pos) +GeometryPropertyCommand::setPos(const TQPoint& pos) { m_pos = pos; emit FormManager::self()->dirty(FormManager::self()->activeForm()); } -QString +TQString GeometryPropertyCommand::name() const { return i18n("Move multiple widgets"); @@ -224,7 +224,7 @@ GeometryPropertyCommand::debug() AlignWidgetsCommand::AlignWidgetsCommand(int type, WidgetList &list, Form *form) : Command(), m_form(form), m_type(type) { - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) m_pos.insert(w->name(), w->pos()); } @@ -236,12 +236,12 @@ AlignWidgetsCommand::execute() int gridX = m_form->gridSize(); int gridY = m_form->gridSize(); - QWidget *parentWidget = m_form->selectedWidgets()->first()->parentWidget(); + TQWidget *tqparentWidget = m_form->selectedWidgets()->first()->tqparentWidget(); int tmpx, tmpy; WidgetList list; - QMap<QCString, QPoint>::ConstIterator endIt = m_pos.constEnd(); - for(QMap<QCString, QPoint>::ConstIterator it = m_pos.constBegin(); it != endIt; ++it) + TQMap<TQCString, TQPoint>::ConstIterator endIt = m_pos.constEnd(); + for(TQMap<TQCString, TQPoint>::ConstIterator it = m_pos.constBegin(); it != endIt; ++it) { ObjectTreeItem *item = m_form->objectTree()->lookup(it.key()); if(item && item->widget()) @@ -252,7 +252,7 @@ AlignWidgetsCommand::execute() { case AlignToGrid: { - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { tmpx = int( (float)w->x() / ((float)gridX) + 0.5 ) * gridX; tmpy = int( (float)w->y() / ((float)gridY) + 0.5 ) * gridY; @@ -265,14 +265,14 @@ AlignWidgetsCommand::execute() case AlignToLeft: { - tmpx = parentWidget->width(); - for(QWidget *w = list.first(); w; w = list.next()) + tmpx = tqparentWidget->width(); + for(TQWidget *w = list.first(); w; w = list.next()) { if(w->x() < tmpx) tmpx = w->x(); } - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) w->move(tmpx, w->y()); break; } @@ -280,27 +280,27 @@ AlignWidgetsCommand::execute() case AlignToRight: { tmpx = 0; - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { if(w->x() + w->width() > tmpx) tmpx = w->x() + w->width(); } - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) w->move(tmpx - w->width(), w->y()); break; } case AlignToTop: { - tmpy = parentWidget->height(); - for(QWidget *w = list.first(); w; w = list.next()) + tmpy = tqparentWidget->height(); + for(TQWidget *w = list.first(); w; w = list.next()) { if(w->y() < tmpy) tmpy = w->y(); } - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) w->move(w->x(), tmpy); break; } @@ -308,13 +308,13 @@ AlignWidgetsCommand::execute() case AlignToBottom: { tmpy = 0; - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { if(w->y() + w->height() > tmpy) tmpy = w->y() + w->height(); } - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) w->move(w->x(), tmpy - w->height()); break; } @@ -324,7 +324,7 @@ AlignWidgetsCommand::execute() } // We restore selection - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) m_form->setSelectedWidget(w, true); } @@ -334,8 +334,8 @@ AlignWidgetsCommand::unexecute() // To avoid creation of GeometryPropertyCommand m_form->selectFormWidget(); // We move widgets to their original pos - QMap<QCString, QPoint>::ConstIterator endIt = m_pos.constEnd(); - for(QMap<QCString, QPoint>::ConstIterator it = m_pos.constBegin(); it != endIt; ++it) + TQMap<TQCString, TQPoint>::ConstIterator endIt = m_pos.constEnd(); + for(TQMap<TQCString, TQPoint>::ConstIterator it = m_pos.constBegin(); it != endIt; ++it) { ObjectTreeItem *item = m_form->objectTree()->lookup(it.key()); if(item && item->widget()) @@ -344,7 +344,7 @@ AlignWidgetsCommand::unexecute() } } -QString +TQString AlignWidgetsCommand::name() const { switch(m_type) @@ -360,7 +360,7 @@ AlignWidgetsCommand::name() const case AlignToBottom: return i18n("Align Widgets to Bottom"); default: - return QString::null; + return TQString(); } } @@ -376,13 +376,13 @@ AlignWidgetsCommand::debug() AdjustSizeCommand::AdjustSizeCommand(int type, WidgetList &list, Form *form) : Command(), m_form(form), m_type(type) { - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { - if(w->parentWidget() && w->parentWidget()->isA("QWidgetStack")) + if(w->tqparentWidget() && w->tqparentWidget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING)) { - w = w->parentWidget(); // widget is WidgetStack page - if(w->parentWidget() && w->parentWidget()->inherits("QTabWidget")) // widget is tabwidget page - w = w->parentWidget(); + w = w->tqparentWidget(); // widget is WidgetStack page + if(w->tqparentWidget() && w->tqparentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) // widget is tabwidget page + w = w->tqparentWidget(); } m_sizes.insert(w->name(), w->size()); @@ -402,8 +402,8 @@ AdjustSizeCommand::execute() int tmpw=0, tmph=0; WidgetList list; - QMap<QCString, QSize>::ConstIterator endIt = m_sizes.constEnd(); - for(QMap<QCString, QSize>::ConstIterator it = m_sizes.constBegin(); it != endIt; ++it) + TQMap<TQCString, TQSize>::ConstIterator endIt = m_sizes.constEnd(); + for(TQMap<TQCString, TQSize>::ConstIterator it = m_sizes.constBegin(); it != endIt; ++it) { ObjectTreeItem *item = m_form->objectTree()->lookup(it.key()); if(item && item->widget()) @@ -416,7 +416,7 @@ AdjustSizeCommand::execute() { int tmpx=0, tmpy=0; // same as in 'Align to Grid' + for the size - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { tmpx = int( (float)w->x() / ((float)gridX) + 0.5 ) * gridX; tmpy = int( (float)w->y() / ((float)gridY) + 0.5 ) * gridY; @@ -433,12 +433,12 @@ AdjustSizeCommand::execute() case SizeToFit: { - for(QWidget *w = list.first(); w; w = list.next()) { + for(TQWidget *w = list.first(); w; w = list.next()) { ObjectTreeItem *item = m_form->objectTree()->lookup(w->name()); - if(item && !item->children()->isEmpty()) { // container - QSize s; - if(item->container() && item->container()->layout()) - s = w->sizeHint(); + if(item && !item->tqchildren()->isEmpty()) { // container + TQSize s; + if(item->container() && item->container()->tqlayout()) + s = w->tqsizeHint(); else s = getSizeFromChildren(item); // minimum size for containers @@ -446,8 +446,8 @@ AdjustSizeCommand::execute() s.setWidth(30); if(s.height() < 30) s.setHeight(30); - // small hack for flow layouts - int type = item->container() ? item->container()->layoutType() : Container::NoLayout; + // small hack for flow tqlayouts + int type = item->container() ? item->container()->tqlayoutType() : Container::NoLayout; if(type == Container::HFlow) s.setWidth(s.width() + 5); else if(type == Container::VFlow) @@ -457,9 +457,9 @@ AdjustSizeCommand::execute() else if(item && item->container()) // empty container w->resize(item->container()->form()->gridSize() * 5, item->container()->form()->gridSize() * 5); // basic size else { - QSize sizeHint(w->sizeHint()); - if (sizeHint.isValid()) - w->resize(sizeHint); + TQSize tqsizeHint(w->tqsizeHint()); + if (tqsizeHint.isValid()) + w->resize(tqsizeHint); } } break; @@ -467,13 +467,13 @@ AdjustSizeCommand::execute() case SizeToSmallWidth: { - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { if((tmpw == 0) || (w->width() < tmpw)) tmpw = w->width(); } - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { if(tmpw != w->width()) w->resize(tmpw, w->height()); @@ -483,13 +483,13 @@ AdjustSizeCommand::execute() case SizeToBigWidth: { - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { if(w->width() > tmpw) tmpw = w->width(); } - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { if(tmpw != w->width()) w->resize(tmpw, w->height()); @@ -499,13 +499,13 @@ AdjustSizeCommand::execute() case SizeToSmallHeight: { - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { if((tmph == 0) || (w->height() < tmph)) tmph = w->height(); } - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { if(tmph != w->height()) w->resize(w->width(), tmph); @@ -515,13 +515,13 @@ AdjustSizeCommand::execute() case SizeToBigHeight: { - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { if(w->height() > tmph) tmph = w->height(); } - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) { if(tmph != w->height()) w->resize(w->width(), tmph); @@ -534,31 +534,31 @@ AdjustSizeCommand::execute() } // We restore selection - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) m_form->setSelectedWidget(w, true); } -QSize +TQSize AdjustSizeCommand::getSizeFromChildren(ObjectTreeItem *item) { if(!item->container()) // multi pages containers (eg tabwidget) { - QSize s; + TQSize s; // get size for each container, and keep the biggest one - for(ObjectTreeItem *tree = item->children()->first(); tree; tree = item->children()->next()) + for(ObjectTreeItem *tree = item->tqchildren()->first(); tree; tree = item->tqchildren()->next()) s = s.expandedTo(getSizeFromChildren(tree)); return s; } int tmpw = 0, tmph = 0; - for(ObjectTreeItem *tree = item->children()->first(); tree; tree = item->children()->next()) { + for(ObjectTreeItem *tree = item->tqchildren()->first(); tree; tree = item->tqchildren()->next()) { if(!tree->widget()) continue; - tmpw = QMAX(tmpw, tree->widget()->geometry().right()); - tmph = QMAX(tmph, tree->widget()->geometry().bottom()); + tmpw = TQMAX(tmpw, tree->widget()->tqgeometry().right()); + tmph = TQMAX(tmph, tree->widget()->tqgeometry().bottom()); } - return QSize(tmpw, tmph) + QSize(10, 10); + return TQSize(tmpw, tmph) + TQSize(10, 10); } void @@ -567,8 +567,8 @@ AdjustSizeCommand::unexecute() // To avoid creation of GeometryPropertyCommand m_form->selectFormWidget(); // We resize widgets to their original size - QMap<QCString, QSize>::ConstIterator endIt = m_sizes.constEnd(); - for(QMap<QCString, QSize>::ConstIterator it = m_sizes.constBegin(); it != endIt; ++it) + TQMap<TQCString, TQSize>::ConstIterator endIt = m_sizes.constEnd(); + for(TQMap<TQCString, TQSize>::ConstIterator it = m_sizes.constBegin(); it != endIt; ++it) { ObjectTreeItem *item = m_form->objectTree()->lookup(it.key()); if(item && item->widget()) @@ -581,7 +581,7 @@ AdjustSizeCommand::unexecute() } } -QString +TQString AdjustSizeCommand::name() const { switch(m_type) @@ -599,7 +599,7 @@ AdjustSizeCommand::name() const case SizeToBigHeight: return i18n("Resize Widgets to Tallest"); default: - return QString::null; + return TQString(); } } @@ -612,18 +612,18 @@ AdjustSizeCommand::debug() // LayoutPropertyCommand -LayoutPropertyCommand::LayoutPropertyCommand(WidgetPropertySet *buf, const QCString &wname, - const QVariant &oldValue, const QVariant &value) - : PropertyCommand(buf, wname, oldValue, value, "layout") +LayoutPropertyCommand::LayoutPropertyCommand(WidgetPropertySet *buf, const TQCString &wname, + const TQVariant &oldValue, const TQVariant &value) + : PropertyCommand(buf, wname, oldValue, value, "tqlayout") { m_form = FormManager::self()->activeForm(); ObjectTreeItem* titem = m_form->objectTree()->lookup(wname); if (!titem) return; //better this than a crash Container *m_container = titem->container(); - // We save the geometry of each wigdet - for(ObjectTreeItem *it = m_container->objectTree()->children()->first(); it; it = m_container->objectTree()->children()->next()) - m_geometries.insert(it->name().latin1(), it->widget()->geometry()); + // We save the tqgeometry of each wigdet + for(ObjectTreeItem *it = m_container->objectTree()->tqchildren()->first(); it; it = m_container->objectTree()->tqchildren()->next()) + m_geometries.insert(it->name().latin1(), it->widget()->tqgeometry()); } void @@ -641,8 +641,8 @@ LayoutPropertyCommand::unexecute() Container *m_container = titem->container(); m_container->setLayout(Container::NoLayout); // We put every widget back in its old location - QMap<QCString,QRect>::ConstIterator endIt = m_geometries.constEnd(); - for(QMap<QCString,QRect>::ConstIterator it = m_geometries.constBegin(); it != endIt; ++it) + TQMap<TQCString,TQRect>::ConstIterator endIt = m_geometries.constEnd(); + for(TQMap<TQCString,TQRect>::ConstIterator it = m_geometries.constBegin(); it != endIt; ++it) { ObjectTreeItem *tree = m_container->form()->objectTree()->lookup(it.key()); if(tree) @@ -652,10 +652,10 @@ LayoutPropertyCommand::unexecute() PropertyCommand::unexecute(); } -QString +TQString LayoutPropertyCommand::name() const { - return i18n("Change layout of widget \"%1\"").arg(m_oldvalues.begin().key()); + return i18n("Change tqlayout of widget \"%1\"").tqarg(TQString(m_oldvalues.begin().key())); } void @@ -681,7 +681,7 @@ InsertWidgetCommand::InsertWidgetCommand(Container *container) } InsertWidgetCommand::InsertWidgetCommand(Container *container, - const QCString& className, const QPoint& pos, const QCString& namePrefix) + const TQCString& className, const TQPoint& pos, const TQCString& namePrefix) : Command() { m_containername = container->widget()->name(); @@ -732,7 +732,7 @@ InsertWidgetCommand::execute() else options |= WidgetFactory::AnyOrientation; - QWidget *w = m_container->form()->library()->createWidget(m_class, m_container->m_container, m_name, + TQWidget *w = m_container->form()->library()->createWidget(m_class, m_container->m_container, m_name, m_container, options); if(!w) { @@ -740,7 +740,7 @@ InsertWidgetCommand::execute() WidgetInfo *winfo = m_container->form()->library()->widgetInfoForClassName(m_class); KMessageBox::sorry(FormManager::self()->activeForm() ? FormManager::self()->activeForm()->widget() : 0, i18n("Could not insert widget of type \"%1\". A problem with widget's creation encountered.") - .arg(winfo ? winfo->name() : QString::null)); + .tqarg(winfo ? winfo->name() : TQString())); kdWarning() << "InsertWidgetCommand::execute() ERROR: widget creation failed" << endl; return; } @@ -755,10 +755,10 @@ InsertWidgetCommand::execute() // if the insertRect is invalid (ie only one point), we use widget' size hint if(( (m_insertRect.width() < 21) && (m_insertRect.height() < 21))) { - QSize s = w->sizeHint(); + TQSize s = w->tqsizeHint(); if(s.isEmpty()) - s = QSize(20, 20); // Minimum size to avoid creating a (0,0) widget + s = TQSize(20, 20); // Minimum size to avoid creating a (0,0) widget int x, y; if(m_insertRect.isValid()) { @@ -770,13 +770,13 @@ InsertWidgetCommand::execute() x = m_point.x(); y = m_point.y(); } - m_insertRect = QRect(x, y, s.width() + 16/* add some space so more text can be entered*/, + m_insertRect = TQRect(x, y, s.width() + 16/* add some space so more text can be entered*/, s.height()); } w->move(m_insertRect.x(), m_insertRect.y()); w->resize(m_insertRect.width()-1, m_insertRect.height()-1); // -1 is not to hide dots - w->setStyle(&(m_container->widget()->style())); - w->setBackgroundOrigin(QWidget::ParentOrigin); + w->setStyle(&(m_container->widget()->tqstyle())); + w->setBackgroundOrigin(TQWidget::ParentOrigin); w->show(); FormManager::self()->stopInsert(); @@ -796,13 +796,13 @@ InsertWidgetCommand::execute() } // We add the autoSaveProperties in the modifProp list of the ObjectTreeItem, so that they are saved later - QValueList<QCString> list(m_container->form()->library()->autoSaveProperties(w->className())); + TQValueList<TQCString> list(m_container->form()->library()->autoSaveProperties(w->className())); - QValueList<QCString>::ConstIterator endIt = list.constEnd(); - for(QValueList<QCString>::ConstIterator it = list.constBegin(); it != endIt; ++it) + TQValueList<TQCString>::ConstIterator endIt = list.constEnd(); + for(TQValueList<TQCString>::ConstIterator it = list.constBegin(); it != endIt; ++it) item->addModifiedProperty(*it, w->property(*it)); - m_container->reloadLayout(); // reload the layout to take the new wigdet into account + m_container->reloadLayout(); // reload the tqlayout to take the new wigdet into account m_container->setSelectedWidget(w, false); if (m_container->form()->library()->internalProperty(w->className(), @@ -821,16 +821,16 @@ InsertWidgetCommand::unexecute() ObjectTreeItem* titem = m_form->objectTree()->lookup(m_name); if (!titem) return; //better this than a crash - QWidget *m_widget = titem->widget(); + TQWidget *m_widget = titem->widget(); Container *m_container = m_form->objectTree()->lookup(m_containername)->container(); m_container->deleteWidget(m_widget); } -QString +TQString InsertWidgetCommand::name() const { if(!m_name.isEmpty()) - return i18n("Insert widget \"%1\"").arg(m_name); + return i18n("Insert widget \"%1\"").tqarg(TQString(m_name)); else return i18n("Insert widget"); } @@ -846,11 +846,11 @@ InsertWidgetCommand::debug() /// CreateLayoutCommand /////////////// -CreateLayoutCommand::CreateLayoutCommand(int layoutType, WidgetList &list, Form *form) - : m_form(form), m_type(layoutType) +CreateLayoutCommand::CreateLayoutCommand(int tqlayoutType, WidgetList &list, Form *form) + : m_form(form), m_type(tqlayoutType) { WidgetList *m_list=0; - switch(layoutType) + switch(tqlayoutType) { case Container::HBox: case Container::Grid: @@ -862,15 +862,15 @@ CreateLayoutCommand::CreateLayoutCommand(int layoutType, WidgetList &list, Form case Container::VFlow: m_list = new VerWidgetList(form->toplevelContainer()->widget()); break; } - for(QWidget *w = list.first(); w; w = list.next()) + for(TQWidget *w = list.first(); w; w = list.next()) m_list->append(w); - m_list->sort(); // we sort them now, before creating the layout + m_list->sort(); // we sort them now, before creating the tqlayout - for(QWidget *w = m_list->first(); w; w = m_list->next()) - m_pos.insert(w->name(), w->geometry()); + for(TQWidget *w = m_list->first(); w; w = m_list->next()) + m_pos.insert(w->name(), w->tqgeometry()); ObjectTreeItem *item = form->objectTree()->lookup(m_list->first()->name()); - if(item && item->parent()->container()) - m_containername = item->parent()->name(); + if(item && item->tqparent()->container()) + m_containername = item->tqparent()->name(); delete m_list; } @@ -885,18 +885,18 @@ CreateLayoutCommand::execute() if(!container) container = m_form->toplevelContainer(); // use toplevelContainer by default - QCString classname; + TQCString classname; switch(m_type) { case Container::HSplitter: case Container::VSplitter: - classname = "QSplitter"; break; + classname = TQSPLITTER_OBJECT_NAME_STRING; break; default: - classname = Container::layoutTypeToString(m_type).latin1(); + classname = Container::tqlayoutTypeToString(m_type).latin1(); } if(m_name.isEmpty())// the name must be generated only once m_name = m_form->objectTree()->generateUniqueName(classname); - QWidget *w = lib->createWidget(classname, container->widget(), m_name.latin1(), container); + TQWidget *w = lib->createWidget(classname, container->widget(), m_name.latin1(), container); #if KDE_VERSION >= KDE_MAKE_VERSION(3,4,0) //! @todo allow setting this for data view mode as well if (w) { @@ -911,17 +911,17 @@ CreateLayoutCommand::execute() return; container->setSelectedWidget(0, false); - w->move(m_pos.begin().data().topLeft()); // we move the layout at the position of the topleft widget - // sizeHint of these widgets depends on geometry, so give them appropriate geometry + w->move(m_pos.begin().data().topLeft()); // we move the tqlayout at the position of the topleft widget + // tqsizeHint of these widgets depends on tqgeometry, so give them appropriate tqgeometry if(m_type == Container::HFlow) - w->resize( QSize(700, 20) ); + w->resize( TQSize(700, 20) ); else if(m_type == Container::VFlow) - w->resize( QSize(20, 700)); + w->resize( TQSize(20, 700)); w->show(); // We reparent every widget to the Layout and insert them into it - QMap<QCString,QRect>::ConstIterator endIt = m_pos.constEnd(); - for(QMap<QCString,QRect>::ConstIterator it = m_pos.constBegin(); it != endIt; ++it) + TQMap<TQCString,TQRect>::ConstIterator endIt = m_pos.constEnd(); + for(TQMap<TQCString,TQRect>::ConstIterator it = m_pos.constBegin(); it != endIt; ++it) { ObjectTreeItem *item = m_form->objectTree()->lookup(it.key()); if(item && item->widget()) @@ -933,12 +933,12 @@ CreateLayoutCommand::execute() } if(m_type == Container::HSplitter) - ((QSplitter*)w)->setOrientation(QSplitter::Horizontal); + ((TQSplitter*)w)->setOrientation(Qt::Horizontal); else if(m_type == Container::VSplitter) - ((QSplitter*)w)->setOrientation(QSplitter::Vertical); + ((TQSplitter*)w)->setOrientation(Qt::Vertical); else if(tree->container()) { tree->container()->setLayout((Container::LayoutType)m_type); - w->resize(tree->container()->layout()->sizeHint()); // the layout doesn't have its own size + w->resize(tree->container()->tqlayout()->tqsizeHint()); // the tqlayout doesn't have its own size } container->setSelectedWidget(w, false); @@ -948,54 +948,54 @@ CreateLayoutCommand::execute() void CreateLayoutCommand::unexecute() { - ObjectTreeItem *parent = m_form->objectTree()->lookup(m_containername); - if(!parent) - parent = m_form->objectTree(); + ObjectTreeItem *tqparent = m_form->objectTree()->lookup(m_containername); + if(!tqparent) + tqparent = m_form->objectTree(); - // We reparent every widget to the Container and take them out of the layout - QMap<QCString,QRect>::ConstIterator endIt = m_pos.constEnd(); - for(QMap<QCString,QRect>::ConstIterator it = m_pos.constBegin(); it != endIt; ++it) + // We reparent every widget to the Container and take them out of the tqlayout + TQMap<TQCString,TQRect>::ConstIterator endIt = m_pos.constEnd(); + for(TQMap<TQCString,TQRect>::ConstIterator it = m_pos.constBegin(); it != endIt; ++it) { ObjectTreeItem *item = m_form->objectTree()->lookup(it.key()); if(item && item->widget()) { - item->widget()->reparent(parent->widget(), QPoint(0,0), true); - item->eventEater()->setContainer(parent->container()); + item->widget()->reparent(tqparent->widget(), TQPoint(0,0), true); + item->eventEater()->setContainer(tqparent->container()); if(m_pos[it.key()].isValid()) item->widget()->setGeometry(m_pos[it.key()]); m_form->objectTree()->reparent(item->name(), m_containername); } } - if(!parent->container()) + if(!tqparent->container()) return; ObjectTreeItem* titem = m_form->objectTree()->lookup(m_name); if (!titem) return; //better this than a crash - QWidget *w = titem->widget(); - parent->container()->deleteWidget(w); // delete the layout widget + TQWidget *w = titem->widget(); + tqparent->container()->deleteWidget(w); // delete the tqlayout widget FormManager::self()->windowChanged(m_form->widget()); // to reload ObjectTreeView } -QString +TQString CreateLayoutCommand::name() const { switch(m_type) { case Container::HBox: - return i18n("Group Widgets Horizontally"); + return i18n("Group WidgetsQt::Horizontally"); case Container::VBox: - return i18n("Group Widgets Vertically"); + return i18n("Group WidgetsQt::Vertically"); case Container::Grid: return i18n("Group Widgets in a Grid"); case Container::HSplitter: - return i18n("Group Widgets Horizontally in a Splitter"); + return i18n("Group WidgetsQt::Horizontally in a Splitter"); case Container::VSplitter: - return i18n("Group Widgets Vertically in a Splitter"); + return i18n("Group WidgetsQt::Vertically in a Splitter"); case Container::HFlow: return i18n("Group Widgets By Rows"); case Container::VFlow: - return i18n("Group Widgets Vertically By Columns"); + return i18n("Group WidgetsQt::Vertically By Columns"); default: return i18n("Group widgets"); } @@ -1017,11 +1017,11 @@ BreakLayoutCommand::BreakLayoutCommand(Container *container) m_containername = container->toplevel()->widget()->name(); m_name = container->widget()->name(); m_form = container->form(); - m_type = container->layoutType(); + m_type = container->tqlayoutType(); - for(ObjectTreeItem *tree = container->objectTree()->children()->first(); tree; tree = container->objectTree()->children()->next()) + for(ObjectTreeItem *tree = container->objectTree()->tqchildren()->first(); tree; tree = container->objectTree()->tqchildren()->next()) { - QRect r(container->widget()->mapTo(container->widget()->parentWidget(), tree->widget()->pos()), tree->widget()->size()); + TQRect r(container->widget()->mapTo(container->widget()->tqparentWidget(), tree->widget()->pos()), tree->widget()->size()); m_pos.insert(tree->widget()->name(), r); } } @@ -1038,10 +1038,10 @@ BreakLayoutCommand::unexecute() CreateLayoutCommand::execute(); } -QString +TQString BreakLayoutCommand::name() const { - return i18n("Break Layout: \"%1\"").arg(m_name); + return i18n("Break Layout: \"%1\"").tqarg(m_name); } void @@ -1054,7 +1054,7 @@ BreakLayoutCommand::debug() // PasteWidgetCommand -PasteWidgetCommand::PasteWidgetCommand(QDomDocument &domDoc, Container *container, const QPoint& p) +PasteWidgetCommand::PasteWidgetCommand(TQDomDocument &domDoc, Container *container, const TQPoint& p) : m_point(p) { m_data = domDoc.toCString(); @@ -1064,30 +1064,30 @@ PasteWidgetCommand::PasteWidgetCommand(QDomDocument &domDoc, Container *containe if(domDoc.namedItem("UI").firstChild().nextSibling().toElement().tagName() != "widget") return; - QRect boundingRect; - for(QDomNode n = domDoc.namedItem("UI").firstChild(); !n.isNull(); n = n.nextSibling()) // more than one widget + TQRect boundingRect; + for(TQDomNode n = domDoc.namedItem("UI").firstChild(); !n.isNull(); n = n.nextSibling()) // more than one widget { if(n.toElement().tagName() != "widget") continue; - QDomElement el = n.toElement(); + TQDomElement el = n.toElement(); - QDomElement rect; - for(QDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) + TQDomElement rect; + for(TQDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) { if((n.toElement().tagName() == "property") && (n.toElement().attribute("name") == "geometry")) rect = n.firstChild().toElement(); } - QDomElement x = rect.namedItem("x").toElement(); - QDomElement y = rect.namedItem("y").toElement(); - QDomElement wi = rect.namedItem("width").toElement(); - QDomElement h = rect.namedItem("height").toElement(); + TQDomElement x = rect.namedItem("x").toElement(); + TQDomElement y = rect.namedItem("y").toElement(); + TQDomElement wi = rect.namedItem("width").toElement(); + TQDomElement h = rect.namedItem("height").toElement(); int rx = x.text().toInt(); int ry = y.text().toInt(); int rw = wi.text().toInt(); int rh = h.text().toInt(); - QRect r(rx, ry, rw, rh); + TQRect r(rx, ry, rw, rh); boundingRect = boundingRect.unite(r); } @@ -1101,10 +1101,10 @@ PasteWidgetCommand::execute() if (!titem) return; //better this than a crash Container *container = titem->container(); - QString errMsg; + TQString errMsg; int errLine; int errCol; - QDomDocument domDoc("UI"); + TQDomDocument domDoc("UI"); bool parsed = domDoc.setContent(m_data, false, &errMsg, &errLine, &errCol); if(!parsed) @@ -1121,7 +1121,7 @@ PasteWidgetCommand::execute() return; if(domDoc.namedItem("UI").firstChild().nextSibling().toElement().tagName() != "widget") // only one widget, so we can paste it at cursor pos { - QDomElement el = domDoc.namedItem("UI").firstChild().toElement(); + TQDomElement el = domDoc.namedItem("UI").firstChild().toElement(); fixNames(el); if(m_point.isNull()) fixPos(el, container); @@ -1132,11 +1132,11 @@ PasteWidgetCommand::execute() FormIO::loadWidget(container, el); m_form->setInteractiveMode(true); } - else for(QDomNode n = domDoc.namedItem("UI").firstChild(); !n.isNull(); n = n.nextSibling()) // more than one widget + else for(TQDomNode n = domDoc.namedItem("UI").firstChild(); !n.isNull(); n = n.nextSibling()) // more than one widget { if(n.toElement().tagName() != "widget") continue; - QDomElement el = n.toElement(); + TQDomElement el = n.toElement(); fixNames(el); if(!m_point.isNull()) moveWidgetBy(el, container, m_point); @@ -1153,11 +1153,11 @@ PasteWidgetCommand::execute() //FormIO::setCurrentForm(0); m_names.clear(); // We store the names of all the created widgets, to delete them later - for(QDomNode n = domDoc.namedItem("UI").firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = domDoc.namedItem("UI").firstChild(); !n.isNull(); n = n.nextSibling()) { if(n.toElement().tagName() != "widget") continue; - for(QDomNode m = n.firstChild(); !m.isNull(); n = m.nextSibling()) + for(TQDomNode m = n.firstChild(); !m.isNull(); n = m.nextSibling()) { if((m.toElement().tagName() == "property") && (m.toElement().attribute("name") == "name")) { @@ -1168,8 +1168,8 @@ PasteWidgetCommand::execute() } container->form()->selectFormWidget(); - QStringList::ConstIterator endIt = m_names.constEnd(); - for(QStringList::ConstIterator it = m_names.constBegin(); it != endIt; ++it) // We select all the pasted widgets + TQStringList::ConstIterator endIt = m_names.constEnd(); + for(TQStringList::ConstIterator it = m_names.constBegin(); it != endIt; ++it) // We select all the pasted widgets { ObjectTreeItem *item = m_form->objectTree()->lookup(*it); if(item) @@ -1185,77 +1185,77 @@ PasteWidgetCommand::unexecute() return; //better this than a crash Container *container = titem->container(); // We just delete all the widgets we have created - QStringList::ConstIterator endIt = m_names.constEnd(); - for(QStringList::ConstIterator it = m_names.constBegin(); it != endIt; ++it) + TQStringList::ConstIterator endIt = m_names.constEnd(); + for(TQStringList::ConstIterator it = m_names.constBegin(); it != endIt; ++it) { ObjectTreeItem* titem = container->form()->objectTree()->lookup(*it); if (!titem) continue; //better this than a crash - QWidget *w = titem->widget(); + TQWidget *w = titem->widget(); container->deleteWidget(w); } } -QString +TQString PasteWidgetCommand::name() const { return i18n("Paste"); } void -//QDomElement -PasteWidgetCommand::changePos(QDomElement &el, const QPoint &newpos) +//TQDomElement +PasteWidgetCommand::changePos(TQDomElement &el, const TQPoint &newpos) { - //QDomElement el = widg.cloneNode(true).toElement(); - QDomElement rect; - // Find the widget geometry if there is one - for(QDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) + //TQDomElement el = widg.cloneNode(true).toElement(); + TQDomElement rect; + // Find the widget tqgeometry if there is one + for(TQDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) { if((n.toElement().tagName() == "property") && (n.toElement().attribute("name") == "geometry")) rect = n.firstChild().toElement(); } - QDomElement x = rect.namedItem("x").toElement(); + TQDomElement x = rect.namedItem("x").toElement(); x.removeChild(x.firstChild()); - QDomText valueX = el.ownerDocument().createTextNode(QString::number(newpos.x())); + TQDomText valueX = el.ownerDocument().createTextNode(TQString::number(newpos.x())); x.appendChild(valueX); - QDomElement y = rect.namedItem("y").toElement(); + TQDomElement y = rect.namedItem("y").toElement(); y.removeChild(y.firstChild()); - QDomText valueY = el.ownerDocument().createTextNode(QString::number(newpos.y())); + TQDomText valueY = el.ownerDocument().createTextNode(TQString::number(newpos.y())); y.appendChild(valueY); //return el; } void -PasteWidgetCommand::fixPos(QDomElement &el, Container *container) +PasteWidgetCommand::fixPos(TQDomElement &el, Container *container) { -/* QDomElement rect; - for(QDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) +/* TQDomElement rect; + for(TQDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) { if((n.toElement().tagName() == "property") && (n.toElement().attribute("name") == "geometry")) rect = n.firstChild().toElement(); } - QDomElement x = rect.namedItem("x").toElement(); - QDomElement y = rect.namedItem("y").toElement(); - QDomElement wi = rect.namedItem("width").toElement(); - QDomElement h = rect.namedItem("height").toElement(); + TQDomElement x = rect.namedItem("x").toElement(); + TQDomElement y = rect.namedItem("y").toElement(); + TQDomElement wi = rect.namedItem("width").toElement(); + TQDomElement h = rect.namedItem("height").toElement(); int rx = x.text().toInt(); int ry = y.text().toInt(); int rw = wi.text().toInt(); int rh = h.text().toInt(); - QRect r(rx, ry, rw, rh); + TQRect r(rx, ry, rw, rh); - QWidget *w = m_form->widget()->childAt(r.x() + 6, r.y() + 6, false); + TQWidget *w = m_form->widget()->tqchildAt(r.x() + 6, r.y() + 6, false); if(!w) return; - while((w->geometry() == r) && (w != 0))// there is already a widget there, with the same size + while((w->tqgeometry() == r) && (w != 0))// there is already a widget there, with the same size { - w = m_form->widget()->childAt(w->x() + 16, w->y() + 16, false); + w = m_form->widget()->tqchildAt(w->x() + 16, w->y() + 16, false); r.moveBy(10,10); } @@ -1270,41 +1270,41 @@ PasteWidgetCommand::fixPos(QDomElement &el, Container *container) else if(r.bottom() > container->widget()->height()) r.moveTop(container->widget()->height() - r.height()); - if(r != QRect(rx, ry, rw, rh)) + if(r != TQRect(rx, ry, rw, rh)) //return el; //else - changePos(el, QPoint(r.x(), r.y())); + changePos(el, TQPoint(r.x(), r.y())); */ - moveWidgetBy(el, container, QPoint(0, 0)); + moveWidgetBy(el, container, TQPoint(0, 0)); } void -PasteWidgetCommand::moveWidgetBy(QDomElement &el, Container *container, const QPoint &p) +PasteWidgetCommand::moveWidgetBy(TQDomElement &el, Container *container, const TQPoint &p) { - QDomElement rect; - for(QDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) + TQDomElement rect; + for(TQDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) { if((n.toElement().tagName() == "property") && (n.toElement().attribute("name") == "geometry")) rect = n.firstChild().toElement(); } - QDomElement x = rect.namedItem("x").toElement(); - QDomElement y = rect.namedItem("y").toElement(); - QDomElement wi = rect.namedItem("width").toElement(); - QDomElement h = rect.namedItem("height").toElement(); + TQDomElement x = rect.namedItem("x").toElement(); + TQDomElement y = rect.namedItem("y").toElement(); + TQDomElement wi = rect.namedItem("width").toElement(); + TQDomElement h = rect.namedItem("height").toElement(); int rx = x.text().toInt(); int ry = y.text().toInt(); int rw = wi.text().toInt(); int rh = h.text().toInt(); - QRect r(rx + p.x(), ry + p.y(), rw, rh); + TQRect r(rx + p.x(), ry + p.y(), rw, rh); kdDebug() << "Moving widget by " << p << " from " << rx << " " << ry << " to " << r.topLeft() << endl; - QWidget *w = m_form->widget()->childAt(r.x() + 6, r.y() + 6, false); + TQWidget *w = m_form->widget()->tqchildAt(r.x() + 6, r.y() + 6, false); - while(w && (w->geometry() == r))// there is already a widget there, with the same size + while(w && (w->tqgeometry() == r))// there is already a widget there, with the same size { - w = m_form->widget()->childAt(w->x() + 16, w->y() + 16, false); + w = m_form->widget()->tqchildAt(w->x() + 16, w->y() + 16, false); r.moveBy(10,10); } @@ -1319,17 +1319,17 @@ PasteWidgetCommand::moveWidgetBy(QDomElement &el, Container *container, const QP else if(r.bottom() > container->widget()->height()) r.moveTop(container->widget()->height() - r.height()); - if(r != QRect(rx, ry, rw, rh)) + if(r != TQRect(rx, ry, rw, rh)) //return el; //else - changePos(el, QPoint(r.x(), r.y())); + changePos(el, TQPoint(r.x(), r.y())); } void -PasteWidgetCommand::fixNames(QDomElement &el) +PasteWidgetCommand::fixNames(TQDomElement &el) { - QString wname; - for(QDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) + TQString wname; + for(TQDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) { if((n.toElement().tagName() == "property") && (n.toElement().attribute("name") == "name")) { @@ -1339,15 +1339,15 @@ PasteWidgetCommand::fixNames(QDomElement &el) bool ok; int num = wname.right(1).toInt(&ok, 10); if(ok) - wname = wname.left(wname.length()-1) + QString::number(num+1); + wname = wname.left(wname.length()-1) + TQString::number(num+1); else wname += "2"; } if(wname != n.toElement().text()) // we change the name, so we recreate the element { n.removeChild(n.firstChild()); - QDomElement type = el.ownerDocument().createElement("string"); - QDomText valueE = el.ownerDocument().createTextNode(wname); + TQDomElement type = el.ownerDocument().createElement("string"); + TQDomText valueE = el.ownerDocument().createTextNode(wname); type.appendChild(valueE); n.toElement().appendChild(type); } @@ -1355,7 +1355,7 @@ PasteWidgetCommand::fixNames(QDomElement &el) } if(n.toElement().tagName() == "widget") // fix child widgets names { - QDomElement child = n.toElement(); + TQDomElement child = n.toElement(); fixNames(child); } } @@ -1375,17 +1375,17 @@ PasteWidgetCommand::debug() DeleteWidgetCommand::DeleteWidgetCommand(WidgetList &list, Form *form) : Command(), m_form(form) { - m_domDoc = QDomDocument("UI"); + m_domDoc = TQDomDocument("UI"); m_domDoc.appendChild(m_domDoc.createElement("UI")); - QDomElement parent = m_domDoc.namedItem("UI").toElement(); + TQDomElement tqparent = m_domDoc.namedItem("UI").toElement(); - //for(QWidget *w = list.first(); w; w = list.next()) + //for(TQWidget *w = list.first(); w; w = list.next()) /*for(WidgetListIterator it(list); it.current() != 0; ++it) { - QWidget *w = it.current(); + TQWidget *w = it.current(); // Don't delete tabwidget or widgetstack pages - if(w->parentWidget()->inherits("QWidgetStack")) + if(w->tqparentWidget()->inherits(TQWIDGETSTACK_OBJECT_NAME_STRING)) { list.remove(w); continue; @@ -1399,14 +1399,14 @@ DeleteWidgetCommand::DeleteWidgetCommand(WidgetList &list, Form *form) if (!item) return; - // We need to store both parentContainer and parentWidget as they may be different (eg for TabWidget page) - m_containers.insert(item->name().latin1(), m_form->parentContainer(item->widget())->widget()->name()); - m_parents.insert(item->name().latin1(), item->parent()->name().latin1()); - FormIO::saveWidget(item, parent, m_domDoc); + // We need to store both tqparentContainer and tqparentWidget as they may be different (eg for TabWidget page) + m_containers.insert(item->name().latin1(), m_form->tqparentContainer(item->widget())->widget()->name()); + m_parents.insert(item->name().latin1(), item->tqparent()->name().latin1()); + FormIO::saveWidget(item, tqparent, m_domDoc); form->connectionBuffer()->saveAllConnectionsForWidget(item->widget()->name(), m_domDoc); } - FormIO::cleanClipboard(parent); + FormIO::cleanClipboard(tqparent); } void @@ -1414,19 +1414,19 @@ DeleteWidgetCommand::execute() { Container *containerToSelect = 0; - QMap<QCString,QCString>::ConstIterator endIt = m_containers.constEnd(); - for(QMap<QCString,QCString>::ConstIterator it = m_containers.constBegin(); it != endIt; ++it) + TQMap<TQCString,TQCString>::ConstIterator endIt = m_containers.constEnd(); + for(TQMap<TQCString,TQCString>::ConstIterator it = m_containers.constBegin(); it != endIt; ++it) { ObjectTreeItem *item = m_form->objectTree()->lookup(it.key()); if (!item || !item->widget()) continue; - Container *cont = m_form->parentContainer(item->widget()); + Container *cont = m_form->tqparentContainer(item->widget()); if (!containerToSelect) containerToSelect = cont; cont->deleteWidget(item->widget()); } - //now we've nothing selecte: select parent container + //now we've nothing selecte: select tqparent container if (containerToSelect) m_form->setSelectedWidget( containerToSelect->widget() ); } @@ -1434,16 +1434,16 @@ DeleteWidgetCommand::execute() void DeleteWidgetCommand::unexecute() { - QCString wname; + TQCString wname; m_form->setInteractiveMode(false); - for(QDomNode n = m_domDoc.namedItem("UI").firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = m_domDoc.namedItem("UI").firstChild(); !n.isNull(); n = n.nextSibling()) { if(n.toElement().tagName() == "connections") // restore the widget connections m_form->connectionBuffer()->load(n); if(n.toElement().tagName() != "widget") continue; // We need first to know the name of the widget - for(QDomNode m = n.firstChild(); !m.isNull(); n = m.nextSibling()) + for(TQDomNode m = n.firstChild(); !m.isNull(); n = m.nextSibling()) { if((m.toElement().tagName() == "property") && (m.toElement().attribute("name") == "name")) { @@ -1456,17 +1456,17 @@ DeleteWidgetCommand::unexecute() if (!titem) return; //better this than a crash Container *cont = titem->container(); - ObjectTreeItem *parent = m_form->objectTree()->lookup(m_parents[wname]); - QDomElement widg = n.toElement(); - if(parent) - FormIO::loadWidget(cont, widg, parent->widget()); + ObjectTreeItem *tqparent = m_form->objectTree()->lookup(m_parents[wname]); + TQDomElement widg = n.toElement(); + if(tqparent) + FormIO::loadWidget(cont, widg, tqparent->widget()); else FormIO::loadWidget(cont, widg); } m_form->setInteractiveMode(true); } -QString +TQString DeleteWidgetCommand::name() const { return i18n("Delete widget"); @@ -1476,7 +1476,7 @@ void DeleteWidgetCommand::debug() { kdDebug() << "DeleteWidgetCommand: containers=" << m_containers.keys() - << " parents=" << m_parents.keys() << " form=" << m_form->widget()->name() << endl; + << " tqparents=" << m_parents.keys() << " form=" << m_form->widget()->name() << endl; } // CutWidgetCommand @@ -1500,7 +1500,7 @@ CutWidgetCommand::unexecute() FormManager::self()->m_domDoc.setContent(m_data); } -QString +TQString CutWidgetCommand::name() const { return i18n("Cut"); @@ -1510,7 +1510,7 @@ void CutWidgetCommand::debug() { kdDebug() << "CutWidgetCommand: containers=" << m_containers.keys() - << " parents=" << m_parents.keys() << " form=" << m_form->widget()->name() + << " tqparents=" << m_parents.keys() << " form=" << m_form->widget()->name() << " data=\"" << m_data.left(80) << "...\"" << endl; } @@ -1520,15 +1520,15 @@ namespace KFormDesigner { class CommandGroup::SubCommands : public KMacroCommand { public: - SubCommands( const QString & name ) + SubCommands( const TQString & name ) : KMacroCommand(name) { } - const QPtrList<KCommand>& commands() const { return m_commands; } + const TQPtrList<KCommand>& commands() const { return m_commands; } }; } -CommandGroup::CommandGroup( const QString & name, WidgetPropertySet *propSet ) +CommandGroup::CommandGroup( const TQString & name, WidgetPropertySet *propSet ) : Command() , m_subCommands(new SubCommands(name)) , m_propSet(propSet) @@ -1540,7 +1540,7 @@ CommandGroup::~CommandGroup() delete m_subCommands; } -const QPtrList<KCommand>& CommandGroup::commands() const +const TQPtrList<KCommand>& CommandGroup::commands() const { return m_subCommands->commands(); } @@ -1558,7 +1558,7 @@ void CommandGroup::addCommand(KCommand *command, bool allowExecute) void CommandGroup::execute() { FormManager::self()->blockPropertyEditorUpdating(this); - for (QPtrListIterator<KCommand> it(m_subCommands->commands()); it.current(); ++it) { + for (TQPtrListIterator<KCommand> it(m_subCommands->commands()); it.current(); ++it) { if (!m_commandsShouldntBeExecuted[it.current()]) it.current()->execute(); } @@ -1572,7 +1572,7 @@ void CommandGroup::unexecute() FormManager::self()->unblockPropertyEditorUpdating(this, m_propSet); } -QString CommandGroup::name() const +TQString CommandGroup::name() const { return m_subCommands->name(); } @@ -1587,7 +1587,7 @@ CommandGroup::debug() { kdDebug() << "*CommandGroup: name=\"" << name() << "\" #=" << m_subCommands->commands().count() << endl; uint i = 1; - for (QPtrListIterator<KCommand> it(m_subCommands->commands()); it.current(); ++it, i++) { + for (TQPtrListIterator<KCommand> it(m_subCommands->commands()); it.current(); ++it, i++) { kdDebug() << "#" << i << ":" << (m_commandsShouldntBeExecuted[it.current()] ? "!" : "") << "allowExecute:" << endl; if (dynamic_cast<Command*>(it.current())) |