diff options
Diffstat (limited to 'kexi/formeditor')
58 files changed, 3749 insertions, 3705 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())) diff --git a/kexi/formeditor/commands.h b/kexi/formeditor/commands.h index 619ef791..c38f9b86 100644 --- a/kexi/formeditor/commands.h +++ b/kexi/formeditor/commands.h @@ -21,21 +21,21 @@ #ifndef KFORMEDITOR_COMMANDS_H #define KFORMEDITOR_COMMANDS_H -#include <qmap.h> -#include <qdict.h> -#include <qptrlist.h> -#include <qptrdict.h> -#include <qvariant.h> -#include <qdom.h> +#include <tqmap.h> +#include <tqdict.h> +#include <tqptrlist.h> +#include <tqptrdict.h> +#include <tqvariant.h> +#include <tqdom.h> #include <kcommand.h> #include "utils.h" -class QWidget; -class QRect; -class QPoint; -class QStringList; -class QCString; +class TQWidget; +class TQRect; +class TQPoint; +class TQStringList; +class TQCString; namespace KFormDesigner { @@ -54,32 +54,32 @@ class KFORMEDITOR_EXPORT Command : public KCommand virtual void debug() = 0; }; -/*! This command is used when changing a property for one or more widgets. \a oldvalues is a QMap +/*! This command is used when changing a property for one or more widgets. \a oldvalues is a TQMap of the old values of the property for every widget, to allow reverting the change. \a value is the new value of the property. You can use the simpler constructor for a single widget. */ class KFORMEDITOR_EXPORT PropertyCommand : public Command { public: - PropertyCommand(WidgetPropertySet *set, const QCString &wname, const QVariant &oldValue, - const QVariant &value, const QCString &property); - PropertyCommand(WidgetPropertySet *set, const QMap<QCString, QVariant> &oldvalues, - const QVariant &value, const QCString &property); + PropertyCommand(WidgetPropertySet *set, const TQCString &wname, const TQVariant &oldValue, + const TQVariant &value, const TQCString &property); + PropertyCommand(WidgetPropertySet *set, const TQMap<TQCString, TQVariant> &oldvalues, + const TQVariant &value, const TQCString &property); virtual void execute(); virtual void unexecute(); - virtual QString name() const; - QCString property() const { return m_property; } + virtual TQString name() const; + TQCString property() const { return m_property; } - void setValue(const QVariant &value); - const QMap<QCString, QVariant>& oldValues() const { return m_oldvalues; } + void setValue(const TQVariant &value); + const TQMap<TQCString, TQVariant>& oldValues() const { return m_oldvalues; } virtual void debug(); protected: WidgetPropertySet *m_propSet; - QVariant m_value; - QMap<QCString, QVariant> m_oldvalues; - QCString m_property; + TQVariant m_value; + TQMap<TQCString, TQVariant> m_oldvalues; + TQCString m_property; }; /*! This command is used when moving multiples widgets at the same time, while holding Ctrl or Shift. @@ -88,24 +88,24 @@ class KFORMEDITOR_EXPORT PropertyCommand : public Command class KFORMEDITOR_EXPORT GeometryPropertyCommand : public Command { public: - GeometryPropertyCommand(WidgetPropertySet *set, const QStringList &names, const QPoint& oldPos); + GeometryPropertyCommand(WidgetPropertySet *set, const TQStringList &names, const TQPoint& oldPos); virtual void execute(); virtual void unexecute(); - virtual QString name() const; - void setPos(const QPoint& pos); + virtual TQString name() const; + void setPos(const TQPoint& pos); virtual void debug(); protected: WidgetPropertySet *m_propSet; - QStringList m_names; - QPoint m_oldPos; - QPoint m_pos; + TQStringList m_names; + TQPoint m_oldPos; + TQPoint m_pos; }; /*! This command is used when an item in 'Align Widgets position' is selected. You just need to give the list of widget names (the selected ones), and the - type of alignment (see the enum for possible values). */ + type of tqalignment (see the enum for possible values). */ class KFORMEDITOR_EXPORT AlignWidgetsCommand : public Command { public: @@ -115,13 +115,13 @@ class KFORMEDITOR_EXPORT AlignWidgetsCommand : public Command virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: Form *m_form; int m_type; - QMap<QCString, QPoint> m_pos; + TQMap<TQCString, TQPoint> m_pos; }; /*! This command is used when an item in 'Adjust Widgets Size' is selected. You just need @@ -137,39 +137,39 @@ class KFORMEDITOR_EXPORT AdjustSizeCommand : public Command virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: - QSize getSizeFromChildren(ObjectTreeItem *item); + TQSize getSizeFromChildren(ObjectTreeItem *item); protected: Form *m_form; int m_type; - QMap<QCString, QPoint> m_pos; - QMap<QCString, QSize> m_sizes; + TQMap<TQCString, TQPoint> m_pos; + TQMap<TQCString, TQSize> m_sizes; }; -/*! This command is used when switching the layout of a Container. It remembers the old pos +/*! This command is used when switching the tqlayout of a Container. It remembers the old pos of every widget inside the Container. */ class KFORMEDITOR_EXPORT LayoutPropertyCommand : public PropertyCommand { public: - LayoutPropertyCommand(WidgetPropertySet *set, const QCString &wname, - const QVariant &oldValue, const QVariant &value); + LayoutPropertyCommand(WidgetPropertySet *set, const TQCString &wname, + const TQVariant &oldValue, const TQVariant &value); virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: Form *m_form; - QMap<QCString,QRect> m_geometries; + TQMap<TQCString,TQRect> m_geometries; }; /*! This command is used when inserting a widger using toolbar or menu. You only need to give -the parent Container and the widget pos. +the tqparent Container and the widget pos. The other information is taken from FormManager. */ class KFORMEDITOR_EXPORT InsertWidgetCommand : public Command { @@ -183,45 +183,45 @@ class KFORMEDITOR_EXPORT InsertWidgetCommand : public Command otherwise, \a namePrefix is used to generate widget's name. This allows e.g. inserting a widgets having name constructed using */ - InsertWidgetCommand(Container *container, const QCString& className, - const QPoint& pos, const QCString& namePrefix = QCString()); + InsertWidgetCommand(Container *container, const TQCString& className, + const TQPoint& pos, const TQCString& namePrefix = TQCString()); virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); //! \return inserted widget's name - QCString widgetName() const { return m_name; } + TQCString widgetName() const { return m_name; } protected: Form *m_form; - QString m_containername; - QPoint m_point; - QCString m_name; - QCString m_class; - QRect m_insertRect; + TQString m_containername; + TQPoint m_point; + TQCString m_name; + TQCString m_class; + TQRect m_insertRect; }; -/*! This command is used when creating a layout from some widgets using "Lay out in..." menu item. +/*! This command is used when creating a tqlayout from some widgets using "Lay out in..." menu item. It remembers the old pos of every widget, and takes care of updating ObjectTree too. You need to supply a WidgetList of the selected widgets. */ class KFORMEDITOR_EXPORT CreateLayoutCommand : public Command { public: - CreateLayoutCommand(int layoutType, WidgetList &list, Form *form); + CreateLayoutCommand(int tqlayoutType, WidgetList &list, Form *form); CreateLayoutCommand() {;} // for BreakLayoutCommand virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: Form *m_form; - QString m_containername; - QString m_name; - QMap<QCString,QRect> m_pos; + TQString m_containername; + TQString m_name; + TQMap<TQCString,TQRect> m_pos; int m_type; }; @@ -234,46 +234,46 @@ class KFORMEDITOR_EXPORT BreakLayoutCommand : public CreateLayoutCommand virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); }; -/*! This command is used when pasting widgets. You need to give the QDomDocument containing +/*! This command is used when pasting widgets. You need to give the TQDomDocument containing the widget(s) to paste, and optionnally the point where to paste widgets. */ class KFORMEDITOR_EXPORT PasteWidgetCommand : public Command { public: - PasteWidgetCommand(QDomDocument &domDoc, Container *container, const QPoint& p = QPoint()); + PasteWidgetCommand(TQDomDocument &domDoc, Container *container, const TQPoint& p = TQPoint()); virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: /*! Internal function used to change the coordinates of a widget to \a newpos before pasting it (to paste it at the position of the contextual menu). It modifies - the "geometry" property of the QDomElement representing the widget. */ - void changePos(QDomElement &widg, const QPoint &newpos); + the "geometry" property of the TQDomElement representing the widget. */ + void changePos(TQDomElement &widg, const TQPoint &newpos); /*! Internal function used to fix the coordinates of a widget before pasting it (to avoid having two widgets at the same position). It moves the widget by (10, 10) increment (several times if there are already pasted widgets at this position). */ - void fixPos(QDomElement &el, Container *container); - void moveWidgetBy(QDomElement &el, Container *container, const QPoint &p); + void fixPos(TQDomElement &el, Container *container); + void moveWidgetBy(TQDomElement &el, Container *container, const TQPoint &p); /*! Internal function used to fix the names of the widgets before pasting them. It prevents from pasting a widget with the same name as an actual widget. The child widgets are also fixed recursively.\n - If the name of the widget ends with a number (eg "QLineEdit1"), the new name is - just incremented by one (eg becomes "QLineEdit2"). Otherwise, a "2" is just + If the name of the widget ends with a number (eg "TQLineEdit1"), the new name is + just incremented by one (eg becomes "TQLineEdit2"). Otherwise, a "2" is just appended at the end of the name (eg "myWidget" becomes "myWidget2"). */ - void fixNames(QDomElement &el); + void fixNames(TQDomElement &el); protected: Form *m_form; - QCString m_data; - QString m_containername; - QPoint m_point; - QStringList m_names; + TQCString m_data; + TQString m_containername; + TQPoint m_point; + TQStringList m_names; }; /*! This command is used when deleting a widget using the "Delete" menu item. @@ -285,14 +285,14 @@ class KFORMEDITOR_EXPORT DeleteWidgetCommand : public Command virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: - QDomDocument m_domDoc; + TQDomDocument m_domDoc; Form *m_form; - QMap<QCString, QCString> m_containers; - QMap<QCString, QCString> m_parents; + TQMap<TQCString, TQCString> m_containers; + TQMap<TQCString, TQCString> m_parents; }; /*! This command is used when cutting widgets. It is basically a DeleteWidgetCommand @@ -304,11 +304,11 @@ class KFORMEDITOR_EXPORT CutWidgetCommand : public DeleteWidgetCommand virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; virtual void debug(); protected: - QCString m_data; + TQCString m_data; }; /*! A Command Group is a command that holds several subcommands. @@ -321,7 +321,7 @@ class KFORMEDITOR_EXPORT CutWidgetCommand : public DeleteWidgetCommand class KFORMEDITOR_EXPORT CommandGroup : public Command { public: - CommandGroup( const QString & name, WidgetPropertySet *propSet ); + CommandGroup( const TQString & name, WidgetPropertySet *propSet ); virtual ~CommandGroup(); /*! Like KmacroCommand::addCommand(KCommand*) @@ -352,12 +352,12 @@ class KFORMEDITOR_EXPORT CommandGroup : public Command (in reversed order). */ virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; /*! \return a list of all subcommands of this group. Note that if a given subcommand is a group itself, it will not be expanded to subcommands on this list. */ - const QPtrList<KCommand>& commands() const; + const TQPtrList<KCommand>& commands() const; /*! Resets all 'allowExecute' flags that was set in addCommand(). Call this after calling CommandGroup::execute() to ensure that @@ -371,7 +371,7 @@ class KFORMEDITOR_EXPORT CommandGroup : public Command SubCommands *m_subCommands; //! Used to store pointers to subcommands that shouldn't be executed //! on CommandGroup::execute() - QPtrDict<char> m_commandsShouldntBeExecuted; + TQPtrDict<char> m_commandsShouldntBeExecuted; WidgetPropertySet *m_propSet; }; diff --git a/kexi/formeditor/connectiondialog.cpp b/kexi/formeditor/connectiondialog.cpp index a40348e7..03302d3a 100644 --- a/kexi/formeditor/connectiondialog.cpp +++ b/kexi/formeditor/connectiondialog.cpp @@ -18,12 +18,12 @@ * Boston, MA 02110-1301, USA. */ -#include <qlayout.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qregexp.h> -#include <qmetaobject.h> -#include <qstrlist.h> +#include <tqlayout.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqregexp.h> +#include <tqmetaobject.h> +#include <tqstrlist.h> #include <kpushbutton.h> #include <kiconloader.h> @@ -45,25 +45,25 @@ namespace KFormDesigner { ///////////////////////////////////////////////////////////////////////////////// ///////////// The dialog to edit or add/remove connections ////////////////////// ///////////////////////////////////////////////////////////////////////////////// -ConnectionDialog::ConnectionDialog(QWidget *parent) -: KDialogBase(parent, "connections_dialog", true, i18n("Edit Form Connections"), +ConnectionDialog::ConnectionDialog(TQWidget *tqparent) +: KDialogBase(tqparent, "connections_dialog", true, i18n("Edit Form Connections"), Ok|Cancel|Details, Ok, false) , m_buffer(0) { - QFrame *frame = makeMainWidget(); - QHBoxLayout *layout = new QHBoxLayout(frame, 0, 6); + TQFrame *frame = makeMainWidget(); + TQHBoxLayout *tqlayout = new TQHBoxLayout(frame, 0, 6); // Setup the details widget ///////// - QHBox *details = new QHBox(frame); + TQHBox *details = new TQHBox(frame); setDetailsWidget(details); setDetails(true); - m_pixmapLabel = new QLabel(details); + m_pixmapLabel = new TQLabel(details); m_pixmapLabel->setFixedWidth( int(IconSize(KIcon::Desktop) * 1.5) ); - m_pixmapLabel->setAlignment(AlignHCenter | AlignTop); + m_pixmapLabel->tqsetAlignment(AlignHCenter | AlignTop); - m_textLabel = new QLabel(details); - m_textLabel->setAlignment(AlignLeft | AlignTop); + m_textLabel = new TQLabel(details); + m_textLabel->tqsetAlignment(AlignLeft | AlignTop); //setStatusOk(); // And the KexiTableView //////// @@ -74,27 +74,27 @@ ConnectionDialog::ConnectionDialog(QWidget *parent) initTable(); m_table->setData(m_data, false); m_table->adjustColumnWidthToContents(0); - layout->addWidget(m_table); + tqlayout->addWidget(m_table); //// Setup the icon toolbar ///////////////// - QVBoxLayout *vlayout = new QVBoxLayout(layout, 3); + TQVBoxLayout *vtqlayout = new TQVBoxLayout(tqlayout, 3); KPushButton *newItem = new KPushButton(SmallIconSet("filenew"), i18n("&New Connection"), frame); - vlayout->addWidget(newItem); + vtqlayout->addWidget(newItem); m_buttons.insert(BAdd, newItem); - connect(newItem, SIGNAL(clicked()), this, SLOT(newItem())); + connect(newItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(newItem())); KPushButton *delItem = new KPushButton(SmallIconSet("editdelete"), i18n("&Remove Connection"), frame); - vlayout->addWidget(delItem); + vtqlayout->addWidget(delItem); m_buttons.insert(BRemove, delItem); - connect(delItem, SIGNAL(clicked()), this, SLOT(removeItem())); + connect(delItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeItem())); - vlayout->addStretch(); + vtqlayout->addStretch(); - setInitialSize(QSize(600, 300)); + setInitialSize(TQSize(600, 300)); //setWFlags(WDestructiveClose); - connect(m_table,SIGNAL(cellSelected(int, int)), this, SLOT(slotCellSelected(int, int))); - connect(m_table->data(), SIGNAL(rowInserted(KexiTableItem*,bool)), this, SLOT(slotRowInserted(KexiTableItem*,bool))); + connect(m_table,TQT_SIGNAL(cellSelected(int, int)), this, TQT_SLOT(slotCellSelected(int, int))); + connect(m_table->KexiDataAwareObjectInterface::data(), TQT_SIGNAL(rowInserted(KexiTableItem*,bool)), this, TQT_SLOT(slotRowInserted(KexiTableItem*,bool))); this->newItem(); } @@ -126,15 +126,15 @@ ConnectionDialog::initTable() col4->setRelatedData( m_slotsColumnData ); m_data->addColumn(col4); - QValueList<int> c; + TQValueList<int> c; c << 2 << 4; m_table->maximizeColumnsWidth(c); m_table->setColumnStretchEnabled( true, 4 ); - connect(m_data, SIGNAL(aboutToChangeCell(KexiTableItem*, int, QVariant&, KexiDB::ResultInfo*)), - this,SLOT(slotCellChanged(KexiTableItem*, int, QVariant, KexiDB::ResultInfo*))); - connect(m_data, SIGNAL(rowUpdated(KexiTableItem*)), this, SLOT(checkConnection(KexiTableItem *))); - connect(m_table, SIGNAL(itemSelected(KexiTableItem *)), this, SLOT(checkConnection(KexiTableItem *))); + connect(m_data, TQT_SIGNAL(aboutToChangeCell(KexiTableItem*, int, TQVariant&, KexiDB::ResultInfo*)), + this,TQT_SLOT(slotCellChanged(KexiTableItem*, int, TQVariant, KexiDB::ResultInfo*))); + connect(m_data, TQT_SIGNAL(rowUpdated(KexiTableItem*)), this, TQT_SLOT(checkConnection(KexiTableItem *))); + connect(m_table, TQT_SIGNAL(itemSelected(KexiTableItem *)), this, TQT_SLOT(checkConnection(KexiTableItem *))); } void @@ -183,7 +183,7 @@ ConnectionDialog::slotOk() delete m_form->connectionBuffer(); m_form->setConnectionBuffer(m_buffer); - QDialog::accept(); + TQDialog::accept(); } void @@ -204,7 +204,7 @@ ConnectionDialog::updateTableData() // Then we fill the columns with the form connections for(Connection *c = m_form->connectionBuffer()->first(); c ; c = m_form->connectionBuffer()->next()) { - KexiTableItem *item = m_table->data()->createItem(); //new KexiTableItem(5); + KexiTableItem *item = m_table->KexiDataAwareObjectInterface::data()->createItem(); //new KexiTableItem(5); (*item)[1] = c->sender(); (*item)[2] = c->signal(); (*item)[3] = c->receiver(); @@ -229,13 +229,13 @@ ConnectionDialog::setStatusOk(KexiTableItem *item) if (item) (*item)[0] = "button_ok"; else { - m_pixmapLabel->setPixmap( QPixmap() ); - m_textLabel->setText(QString::null); + m_pixmapLabel->setPixmap( TQPixmap() ); + m_textLabel->setText(TQString()); } } void -ConnectionDialog::setStatusError(const QString &msg, KexiTableItem *item) +ConnectionDialog::setStatusError(const TQString &msg, KexiTableItem *item) { m_pixmapLabel->setPixmap( DesktopIcon("button_cancel") ); m_textLabel->setText("<qt><h2>The connection is invalid.</h2></qt>" + msg); @@ -248,24 +248,24 @@ ConnectionDialog::setStatusError(const QString &msg, KexiTableItem *item) if (item) (*item)[0] = "button_cancel"; else { - m_pixmapLabel->setPixmap( QPixmap() ); - m_textLabel->setText(QString::null); + m_pixmapLabel->setPixmap( TQPixmap() ); + m_textLabel->setText(TQString()); } } void -ConnectionDialog::slotCellChanged(KexiTableItem *item, int col, QVariant&, KexiDB::ResultInfo*) +ConnectionDialog::slotCellChanged(KexiTableItem *item, int col, TQVariant&, KexiDB::ResultInfo*) { switch(col) { // sender changed, we clear siganl and slot case 1: - (*item)[2] = QString(""); + (*item)[2] = TQString(""); // signal or receiver changed, we clear the slot cell case 2: case 3: { - (*item)[4] = QString(""); + (*item)[4] = TQString(""); break; } default: @@ -277,8 +277,8 @@ void ConnectionDialog::updateSlotList(KexiTableItem *item) { m_slotsColumnData->deleteAllRows(); - QString widget = (*item)[1].toString(); - QString signal = (*item)[2].toString(); + TQString widget = (*item)[1].toString(); + TQString signal = (*item)[2].toString(); if((widget.isEmpty()) || signal.isEmpty()) return; @@ -286,22 +286,22 @@ ConnectionDialog::updateSlotList(KexiTableItem *item) if(!tree || !tree->widget()) return; - QString signalArg(signal); - signalArg = signalArg.remove( QRegExp(".*[(]|[)]") ); + TQString signalArg(signal); + signalArg = signalArg.remove( TQRegExp(".*[(]|[)]") ); - QStrList slotList = tree->widget()->metaObject()->slotNames(true); - QStrListIterator it(slotList); + TQStrList slotList = tree->widget()->tqmetaObject()->slotNames(true); + TQStrListIterator it(slotList); for(; it.current() != 0; ++it) { // we add the slot only if it is compatible with the signal - QString slotArg(*it); - slotArg = slotArg.remove( QRegExp(".*[(]|[)]") ); + TQString slotArg(*it); + slotArg = slotArg.remove( TQRegExp(".*[(]|[)]") ); - if(!signalArg.startsWith(slotArg, true) && (!signal.isEmpty())) // args not compatible + if(!signalArg.tqstartsWith(slotArg, true) && (!signal.isEmpty())) // args not compatible continue; KexiTableItem *item = m_slotsColumnData->createItem(); //new KexiTableItem(2); - (*item)[0] = QString(*it); + (*item)[0] = TQString(*it); (*item)[1] = (*item)[0]; m_slotsColumnData->append(item); } @@ -315,12 +315,12 @@ ConnectionDialog::updateSignalList(KexiTableItem *item) return; m_signalsColumnData->deleteAllRows(); - QStrList signalList = tree->widget()->metaObject()->signalNames(true); - QStrListIterator it(signalList); + TQStrList signalList = tree->widget()->tqmetaObject()->signalNames(true); + TQStrListIterator it(signalList); for(; it.current() != 0; ++it) { KexiTableItem *item = m_signalsColumnData->createItem(); //new KexiTableItem(2); - (*item)[0] = QString(*it); + (*item)[0] = TQString(*it); (*item)[1] = (*item)[0]; m_signalsColumnData->append(item); } @@ -334,19 +334,19 @@ ConnectionDialog::checkConnection(KexiTableItem *item) { if( !item || (*item)[i].toString().isEmpty()) { - setStatusError( i18n("<qt>You have not selected item: <b>%1</b>.</qt>").arg(m_data->column(i)->captionAliasOrName()), + setStatusError( i18n("<qt>You have not selected item: <b>%1</b>.</qt>").tqarg(m_data->column(i)->captionAliasOrName()), item); return; } } // Then we check if signal/slot args are compatible - QString signal = (*item)[2].toString(); - signal = signal.remove( QRegExp(".*[(]|[)]") ); // just keep the args list - QString slot = (*item)[4].toString(); - slot = slot.remove( QRegExp(".*[(]|[)]") ); + TQString signal = (*item)[2].toString(); + signal = signal.remove( TQRegExp(".*[(]|[)]") ); // just keep the args list + TQString slot = (*item)[4].toString(); + slot = slot.remove( TQRegExp(".*[(]|[)]") ); - if(!signal.startsWith(slot, true)) + if(!signal.tqstartsWith(slot, true)) { setStatusError( i18n("The signal/slot arguments are not compatible."), item); return; @@ -366,8 +366,8 @@ void ConnectionDialog::newItemByDragnDrop() { KFormDesigner::FormManager::self()->startCreatingConnection(); - connect(KFormDesigner::FormManager::self(), SIGNAL(connectionAborted(KFormDesigner::Form*)), this, SLOT(slotConnectionAborted(KFormDesigner::Form*))); - connect(KFormDesigner::FormManager::self(), SIGNAL(connectionCreated(KFormDesigner::Form*, Connection&)), this, SLOT(slotConnectionCreated(KFormDesigner::Form*, Connection&)) ); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(connectionAborted(KFormDesigner::Form*)), this, TQT_SLOT(slotConnectionAborted(KFormDesigner::Form*))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(connectionCreated(KFormDesigner::Form*, Connection&)), this, TQT_SLOT(slotConnectionCreated(KFormDesigner::Form*, Connection&)) ); hide(); } @@ -380,7 +380,7 @@ ConnectionDialog::slotConnectionCreated(KFormDesigner::Form *form, Connection &c return; Connection *c = new Connection(connection); - KexiTableItem *item = m_table->data()->createItem(); //new KexiTableItem(5); + KexiTableItem *item = m_table->KexiDataAwareObjectInterface::data()->createItem(); //new KexiTableItem(5); (*item)[1] = c->sender(); (*item)[2] = c->signal(); (*item)[3] = c->receiver(); @@ -405,8 +405,8 @@ ConnectionDialog::removeItem() if(m_table->currentRow() == -1 || m_table->currentRow()>=m_table->rows()) return; - int confirm = KMessageBox::warningContinueCancel(parentWidget(), - QString("<qt>")+i18n("Do you want to delete this connection ?")+"</qt>", QString::null, KGuiItem(i18n("&Delete Connection")), + int confirm = KMessageBox::warningContinueCancel(tqparentWidget(), + TQString("<qt>")+i18n("Do you want to delete this connection ?")+"</qt>", TQString(), KGuiItem(i18n("&Delete Connection")), "dontAskBeforeDeleteConnection"/*config entry*/); if(confirm == KMessageBox::Cancel) return; diff --git a/kexi/formeditor/connectiondialog.h b/kexi/formeditor/connectiondialog.h index 3e6ac07b..4f1a9a28 100644 --- a/kexi/formeditor/connectiondialog.h +++ b/kexi/formeditor/connectiondialog.h @@ -21,15 +21,15 @@ #ifndef FORMCONNECTIONDIALOG_H #define FORMCONNECTIONDIALOG_H -#include <qintdict.h> +#include <tqintdict.h> #include <kdialogbase.h> namespace KexiDB { class ResultInfo; } -class QLabel; -class QButton; +class TQLabel; +class TQButton; class KexiTableView; class KexiTableViewData; class KexiTableItem; @@ -46,9 +46,10 @@ class Connection; class KFORMEDITOR_EXPORT ConnectionDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - ConnectionDialog(QWidget *parent); + ConnectionDialog(TQWidget *tqparent); ~ConnectionDialog() {;} /*! Displays as modal dialog, to edit connections in Form::connectionBuffer(). */ @@ -59,7 +60,7 @@ class KFORMEDITOR_EXPORT ConnectionDialog : public KDialogBase void setStatusOk(KexiTableItem *item = 0); /*! Used when connection is wrong. Displays a message in details widget and changes icon in 'OK?' column. \a msg is the message explaining what's wrong. */ - void setStatusError(const QString &msg, KexiTableItem *item = 0); + void setStatusError(const TQString &msg, KexiTableItem *item = 0); //! Inits table data, columns, etc. void initTable(); /*! Updates the widget list (shown in receiver and sender columns). Then fill in the table with the connections in m_buffer. */ @@ -71,7 +72,7 @@ class KFORMEDITOR_EXPORT ConnectionDialog : public KDialogBase protected slots: /*! Slot called when the user modifies a cell. Signal and/or slot cells are cleared if necessary (not valid anymore). */ - void slotCellChanged(KexiTableItem*, int, QVariant&, KexiDB::ResultInfo*); + void slotCellChanged(KexiTableItem*, int, TQVariant&, KexiDB::ResultInfo*); /*! This function checks if the connection represented by KexiTableItem \a item is valid. It checks if all args (sender, receiver, signal and slot) are given, and then if signal/slot args are compatible (should be always true, as we don't show non-compatible slots). It calls \ref setStatusOk() or \ref setStatusError() following the result of checks. */ @@ -105,8 +106,8 @@ class KFORMEDITOR_EXPORT ConnectionDialog : public KDialogBase KexiTableView *m_table; KexiTableViewData *m_data; KexiTableViewData *m_widgetsColumnData, *m_slotsColumnData, *m_signalsColumnData; - QLabel *m_pixmapLabel, *m_textLabel; - QIntDict<QButton> m_buttons; //! dict of button (for disabling them) + TQLabel *m_pixmapLabel, *m_textLabel; + TQIntDict<TQButton> m_buttons; //! dict of button (for disabling them) }; } diff --git a/kexi/formeditor/container.cpp b/kexi/formeditor/container.cpp index 75a6dea6..a68e34d2 100644 --- a/kexi/formeditor/container.cpp +++ b/kexi/formeditor/container.cpp @@ -18,13 +18,13 @@ * Boston, MA 02110-1301, USA. */ -#include <qpainter.h> -#include <qpixmap.h> -#include <qrect.h> -#include <qevent.h> -#include <qvaluevector.h> -#include <qlayout.h> -#include <qcursor.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqrect.h> +#include <tqevent.h> +#include <tqvaluevector.h> +#include <tqlayout.h> +#include <tqcursor.h> #include <kdebug.h> #include <klocale.h> @@ -44,36 +44,36 @@ using namespace KFormDesigner; -EventEater::EventEater(QWidget *widget, QObject *container) - : QObject(container) +EventEater::EventEater(TQWidget *widget, TQObject *container) + : TQObject(container) { m_widget = widget; m_container = container; - installRecursiveEventFilter(m_widget, this); + installRecursiveEventFilter(TQT_TQOBJECT(m_widget), this); } bool -EventEater::eventFilter(QObject *, QEvent *ev) +EventEater::eventFilter(TQObject *, TQEvent *ev) { if(!m_container) return false; // When the user click the empty part of tab bar, only MouseReleaseEvent is sent, // we need to simulate the Press event - if(ev->type() == QEvent::MouseButtonRelease && m_widget->inherits("QTabWidget")) + if(ev->type() == TQEvent::MouseButtonRelease && m_widget->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) { - QMouseEvent *mev = static_cast<QMouseEvent*>(ev); - if(mev->button() == LeftButton) + TQMouseEvent *mev = TQT_TQMOUSEEVENT(ev); + if(mev->button() == Qt::LeftButton) { - QMouseEvent *myev = new QMouseEvent(QEvent::MouseButtonPress, mev->pos(), mev->button(), mev->state()); + TQMouseEvent *myev = new TQMouseEvent(TQEvent::MouseButtonPress, mev->pos(), mev->button(), mev->state()); m_container->eventFilter(m_widget, myev); delete myev; //return true; } } -// else if(ev->type() == QEvent::ChildInserted) { - // widget's children have changed, we need to reinstall filter +// else if(ev->type() == TQEvent::ChildInserted) { + // widget's tqchildren have changed, we need to reinstall filter // installRecursiveEventFilter(m_widget, this); // } @@ -83,16 +83,16 @@ EventEater::eventFilter(QObject *, QEvent *ev) EventEater::~EventEater() { if(m_widget) - removeRecursiveEventFilter(m_widget, this); + removeRecursiveEventFilter(TQT_TQOBJECT(m_widget), TQT_TQOBJECT(this)); } // Container itself -Container::Container(Container *toplevel, QWidget *container, QObject *parent, const char *name) -: QObject(parent, name) +Container::Container(Container *toplevel, TQWidget *container, TQObject *tqparent, const char *name) +: TQObject(tqparent, name) , m_insertBegin(-1,-1) , m_mousePressEventReceived(false) -, m_mouseReleaseEvent(QEvent::None, QPoint(), 0, 0) +, m_mouseReleaseEvent(TQEvent::None, TQPoint(), 0, 0) { m_container = container; m_toplevel = toplevel; @@ -104,7 +104,7 @@ Container::Container(Container *toplevel, QWidget *container, QObject *parent, c m_layType = NoLayout; m_state = DoingNothing; - QCString classname = container->className(); + TQCString classname = container->className(); if((classname == "HBox") || (classname == "Grid") || (classname == "VBox") || (classname == "HFlow") || (classname == "VFlow")) m_margin = 4; // those containers don't have frames, so little margin @@ -118,19 +118,19 @@ Container::Container(Container *toplevel, QWidget *container, QObject *parent, c widget()->name(), widget(), this, this); setObjectTree(it); - if(parent->isWidgetType()) + if(tqparent->isWidgetType()) { - QString n = parent->name(); - ObjectTreeItem *parent = m_form->objectTree()->lookup(n); - m_form->objectTree()->addItem(parent, it); + TQString n = tqparent->name(); + ObjectTreeItem *tqparent = m_form->objectTree()->lookup(n); + m_form->objectTree()->addItem(tqparent, it); } else m_form->objectTree()->addItem(toplevel->objectTree(), it); - connect(toplevel, SIGNAL(destroyed()), this, SLOT(widgetDeleted())); + connect(toplevel, TQT_SIGNAL(destroyed()), this, TQT_SLOT(widgetDeleted())); } - connect(container, SIGNAL(destroyed()), this, SLOT(widgetDeleted())); + connect(container, TQT_SIGNAL(destroyed()), this, TQT_SLOT(widgetDeleted())); } Container::~Container() @@ -147,23 +147,23 @@ Container::setForm(Form *form) } bool -Container::eventFilter(QObject *s, QEvent *e) +Container::eventFilter(TQObject *s, TQEvent *e) { // kdDebug() << e->type() << endl; switch(e->type()) { - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: { - m_insertBegin = QPoint(-1, -1); + m_insertBegin = TQPoint(-1, -1); m_mousePressEventReceived = true; - kdDebug() << "QEvent::MouseButtonPress sender object = " << s->name() + kdDebug() << "TQEvent::MouseButtonPress sender object = " << s->name() << "of type " << s->className() << endl; - kdDebug() << "QEvent::MouseButtonPress this = " << name() << endl; + kdDebug() << "TQEvent::MouseButtonPress this = " << name() << endl; - m_moving = static_cast<QWidget*>(s); - QMouseEvent *mev = static_cast<QMouseEvent*>(e); - m_grab = QPoint(mev->x(), mev->y()); + m_moving = TQT_TQWIDGET(s); + TQMouseEvent *mev = TQT_TQMOUSEEVENT(e); + m_grab = TQPoint(mev->x(), mev->y()); // we are drawing a connection if(FormManager::self()->isCreatingConnection()) { @@ -174,35 +174,35 @@ Container::eventFilter(QObject *s, QEvent *e) if(((mev->state() == ControlButton) || (mev->state() == ShiftButton)) && (!FormManager::self()->isInserting())) // multiple selection mode { - if(m_form->selectedWidgets()->findRef(m_moving) != -1) // widget is already selected + if(m_form->selectedWidgets()->tqfindRef(m_moving) != -1) // widget is already selected { if(m_form->selectedWidgets()->count() > 1) // we remove it from selection unSelectWidget(m_moving); else // the widget is the only selected, so it means we want to copy it { - //m_copyRect = m_moving->geometry(); + //m_copyRect = m_moving->tqgeometry(); m_state = CopyingWidget; if(m_form->formWidget()) m_form->formWidget()->initBuffer(); } } else // the widget is not yet selected, we add it - setSelectedWidget(m_moving, true, (mev->button() == RightButton)); + setSelectedWidget(m_moving, true, (mev->button() == Qt::RightButton)); } else if((m_form->selectedWidgets()->count() > 1))//&& (!m_form->manager()->isInserting())) // more than one widget selected { - if(m_form->selectedWidgets()->findRef(m_moving) == -1) // widget is not selected, it becomes the only selected widget - setSelectedWidget(m_moving, false, (mev->button() == RightButton)); + if(m_form->selectedWidgets()->tqfindRef(m_moving) == -1) // widget is not selected, it becomes the only selected widget + setSelectedWidget(m_moving, false, (mev->button() == Qt::RightButton)); // If the widget is already selected, we do nothing (to ease widget moving, etc.) } else// if(!m_form->manager()->isInserting()) - setSelectedWidget(m_moving, false, (mev->button() == RightButton)); + setSelectedWidget(m_moving, false, (mev->button() == Qt::RightButton)); // we are inserting a widget or drawing a selection rect in the form if((/*s == m_container &&*/ FormManager::self()->isInserting()) || ((s == m_container) && !m_toplevel)) { int tmpx,tmpy; - if(!FormManager::self()->snapWidgetsToGrid() || (mev->state() == (LeftButton|ControlButton|AltButton))) + if(!FormManager::self()->snapWidgetsToGrid() || (mev->state() == (Qt::LeftButton|ControlButton|AltButton))) { tmpx = mev->x(); tmpy = mev->y(); @@ -217,7 +217,7 @@ Container::eventFilter(QObject *s, QEvent *e) tmpy *= gridX; } - m_insertBegin = (static_cast<QWidget*>(s))->mapTo(m_container, QPoint(tmpx, tmpy)); + m_insertBegin = (TQT_TQWIDGET(s))->mapTo(m_container, TQPoint(tmpx, tmpy)); if(m_form->formWidget()) m_form->formWidget()->initBuffer(); @@ -225,7 +225,7 @@ Container::eventFilter(QObject *s, QEvent *e) m_state = DrawingSelectionRect; } else { - if(s->inherits("QTabWidget")) // to allow changing page by clicking tab + if(s->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) // to allow changing page by clicking tab return false; } @@ -237,9 +237,9 @@ Container::eventFilter(QObject *s, QEvent *e) return true; } - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: { - QMouseEvent *mev = static_cast<QMouseEvent*>(e); + TQMouseEvent *mev = TQT_TQMOUSEEVENT(e); if (!m_mousePressEventReceived) { m_mouseReleaseEvent = *mev; m_objectForMouseReleaseEvent = s; @@ -250,11 +250,11 @@ Container::eventFilter(QObject *s, QEvent *e) return handleMouseReleaseEvent(s, mev); } - case QEvent::MouseMove: + case TQEvent::MouseMove: { - QMouseEvent *mev = static_cast<QMouseEvent*>(e); - if(m_insertBegin!=QPoint(-1,-1) && FormManager::self()->isInserting() && ((mev->state() == LeftButton) || (mev->state() == (LeftButton|ControlButton)) || - (mev->state() == (LeftButton|ControlButton|AltButton)) || (mev->state() == (LeftButton|ShiftButton)) ) ) + TQMouseEvent *mev = TQT_TQMOUSEEVENT(e); + if(m_insertBegin!=TQPoint(-1,-1) && FormManager::self()->isInserting() && ((mev->state() == Qt::LeftButton) || (mev->state() == (Qt::LeftButton|ControlButton)) || + (mev->state() == (Qt::LeftButton|ControlButton|AltButton)) || (mev->state() == (Qt::LeftButton|ShiftButton)) ) ) // draw the insert rect { drawInsertRect(mev, s); @@ -267,18 +267,18 @@ Container::eventFilter(QObject *s, QEvent *e) if(!tree || !tree->widget()) return true; - if(m_form->formWidget() && (tree->widget() != s)) - m_form->formWidget()->highlightWidgets(tree->widget(), static_cast<QWidget*>(s)); + if(m_form->formWidget() && (TQT_BASE_OBJECT(tree->widget()) != TQT_BASE_OBJECT(s))) + m_form->formWidget()->highlightWidgets(tree->widget(), TQT_TQWIDGET(s)); } - else if(m_insertBegin!=QPoint(-1,-1) && s == m_container && !m_toplevel && (mev->state() != ControlButton) && !FormManager::self()->isCreatingConnection()) // draw the selection rect + else if(m_insertBegin!=TQPoint(-1,-1) && s == m_container && !m_toplevel && (mev->state() != ControlButton) && !FormManager::self()->isCreatingConnection()) // draw the selection rect { - if((mev->state() != LeftButton) || /*m_inlineEditing*/ m_state == InlineEditing) + if((mev->state() != Qt::LeftButton) || /*m_inlineEditing*/ m_state == InlineEditing) return true; int topx = (m_insertBegin.x() < mev->x()) ? m_insertBegin.x() : mev->x(); int topy = (m_insertBegin.y() < mev->y()) ? m_insertBegin.y() : mev->y(); int botx = (m_insertBegin.x() > mev->x()) ? m_insertBegin.x() : mev->x(); int boty = (m_insertBegin.y() > mev->y()) ? m_insertBegin.y() : mev->y(); - QRect r = QRect(QPoint(topx, topy), QPoint(botx, boty)); + TQRect r = TQRect(TQPoint(topx, topy), TQPoint(botx, boty)); m_insertRect = r; if(m_form->formWidget()) @@ -287,19 +287,19 @@ Container::eventFilter(QObject *s, QEvent *e) m_state = DoingNothing; return true; } - else if(mev->state() == (LeftButton|ControlButton)) // draw the insert rect for the copied widget + else if(mev->state() == (Qt::LeftButton|ControlButton)) // draw the insert rect for the copied widget { if(s == m_container)// || (m_form->selectedWidgets()->count() > 1)) return true; drawCopiedWidgetRect(mev); return true; } - else if( ( (mev->state() == Qt::LeftButton) || (mev->state() == (LeftButton|ControlButton|AltButton)) ) + else if( ( (mev->state() == Qt::LeftButton) || (mev->state() == (Qt::LeftButton|ControlButton|AltButton)) ) && !FormManager::self()->isInserting() && (m_state != CopyingWidget)) // we are dragging the widget(s) to move it { if(!m_toplevel && m_moving == m_container) // no effect for form return false; - if((!m_moving) || (!m_moving->parentWidget()))// || (m_moving->parentWidget()->inherits("QWidgetStack"))) + if((!m_moving) || (!m_moving->tqparentWidget()))// || (m_moving->tqparentWidget()->inherits(TQWIDGETSTACK_OBJECT_NAME_STRING))) return true; moveSelectedWidgetsBy(mev->x() - m_grab.x(), mev->y() - m_grab.y()); @@ -309,15 +309,15 @@ Container::eventFilter(QObject *s, QEvent *e) return true; // eat } - case QEvent::Paint: // Draw the dotted background + case TQEvent::Paint: // Draw the dotted background { if(s != m_container) return false; int gridX = m_form->gridSize(); int gridY = m_form->gridSize(); - QPainter p(m_container); - p.setPen(QPen(white, 2)); + TQPainter p(m_container); + p.setPen(TQPen(white, 2)); p.setRasterOp(XorROP); int cols = m_container->width() / gridX; int rows = m_container->height() / gridY; @@ -333,27 +333,27 @@ Container::eventFilter(QObject *s, QEvent *e) return false; } - case QEvent::Resize: // we are resizing a widget, so we set m_move to true -> the layout will be reloaded when releasing mouse + case TQEvent::Resize: // we are resizing a widget, so we set m_move to true -> the tqlayout will be reloaded when releasing mouse { if(m_form->interactiveMode()) m_state = MovingWidget; break; } - //case QEvent::AccelOverride: - case QEvent::KeyPress: + //case TQEvent::AccelOverride: + case TQEvent::KeyPress: { - QKeyEvent *kev = static_cast<QKeyEvent*>(e); + TQKeyEvent *kev = TQT_TQKEYEVENT(e); if(kev->key() == Key_F2) // pressing F2 == double-clicking { m_state = InlineEditing; - QWidget *w; + TQWidget *w; // try to find the widget which was clicked last and should be edited if(m_form->selectedWidgets()->count() == 1) w = m_form->selectedWidgets()->first(); - else if(m_form->selectedWidgets()->findRef(m_moving) != -1) + else if(m_form->selectedWidgets()->tqfindRef(m_moving) != -1) w = m_moving; else w = m_form->selectedWidgets()->last(); @@ -372,14 +372,14 @@ Container::eventFilter(QObject *s, QEvent *e) if(!m_moving) return true; // we simulate a mouse move event to update screen - QMouseEvent *mev = new QMouseEvent(QEvent::MouseMove, m_moving->mapFromGlobal(QCursor::pos()), NoButton, - LeftButton|ControlButton ); - eventFilter(m_moving, mev); + TQMouseEvent *mev = new TQMouseEvent(TQEvent::MouseMove, m_moving->mapFromGlobal(TQCursor::pos()), Qt::NoButton, + Qt::LeftButton|ControlButton ); + eventFilter(TQT_TQOBJECT(m_moving), TQT_TQEVENT(mev)); delete mev; } else if(kev->key() == FormManager::self()->contextMenuKey()) { - FormManager::self()->createContextMenu(static_cast<QWidget*>(s), this, false); + FormManager::self()->createContextMenu(TQT_TQWIDGET(s), this, false); return true; } else if (kev->key() == Key_Delete) @@ -406,12 +406,12 @@ Container::eventFilter(QObject *s, QEvent *e) } else if((kev->key() == Key_Tab) || (kev->key() == Key_BackTab)){ ObjectTreeItem *item = form()->objectTree()->lookup(form()->selectedWidgets()->first()->name()); - if(!item || !item->parent()) + if(!item || !item->tqparent()) return true; - ObjectTreeList *list = item->parent()->children(); + ObjectTreeList *list = item->tqparent()->tqchildren(); if(list->count() == 1) return true; - int index = list->findRef(item); + int index = list->tqfindRef(item); if(kev->key() == Key_BackTab){ if(index == 0) // go back to the last item @@ -433,22 +433,22 @@ Container::eventFilter(QObject *s, QEvent *e) return true; } - case QEvent::KeyRelease: + case TQEvent::KeyRelease: { - QKeyEvent *kev = static_cast<QKeyEvent*>(e); + TQKeyEvent *kev = TQT_TQKEYEVENT(e); if((kev->key() == Key_Control) && (m_state == CopyingWidget)) { // cancel copying - //m_copyRect = QRect(); + //m_copyRect = TQRect(); if(m_form->formWidget()) m_form->formWidget()->clearForm(); } return true; } - case QEvent::MouseButtonDblClick: // editing + case TQEvent::MouseButtonDblClick: // editing { kdDebug() << "Container: Mouse dbl click for widget " << s->name() << endl; - QWidget *w = static_cast<QWidget*>(s); + TQWidget *w = TQT_TQWIDGET(s); if(!w) return false; @@ -458,14 +458,14 @@ Container::eventFilter(QObject *s, QEvent *e) return true; } - case QEvent::ContextMenu: - case QEvent::Enter: - case QEvent::Leave: - case QEvent::FocusIn: - case QEvent::FocusOut: -// case QEvent::DragEnter: -// case QEvent::DragMove: -// case QEvent::DragLeave: + case TQEvent::ContextMenu: + case TQEvent::Enter: + case TQEvent::Leave: + case TQEvent::FocusIn: + case TQEvent::FocusOut: +// case TQEvent::DragEnter: +// case TQEvent::DragMove: +// case TQEvent::DragLeave: return true; // eat them default: @@ -475,7 +475,7 @@ Container::eventFilter(QObject *s, QEvent *e) } bool -Container::handleMouseReleaseEvent(QObject *s, QMouseEvent *mev) +Container::handleMouseReleaseEvent(TQObject *s, TQMouseEvent *mev) { if(FormManager::self()->isInserting()) // we insert the widget at cursor pos { @@ -483,20 +483,20 @@ Container::handleMouseReleaseEvent(QObject *s, QMouseEvent *mev) m_form->formWidget()->clearForm(); KCommand *com = new InsertWidgetCommand(this/*, mev->pos()*/); m_form->addCommand(com, true); - m_insertBegin = QPoint(-1,-1); - m_insertRect = QRect(); + m_insertBegin = TQPoint(-1,-1); + m_insertRect = TQRect(); return true; } - else if(s == m_container && !m_toplevel && (mev->button() != RightButton) && m_insertRect.isValid()) // we are drawing a rect to select widgets + else if(s == m_container && !m_toplevel && (mev->button() != Qt::RightButton) && m_insertRect.isValid()) // we are drawing a rect to select widgets { drawSelectionRect(mev); return true; } - if(mev->button() == RightButton) // Right-click -> context menu + if(mev->button() == Qt::RightButton) // Right-click -> context menu { - FormManager::self()->createContextMenu(static_cast<QWidget*>(s), this); + FormManager::self()->createContextMenu(TQT_TQWIDGET(s), this); } - else if(mev->state() == (Qt::LeftButton|Qt::ControlButton))// && (m_copyRect.isValid())) + else if(mev->state() == (Qt::LeftButton|TQt::ControlButton))// && (m_copyRect.isValid())) { // copying a widget by Ctrl+dragging @@ -519,24 +519,24 @@ Container::handleMouseReleaseEvent(QObject *s, QMouseEvent *mev) if(m_form->selectedWidgets()->count() > 1) FormManager::self()->setInsertPoint( mev->pos() ); else - FormManager::self()->setInsertPoint( static_cast<QWidget*>(s)->mapTo(m_container, mev->pos() - m_grab) ); + FormManager::self()->setInsertPoint( TQT_TQWIDGET(s)->mapTo(m_container, mev->pos() - m_grab) ); FormManager::self()->pasteWidget(); m_form->setInteractiveMode(true); - //m_initialPos = QPoint(); + //m_initialPos = TQPoint(); } - else if(m_state == MovingWidget) // one widget has been moved, so we need to update the layout + else if(m_state == MovingWidget) // one widget has been moved, so we need to update the tqlayout reloadLayout(); // cancel copying as user released Ctrl before releasing mouse button - m_insertBegin = QPoint(-1,-1); - m_insertRect = QRect(); + m_insertBegin = TQPoint(-1,-1); + m_insertRect = TQRect(); m_state = DoingNothing; return true; // eat } void -Container::setSelectedWidget(QWidget *w, bool add, bool dontRaise, bool moreWillBeSelected) +Container::setSelectedWidget(TQWidget *w, bool add, bool dontRaise, bool moreWillBeSelected) { if (w) kdDebug() << "slotSelectionChanged " << w->name()<< endl; @@ -551,7 +551,7 @@ Container::setSelectedWidget(QWidget *w, bool add, bool dontRaise, bool moreWill } void -Container::unSelectWidget(QWidget *w) +Container::unSelectWidget(TQWidget *w) { if(!w) return; @@ -569,7 +569,7 @@ Container::toplevel() } void -Container::deleteWidget(QWidget *w) +Container::deleteWidget(TQWidget *w) { if(!w) return; @@ -602,13 +602,13 @@ Container::setLayout(LayoutType type) { case HBox: { - m_layout = (QLayout*) new QHBoxLayout(m_container, m_margin, m_spacing); + m_layout = (TQLayout*) new TQHBoxLayout(m_container, m_margin, m_spacing); createBoxLayout(new HorWidgetList(m_form->toplevelContainer()->widget())); break; } case VBox: { - m_layout = (QLayout*) new QVBoxLayout(m_container, m_margin, m_spacing); + m_layout = (TQLayout*) new TQVBoxLayout(m_container, m_margin, m_spacing); createBoxLayout(new VerWidgetList(m_form->toplevelContainer()->widget())); break; } @@ -620,16 +620,16 @@ Container::setLayout(LayoutType type) case HFlow: { KexiFlowLayout *flow = new KexiFlowLayout(m_container,m_margin, m_spacing); - flow->setOrientation(Horizontal); - m_layout = (QLayout*)flow; + flow->setOrientation(Qt::Horizontal); + m_layout = (TQLayout*)flow; createFlowLayout(); break; } case VFlow: { KexiFlowLayout *flow = new KexiFlowLayout(m_container,m_margin, m_spacing); - flow->setOrientation(Vertical); - m_layout = (QLayout*)flow; + flow->setOrientation(Qt::Vertical); + m_layout = (TQLayout*)flow; createFlowLayout(); break; } @@ -639,7 +639,7 @@ Container::setLayout(LayoutType type) return; } } - m_container->setGeometry(m_container->geometry()); // just update layout + m_container->setGeometry(m_container->tqgeometry()); // just update tqlayout m_layout->activate(); } @@ -654,14 +654,14 @@ Container::reloadLayout() void Container::createBoxLayout(WidgetList *list) { - QBoxLayout *layout = static_cast<QBoxLayout*>(m_layout); + TQBoxLayout *tqlayout = static_cast<TQBoxLayout*>(m_layout); - for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) + for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) list->append( tree->widget()); list->sort(); - for(QWidget *obj = list->first(); obj; obj = list->next()) - layout->addWidget(obj); + for(TQWidget *obj = list->first(); obj; obj = list->next()) + tqlayout->addWidget(obj); delete list; } @@ -669,12 +669,12 @@ void Container::createFlowLayout() { KexiFlowLayout *flow = dynamic_cast<KexiFlowLayout*>(m_layout); - if(!flow || m_tree->children()->isEmpty()) + if(!flow || m_tree->tqchildren()->isEmpty()) return; const int offset = 15; WidgetList *list=0, *list2=0; - if(flow->orientation() == Horizontal) { + if(flow->orientation() ==Qt::Horizontal) { list = new VerWidgetList(m_form->toplevelContainer()->widget()); list2 = new HorWidgetList(m_form->toplevelContainer()->widget()); } @@ -684,17 +684,17 @@ Container::createFlowLayout() } // fill the list - for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) + for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) list->append( tree->widget()); list->sort(); - if(flow->orientation() == Horizontal) { + if(flow->orientation() ==Qt::Horizontal) { int y = list->first()->y(); - for(QWidget *w = list->first(); w; w = list->next()) { + for(TQWidget *w = list->first(); w; w = list->next()) { if( (w->y() > y +offset)) { // start a new line list2->sort(); - for(QWidget *obj = list2->first(); obj; obj = list2->next()) + for(TQWidget *obj = list2->first(); obj; obj = list2->next()) flow->add(obj); list2->clear(); y = w->y(); @@ -703,16 +703,16 @@ Container::createFlowLayout() } list2->sort(); // don't forget the last line - for(QWidget *obj = list2->first(); obj; obj = list2->next()) + for(TQWidget *obj = list2->first(); obj; obj = list2->next()) flow->add(obj); } else { int x = list->first()->x(); - for(QWidget *w = list->first(); w; w = list->next()) { + for(TQWidget *w = list->first(); w; w = list->next()) { if( (w->x() > x +offset)) { // start a new column list2->sort(); - for(QWidget *obj = list2->first(); obj; obj = list2->next()) + for(TQWidget *obj = list2->first(); obj; obj = list2->next()) flow->add(obj); list2->clear(); x = w->x(); @@ -721,7 +721,7 @@ Container::createFlowLayout() } list2->sort(); // don't forget the last column - for(QWidget *obj = list2->first(); obj; obj = list2->next()) + for(TQWidget *obj = list2->first(); obj; obj = list2->next()) flow->add(obj); } @@ -736,16 +736,16 @@ Container::createGridLayout(bool testOnly) VerWidgetList *vlist = new VerWidgetList(m_form->toplevelContainer()->widget()); HorWidgetList *hlist = new HorWidgetList(m_form->toplevelContainer()->widget()); // The vector are used to store the x (or y) beginning of each column (or row) - QValueVector<int> cols; - QValueVector<int> rows; + TQValueVector<int> cols; + TQValueVector<int> rows; int end=-1000; bool same = false; - for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) + for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) vlist->append( tree->widget()); vlist->sort(); - for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) + for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) hlist->append( tree->widget()); hlist->sort(); @@ -754,35 +754,35 @@ Container::createGridLayout(bool testOnly) if(!testOnly) { for(WidgetListIterator it(*vlist); it.current() != 0; ++it) { - QWidget *w = it.current(); + TQWidget *w = it.current(); WidgetListIterator it2 = it; for(; it2.current() != 0; ++it2) { - QWidget *nextw = it2.current(); - if((w->y() >= nextw->y()) || (nextw->y() >= w->geometry().bottom())) + TQWidget *nextw = it2.current(); + if((w->y() >= nextw->y()) || (nextw->y() >= w->tqgeometry().bottom())) break; - if(!w->geometry().intersects(nextw->geometry())) + if(!w->tqgeometry().intersects(nextw->tqgeometry())) break; // If the geometries of the two widgets intersect each other, // we move one of the widget to the rght or bottom of the other if((nextw->y() - w->y()) > abs(nextw->x() - w->x())) - nextw->move(nextw->x(), w->geometry().bottom()+1); + nextw->move(nextw->x(), w->tqgeometry().bottom()+1); else if(nextw->x() >= w->x()) - nextw->move(w->geometry().right()+1, nextw->y()); + nextw->move(w->tqgeometry().right()+1, nextw->y()); else - w->move(nextw->geometry().right()+1, nextw->y()); + w->move(nextw->tqgeometry().right()+1, nextw->y()); } } } - // Then we count the number of rows in the layout, and set their beginnings + // Then we count the number of rows in the tqlayout, and set their beginnings for(WidgetListIterator it(*vlist); it.current() != 0; ++it) { - QWidget *w = it.current(); + TQWidget *w = it.current(); WidgetListIterator it2 = it; if(!same) { // this widget will make a new row - end = w->geometry().bottom(); + end = w->tqgeometry().bottom(); rows.append(w->y()); } @@ -792,13 +792,13 @@ Container::createGridLayout(bool testOnly) if(!it2.current()) break; - QWidget *nextw = it2.current(); + TQWidget *nextw = it2.current(); if(nextw->y() >= end) same = false; else { - same = !(same && (nextw->y() >= w->geometry().bottom())); + same = !(same && (nextw->y() >= w->tqgeometry().bottom())); if(!same) - end = w->geometry().bottom(); + end = w->tqgeometry().bottom(); } } kdDebug() << "the new grid will have n rows: n == " << rows.size() << endl; @@ -808,10 +808,10 @@ Container::createGridLayout(bool testOnly) // We do the same thing for the columns for(WidgetListIterator it(*hlist); it.current() != 0; ++it) { - QWidget *w = it.current(); + TQWidget *w = it.current(); WidgetListIterator it2 = it; if(!same) { - end = w->geometry().right(); + end = w->tqgeometry().right(); cols.append(w->x()); } @@ -819,29 +819,29 @@ Container::createGridLayout(bool testOnly) if(!it2.current()) break; - QWidget *nextw = it2.current(); + TQWidget *nextw = it2.current(); if(nextw->x() >= end) same = false; else { - same = !(same && (nextw->x() >= w->geometry().right())); + same = !(same && (nextw->x() >= w->tqgeometry().right())); if(!same) - end = w->geometry().right(); + end = w->tqgeometry().right(); } } kdDebug() << "the new grid will have n columns: n == " << cols.size() << endl; - // We create the layout .. - QGridLayout *layout=0; + // We create the tqlayout .. + TQGridLayout *tqlayout=0; if(!testOnly) { - layout = new QGridLayout(m_container, rows.size(), cols.size(), m_margin, m_spacing, "grid"); - m_layout = (QLayout*)layout; + tqlayout = new TQGridLayout(m_container, rows.size(), cols.size(), m_margin, m_spacing, "grid"); + m_layout = (TQLayout*)tqlayout; } // .. and we fill it with widgets for(WidgetListIterator it(*vlist); it.current() != 0; ++it) { - QWidget *w = it.current(); - QRect r = w->geometry(); + TQWidget *w = it.current(); + TQRect r = w->tqgeometry(); uint wcol=0, wrow=0, endrow=0, endcol=0; uint i = 0; @@ -901,21 +901,21 @@ Container::createGridLayout(bool testOnly) ObjectTreeItem *item = m_form->objectTree()->lookup(w->name()); if(!endrow && !endcol) { if(!testOnly) - layout->addWidget(w, wrow, wcol); + tqlayout->addWidget(w, wrow, wcol); item->setGridPos(wrow, wcol, 0, 0); } else { if(!endcol) endcol = wcol; if(!endrow) endrow = wrow; if(!testOnly) - layout->addMultiCellWidget(w, wrow, endrow, wcol, endcol); + tqlayout->addMultiCellWidget(w, wrow, endrow, wcol, endcol); item->setGridPos(wrow, wcol, endrow-wrow+1, endcol-wcol+1); } } } -QString -Container::layoutTypeToString(int type) +TQString +Container::tqlayoutTypeToString(int type) { switch(type) { @@ -929,7 +929,7 @@ Container::layoutTypeToString(int type) } Container::LayoutType -Container::stringToLayoutType(const QString &name) +Container::stringToLayoutType(const TQString &name) { if(name == "HBox") return HBox; if(name == "VBox") return VBox; @@ -941,9 +941,9 @@ Container::stringToLayoutType(const QString &name) /// Drawing functions used by eventFilter void -Container::drawConnection(QMouseEvent *mev) +Container::drawConnection(TQMouseEvent *mev) { - if(mev->button() != LeftButton) + if(mev->button() != Qt::LeftButton) { FormManager::self()->resetCreatedConnection(); return; @@ -955,7 +955,7 @@ Container::drawConnection(QMouseEvent *mev) if(m_form->formWidget()) { m_form->formWidget()->initBuffer(); - m_form->formWidget()->highlightWidgets(m_moving, 0/*, QPoint()*/); + m_form->formWidget()->highlightWidgets(m_moving, 0/*, TQPoint()*/); } FormManager::self()->createSignalMenu(m_moving); return; @@ -971,7 +971,7 @@ Container::drawConnection(QMouseEvent *mev) { FormManager::self()->createdConnection()->setReceiver(m_moving->name()); FormManager::self()->createSlotMenu(m_moving); - m_container->repaint(); + m_container->tqrepaint(); return; } // the user clicked outside the menu, we cancel the connection @@ -983,7 +983,7 @@ Container::drawConnection(QMouseEvent *mev) } void -Container::drawSelectionRect(QMouseEvent *mev) +Container::drawSelectionRect(TQMouseEvent *mev) { //finish drawing unclipped selection rectangle: clear the surface if(m_form->formWidget()) @@ -992,17 +992,17 @@ Container::drawSelectionRect(QMouseEvent *mev) int topy = (m_insertBegin.y() < mev->y()) ? m_insertBegin.y() : mev->y(); int botx = (m_insertBegin.x() > mev->x()) ? m_insertBegin.x() : mev->x(); int boty = (m_insertBegin.y() > mev->y()) ? m_insertBegin.y() : mev->y(); - QRect r = QRect(QPoint(topx, topy), QPoint(botx, boty)); + TQRect r = TQRect(TQPoint(topx, topy), TQPoint(botx, boty)); setSelectedWidget(m_container, false); - QWidget *widgetToSelect = 0; + TQWidget *widgetToSelect = 0; // We check which widgets are in the rect and select them - for(ObjectTreeItem *item = m_tree->children()->first(); item; item = m_tree->children()->next()) + for(ObjectTreeItem *item = m_tree->tqchildren()->first(); item; item = m_tree->tqchildren()->next()) { - QWidget *w = item->widget(); + TQWidget *w = item->widget(); if(!w) continue; - if(w->geometry().intersects(r) && w != m_container) { + if(w->tqgeometry().intersects(r) && w != m_container) { if (widgetToSelect) setSelectedWidget(widgetToSelect, true/*add*/, false/*raise*/, true/*moreWillBeSelected*/); widgetToSelect = w; //select later @@ -1011,19 +1011,19 @@ Container::drawSelectionRect(QMouseEvent *mev) if (widgetToSelect) //the last one left setSelectedWidget(widgetToSelect, true/*add*/, false/*raise*/, false/*!moreWillBeSelected*/); - m_insertRect = QRect(); + m_insertRect = TQRect(); m_state = DoingNothing; - m_container->repaint(); + m_container->tqrepaint(); } void -Container::drawInsertRect(QMouseEvent *mev, QObject *s) +Container::drawInsertRect(TQMouseEvent *mev, TQObject *s) { int tmpx, tmpy; - QPoint pos = static_cast<QWidget*>(s)->mapTo(m_container, mev->pos()); + TQPoint pos = TQT_TQWIDGET(s)->mapTo(m_container, mev->pos()); int gridX = m_form->gridSize(); int gridY = m_form->gridSize(); - if(!FormManager::self()->snapWidgetsToGrid() || (mev->state() == (LeftButton|ControlButton|AltButton)) ) + if(!FormManager::self()->snapWidgetsToGrid() || (mev->state() == (Qt::LeftButton|ControlButton|AltButton)) ) { tmpx = pos.x(); tmpy = pos.y(); @@ -1040,7 +1040,7 @@ Container::drawInsertRect(QMouseEvent *mev, QObject *s) int topy = (m_insertBegin.y() < tmpy) ? m_insertBegin.y() : tmpy; int botx = (m_insertBegin.x() > tmpx) ? m_insertBegin.x() : tmpx; int boty = (m_insertBegin.y() > tmpy) ? m_insertBegin.y() : tmpy; - m_insertRect = QRect(QPoint(topx, topy), QPoint(botx, boty)); + m_insertRect = TQRect(TQPoint(topx, topy), TQPoint(botx, boty)); if(m_insertRect.x() < 0) m_insertRect.setLeft(0); @@ -1055,7 +1055,7 @@ Container::drawInsertRect(QMouseEvent *mev, QObject *s) { if(m_form->formWidget()) { - QRect drawRect = QRect(m_container->mapTo(m_form->widget(), m_insertRect.topLeft()) + TQRect drawRect = TQRect(m_container->mapTo(m_form->widget(), m_insertRect.topLeft()) , m_insertRect.size()); m_form->formWidget()->drawRect(drawRect, 2); } @@ -1063,14 +1063,14 @@ Container::drawInsertRect(QMouseEvent *mev, QObject *s) } void -Container::drawCopiedWidgetRect(QMouseEvent *mev) +Container::drawCopiedWidgetRect(TQMouseEvent *mev) { // We've been dragging a widget, but Ctrl was hold, so we start copy if(m_state == MovingWidget) { //FormManager::self()->undo(); // undo last moving //m_moving->move(m_initialPos); if(m_form->formWidget()) { - m_container->repaint(); + m_container->tqrepaint(); m_form->formWidget()->initBuffer(); } m_state = CopyingWidget; @@ -1079,13 +1079,13 @@ Container::drawCopiedWidgetRect(QMouseEvent *mev) //m_copyRect.moveTopLeft(m_container->mapFromGlobal( mev->globalPos()) - m_grab); if(m_form->formWidget()) { - QValueList<QRect> rectList; - for(QWidget *w = m_form->selectedWidgets()->first(); w; w = m_form->selectedWidgets()->next()) { - QRect drawRect = w->geometry(); - QPoint p = mev->pos() - m_grab; + TQValueList<TQRect> rectList; + for(TQWidget *w = m_form->selectedWidgets()->first(); w; w = m_form->selectedWidgets()->next()) { + TQRect drawRect = w->tqgeometry(); + TQPoint p = mev->pos() - m_grab; drawRect.moveBy(p.x(), p.y()); - p = m_container->mapTo(m_form->widget(), QPoint(0, 0)); - //drawRect = QRect( ((QWidget*)s)->mapTo(m_form->widget(), drawRect.topLeft()), drawRect.size()); + p = m_container->mapTo(m_form->widget(), TQPoint(0, 0)); + //drawRect = TQRect( ((TQWidget*)s)->mapTo(m_form->widget(), drawRect.topLeft()), drawRect.size()); drawRect.moveBy(p.x(), p.y()); rectList.append(drawRect); } @@ -1096,7 +1096,7 @@ Container::drawCopiedWidgetRect(QMouseEvent *mev) /// Other functions used by eventFilter void -Container::moveSelectedWidgetsBy(int realdx, int realdy, QMouseEvent *mev) +Container::moveSelectedWidgetsBy(int realdx, int realdy, TQMouseEvent *mev) { if (m_form->selectedWidget() == m_form->widget()) return; //do not move top-level widget @@ -1105,46 +1105,46 @@ Container::moveSelectedWidgetsBy(int realdx, int realdy, QMouseEvent *mev) const int gridY = m_form->gridSize(); int dx=realdx, dy=realdy; - for(QWidget *w = m_form->selectedWidgets()->first(); w; w = m_form->selectedWidgets()->next()) + for(TQWidget *w = m_form->selectedWidgets()->first(); w; w = m_form->selectedWidgets()->next()) { - if(!w || !w->parent() || w->parent()->inherits("QTabWidget") || w->parent()->inherits("QWidgetStack")) + if(!w || !w->tqparent() || w->tqparent()->inherits(TQTABWIDGET_OBJECT_NAME_STRING) || w->tqparent()->inherits(TQWIDGETSTACK_OBJECT_NAME_STRING)) continue; - 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(); } int tmpx = w->x() + realdx; int tmpy = w->y() + realdy; if(tmpx < 0) - dx = QMAX(0 - w->x(), dx); // because dx is <0 - else if(tmpx > w->parentWidget()->width() - gridX) - dx = QMIN(w->parentWidget()->width() - gridX - w->x(), dx); + dx = TQMAX(0 - w->x(), dx); // because dx is <0 + else if(tmpx > w->tqparentWidget()->width() - gridX) + dx = TQMIN(w->tqparentWidget()->width() - gridX - w->x(), dx); if(tmpy < 0) - dy = QMAX(0 - w->y(), dy); // because dy is <0 - else if(tmpy > w->parentWidget()->height() - gridY) - dy = QMIN(w->parentWidget()->height() - gridY - w->y(), dy); + dy = TQMAX(0 - w->y(), dy); // because dy is <0 + else if(tmpy > w->tqparentWidget()->height() - gridY) + dy = TQMIN(w->tqparentWidget()->height() - gridY - w->y(), dy); } - for(QWidget *w = m_form->selectedWidgets()->first(); w; w = m_form->selectedWidgets()->next()) + for(TQWidget *w = m_form->selectedWidgets()->first(); w; w = m_form->selectedWidgets()->next()) { // Don't move tab widget pages (or widget stack pages) - if(!w || !w->parent() || w->parent()->inherits("QTabWidget") || w->parent()->inherits("QWidgetStack")) + if(!w || !w->tqparent() || w->tqparent()->inherits(TQTABWIDGET_OBJECT_NAME_STRING) || w->tqparent()->inherits(TQWIDGETSTACK_OBJECT_NAME_STRING)) continue; - 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(); } int tmpx, tmpy; - if(!FormManager::self()->snapWidgetsToGrid() || (mev && mev->state() == (LeftButton|ControlButton|AltButton)) ) + if(!FormManager::self()->snapWidgetsToGrid() || (mev && mev->state() == (Qt::LeftButton|ControlButton|AltButton)) ) { tmpx = w->x() + dx; tmpy = w->y() + dy; @@ -1172,10 +1172,10 @@ DesignTimeDynamicChildWidgetHandler::~DesignTimeDynamicChildWidgetHandler() } void -DesignTimeDynamicChildWidgetHandler::childWidgetAdded(QWidget* w) +DesignTimeDynamicChildWidgetHandler::childWidgetAdded(TQWidget* w) { if (m_item) { - installRecursiveEventFilter(w, m_item->eventEater()); + installRecursiveEventFilter(TQT_TQOBJECT(w), m_item->eventEater()); } } diff --git a/kexi/formeditor/container.h b/kexi/formeditor/container.h index b7036aa7..a76c913a 100644 --- a/kexi/formeditor/container.h +++ b/kexi/formeditor/container.h @@ -21,16 +21,16 @@ #ifndef FORMEDITORCONTAINER_H #define FORMEDITORCONTAINER_H -#include <qobject.h> -#include <qguardedptr.h> -#include <qptrlist.h> -#include <qwidget.h> +#include <tqobject.h> +#include <tqguardedptr.h> +#include <tqptrlist.h> +#include <tqwidget.h> #include "utils.h" -class QEvent; -class QWidget; -class QLayout; +class TQEvent; +class TQWidget; +class TQLayout; namespace KFormDesigner { @@ -44,42 +44,44 @@ class Form; * and direct it to the Container. */ //! A class for redirecting events -class KFORMEDITOR_EXPORT EventEater : public QObject +class KFORMEDITOR_EXPORT EventEater : public TQObject { Q_OBJECT + TQ_OBJECT public: /*! Constructs eater object. All events for \a widget and it's subwidgets - will be redirected to \a container. \a container will be also parent of eater object, + will be redirected to \a container. \a container will be also tqparent of eater object, so you don't need to care about deleting it. */ - EventEater(QWidget *widget, QObject *container); + EventEater(TQWidget *widget, TQObject *container); ~EventEater(); //! Sets the object which will receive the events - void setContainer(QObject *container) { m_container = container; } - bool eventFilter(QObject *o, QEvent *ev); + void setContainer(TQObject *container) { m_container = container; } + bool eventFilter(TQObject *o, TQEvent *ev); private: - QGuardedPtr<QWidget> m_widget; - QGuardedPtr<QObject> m_container; + TQGuardedPtr<TQWidget> m_widget; + TQGuardedPtr<TQObject> m_container; }; /** - * This class makes a container out of any QWidget. You can then create child widgets, and + * This class makes a container out of any TQWidget. You can then create child widgets, and the background is dotted. */ //! A class to make a container from any widget -class KFORMEDITOR_EXPORT Container : public QObject +class KFORMEDITOR_EXPORT Container : public TQObject { Q_OBJECT + TQ_OBJECT public: enum LayoutType { NoLayout=0, HBox, VBox, Grid, HFlow, VFlow, /* special types */ HSplitter, VSplitter }; /** * Creates a Container from the widget \a container, which have - \a toplevel as parent Container. */ - Container(Container *toplevel, QWidget *container, QObject *parent=0, const char *name=0); + \a toplevel as tqparent Container. */ + Container(Container *toplevel, TQWidget *container, TQObject *tqparent=0, const char *name=0); virtual ~Container(); //! \return a pointer to the toplevel Container, or 0 if this Container is toplevel @@ -89,7 +91,7 @@ class KFORMEDITOR_EXPORT Container : public QObject Form* form() const { return m_form; } //! \return The watched widget. - QWidget* widget() const { return m_container; } + TQWidget* widget() const { return m_container; } //! \return The ObjectTreeItem associated with this Container's widget. ObjectTreeItem* objectTree() const { return m_tree; } @@ -101,20 +103,20 @@ class KFORMEDITOR_EXPORT Container : public QObject * NOTE: this is needed only if we are toplevel. */ void setObjectTree(ObjectTreeItem *t) { m_tree = t; } - //! \return a pointer to the QLayout of this Container, or 0 if there is not. - QLayout* layout() const { return m_layout; } + //! \return a pointer to the TQLayout of this Container, or 0 if there is not. + TQLayout* tqlayout() const { return m_layout; } - //! \return the type of the layout associated to this Container's widget (see LayoutType enum). - LayoutType layoutType() const { return m_layType; } + //! \return the type of the tqlayout associated to this Container's widget (see LayoutType enum). + LayoutType tqlayoutType() const { return m_layType; } //! \return the margin of this Container. - int layoutMargin() { return m_margin; } + int tqlayoutMargin() { return m_margin; } //! \return the spacing of this Container. - int layoutSpacing() { return m_spacing; } + int tqlayoutSpacing() { return m_spacing; } - /*! Sets this Container to use \a type of layout. The widget are inserted - automatically in the layout following their positions. + /*! Sets this Container to use \a type of tqlayout. The widget are inserted + automatically in the tqlayout following their positions. \sa createBoxLayout(), createGridLayout() */ void setLayout(LayoutType type); @@ -124,11 +126,11 @@ class KFORMEDITOR_EXPORT Container : public QObject //! Sets the margin of this Container. void setLayoutMargin(int margin) { m_margin = margin;} - //! \return the string representing the layoutType \a type. - static QString layoutTypeToString(int type); + //! \return the string representing the tqlayoutType \a type. + static TQString tqlayoutTypeToString(int type); - //! \return the LayoutType (an int) for a given layout name. - static LayoutType stringToLayoutType(const QString &name); + //! \return the LayoutType (an int) for a given tqlayout name. + static LayoutType stringToLayoutType(const TQString &name); /*! Stops the inline editing of the current widget (as when you click on another widget or press Esc). */ @@ -138,29 +140,29 @@ class KFORMEDITOR_EXPORT Container : public QObject to the watched widget.\n It takes care of drawing the background and the insert rect, of creating the new child widgets, of moving the widgets and pop up a menu when right-clicking. */ - virtual bool eventFilter(QObject *o, QEvent *e); + virtual bool eventFilter(TQObject *o, TQEvent *e); public slots: /*! Sets \a selected to be the selected widget of this container (and so of the Form). If \a add is true, the formerly selected widget is still selected, and the new one is just added. If false, \a selected replace the actually selected widget. If \a dontRaise is true, then - the widget \a selected (and its parent) won't be raised (eg when you + the widget \a selected (and its tqparent) won't be raised (eg when you select widget in ObjectTreeView). \sa Form::setSelectedWidget() */ - void setSelectedWidget(QWidget *selected, bool add, bool dontRaise=false, + void setSelectedWidget(TQWidget *selected, bool add, bool dontRaise=false, bool moreWillBeSelected = false); /*! Unselects the widget \a w. The widget is removed from the Form's list and its resizeHandles are removed. */ - void unSelectWidget(QWidget *w); + void unSelectWidget(TQWidget *w); /*! Deletes the widget \a w. Removes it from ObjectTree, and sets selection to Container's widget. */ - void deleteWidget(QWidget *w); + void deleteWidget(TQWidget *w); - /*! Recreates the Container layout. Calls this when a widget has been moved - or added to update the layout. */ + /*! Recreates the Container tqlayout. Calls this when a widget has been moved + or added to update the tqlayout. */ void reloadLayout(); protected slots: @@ -169,55 +171,55 @@ class KFORMEDITOR_EXPORT Container : public QObject protected: /*! Internal function to create a HBoxLayout or VBoxLayout for this container. - \a list is a subclass of QObjectList that can sort widgets + \a list is a subclass of TQObjectList that can sort widgets following their position (such as HorWidgetList or VerWidgetList). */ void createBoxLayout(WidgetList *list); /*! Internal function to create a KexiFlowLayout. */ void createFlowLayout(); - /*! Internal function to create a GridLayout. if \a testOnly is true, the layout + /*! Internal function to create a GridLayout. if \a testOnly is true, the tqlayout is simulated, and only the widget's grid info aris filled. */ void createGridLayout(bool testOnly=false); - void drawConnection(QMouseEvent *mev); - void drawSelectionRect(QMouseEvent *mev); - void drawInsertRect(QMouseEvent *mev, QObject *s); - void drawCopiedWidgetRect(QMouseEvent *mev); + void drawConnection(TQMouseEvent *mev); + void drawSelectionRect(TQMouseEvent *mev); + void drawInsertRect(TQMouseEvent *mev, TQObject *s); + void drawCopiedWidgetRect(TQMouseEvent *mev); - void moveSelectedWidgetsBy(int realdx, int realdy, QMouseEvent *mev=0); + void moveSelectedWidgetsBy(int realdx, int realdy, TQMouseEvent *mev=0); private: - bool handleMouseReleaseEvent(QObject *s, QMouseEvent *mev); + bool handleMouseReleaseEvent(TQObject *s, TQMouseEvent *mev); // the watched container and it's toplevel one... - QGuardedPtr<QWidget> m_container; - QGuardedPtr<Container> m_toplevel; + TQGuardedPtr<TQWidget> m_container; + TQGuardedPtr<Container> m_toplevel; int m_state; enum { DoingNothing = 100, DrawingSelectionRect, CopyingWidget, MovingWidget, InlineEditing }; // Layout - QLayout *m_layout; + TQLayout *m_layout; LayoutType m_layType; int m_margin, m_spacing; // moving etc. - QPoint m_grab; - //QPoint m_initialPos; - QGuardedPtr<QWidget> m_moving; - //QRect m_copyRect; + TQPoint m_grab; + //TQPoint m_initialPos; + TQGuardedPtr<TQWidget> m_moving; + //TQRect m_copyRect; //inserting - QPoint m_insertBegin; - QRect m_insertRect; + TQPoint m_insertBegin; + TQRect m_insertRect; ObjectTreeItem *m_tree; - QGuardedPtr<Form> m_form; + TQGuardedPtr<Form> m_form; bool m_mousePressEventReceived; - QMouseEvent m_mouseReleaseEvent; - QGuardedPtr<QObject> m_objectForMouseReleaseEvent; + TQMouseEvent m_mouseReleaseEvent; + TQGuardedPtr<TQObject> m_objectForMouseReleaseEvent; friend class InsertWidgetCommand; friend class PasteWidgetCommand; @@ -234,7 +236,7 @@ class KFORMEDITOR_EXPORT DesignTimeDynamicChildWidgetHandler ~DesignTimeDynamicChildWidgetHandler(); protected: - void childWidgetAdded(QWidget* w); + void childWidgetAdded(TQWidget* w); void assignItem(ObjectTreeItem* item) { m_item = item; } private: diff --git a/kexi/formeditor/editlistviewdialog.cpp b/kexi/formeditor/editlistviewdialog.cpp index 5b128ec8..020a7876 100644 --- a/kexi/formeditor/editlistviewdialog.cpp +++ b/kexi/formeditor/editlistviewdialog.cpp @@ -16,8 +16,8 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include <qheader.h> -#include <qlayout.h> +#include <tqheader.h> +#include <tqlayout.h> #include <klistview.h> #include <ktabwidget.h> @@ -38,53 +38,53 @@ namespace KFormDesigner { /// A Dialog to edit the contents of a listview ///////////////////// ///////////////////////////////////////////////////////////////////////////////// -EditListViewDialog::EditListViewDialog(QWidget *parent) -//js(kde3.2 dependent) : KDialogBase(Tabbed, 0/* WFlags */, parent, "editlistview_dialog", true, i18n("Edit listview contents"), Ok|Cancel, Ok, false) -: KDialogBase(Tabbed, i18n("Edit Listview Contents"), Ok|Cancel, Ok, parent, "editlistview_dialog", true /* modal */, false) +EditListViewDialog::EditListViewDialog(TQWidget *tqparent) +//js(kde3.2 dependent) : KDialogBase(Tabbed, 0/* WFlags */, tqparent, "editlistview_dialog", true, i18n("Edit listview contents"), Ok|Cancel, Ok, false) +: KDialogBase(Tabbed, i18n("Edit Listview Contents"), Ok|Cancel, Ok, tqparent, "editlistview_dialog", true /* modal */, false) { m_column = addPage(i18n("Columns")); m_contents = addPage(i18n("Contents")); ///////// Setup the "Contents" page ///////////////////////////// - QHBoxLayout *layout = new QHBoxLayout(m_contents, 0, 6); + TQHBoxLayout *tqlayout = new TQHBoxLayout(m_contents, 0, 6); //// Setup the icon toolbar ///////////////// - QVBoxLayout *vlayout = new QVBoxLayout(layout, 3); - QToolButton *newRow = new QToolButton(m_contents); + TQVBoxLayout *vtqlayout = new TQVBoxLayout(tqlayout, 3); + TQToolButton *newRow = new TQToolButton(m_contents); newRow->setIconSet(BarIconSet("edit_add")); newRow->setTextLabel(i18n("&Add Item"), true); - vlayout->addWidget(newRow); + vtqlayout->addWidget(newRow); m_buttons.insert(BNewRow, newRow); - connect(newRow, SIGNAL(clicked()), this, SLOT(newRow())); + connect(newRow, TQT_SIGNAL(clicked()), this, TQT_SLOT(newRow())); - QToolButton *newChild = new QToolButton(m_contents); + TQToolButton *newChild = new TQToolButton(m_contents); newChild->setIconSet(BarIconSet("1rightarrow")); newChild->setTextLabel(i18n("New &Subitem"), true); - vlayout->addWidget(newChild); + vtqlayout->addWidget(newChild); m_buttons.insert(BNewChild, newChild); - connect(newChild, SIGNAL(clicked()), this, SLOT(newChildRow())); + connect(newChild, TQT_SIGNAL(clicked()), this, TQT_SLOT(newChildRow())); - QToolButton *delRow = new QToolButton(m_contents); + TQToolButton *delRow = new TQToolButton(m_contents); delRow->setIconSet(BarIconSet("edit_remove")); delRow->setTextLabel(i18n("&Remove Item"), true); - vlayout->addWidget(delRow); + vtqlayout->addWidget(delRow); m_buttons.insert(BRemRow, delRow); - connect(delRow, SIGNAL(clicked()), this, SLOT(removeRow())); + connect(delRow, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeRow())); - QToolButton *rowUp = new QToolButton(m_contents); + TQToolButton *rowUp = new TQToolButton(m_contents); rowUp->setIconSet(BarIconSet("1uparrow")); rowUp->setTextLabel(i18n("Move Item &Up"), true); - vlayout->addWidget(rowUp); + vtqlayout->addWidget(rowUp); m_buttons.insert(BRowUp, rowUp); - connect(rowUp, SIGNAL(clicked()), this, SLOT(MoveRowUp())); + connect(rowUp, TQT_SIGNAL(clicked()), this, TQT_SLOT(MoveRowUp())); - QToolButton *rowDown = new QToolButton(m_contents); + TQToolButton *rowDown = new TQToolButton(m_contents); rowDown->setIconSet(BarIconSet("1downarrow")); rowDown->setTextLabel(i18n("Move Item &Down"), true); - vlayout->addWidget(rowDown); + vtqlayout->addWidget(rowDown); m_buttons.insert(BRowDown, rowDown); - connect(rowDown, SIGNAL(clicked()), this, SLOT(MoveRowDown())); - vlayout->addStretch(); + connect(rowDown, TQT_SIGNAL(clicked()), this, TQT_SLOT(MoveRowDown())); + vtqlayout->addStretch(); //// The listview /////////// m_listview = new KListView(m_contents, "editlistview_listview"); @@ -96,55 +96,55 @@ EditListViewDialog::EditListViewDialog(QWidget *parent) m_listview->setDropVisualizer(true); m_listview->setAcceptDrops(true); m_listview->setSorting(-1); - layout->addWidget(m_listview); + tqlayout->addWidget(m_listview); m_listview->setFocus(); - connect(m_listview, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(updateButtons(QListViewItem*))); - connect(m_listview, SIGNAL(moved(QListViewItem*, QListViewItem*, QListViewItem*)), this, SLOT(updateButtons(QListViewItem*))); + connect(m_listview, TQT_SIGNAL(currentChanged(TQListViewItem*)), this, TQT_SLOT(updateButtons(TQListViewItem*))); + connect(m_listview, TQT_SIGNAL(moved(TQListViewItem*, TQListViewItem*, TQListViewItem*)), this, TQT_SLOT(updateButtons(TQListViewItem*))); /////////////////// Setup the columns page //////////////// - QHBoxLayout *hbox = new QHBoxLayout(m_column, 0, 6); + TQHBoxLayout *hbox = new TQHBoxLayout(m_column, 0, 6); // The "item properties" field m_editor = new KoProperty::Editor(m_column, "editcolumn_propeditor"); - m_propSet = new KoProperty::Set(this, "columns"); + m_propSet = new KoProperty::Set(TQT_TQOBJECT(this), "columns"); m_propSet->addProperty(new KoProperty::Property("caption", "Caption", i18n("Caption"),i18n("Caption"))); m_propSet->addProperty(new KoProperty::Property("width", 100, i18n("Width"), i18n("Width"))); - m_propSet->addProperty(new KoProperty::Property("clickable", QVariant(true, 3), i18n("Clickable"), i18n("Clickable") )); - m_propSet->addProperty(new KoProperty::Property("resizable", QVariant(true, 3), i18n("Resizable"), i18n("Resizable") )); - m_propSet->addProperty(new KoProperty::Property("fullwidth", QVariant(false, 3), i18n("Full Width"), i18n("Full Width") )); + m_propSet->addProperty(new KoProperty::Property("clickable", TQVariant(true, 3), i18n("Clickable"), i18n("Clickable") )); + m_propSet->addProperty(new KoProperty::Property("resizable", TQVariant(true, 3), i18n("Resizable"), i18n("Resizable") )); + m_propSet->addProperty(new KoProperty::Property("fullwidth", TQVariant(false, 3), i18n("Full Width"), i18n("Full Width") )); m_editor->changeSet(m_propSet); - connect(m_propSet, SIGNAL(propertyChanged(KoProperty::Set & KoProperty::Property&)), - this, SLOT(changeProperty(KoProperty::Set & KoProperty::Property&))); + connect(m_propSet, TQT_SIGNAL(propertyChanged(KoProperty::Set & KoProperty::Property&)), + this, TQT_SLOT(changeProperty(KoProperty::Set & KoProperty::Property&))); // Setup the icon toolbar ////////// - QVBoxLayout *vbox = new QVBoxLayout(hbox, 3); - QToolButton *add = new QToolButton(m_column); + TQVBoxLayout *vbox = new TQVBoxLayout(hbox, 3); + TQToolButton *add = new TQToolButton(m_column); add->setIconSet(BarIconSet("edit_add")); add->setTextLabel(i18n("&Add Item"), true); vbox->addWidget(add); m_buttons.insert(BColAdd, add); - connect(add, SIGNAL(clicked()), this, SLOT(newItem())); + connect(add, TQT_SIGNAL(clicked()), this, TQT_SLOT(newItem())); - QToolButton *remove = new QToolButton(m_column); + TQToolButton *remove = new TQToolButton(m_column); remove->setIconSet(BarIconSet("edit_remove")); remove->setTextLabel(i18n("&Remove Item"), true); vbox->addWidget(remove); m_buttons.insert(BColRem, remove); - connect(remove, SIGNAL(clicked()), this, SLOT(removeItem())); + connect(remove, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeItem())); - QToolButton *up = new QToolButton(m_column); + TQToolButton *up = new TQToolButton(m_column); up->setIconSet(BarIconSet("1uparrow")); up->setTextLabel(i18n("Move Item &Up"), true); vbox->addWidget(up); m_buttons.insert(BColUp, up); - connect(up, SIGNAL(clicked()), this, SLOT(MoveItemUp())); + connect(up, TQT_SIGNAL(clicked()), this, TQT_SLOT(MoveItemUp())); - QToolButton *down = new QToolButton(m_column); + TQToolButton *down = new TQToolButton(m_column); down->setIconSet(BarIconSet("1downarrow")); down->setTextLabel(i18n("Move Item &Down"), true); vbox->addWidget(down); m_buttons.insert(BColDown, down); - connect(down, SIGNAL(clicked()), this, SLOT(MoveItemDown())); + connect(down, TQT_SIGNAL(clicked()), this, TQT_SLOT(MoveItemDown())); vbox->addStretch(); // The listbox with columns name ///// @@ -152,14 +152,14 @@ EditListViewDialog::EditListViewDialog(QWidget *parent) m_listbox->setFocus(); hbox->insertWidget(0, m_listbox); hbox->addWidget(m_editor); - connect(m_listbox, SIGNAL(currentChanged(QListBoxItem*)), this, SLOT(updateItemProperties(QListBoxItem*))); + connect(m_listbox, TQT_SIGNAL(currentChanged(TQListBoxItem*)), this, TQT_SLOT(updateItemProperties(TQListBoxItem*))); //// Init dialog and display it //////////////////////// - setInitialSize(QSize(500, 300), true); + setInitialSize(TQSize(500, 300), true); } int -EditListViewDialog::exec(QListView *listview) +EditListViewDialog::exec(TQListView *listview) { if(!listview) { @@ -176,7 +176,7 @@ EditListViewDialog::exec(QListView *listview) m_listview->header()->setStretchEnabled(listview->header()->isStretchEnabled(i), i); m_listview->setRenameable(i, true); } - QListViewItem *item = listview->firstChild(); + TQListViewItem *item = listview->firstChild(); while(item) { loadChildNodes(m_listview, item, 0); item = item->nextSibling(); @@ -192,7 +192,7 @@ EditListViewDialog::exec(QListView *listview) // and we exec the dialog int r = KDialogBase::exec(); - if(r == QDialog::Accepted) + if(r == TQDialog::Accepted) { listview->clear(); // We copy the contents of our listview back in the listview @@ -210,7 +210,7 @@ EditListViewDialog::exec(QListView *listview) listview->header()->setStretchEnabled(m_listview->header()->isStretchEnabled(i), i); } - QListViewItem *item = m_listview->firstChild(); + TQListViewItem *item = m_listview->firstChild(); while(item) { loadChildNodes(listview, item, 0); @@ -227,8 +227,8 @@ EditListViewDialog::changeProperty(KoProperty::Set& set, KoProperty::Property& p if(&set != m_propSet) return; - QString name = property.name(); - QVariant value = property.value(); + TQString name = property.name(); + TQVariant value = property.value(); if(name == "caption") { m_propSet->blockSignals(true); // we need to block signals because changeItem will modify selection, and call updateItemProperties m_listbox->changeItem(value.toString(), m_listbox->currentItem()); @@ -246,7 +246,7 @@ EditListViewDialog::changeProperty(KoProperty::Set& set, KoProperty::Property& p } void -EditListViewDialog::updateItemProperties(QListBoxItem *item) +EditListViewDialog::updateItemProperties(TQListBoxItem *item) { if(!item) return; @@ -256,9 +256,9 @@ EditListViewDialog::updateItemProperties(QListBoxItem *item) m_propSet->blockSignals(true); // we don't want changeProperty to be called (*m_propSet)["caption"].setValue(m_listview->columnText(id), false); (*m_propSet)["width"].setValue(m_listview->columnWidth(id), false); - (*m_propSet)["clickable"].setValue(QVariant(m_listview->header()->isClickEnabled(id), 4), false); - (*m_propSet)["resizable"].setValue(QVariant(m_listview->header()->isResizeEnabled(id), 4), false); - (*m_propSet)["fullwidth"].setValue(QVariant(m_listview->header()->isStretchEnabled(id), 4), false); + (*m_propSet)["clickable"].setValue(TQVariant(m_listview->header()->isClickEnabled(id), 4), false); + (*m_propSet)["resizable"].setValue(TQVariant(m_listview->header()->isResizeEnabled(id), 4), false); + (*m_propSet)["fullwidth"].setValue(TQVariant(m_listview->header()->isStretchEnabled(id), 4), false); m_propSet->blockSignals(false); m_editor->changeSet(m_propSet); } @@ -296,7 +296,7 @@ void EditListViewDialog::MoveItemUp() { int current = m_listbox->currentItem(); - QString text = m_listbox->text(current); + TQString text = m_listbox->text(current); m_listbox->blockSignals(true); m_listbox->changeItem(m_listbox->text(current - 1), current); @@ -321,7 +321,7 @@ void EditListViewDialog::MoveItemDown() { int current = m_listbox->currentItem(); - QString text = m_listbox->text(current); + TQString text = m_listbox->text(current); m_listbox->blockSignals(true); m_listbox->changeItem(m_listbox->text(current+1), current); @@ -345,7 +345,7 @@ EditListViewDialog::MoveItemDown() /// Contents page slots //////// void -EditListViewDialog::updateButtons(QListViewItem *item) +EditListViewDialog::updateButtons(TQListViewItem *item) { if(!item) { @@ -356,33 +356,33 @@ EditListViewDialog::updateButtons(QListViewItem *item) m_buttons[BNewChild]->setEnabled(true); m_buttons[BRemRow]->setEnabled(true); - m_buttons[BRowUp]->setEnabled( (item->itemAbove() && (item->itemAbove()->parent() == item->parent())) ); + m_buttons[BRowUp]->setEnabled( (item->itemAbove() && (item->itemAbove()->tqparent() == item->tqparent())) ); m_buttons[BRowDown]->setEnabled(item->nextSibling()); } void -EditListViewDialog::loadChildNodes(QListView *listview, QListViewItem *item, QListViewItem *parent) +EditListViewDialog::loadChildNodes(TQListView *listview, TQListViewItem *item, TQListViewItem *tqparent) { - QListViewItem *newItem; + TQListViewItem *newItem; if(listview->inherits("KListView")) { - if(parent) - newItem = new KListViewItem(parent); + if(tqparent) + newItem = new KListViewItem(tqparent); else newItem = new KListViewItem(listview); } else { - if(parent) - newItem = new QListViewItem(parent); + if(tqparent) + newItem = new TQListViewItem(tqparent); else - newItem = new QListViewItem(listview); + newItem = new TQListViewItem(listview); } // We need to move the item at the end, which is the expected behaviour (by default it is inserted at the beginning) - QListViewItem *last; - if(parent) - last = parent->firstChild(); + TQListViewItem *last; + if(tqparent) + last = tqparent->firstChild(); else last = listview->firstChild(); @@ -394,7 +394,7 @@ EditListViewDialog::loadChildNodes(QListView *listview, QListViewItem *item, QLi for(int i = 0; i < listview->columns(); i++) newItem->setText(i, item->text(i)); - QListViewItem *child = item->firstChild(); + TQListViewItem *child = item->firstChild(); if(child) newItem->setOpen(true); while(child) { @@ -406,12 +406,12 @@ EditListViewDialog::loadChildNodes(QListView *listview, QListViewItem *item, QLi void EditListViewDialog::newRow() { - KListViewItem *parent = (KListViewItem*)m_listview->selectedItem(); - if(parent) - parent = (KListViewItem*)parent->parent(); + KListViewItem *tqparent = (KListViewItem*)m_listview->selectedItem(); + if(tqparent) + tqparent = (KListViewItem*)tqparent->tqparent(); KListViewItem *item; - if(parent) - item = new KListViewItem(parent, m_listview->selectedItem()); + if(tqparent) + item = new KListViewItem(tqparent, m_listview->selectedItem()); else item = new KListViewItem(m_listview, m_listview->selectedItem()); item->setText(0, i18n("New Item")); @@ -421,16 +421,16 @@ EditListViewDialog::newRow() void EditListViewDialog::newChildRow() { - KListViewItem *parent = (KListViewItem*)m_listview->currentItem(); + KListViewItem *tqparent = (KListViewItem*)m_listview->currentItem(); KListViewItem *item; - if(parent) - item = new KListViewItem(parent); + if(tqparent) + item = new KListViewItem(tqparent); else item = new KListViewItem(m_listview, m_listview->currentItem()); item->setText(0, i18n("Sub Item")); m_listview->setCurrentItem(item); - parent->setOpen(true); + tqparent->setOpen(true); } void @@ -442,7 +442,7 @@ EditListViewDialog::removeRow() void EditListViewDialog::MoveRowUp() { - QListViewItem *item = m_listview->currentItem()->itemAbove(); + TQListViewItem *item = m_listview->currentItem()->itemAbove(); item->moveItem(m_listview->currentItem()); updateButtons(m_listview->currentItem()); } @@ -450,7 +450,7 @@ EditListViewDialog::MoveRowUp() void EditListViewDialog::MoveRowDown() { - QListViewItem *before = m_listview->currentItem(); + TQListViewItem *before = m_listview->currentItem(); before->moveItem(before->nextSibling()); updateButtons(before); } diff --git a/kexi/formeditor/editlistviewdialog.h b/kexi/formeditor/editlistviewdialog.h index 09de4429..be2ae106 100644 --- a/kexi/formeditor/editlistviewdialog.h +++ b/kexi/formeditor/editlistviewdialog.h @@ -20,17 +20,17 @@ #ifndef EDITLISTVIEW_DIALOG_H #define EDITLISTVIEW_DIALOG_H -#include <qintdict.h> -#include <qtoolbutton.h> +#include <tqintdict.h> +#include <tqtoolbutton.h> #include <kdialogbase.h> -class QFrame; -class QListView; -class QListViewItem; +class TQFrame; +class TQListView; +class TQListViewItem; class KListViewItem; class KListView; class KListBox; -class QListBoxItem; +class TQListBoxItem; namespace KoProperty { class Property; @@ -40,25 +40,26 @@ namespace KoProperty { namespace KFormDesigner { -//! A dialog to edit the contents of a listvuew (KListView or QListView) +//! A dialog to edit the contents of a listvuew (KListView or TQListView) /*! The dialog contains two pages, one to edit columns and one to edit ist items. KoProperty::Editor is used in columns to edit column properties - (there are two properties not supported by Qt Designer: 'width' and 'resizable'). + (there are two properties not supported by TQt Designer: 'width' and 'resizable'). The user can enter list contents inside the list using KListViewItem::setRenameable(). Pixmaps are not yet supported. */ class KFORMEDITOR_EXPORT EditListViewDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - EditListViewDialog(QWidget *parent); + EditListViewDialog(TQWidget *tqparent); ~EditListViewDialog() {} - int exec(QListView *listview); + int exec(TQListView *listview); public slots: // Columns page - void updateItemProperties(QListBoxItem*); + void updateItemProperties(TQListBoxItem*); void newItem(); void removeItem(); void MoveItemUp(); @@ -66,7 +67,7 @@ class KFORMEDITOR_EXPORT EditListViewDialog : public KDialogBase void changeProperty(KoProperty::Set& set, KoProperty::Property& property); // Contents page - void updateButtons(QListViewItem*); + void updateButtons(TQListViewItem*); void newRow(); void newChildRow(); void removeRow(); @@ -74,18 +75,18 @@ class KFORMEDITOR_EXPORT EditListViewDialog : public KDialogBase void MoveRowDown(); protected: - /*! Loads all child items of \a item into \a listview (may be different from the \a items 's listview) as child of \a parent item. + /*! Loads all child items of \a item into \a listview (may be different from the \a items 's listview) as child of \a tqparent item. This is used to copy the contents of a listview into another listview. */ - void loadChildNodes(QListView *listview, QListViewItem *item, QListViewItem *parent); + void loadChildNodes(TQListView *listview, TQListViewItem *item, TQListViewItem *tqparent); protected: enum { BNewRow = 10, BNewChild, BRemRow, BRowUp, BRowDown , BColAdd = 20, BColRem, BColUp, BColDown }; KoProperty::Editor *m_editor; KoProperty::Set *m_propSet; - QFrame *m_contents, *m_column; + TQFrame *m_contents, *m_column; KListBox *m_listbox; KListView *m_listview; - QIntDict<QToolButton> m_buttons; + TQIntDict<TQToolButton> m_buttons; }; } diff --git a/kexi/formeditor/events.cpp b/kexi/formeditor/events.cpp index e96b9f4f..d7d62358 100644 --- a/kexi/formeditor/events.cpp +++ b/kexi/formeditor/events.cpp @@ -17,15 +17,15 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> +#include <tqdom.h> #include <kdebug.h> #include "events.h" namespace KFormDesigner { -Connection::Connection(const QString &sender, const QString &signal, - const QString &receiver, const QString &slot) +Connection::Connection(const TQString &sender, const TQString &signal, + const TQString &receiver, const TQString &slot) { m_sender = sender; m_signal = signal; @@ -41,7 +41,7 @@ ConnectionBuffer::ConnectionBuffer() } void -ConnectionBuffer::fixName(const QString &oldName, const QString &newName) +ConnectionBuffer::fixName(const TQString &oldName, const TQString &newName) { for(Connection *c = first(); c; c = next()) { @@ -53,7 +53,7 @@ ConnectionBuffer::fixName(const QString &oldName, const QString &newName) } ConnectionBuffer* -ConnectionBuffer::allConnectionsForWidget(const QString &widget) +ConnectionBuffer::allConnectionsForWidget(const TQString &widget) { ConnectionBuffer *list = new ConnectionBuffer(); list->setAutoDelete(false); // or it will delete all our connections @@ -67,59 +67,59 @@ ConnectionBuffer::allConnectionsForWidget(const QString &widget) } void -ConnectionBuffer::save(QDomNode &parentNode) +ConnectionBuffer::save(TQDomNode &tqparentNode) { if(isEmpty()) return; - QDomDocument domDoc = parentNode.ownerDocument(); - QDomElement connections; - if(!parentNode.namedItem("connections").isNull()) - connections = parentNode.namedItem("connections").toElement(); + TQDomDocument domDoc = tqparentNode.ownerDocument(); + TQDomElement connections; + if(!tqparentNode.namedItem("connections").isNull()) + connections = tqparentNode.namedItem("connections").toElement(); else connections = domDoc.createElement("connections"); - parentNode.appendChild(connections); + tqparentNode.appendChild(connections); for(Connection *c = first(); c; c = next()) { - QDomElement connection = domDoc.createElement("connection"); + TQDomElement connection = domDoc.createElement("connection"); connection.setAttribute("language", "C++"); connections.appendChild(connection); - QDomElement sender = domDoc.createElement("sender"); + TQDomElement sender = domDoc.createElement("sender"); connection.appendChild(sender); - QDomText senderText = domDoc.createTextNode(c->sender()); + TQDomText senderText = domDoc.createTextNode(c->sender()); sender.appendChild(senderText); - QDomElement signal = domDoc.createElement("signal"); + TQDomElement signal = domDoc.createElement("signal"); connection.appendChild(signal); - QDomText signalText = domDoc.createTextNode(c->signal()); + TQDomText signalText = domDoc.createTextNode(c->signal()); signal.appendChild(signalText); - QDomElement receiver = domDoc.createElement("receiver"); + TQDomElement receiver = domDoc.createElement("receiver"); connection.appendChild(receiver); - QDomText receiverText = domDoc.createTextNode(c->receiver()); + TQDomText receiverText = domDoc.createTextNode(c->receiver()); receiver.appendChild(receiverText); - QDomElement slot = domDoc.createElement("slot"); + TQDomElement slot = domDoc.createElement("slot"); connection.appendChild(slot); - QDomText slotText = domDoc.createTextNode(c->slot()); + TQDomText slotText = domDoc.createTextNode(c->slot()); slot.appendChild(slotText); } } void -ConnectionBuffer::saveAllConnectionsForWidget(const QString &widget, QDomNode parentNode) +ConnectionBuffer::saveAllConnectionsForWidget(const TQString &widget, TQDomNode tqparentNode) { ConnectionBuffer *buff = allConnectionsForWidget(widget); - buff->save(parentNode); + buff->save(tqparentNode); delete buff; } void -ConnectionBuffer::load(QDomNode node) +ConnectionBuffer::load(TQDomNode node) { - for(QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { Connection *conn = new Connection(); conn->setSender(n.namedItem("sender").toElement().text()); @@ -131,7 +131,7 @@ ConnectionBuffer::load(QDomNode node) } void -ConnectionBuffer::removeAllConnectionsForWidget(const QString &widget) +ConnectionBuffer::removeAllConnectionsForWidget(const TQString &widget) { for(Connection *c = first(); c; c = next()) { diff --git a/kexi/formeditor/events.h b/kexi/formeditor/events.h index c9e1b2cd..727b3a43 100644 --- a/kexi/formeditor/events.h +++ b/kexi/formeditor/events.h @@ -20,39 +20,39 @@ #ifndef KFORMDESIGNEREVENTS_H #define KFORMDESIGNEREVENTS_H -#include <qptrlist.h> -#include <qstring.h> +#include <tqptrlist.h> +#include <tqstring.h> -class QDomNode; +class TQDomNode; namespace KFormDesigner { class KFORMEDITOR_EXPORT Connection { public: - Connection(const QString &sender, const QString &signal, - const QString &receiver, const QString &slot); + Connection(const TQString &sender, const TQString &signal, + const TQString &receiver, const TQString &slot); Connection() {;} ~Connection() {;} - QString sender() const { return m_sender; } - QString receiver() const { return m_receiver; } - QString signal() const { return m_signal; } - QString slot() const { return m_slot; } + TQString sender() const { return m_sender; } + TQString receiver() const { return m_receiver; } + TQString signal() const { return m_signal; } + TQString slot() const { return m_slot; } - void setSender(const QString &v) { m_sender = v; } - void setReceiver(const QString &v) { m_receiver = v; } - void setSignal(const QString &v) { m_signal = v; } - void setSlot(const QString &v) { m_slot = v; } + void setSender(const TQString &v) { m_sender = v; } + void setReceiver(const TQString &v) { m_receiver = v; } + void setSignal(const TQString &v) { m_signal = v; } + void setSlot(const TQString &v) { m_slot = v; } protected: - QString m_sender; - QString m_signal; - QString m_receiver; - QString m_slot; + TQString m_sender; + TQString m_signal; + TQString m_receiver; + TQString m_slot; }; -typedef QPtrList<Connection> ConnectionList; +typedef TQPtrList<Connection> ConnectionList; class KFORMEDITOR_EXPORT ConnectionBuffer : public ConnectionList { @@ -60,16 +60,16 @@ class KFORMEDITOR_EXPORT ConnectionBuffer : public ConnectionList ConnectionBuffer(); ~ConnectionBuffer() {;} - void save(QDomNode &parentNode); - void load(QDomNode parentNode); + void save(TQDomNode &tqparentNode); + void load(TQDomNode tqparentNode); /*! This function is called when a widget is renamed from \a oldname to \a newname. All the Connections for this widget are updated. */ - void fixName(const QString &oldname, const QString &newName); + void fixName(const TQString &oldname, const TQString &newName); - ConnectionBuffer* allConnectionsForWidget(const QString &widget); - void saveAllConnectionsForWidget(const QString &widget, QDomNode parentNode); - void removeAllConnectionsForWidget(const QString &widget); + ConnectionBuffer* allConnectionsForWidget(const TQString &widget); + void saveAllConnectionsForWidget(const TQString &widget, TQDomNode tqparentNode); + void removeAllConnectionsForWidget(const TQString &widget); }; } diff --git a/kexi/formeditor/factories/containerfactory.cpp b/kexi/formeditor/factories/containerfactory.cpp index d098c290..ada3f994 100644 --- a/kexi/formeditor/factories/containerfactory.cpp +++ b/kexi/formeditor/factories/containerfactory.cpp @@ -19,24 +19,24 @@ * Boston, MA 02110-1301, USA. */ -#include <qwidgetstack.h> -#include <qframe.h> -#include <qbuttongroup.h> -#include <qwidget.h> -#include <qhbox.h> -#include <qvbox.h> -#include <qstring.h> -#include <qpopupmenu.h> -#include <qdom.h> -#include <qevent.h> -#include <qobjectlist.h> -#include <qpainter.h> -#include <qvaluevector.h> -#include <qfileinfo.h> -#include <qscrollview.h> -#include <qtabbar.h> -#include <qsplitter.h> -#include <qlayout.h> +#include <tqwidgetstack.h> +#include <tqframe.h> +#include <tqbuttongroup.h> +#include <tqwidget.h> +#include <tqhbox.h> +#include <tqvbox.h> +#include <tqstring.h> +#include <tqpopupmenu.h> +#include <tqdom.h> +#include <tqevent.h> +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqvaluevector.h> +#include <tqfileinfo.h> +#include <tqscrollview.h> +#include <tqtabbar.h> +#include <tqsplitter.h> +#include <tqlayout.h> #include <kiconloader.h> #include <kgenericfactory.h> @@ -57,15 +57,15 @@ #include <formeditor/utils.h> #if KDE_VERSION < KDE_MAKE_VERSION(3,1,9) -# define KInputDialog QInputDialog -# include <qinputdialog.h> -# include <qlineedit.h> +# define KInputDialog TQInputDialog +# include <tqinputdialog.h> +# include <tqlineedit.h> #else # include <kinputdialog.h> #endif -ContainerWidget::ContainerWidget(QWidget *parent, const char *name) - : QWidget(parent, name) +ContainerWidget::ContainerWidget(TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name) { } @@ -73,27 +73,27 @@ ContainerWidget::~ContainerWidget() { } -QSize ContainerWidget::sizeHint() const +TQSize ContainerWidget::tqsizeHint() const { - return QSize(30,30); //default + return TQSize(30,30); //default } -void ContainerWidget::dragMoveEvent( QDragMoveEvent *e ) +void ContainerWidget::dragMoveEvent( TQDragMoveEvent *e ) { - QWidget::dragMoveEvent(e); + TQWidget::dragMoveEvent(e); emit handleDragMoveEvent(e); } -void ContainerWidget::dropEvent( QDropEvent *e ) +void ContainerWidget::dropEvent( TQDropEvent *e ) { - QWidget::dropEvent(e); + TQWidget::dropEvent(e); emit handleDropEvent(e); } //////////////////////// -GroupBox::GroupBox(const QString & title, QWidget *parent, const char *name) - : QGroupBox(title, parent, name) +GroupBox::GroupBox(const TQString & title, TQWidget *tqparent, const char *name) + : TQGroupBox(title, tqparent, name) { } @@ -101,22 +101,22 @@ GroupBox::~GroupBox() { } -void GroupBox::dragMoveEvent( QDragMoveEvent *e ) +void GroupBox::dragMoveEvent( TQDragMoveEvent *e ) { - QGroupBox::dragMoveEvent(e); + TQGroupBox::dragMoveEvent(e); emit handleDragMoveEvent(e); } -void GroupBox::dropEvent( QDropEvent *e ) +void GroupBox::dropEvent( TQDropEvent *e ) { - QGroupBox::dropEvent(e); + TQGroupBox::dropEvent(e); emit handleDropEvent(e); } //////////////////////// -KFDTabWidget::KFDTabWidget(QWidget *parent, const char *name) - : KFormDesigner::TabWidget(parent, name) +KFDTabWidget::KFDTabWidget(TQWidget *tqparent, const char *name) + : KFormDesigner::TabWidget(tqparent, name) { } @@ -124,17 +124,17 @@ KFDTabWidget::~KFDTabWidget() { } -QSize -KFDTabWidget::sizeHint() const +TQSize +KFDTabWidget::tqsizeHint() const { - QSize s(30,30); // default min size + TQSize s(30,30); // default min size for(int i=0; i < count(); i++) s = s.expandedTo( KFormDesigner::getSizeFromChildren(page(i)) ); - return s + QSize(10/*margin*/, tabBar()->height() + 20/*margin*/); + return s + TQSize(10/*margin*/, tabBar()->height() + 20/*margin*/); } -void KFDTabWidget::dragMoveEvent( QDragMoveEvent *e ) +void KFDTabWidget::dragMoveEvent( TQDragMoveEvent *e ) { TabWidgetBase::dragMoveEvent( e ); if (dynamic_cast<ContainerWidget*>(currentPage())) @@ -142,7 +142,7 @@ void KFDTabWidget::dragMoveEvent( QDragMoveEvent *e ) emit handleDragMoveEvent(e); } -void KFDTabWidget::dropEvent( QDropEvent *e ) +void KFDTabWidget::dropEvent( TQDropEvent *e ) { TabWidgetBase::dropEvent( e ); if (dynamic_cast<ContainerWidget*>(currentPage())) @@ -150,90 +150,90 @@ void KFDTabWidget::dropEvent( QDropEvent *e ) emit handleDropEvent(e); } -/// Various layout widgets /////////////////: +/// Various tqlayout widgets /////////////////: -HBox::HBox(QWidget *parent, const char *name) - : QFrame(parent, name), m_preview(false) +HBox::HBox(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), m_preview(false) {} void -HBox::paintEvent(QPaintEvent *) +HBox::paintEvent(TQPaintEvent *) { if(m_preview) return; - QPainter p(this); - p.setPen(QPen(red, 2, Qt::DashLine)); + TQPainter p(this); + p.setPen(TQPen(red, 2, TQt::DashLine)); p.drawRect(1, 1, width()-1, height() - 1); } -VBox::VBox(QWidget *parent, const char *name) - : QFrame(parent, name), m_preview(false) +VBox::VBox(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), m_preview(false) {} void -VBox::paintEvent(QPaintEvent *) +VBox::paintEvent(TQPaintEvent *) { if(m_preview) return; - QPainter p(this); - p.setPen(QPen(blue, 2, Qt::DashLine)); + TQPainter p(this); + p.setPen(TQPen(blue, 2, TQt::DashLine)); p.drawRect(1, 1, width()-1, height() - 1); } -Grid::Grid(QWidget *parent, const char *name) - : QFrame(parent, name), m_preview(false) +Grid::Grid(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), m_preview(false) {} void -Grid::paintEvent(QPaintEvent *) +Grid::paintEvent(TQPaintEvent *) { if(m_preview) return; - QPainter p(this); - p.setPen(QPen(darkGreen, 2, Qt::DashLine)); + TQPainter p(this); + p.setPen(TQPen(darkGreen, 2, TQt::DashLine)); p.drawRect(1, 1, width()-1, height() - 1); } -HFlow::HFlow(QWidget *parent, const char *name) - : QFrame(parent, name), m_preview(false) +HFlow::HFlow(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), m_preview(false) {} void -HFlow::paintEvent(QPaintEvent *) +HFlow::paintEvent(TQPaintEvent *) { if(m_preview) return; - QPainter p(this); - p.setPen(QPen(magenta, 2, Qt::DashLine)); + TQPainter p(this); + p.setPen(TQPen(magenta, 2, TQt::DashLine)); p.drawRect(1, 1, width()-1, height() - 1); } -VFlow::VFlow(QWidget *parent, const char *name) - : QFrame(parent, name), m_preview(false) +VFlow::VFlow(TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name), m_preview(false) {} void -VFlow::paintEvent(QPaintEvent *) +VFlow::paintEvent(TQPaintEvent *) { if(m_preview) return; - QPainter p(this); - p.setPen(QPen(cyan, 2, Qt::DashLine)); + TQPainter p(this); + p.setPen(TQPen(cyan, 2, TQt::DashLine)); p.drawRect(1, 1, width()-1, height() - 1); } -QSize -VFlow::sizeHint() const +TQSize +VFlow::tqsizeHint() const { - if(layout()) - return layout()->sizeHint(); + if(tqlayout()) + return tqlayout()->tqsizeHint(); else - return QSize(700, 50); // default + return TQSize(700, 50); // default } /////// Tab related KCommand (to allow tab creation/deletion undoing) -InsertPageCommand::InsertPageCommand(KFormDesigner::Container *container, QWidget *parent) +InsertPageCommand::InsertPageCommand(KFormDesigner::Container *container, TQWidget *tqparent) : KCommand() { m_containername = container->widget()->name(); m_form = container->form(); - m_parentname = parent->name(); + m_parentname = tqparent->name(); m_pageid = -1; } @@ -241,31 +241,31 @@ void InsertPageCommand::execute() { KFormDesigner::Container *container = m_form->objectTree()->lookup(m_containername)->container(); - QWidget *parent = m_form->objectTree()->lookup(m_parentname)->widget(); + TQWidget *tqparent = m_form->objectTree()->lookup(m_parentname)->widget(); if(m_name.isEmpty()) { m_name = container->form()->objectTree()->generateUniqueName( - container->form()->library()->displayName("QWidget").latin1(), + container->form()->library()->displayName(TQWIDGET_OBJECT_NAME_STRING).latin1(), /*!numberSuffixRequired*/false); } - QWidget *page = container->form()->library()->createWidget("QWidget", parent, m_name.latin1(), container); -// QWidget *page = new ContainerWidget(parent, m_name.latin1()); -// new KFormDesigner::Container(container, page, parent); + TQWidget *page = container->form()->library()->createWidget(TQWIDGET_OBJECT_NAME_STRING, tqparent, m_name.latin1(), container); +// TQWidget *page = new ContainerWidget(tqparent, m_name.latin1()); +// new KFormDesigner::Container(container, page, tqparent); - QCString classname = parent->className(); + TQCString classname = tqparent->className(); if(classname == "KFDTabWidget") { - TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(parent); - QString n = i18n("Page %1").arg(tab->count() + 1); + TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(tqparent); + TQString n = i18n("Page %1").tqarg(tab->count() + 1); tab->addTab(page, n); tab->showPage(page); KFormDesigner::ObjectTreeItem *item = container->form()->objectTree()->lookup(m_name); item->addModifiedProperty("title", n); } - else if(classname == "QWidgetStack") + else if(classname == TQWIDGETSTACK_OBJECT_NAME_STRING) { - QWidgetStack *stack = (QWidgetStack*)parent; + TQWidgetStack *stack = (TQWidgetStack*)tqparent; stack->addWidget(page, m_pageid); stack->raiseWidget(page); m_pageid = stack->id(page); @@ -278,22 +278,22 @@ InsertPageCommand::execute() void InsertPageCommand::unexecute() { - QWidget *page = m_form->objectTree()->lookup(m_name)->widget(); - QWidget *parent = m_form->objectTree()->lookup(m_parentname)->widget(); + TQWidget *page = m_form->objectTree()->lookup(m_name)->widget(); + TQWidget *tqparent = m_form->objectTree()->lookup(m_parentname)->widget(); KFormDesigner::WidgetList list; list.append(page); KCommand *com = new KFormDesigner::DeleteWidgetCommand(list, m_form); - QCString classname = parent->className(); + TQCString classname = tqparent->className(); if(classname == "KFDTabWidget") { - TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(parent); + TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(tqparent); tab->removePage(page); } - else if(classname == "QWidgetStack") + else if(classname == TQWIDGETSTACK_OBJECT_NAME_STRING) { - QWidgetStack *stack = (QWidgetStack*)parent; + TQWidgetStack *stack = (TQWidgetStack*)tqparent; int id = stack->id(page) - 1; while(!stack->widget(id)) id--; @@ -306,7 +306,7 @@ InsertPageCommand::unexecute() delete com; } -QString +TQString InsertPageCommand::name() const { return i18n("Add Page"); @@ -314,20 +314,20 @@ InsertPageCommand::name() const /////// Sub forms ////////////////////////: -SubForm::SubForm(QWidget *parent, const char *name) -: QScrollView(parent, name), m_form(0), m_widget(0) +SubForm::SubForm(TQWidget *tqparent, const char *name) +: TQScrollView(tqparent, name), m_form(0), m_widget(0) { - setFrameStyle(QFrame::WinPanel | QFrame::Sunken); - viewport()->setPaletteBackgroundColor(colorGroup().mid()); + setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); + viewport()->setPaletteBackgroundColor(tqcolorGroup().mid()); } void -SubForm::setFormName(const QString &name) +SubForm::setFormName(const TQString &name) { if(name.isEmpty()) return; - QFileInfo info(name); + TQFileInfo info(name); if(!info.exists() || (KFormDesigner::FormManager::self()->activeForm() && (info.fileName() == KFormDesigner::FormManager::self()->activeForm()->filename()) ) ) @@ -335,7 +335,7 @@ SubForm::setFormName(const QString &name) // we create the container widget delete m_widget; - m_widget = new QWidget(viewport(), "subform_widget"); + m_widget = new TQWidget(viewport(), "subform_widget"); // m_widget->show(); addChild(m_widget); m_form = new KFormDesigner::Form( @@ -352,12 +352,12 @@ SubForm::setFormName(const QString &name) ///// The factory ///////////////////////// -ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringList &) - : KFormDesigner::WidgetFactory(parent, "containers") +ContainerFactory::ContainerFactory(TQObject *tqparent, const char *, const TQStringList &) + : KFormDesigner::WidgetFactory(tqparent, "containers") { KFormDesigner::WidgetInfo *wBtnGroup = new KFormDesigner::WidgetInfo(this); wBtnGroup->setPixmap("frame"); - wBtnGroup->setClassName("QButtonGroup"); + wBtnGroup->setClassName(TQBUTTONGROUP_OBJECT_NAME_STRING); wBtnGroup->setName(i18n("Button Group")); wBtnGroup->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "buttonGroup")); @@ -369,11 +369,11 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL wTabWidget->setClassName("KFDTabWidget"); #if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) wTabWidget->addAlternateClassName("KTabWidget"); - wTabWidget->addAlternateClassName("QTabWidget"); -//tmp: wTabWidget->setSavingName("QTabWidget"); + wTabWidget->addAlternateClassName(TQTABWIDGET_OBJECT_NAME_STRING); +//tmp: wTabWidget->setSavingName(TQTABWIDGET_OBJECT_NAME_STRING); wTabWidget->setSavingName("KTabWidget"); #else - wTabWidget->setSavingName("QTabWidget"); + wTabWidget->setSavingName(TQTABWIDGET_OBJECT_NAME_STRING); #endif wTabWidget->setIncludeFileName("ktabwidget.h"); wTabWidget->setName(i18n("Tab Widget")); @@ -384,7 +384,7 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wWidget = new KFormDesigner::WidgetInfo(this); wWidget->setPixmap("frame"); - wWidget->setClassName("QWidget"); + wWidget->setClassName(TQWIDGET_OBJECT_NAME_STRING); wWidget->addAlternateClassName("ContainerWidget"); wWidget->setName(i18n("Basic container")); wWidget->setNamePrefix( @@ -394,7 +394,7 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wGroupBox = new KFormDesigner::WidgetInfo(this); wGroupBox->setPixmap("groupbox"); - wGroupBox->setClassName("QGroupBox"); + wGroupBox->setClassName(TQGROUPBOX_OBJECT_NAME_STRING); wGroupBox->addAlternateClassName("GroupBox"); wGroupBox->setName(i18n("Group Box")); wGroupBox->setNamePrefix( @@ -404,7 +404,7 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wFrame = new KFormDesigner::WidgetInfo(this); wFrame->setPixmap("frame"); - wFrame->setClassName("QFrame"); + wFrame->setClassName(TQFRAME_OBJECT_NAME_STRING); wFrame->setName(i18n("Frame")); wFrame->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "frame")); @@ -413,7 +413,7 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wWidgetStack = new KFormDesigner::WidgetInfo(this); wWidgetStack->setPixmap("widgetstack"); - wWidgetStack->setClassName("QWidgetStack"); + wWidgetStack->setClassName(TQWIDGETSTACK_OBJECT_NAME_STRING); wWidgetStack->setName(i18n("Widget Stack")); wWidgetStack->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "widgetStack")); @@ -451,11 +451,11 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL //! @todo horizontal/vertical splitter icons wSplitter->setPixmap("frame"); wSplitter->setClassName("Splitter"); - wSplitter->addAlternateClassName("QSplitter"); + wSplitter->addAlternateClassName(TQSPLITTER_OBJECT_NAME_STRING); wSplitter->setName(i18n("Splitter")); wSplitter->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "splitter")); - wSplitter->setDescription(i18n("A container that enables user to resize its children")); + wSplitter->setDescription(i18n("A container that enables user to resize its tqchildren")); addClass(wSplitter); KFormDesigner::WidgetInfo *wHFlow = new KFormDesigner::WidgetInfo(this); @@ -504,14 +504,14 @@ ContainerFactory::ContainerFactory(QObject *parent, const char *, const QStringL m_propValDesc["Triangular"] = i18n("for Tab Shape", "Triangular"); } -QWidget* -ContainerFactory::createWidget(const QCString &c, QWidget *p, const char *n, +TQWidget* +ContainerFactory::createWidget(const TQCString &c, TQWidget *p, const char *n, KFormDesigner::Container *container, int options) { - if(c == "QButtonGroup") + if(c == TQBUTTONGROUP_OBJECT_NAME_STRING) { - QString text = container->form()->library()->textForWidgetName(n, c); - QButtonGroup *w = new QButtonGroup(/*i18n("Button Group")*/text, p, n); + TQString text = container->form()->library()->textForWidgetName(n, c); + TQButtonGroup *w = new TQButtonGroup(/*i18n("Button Group")*/text, p, n); new KFormDesigner::Container(container, w, container); return w; } @@ -520,7 +520,7 @@ ContainerFactory::createWidget(const QCString &c, QWidget *p, const char *n, KFDTabWidget *tab = new KFDTabWidget(p, n); #if defined(USE_KTabWidget) && KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) tab->setTabReorderingEnabled(true); - connect(tab, SIGNAL(movedTab(int,int)), this, SLOT(reorderTabs(int,int))); + connect(tab, TQT_SIGNAL(movedTab(int,int)), this, TQT_SLOT(reorderTabs(int,int))); #endif container->form()->objectTree()->addItem(container->objectTree(), new KFormDesigner::ObjectTreeItem( @@ -538,32 +538,32 @@ ContainerFactory::createWidget(const QCString &c, QWidget *p, const char *n, return tab; } - else if(c == "QWidget" || c=="ContainerWidget") + else if(c == TQWIDGET_OBJECT_NAME_STRING || c=="ContainerWidget") { - QWidget *w = new ContainerWidget(p, n); - new KFormDesigner::Container(container, w, p); + TQWidget *w = new ContainerWidget(p, n); + new KFormDesigner::Container(container, w, TQT_TQOBJECT(p)); return w; } - else if(c == "QGroupBox" || c == "GroupBox") + else if(c == TQGROUPBOX_OBJECT_NAME_STRING || c == "GroupBox") { - QString text = container->form()->library()->textForWidgetName(n, c); - QGroupBox *w = new GroupBox(text, p, n); + TQString text = container->form()->library()->textForWidgetName(n, c); + TQGroupBox *w = new GroupBox(text, p, n); new KFormDesigner::Container(container, w, container); return w; } - else if(c == "QFrame") + else if(c == TQFRAME_OBJECT_NAME_STRING) { - QFrame *w = new QFrame(p, n); + TQFrame *w = new TQFrame(p, n); w->setLineWidth(2); - w->setFrameStyle(QFrame::StyledPanel|QFrame::Raised); + w->setFrameStyle(TQFrame::StyledPanel|TQFrame::Raised); new KFormDesigner::Container(container, w, container); return w; } - else if(c == "QWidgetStack") + else if(c == TQWIDGETSTACK_OBJECT_NAME_STRING) { - QWidgetStack *stack = new QWidgetStack(p, n); + TQWidgetStack *stack = new TQWidgetStack(p, n); stack->setLineWidth(2); - stack->setFrameStyle(QFrame::StyledPanel|QFrame::Raised); + stack->setFrameStyle(TQFrame::StyledPanel|TQFrame::Raised); container->form()->objectTree()->addItem( container->objectTree(), new KFormDesigner::ObjectTreeItem( container->form()->library()->displayName(c), n, stack, container)); @@ -606,8 +606,8 @@ ContainerFactory::createWidget(const QCString &c, QWidget *p, const char *n, SubForm *subform = new SubForm(p, n); return subform; } - else if(c == "QSplitter") { - QSplitter *split = new QSplitter(p, n); + else if(c == TQSPLITTER_OBJECT_NAME_STRING) { + TQSplitter *split = new TQSplitter(p, n); if (0 == (options & WidgetFactory::AnyOrientation)) split->setOrientation( (options & WidgetFactory::VerticalOrientation) ? Qt::Vertical : Qt::Horizontal); @@ -619,14 +619,14 @@ ContainerFactory::createWidget(const QCString &c, QWidget *p, const char *n, } bool -ContainerFactory::previewWidget(const QCString &classname, QWidget *widget, KFormDesigner::Container *container) +ContainerFactory::previewWidget(const TQCString &classname, TQWidget *widget, KFormDesigner::Container *container) { if(classname == "WidgetStack") { - QWidgetStack *stack = ((QWidgetStack*)widget); + TQWidgetStack *stack = ((TQWidgetStack*)widget); KFormDesigner::ObjectTreeItem *tree = container->form()->objectTree()->lookup(widget->name()); - if(!tree->modifiedProperties()->contains("frameShape")) - stack->setFrameStyle(QFrame::NoFrame); + if(!tree->modifiedProperties()->tqcontains("frameShape")) + stack->setFrameStyle(TQFrame::NoFrame); } else if(classname == "HBox") ((HBox*)widget)->setPreviewMode(); @@ -644,53 +644,53 @@ ContainerFactory::previewWidget(const QCString &classname, QWidget *widget, KFor } bool -ContainerFactory::createMenuActions(const QCString &classname, QWidget *w, QPopupMenu *menu, +ContainerFactory::createMenuActions(const TQCString &classname, TQWidget *w, TQPopupMenu *menu, KFormDesigner::Container *container) { setWidget(w, container); //m_widget = w; // m_container = container; - if((classname == "KFDTabWidget") || (w->parentWidget()->parentWidget()->inherits("QTabWidget"))) + if((classname == "KFDTabWidget") || (w->tqparentWidget()->tqparentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))) { - if(w->parentWidget()->parentWidget()->inherits("QTabWidget")) + if(w->tqparentWidget()->tqparentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) { - //m_widget = w->parentWidget()->parentWidget(); - setWidget(w->parentWidget()->parentWidget(), m_container->toplevel()); + //m_widget = w->tqparentWidget()->tqparentWidget(); + setWidget(w->tqparentWidget()->tqparentWidget(), m_container->toplevel()); // m_container = m_container->toplevel(); } - int id = menu->insertItem(SmallIconSet("tab_new"), i18n("Add Page"), this, SLOT(addTabPage()) ); - id = menu->insertItem(SmallIconSet("edit"), i18n("Rename Page..."), this, SLOT(renameTabPage())); - id = menu->insertItem(SmallIconSet("tab_remove"), i18n("Remove Page"), this, SLOT(removeTabPage())); + int id = menu->insertItem(SmallIconSet("tab_new"), i18n("Add Page"), this, TQT_SLOT(addTabPage()) ); + id = menu->insertItem(SmallIconSet("edit"), i18n("Rename Page..."), this, TQT_SLOT(renameTabPage())); + id = menu->insertItem(SmallIconSet("tab_remove"), i18n("Remove Page"), this, TQT_SLOT(removeTabPage())); // if( dynamic_cast<TabWidgetBase*>(m_widget)->count() == 1) if( dynamic_cast<TabWidgetBase*>(widget())->count() == 1) menu->setItemEnabled(id, false); return true; } - else if(w->parentWidget()->isA("QWidgetStack") && !w->parentWidget()->parentWidget()->inherits("QTabWidget")) + else if(w->tqparentWidget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING) && !w->tqparentWidget()->tqparentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) { - //m_widget = w->parentWidget(); - QWidgetStack *stack = (QWidgetStack*)w->parentWidget(); //m_widget; + //m_widget = w->tqparentWidget(); + TQWidgetStack *stack = (TQWidgetStack*)w->tqparentWidget(); //m_widget; setWidget( - w->parentWidget(), - container->form()->objectTree()->lookup(stack->name())->parent()->container() + w->tqparentWidget(), + container->form()->objectTree()->lookup(stack->name())->tqparent()->container() ); -// m_container = container->form()->objectTree()->lookup(m_widget->name())->parent()->container(); -// m_container = container->form()->objectTree()->lookup(stack->name())->parent()->container(); +// m_container = container->form()->objectTree()->lookup(m_widget->name())->tqparent()->container(); +// m_container = container->form()->objectTree()->lookup(stack->name())->tqparent()->container(); - int id = menu->insertItem(SmallIconSet("tab_new"), i18n("Add Page"), this, SLOT(addStackPage()) ); + int id = menu->insertItem(SmallIconSet("tab_new"), i18n("Add Page"), this, TQT_SLOT(addStackPage()) ); - id = menu->insertItem(SmallIconSet("tab_remove"), i18n("Remove Page"), this, SLOT(removeStackPage()) ); -// if( ((QWidgetStack*)m_widget)->children()->count() == 4) // == the stack has only one page - if(stack->children()->count() == 4) // == the stack has only one page + id = menu->insertItem(SmallIconSet("tab_remove"), i18n("Remove Page"), this, TQT_SLOT(removeStackPage()) ); +// if( ((TQWidgetStack*)m_widget)->tqchildren()->count() == 4) // == the stack has only one page + if(stack->childrenListObject().count() == 4) // == the stack has only one page menu->setItemEnabled(id, false); - id = menu->insertItem(SmallIconSet("next"), i18n("Jump to Next Page"), this, SLOT(nextStackPage())); + id = menu->insertItem(SmallIconSet("next"), i18n("Jump to Next Page"), this, TQT_SLOT(nextStackPage())); if(!stack->widget(stack->id(stack->visibleWidget())+1)) menu->setItemEnabled(id, false); - id = menu->insertItem(SmallIconSet("previous"), i18n("Jump to Previous Page"), this, SLOT(prevStackPage())); + id = menu->insertItem(SmallIconSet("previous"), i18n("Jump to Previous Page"), this, TQT_SLOT(prevStackPage())); if(!stack->widget(stack->id(stack->visibleWidget()) -1) ) menu->setItemEnabled(id, false); return true; @@ -699,38 +699,38 @@ ContainerFactory::createMenuActions(const QCString &classname, QWidget *w, QPopu } bool -ContainerFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner::Container *container) +ContainerFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container) { m_container = container; - if(classname == "QButtonGroup") + if(classname == TQBUTTONGROUP_OBJECT_NAME_STRING) { - QButtonGroup *group = static_cast<QButtonGroup*>(w); - QRect r = QRect(group->x()+2, group->y()-5, group->width()-10, w->fontMetrics().height() + 10); - createEditor(classname, group->title(), group, container, r, Qt::AlignAuto); + TQButtonGroup *group = static_cast<TQButtonGroup*>(w); + TQRect r = TQRect(group->x()+2, group->y()-5, group->width()-10, w->fontMetrics().height() + 10); + createEditor(classname, group->title(), group, container, r, TQt::AlignAuto); return true; } - if(classname == "QGroupBox" || classname == "GroupBox") + if(classname == TQGROUPBOX_OBJECT_NAME_STRING || classname == "GroupBox") { - QGroupBox *group = static_cast<QGroupBox*>(w); - QRect r = QRect(group->x()+2, group->y()-5, group->width()-10, w->fontMetrics().height() + 10); - createEditor(classname, group->title(), group, container, r, Qt::AlignAuto); + TQGroupBox *group = static_cast<TQGroupBox*>(w); + TQRect r = TQRect(group->x()+2, group->y()-5, group->width()-10, w->fontMetrics().height() + 10); + createEditor(classname, group->title(), group, container, r, TQt::AlignAuto); return true; } return false; } bool -ContainerFactory::saveSpecialProperty(const QCString &, const QString &name, const QVariant &, QWidget *w, QDomElement &parentNode, QDomDocument &parent) +ContainerFactory::saveSpecialProperty(const TQCString &, const TQString &name, const TQVariant &, TQWidget *w, TQDomElement &tqparentNode, TQDomDocument &tqparent) { - if((name == "title") && (w->parentWidget()->parentWidget()->inherits("QTabWidget"))) + if((name == "title") && (w->tqparentWidget()->tqparentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))) { - TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(w->parentWidget()->parentWidget()); - KFormDesigner::FormIO::savePropertyElement(parentNode, parent, "attribute", "title", tab->tabLabel(w)); + TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(w->tqparentWidget()->tqparentWidget()); + KFormDesigner::FormIO::savePropertyElement(tqparentNode, tqparent, "attribute", "title", tab->tabLabel(w)); } - else if((name == "id") && (w->parentWidget()->isA("QWidgetStack"))) + else if((name == "id") && (w->tqparentWidget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING))) { - QWidgetStack *stack = (QWidgetStack*)w->parentWidget(); - KFormDesigner::FormIO::savePropertyElement(parentNode, parent, "attribute", "id", stack->id(w)); + TQWidgetStack *stack = (TQWidgetStack*)w->tqparentWidget(); + KFormDesigner::FormIO::savePropertyElement(tqparentNode, tqparent, "attribute", "id", stack->id(w)); } else return false; @@ -738,21 +738,21 @@ ContainerFactory::saveSpecialProperty(const QCString &, const QString &name, con } bool -ContainerFactory::readSpecialProperty(const QCString &, QDomElement &node, QWidget *w, KFormDesigner::ObjectTreeItem *item) +ContainerFactory::readSpecialProperty(const TQCString &, TQDomElement &node, TQWidget *w, KFormDesigner::ObjectTreeItem *item) { - QString name = node.attribute("name"); - if((name == "title") && (item->parent()->widget()->inherits("QTabWidget"))) + TQString name = node.attribute("name"); + if((name == "title") && (item->tqparent()->widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING))) { - TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(w->parentWidget()); + TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(w->tqparentWidget()); tab->addTab(w, node.firstChild().toElement().text()); item->addModifiedProperty("title", node.firstChild().toElement().text()); return true; } - if((name == "id") && (w->parentWidget()->isA("QWidgetStack"))) + if((name == "id") && (w->tqparentWidget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING))) { - QWidgetStack *stack = (QWidgetStack*)w->parentWidget(); - int id = KFormDesigner::FormIO::readPropertyValue(node.firstChild(), w, name).toInt(); + TQWidgetStack *stack = (TQWidgetStack*)w->tqparentWidget(); + int id = KFormDesigner::FormIO::readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toInt(); stack->addWidget(w, id); stack->raiseWidget(w); item->addModifiedProperty("id", id); @@ -762,20 +762,20 @@ ContainerFactory::readSpecialProperty(const QCString &, QDomElement &node, QWidg return false; } -QValueList<QCString> -ContainerFactory::autoSaveProperties(const QCString &c) +TQValueList<TQCString> +ContainerFactory::autoSaveProperties(const TQCString &c) { - QValueList<QCString> lst; + TQValueList<TQCString> lst; // if(c == "SubForm") // lst << "formName"; - if(c == "QSplitter") + if(c == TQSPLITTER_OBJECT_NAME_STRING) lst << "orientation"; return lst; } bool -ContainerFactory::isPropertyVisibleInternal(const QCString &classname, - QWidget *w, const QCString &property, bool isTopLevel) +ContainerFactory::isPropertyVisibleInternal(const TQCString &classname, + TQWidget *w, const TQCString &property, bool isTopLevel) { bool ok = true; @@ -784,7 +784,7 @@ ContainerFactory::isPropertyVisibleInternal(const QCString &classname, { return property == "name" || property == "geometry"; } - else if (classname == "QGroupBox" || classname=="GroupBox") { + else if (classname == TQGROUPBOX_OBJECT_NAME_STRING || classname=="GroupBox") { ok = #ifdef KEXI_NO_UNFINISHED /*! @todo Hidden for now in Kexi. "checkable" and "checked" props need adding @@ -803,16 +803,16 @@ child widgets become frozen when checked==true */ } bool -ContainerFactory::changeText(const QString &text) +ContainerFactory::changeText(const TQString &text) { changeProperty("title", text, m_container->form()); return true; } void -ContainerFactory::resizeEditor(QWidget *editor, QWidget *widget, const QCString &) +ContainerFactory::resizeEditor(TQWidget *editor, TQWidget *widget, const TQCString &) { - QSize s = widget->size(); + TQSize s = widget->size(); editor->move(widget->x() + 2, widget->y() - 5); editor->resize(s.width() - 20, widget->fontMetrics().height() +10); } @@ -821,8 +821,8 @@ ContainerFactory::resizeEditor(QWidget *editor, QWidget *widget, const QCString void ContainerFactory::addTabPage() { -// if (!m_widget->inherits("QTabWidget")) - if (!widget()->inherits("QTabWidget")) +// if (!m_widget->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) + if (!widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) return; KCommand *com = new InsertPageCommand(m_container, widget()); if(dynamic_cast<TabWidgetBase*>(widget())->count() == 0) @@ -836,10 +836,10 @@ void ContainerFactory::addTabPage() void ContainerFactory::removeTabPage() { - if (!widget()->inherits("QTabWidget")) + if (!widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) return; TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(widget()); - QWidget *w = tab->currentPage(); + TQWidget *w = tab->currentPage(); KFormDesigner::WidgetList list; list.append(w); @@ -850,17 +850,17 @@ void ContainerFactory::removeTabPage() void ContainerFactory::renameTabPage() { - if (!widget()->inherits("QTabWidget")) + if (!widget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) return; TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(widget()); - QWidget *w = tab->currentPage(); + TQWidget *w = tab->currentPage(); bool ok; - QString name = KInputDialog::getText(i18n("New Page Title"), i18n("Enter a new title for the current page:"), + TQString name = KInputDialog::getText(i18n("New Page Title"), i18n("Enter a new title for the current page:"), #if KDE_VERSION < KDE_MAKE_VERSION(3,1,9) - QLineEdit::Normal, + TQLineEdit::Normal, #endif - tab->tabLabel(w), &ok, w->topLevelWidget()); + tab->tabLabel(w), &ok, w->tqtopLevelWidget()); if(ok) tab->changeTab(w, name); } @@ -868,20 +868,20 @@ void ContainerFactory::renameTabPage() void ContainerFactory::reorderTabs(int oldpos, int newpos) { KFormDesigner::ObjectTreeItem *tab - = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup(sender()->name()); + = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup(TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name()); if(!tab) return; - KFormDesigner::ObjectTreeItem *item = tab->children()->take(oldpos); - tab->children()->insert(newpos, item); + KFormDesigner::ObjectTreeItem *item = tab->tqchildren()->take(oldpos); + tab->tqchildren()->insert(newpos, item); } void ContainerFactory::addStackPage() { - if (!widget()->isA("QWidgetStack")) + if (!widget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING)) return; KCommand *com = new InsertPageCommand(m_container, widget()); - if(!((QWidgetStack*)widget())->visibleWidget()) + if(!((TQWidgetStack*)widget())->visibleWidget()) { com->execute(); delete com; @@ -892,10 +892,10 @@ void ContainerFactory::addStackPage() void ContainerFactory::removeStackPage() { - if (!widget()->isA("QWidgetStack")) + if (!widget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING)) return; - QWidgetStack *stack = (QWidgetStack*)widget(); - QWidget *page = stack->visibleWidget(); + TQWidgetStack *stack = (TQWidgetStack*)widget(); + TQWidget *page = stack->visibleWidget(); KFormDesigner::WidgetList list; list.append(page); @@ -913,7 +913,7 @@ void ContainerFactory::removeStackPage() void ContainerFactory::prevStackPage() { - QWidgetStack *stack = (QWidgetStack*)widget(); + TQWidgetStack *stack = (TQWidgetStack*)widget(); int id = stack->id(stack->visibleWidget()) - 1; if(stack->widget(id)) stack->raiseWidget(id); @@ -921,7 +921,7 @@ void ContainerFactory::prevStackPage() void ContainerFactory::nextStackPage() { - QWidgetStack *stack = (QWidgetStack*)widget(); + TQWidgetStack *stack = (TQWidgetStack*)widget(); int id = stack->id(stack->visibleWidget()) + 1; if(stack->widget(id)) stack->raiseWidget(id); diff --git a/kexi/formeditor/factories/containerfactory.h b/kexi/formeditor/factories/containerfactory.h index 1092d852..b8623fad 100644 --- a/kexi/formeditor/factories/containerfactory.h +++ b/kexi/formeditor/factories/containerfactory.h @@ -37,220 +37,230 @@ namespace KFormDesigner class InsertPageCommand : public KCommand { public: - InsertPageCommand(KFormDesigner::Container *container, QWidget *widget); + InsertPageCommand(KFormDesigner::Container *container, TQWidget *widget); virtual void execute(); virtual void unexecute(); - virtual QString name() const; + virtual TQString name() const; protected: KFormDesigner::Form *m_form; - QString m_containername; - QString m_name; - QString m_parentname; + TQString m_containername; + TQString m_name; + TQString m_parentname; int m_pageid; }; //! Helper widget (used when using 'Lay out horizontally') -class KFORMEDITOR_EXPORT HBox : public QFrame +class KFORMEDITOR_EXPORT HBox : public TQFrame { Q_OBJECT + TQ_OBJECT public: - HBox(QWidget *parent, const char *name); + HBox(TQWidget *tqparent, const char *name); virtual ~HBox(){;} void setPreviewMode() {m_preview = true;} - virtual void paintEvent(QPaintEvent *ev); + virtual void paintEvent(TQPaintEvent *ev); protected: bool m_preview; }; //! Helper widget (used when using 'Lay out vertically') -class KFORMEDITOR_EXPORT VBox : public QFrame +class KFORMEDITOR_EXPORT VBox : public TQFrame { Q_OBJECT + TQ_OBJECT public: - VBox(QWidget *parent, const char *name); + VBox(TQWidget *tqparent, const char *name); virtual ~VBox(){;} void setPreviewMode() {m_preview = true;} - virtual void paintEvent(QPaintEvent *ev); + virtual void paintEvent(TQPaintEvent *ev); protected: bool m_preview; }; //! Helper widget (used when using 'Lay out in a grid') -class KFORMEDITOR_EXPORT Grid : public QFrame +class KFORMEDITOR_EXPORT Grid : public TQFrame { Q_OBJECT + TQ_OBJECT public: - Grid(QWidget *parent, const char *name); + Grid(TQWidget *tqparent, const char *name); virtual ~Grid(){;} void setPreviewMode() {m_preview = true;} - virtual void paintEvent(QPaintEvent *ev); + virtual void paintEvent(TQPaintEvent *ev); protected: bool m_preview; }; //! Helper widget (used when using 'Lay out with horizontal flow') -class KFORMEDITOR_EXPORT HFlow : public QFrame +class KFORMEDITOR_EXPORT HFlow : public TQFrame { Q_OBJECT + TQ_OBJECT public: - HFlow(QWidget *parent, const char *name); + HFlow(TQWidget *tqparent, const char *name); virtual ~HFlow(){;} void setPreviewMode() {m_preview = true;} - virtual void paintEvent(QPaintEvent *ev); + virtual void paintEvent(TQPaintEvent *ev); protected: bool m_preview; }; //! Helper widget (used when using 'Lay out with horizontal flow') -class KFORMEDITOR_EXPORT VFlow : public QFrame +class KFORMEDITOR_EXPORT VFlow : public TQFrame { Q_OBJECT + TQ_OBJECT public: - VFlow(QWidget *parent, const char *name); + VFlow(TQWidget *tqparent, const char *name); virtual ~VFlow(){;} void setPreviewMode() {m_preview = true;} - virtual void paintEvent(QPaintEvent *ev); - virtual QSize sizeHint() const; + virtual void paintEvent(TQPaintEvent *ev); + virtual TQSize tqsizeHint() const; protected: bool m_preview; }; //! A simple container widget -class KFORMEDITOR_EXPORT ContainerWidget : public QWidget +class KFORMEDITOR_EXPORT ContainerWidget : public TQWidget { Q_OBJECT + TQ_OBJECT friend class KFDTabWidget; public: - ContainerWidget(QWidget *parent, const char *name); + ContainerWidget(TQWidget *tqparent, const char *name); virtual ~ContainerWidget(); - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; //! Used to emit handleDragMoveEvent() signal needed to control dragging over the container's surface - virtual void dragMoveEvent( QDragMoveEvent *e ); + virtual void dragMoveEvent( TQDragMoveEvent *e ); //! Used to emit handleDropEvent() signal needed to control dropping on the container's surface - virtual void dropEvent( QDropEvent *e ); + virtual void dropEvent( TQDropEvent *e ); signals: //! Needed to control dragging over the container's surface - void handleDragMoveEvent(QDragMoveEvent *e); + void handleDragMoveEvent(TQDragMoveEvent *e); //! Needed to control dropping on the container's surface - void handleDropEvent(QDropEvent *e); + void handleDropEvent(TQDropEvent *e); }; //! A tab widget class KFORMEDITOR_EXPORT KFDTabWidget : public KFormDesigner::TabWidget { Q_OBJECT + TQ_OBJECT public: - KFDTabWidget(QWidget *parent, const char *name); + KFDTabWidget(TQWidget *tqparent, const char *name); virtual ~KFDTabWidget(); - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; //! Used to emit handleDragMoveEvent() signal needed to control dragging over the container's surface - virtual void dragMoveEvent( QDragMoveEvent *e ); + virtual void dragMoveEvent( TQDragMoveEvent *e ); //! Used to emit handleDropEvent() signal needed to control dropping on the container's surface - virtual void dropEvent( QDropEvent *e ); + virtual void dropEvent( TQDropEvent *e ); signals: //! Needed to control dragging over the container's surface - void handleDragMoveEvent(QDragMoveEvent *e); + void handleDragMoveEvent(TQDragMoveEvent *e); //! Needed to control dropping on the container's surface - void handleDropEvent(QDropEvent *e); + void handleDropEvent(TQDropEvent *e); }; //! A group box widget -class KFORMEDITOR_EXPORT GroupBox : public QGroupBox +class KFORMEDITOR_EXPORT GroupBox : public TQGroupBox { Q_OBJECT + TQ_OBJECT public: - GroupBox(const QString & title, QWidget *parent, const char *name); + GroupBox(const TQString & title, TQWidget *tqparent, const char *name); virtual ~GroupBox(); //! Used to emit handleDragMoveEvent() signal needed to control dragging over the container's surface - virtual void dragMoveEvent( QDragMoveEvent *e ); + virtual void dragMoveEvent( TQDragMoveEvent *e ); //! Used to emit handleDropEvent() signal needed to control dropping on the container's surface - virtual void dropEvent( QDropEvent *e ); + virtual void dropEvent( TQDropEvent *e ); signals: //! Needed to control dragging over the container's surface - void handleDragMoveEvent(QDragMoveEvent *e); + void handleDragMoveEvent(TQDragMoveEvent *e); //! Needed to control dropping on the container's surface - void handleDropEvent(QDropEvent *e); + void handleDropEvent(TQDropEvent *e); }; //! A form embedded as a widget inside other form -class KFORMEDITOR_EXPORT SubForm : public QScrollView +class KFORMEDITOR_EXPORT SubForm : public TQScrollView { Q_OBJECT - Q_PROPERTY(QString formName READ formName WRITE setFormName DESIGNABLE true) + TQ_OBJECT + TQ_PROPERTY(TQString formName READ formName WRITE setFormName DESIGNABLE true) public: - SubForm(QWidget *parent, const char *name); + SubForm(TQWidget *tqparent, const char *name); ~SubForm() {} //! \return the name of the subform inside the db - QString formName() const { return m_formName; } - void setFormName(const QString &name); + TQString formName() const { return m_formName; } + void setFormName(const TQString &name); private: // KFormDesigner::FormManager *m_manager; KFormDesigner::Form *m_form; - QWidget *m_widget; - QString m_formName; + TQWidget *m_widget; + TQString m_formName; }; //! Standard Factory for all container widgets class ContainerFactory : public KFormDesigner::WidgetFactory { Q_OBJECT + TQ_OBJECT public: - ContainerFactory(QObject *parent, const char *name, const QStringList &args); + ContainerFactory(TQObject *tqparent, const char *name, const TQStringList &args); virtual ~ContainerFactory(); - virtual QWidget *createWidget(const QCString & classname, QWidget *parent, const char *name, KFormDesigner::Container *container, + virtual TQWidget *createWidget(const TQCString & classname, TQWidget *tqparent, const char *name, KFormDesigner::Container *container, int options = DefaultOptions); - virtual bool createMenuActions(const QCString& classname, QWidget *w, QPopupMenu *menu, + virtual bool createMenuActions(const TQCString& classname, TQWidget *w, TQPopupMenu *menu, KFormDesigner::Container *container); - virtual bool startEditing(const QCString &classname, QWidget *w, + virtual bool startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container); - virtual bool previewWidget(const QCString &classname, QWidget *widget, + virtual bool previewWidget(const TQCString &classname, TQWidget *widget, KFormDesigner::Container *container); - virtual bool saveSpecialProperty(const QCString &classname, const QString &name, - const QVariant &value, QWidget *w, QDomElement &parentNode, QDomDocument &parent); - virtual bool readSpecialProperty(const QCString &classname, QDomElement &node, QWidget *w, + virtual bool saveSpecialProperty(const TQCString &classname, const TQString &name, + const TQVariant &value, TQWidget *w, TQDomElement &tqparentNode, TQDomDocument &tqparent); + virtual bool readSpecialProperty(const TQCString &classname, TQDomElement &node, TQWidget *w, KFormDesigner::ObjectTreeItem *item); - virtual QValueList<QCString> autoSaveProperties(const QCString &classname); + virtual TQValueList<TQCString> autoSaveProperties(const TQCString &classname); protected: - virtual bool isPropertyVisibleInternal(const QCString &classname, QWidget *w, - const QCString &property, bool isTopLevel); - virtual bool changeText(const QString &newText); - virtual void resizeEditor(QWidget *editor, QWidget *widget, const QCString &classname); + virtual bool isPropertyVisibleInternal(const TQCString &classname, TQWidget *w, + const TQCString &property, bool isTopLevel); + virtual bool changeText(const TQString &newText); + virtual void resizeEditor(TQWidget *editor, TQWidget *widget, const TQCString &classname); public slots: void addTabPage(); @@ -263,7 +273,7 @@ class ContainerFactory : public KFormDesigner::WidgetFactory void reorderTabs(int oldpos, int newpos); private: -// QWidget *m_widget; +// TQWidget *m_widget; // KFormDesigner::Container *m_container; // KFormDesigner::FormManager *m_manager; }; diff --git a/kexi/formeditor/factories/stdwidgetfactory.cpp b/kexi/formeditor/factories/stdwidgetfactory.cpp index fade100a..b625c712 100644 --- a/kexi/formeditor/factories/stdwidgetfactory.cpp +++ b/kexi/formeditor/factories/stdwidgetfactory.cpp @@ -7,19 +7,19 @@ * License, or (at your option) any later version. * ***************************************************************************/ -#include <qlabel.h> -#include <qpopupmenu.h> -#include <qcursor.h> -#include <qradiobutton.h> -#include <qcheckbox.h> -#include <qslider.h> -#include <qobjectlist.h> -#include <qstring.h> -#include <qvariant.h> -#include <qheader.h> -#include <qdom.h> -#include <qstyle.h> -#include <qvaluevector.h> +#include <tqlabel.h> +#include <tqpopupmenu.h> +#include <tqcursor.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqslider.h> +#include <tqobjectlist.h> +#include <tqstring.h> +#include <tqvariant.h> +#include <tqheader.h> +#include <tqdom.h> +#include <tqstyle.h> +#include <tqvaluevector.h> #include <klineedit.h> #include <kpushbutton.h> @@ -36,10 +36,10 @@ #include <kdeversion.h> #if KDE_VERSION < KDE_MAKE_VERSION(3,1,9) -# include <qdatetimeedit.h> -# define KTimeWidget QTimeEdit -# define KDateWidget QDateEdit -# define KDateTimeWidget QDateTimeEdit +# include <tqdatetimeedit.h> +# define KTimeWidget TQTimeEdit +# define KDateWidget TQDateEdit +# define KDateTimeWidget TQDateTimeEdit #else # include <ktimewidget.h> # include <kdatewidget.h> @@ -57,26 +57,26 @@ #include "stdwidgetfactory.h" // Some widgets subclass to allow event filtering and some other things -KexiPictureLabel::KexiPictureLabel(const QPixmap &pix, QWidget *parent, const char *name) - : QLabel(parent, name) +KexiPictureLabel::KexiPictureLabel(const TQPixmap &pix, TQWidget *tqparent, const char *name) + : TQLabel(tqparent, name) { setPixmap(pix); setScaledContents(false); } bool -KexiPictureLabel::setProperty(const char *name, const QVariant &value) +KexiPictureLabel::setProperty(const char *name, const TQVariant &value) { - if(QString(name) == "pixmap") + if(TQString(name) == "pixmap") resize(value.toPixmap().height(), value.toPixmap().width()); - return QLabel::setProperty(name, value); + return TQLabel::setProperty(name, value); } -Line::Line(Qt::Orientation orient, QWidget *parent, const char *name) - : QFrame(parent, name) +Line::Line(Qt::Orientation orient, TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name) { setFrameShadow(Sunken); - if(orient == Horizontal) + if(orient ==Qt::Horizontal) setFrameShape(HLine); else setFrameShape(VLine); @@ -85,7 +85,7 @@ Line::Line(Qt::Orientation orient, QWidget *parent, const char *name) void Line::setOrientation(Qt::Orientation orient) { - if(orient == Horizontal) + if(orient ==Qt::Horizontal) setFrameShape(HLine); else setFrameShape(VLine); @@ -95,15 +95,15 @@ Qt::Orientation Line::orientation() const { if(frameShape() == HLine) - return Horizontal; + return Qt::Horizontal; else - return Vertical; + return Qt::Vertical; } // The factory itself -StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringList &) - : KFormDesigner::WidgetFactory(parent, "stdwidgets") +StdWidgetFactory::StdWidgetFactory(TQObject *tqparent, const char *, const TQStringList &) + : KFormDesigner::WidgetFactory(tqparent, "stdwidgets") { KFormDesigner::WidgetInfo *wFormWidget = new KFormDesigner::WidgetInfo(this); wFormWidget->setPixmap("form"); @@ -125,7 +125,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wLabel = new KFormDesigner::WidgetInfo(this); wLabel->setPixmap("label"); - wLabel->setClassName("QLabel"); + wLabel->setClassName(TQLABEL_OBJECT_NAME_STRING); wLabel->setName(i18n("Text Label")); wLabel->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "label")); @@ -136,8 +136,8 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL wPixLabel->setPixmap("pixmaplabel"); wPixLabel->setClassName("KexiPictureLabel"); wPixLabel->setName(i18n("Picture Label")); -//! @todo Qt designer compatibility: maybe use this class when QLabel has a pixmap set...? - //wPixLabel->addAlternateClassName("QLabel"); +//! @todo TQt designer compatibility: maybe use this class when TQLabel has a pixmap set...? + //wPixLabel->addAlternateClassName(TQLABEL_OBJECT_NAME_STRING); wPixLabel->setSavingName("KexiPictureLabel"); wPixLabel->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "picture")); @@ -147,7 +147,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wLineEdit = new KFormDesigner::WidgetInfo(this); wLineEdit->setPixmap("lineedit"); wLineEdit->setClassName("KLineEdit"); - wLineEdit->addAlternateClassName("QLineEdit"); + wLineEdit->addAlternateClassName(TQLINEEDIT_OBJECT_NAME_STRING); wLineEdit->setIncludeFileName("klineedit.h"); wLineEdit->setName(i18n("Line Edit")); wLineEdit->setNamePrefix( @@ -167,7 +167,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wPushButton = new KFormDesigner::WidgetInfo(this); wPushButton->setPixmap("button"); wPushButton->setClassName("KPushButton"); - wPushButton->addAlternateClassName("QPushButton"); + wPushButton->addAlternateClassName(TQPUSHBUTTON_OBJECT_NAME_STRING); wPushButton->setIncludeFileName("kpushbutton.h"); wPushButton->setName(i18n("Push Button")); wPushButton->setNamePrefix( @@ -177,7 +177,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wRadioButton = new KFormDesigner::WidgetInfo(this); wRadioButton->setPixmap("radio"); - wRadioButton->setClassName("QRadioButton"); + wRadioButton->setClassName(TQRADIOBUTTON_OBJECT_NAME_STRING); wRadioButton->setName(i18n("Option Button")); wRadioButton->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "optionButton")); @@ -186,7 +186,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wCheckBox = new KFormDesigner::WidgetInfo(this); wCheckBox->setPixmap("check"); - wCheckBox->setClassName("QCheckBox"); + wCheckBox->setClassName(TQCHECKBOX_OBJECT_NAME_STRING); wCheckBox->setName(i18n("Check Box")); wCheckBox->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "checkBox")); @@ -196,7 +196,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wSpinBox = new KFormDesigner::WidgetInfo(this); wSpinBox->setPixmap("spin"); wSpinBox->setClassName("KIntSpinBox"); - wSpinBox->addAlternateClassName("QSpinBox"); + wSpinBox->addAlternateClassName(TQSPINBOX_OBJECT_NAME_STRING); wSpinBox->setIncludeFileName("knuminput.h"); wSpinBox->setName(i18n("Spin Box")); wSpinBox->setNamePrefix( @@ -207,7 +207,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wComboBox = new KFormDesigner::WidgetInfo(this); wComboBox->setPixmap("combo"); wComboBox->setClassName("KComboBox"); - wComboBox->addAlternateClassName("QComboBox"); + wComboBox->addAlternateClassName(TQCOMBOBOX_OBJECT_NAME_STRING); wComboBox->setIncludeFileName("kcombobox.h"); wComboBox->setName(i18n("Combo Box")); wComboBox->setNamePrefix( @@ -218,7 +218,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wListBox = new KFormDesigner::WidgetInfo(this); wListBox->setPixmap("listbox"); wListBox->setClassName("KListBox"); - wListBox->addAlternateClassName("QListBox"); + wListBox->addAlternateClassName(TQLISTBOX_OBJECT_NAME_STRING); wListBox->setIncludeFileName("klistbox.h"); wListBox->setName(i18n("List Box")); wListBox->setNamePrefix( @@ -229,7 +229,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wTextEdit = new KFormDesigner::WidgetInfo(this); wTextEdit->setPixmap("textedit"); wTextEdit->setClassName("KTextEdit"); - wTextEdit->addAlternateClassName("QTextEdit"); + wTextEdit->addAlternateClassName(TQTEXTEDIT_OBJECT_NAME_STRING); wTextEdit->setIncludeFileName("ktextedit.h"); wTextEdit->setName(i18n("Text Editor")); wTextEdit->setNamePrefix( @@ -240,7 +240,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wListView = new KFormDesigner::WidgetInfo(this); wListView->setPixmap("listview"); wListView->setClassName("KListView"); - wListView->addAlternateClassName("QListView"); + wListView->addAlternateClassName(TQLISTVIEW_OBJECT_NAME_STRING); wListView->setIncludeFileName("klistview.h"); wListView->setName(i18n("List View")); wListView->setNamePrefix( @@ -250,7 +250,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wSlider = new KFormDesigner::WidgetInfo(this); wSlider->setPixmap("slider"); - wSlider->setClassName("QSlider"); + wSlider->setClassName(TQSLIDER_OBJECT_NAME_STRING); wSlider->setName(i18n("Slider")); wSlider->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "slider")); @@ -260,7 +260,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wProgressBar = new KFormDesigner::WidgetInfo(this); wProgressBar->setPixmap("progress"); wProgressBar->setClassName("KProgress"); - wProgressBar->addAlternateClassName("QProgressBar"); + wProgressBar->addAlternateClassName(TQPROGRESSBAR_OBJECT_NAME_STRING); wProgressBar->setIncludeFileName("kprogress.h"); wProgressBar->setName(i18n("Progress Bar")); wProgressBar->setNamePrefix( @@ -281,7 +281,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL wDate->setPixmap("dateedit"); wDate->setClassName("KDateWidget"); #if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) - wDate->addAlternateClassName("QDateEdit"); + wDate->addAlternateClassName(TQDATEEDIT_OBJECT_NAME_STRING); wDate->setIncludeFileName("kdatewidget.h"); #endif wDate->setName(i18n("Date Widget")); @@ -294,7 +294,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL wTime->setPixmap("timeedit"); wTime->setClassName("KTimeWidget"); #if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) - wTime->addAlternateClassName("QTimeEdit"); + wTime->addAlternateClassName(TQTIMEEDIT_OBJECT_NAME_STRING); wTime->setIncludeFileName("ktimewidget.h"); #endif wTime->setName(i18n("Time Widget")); @@ -307,7 +307,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL wDateTime->setPixmap("datetimeedit"); wDateTime->setClassName("KDateTimeWidget"); #if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) - wDateTime->addAlternateClassName("QDateTimeEdit"); + wDateTime->addAlternateClassName(TQDATETIMEEDIT_OBJECT_NAME_STRING); wDateTime->setIncludeFileName("kdatetimewidget.h"); #endif wDateTime->setName(i18n("Date/Time Widget")); @@ -325,7 +325,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL i18n("Echo mode for Line Edit widget eg. Normal, NoEcho, Password","Echo Mode"); m_propDesc["indent"] = i18n("Indent"); //line - m_propDesc["orientation"] = i18n("Orientation"); + m_propDesc["orientation"] = i18n("Qt::Orientation"); //checkbox m_propDesc["checked"] = i18n("Checked checkbox", "Checked"); m_propDesc["tristate"] = i18n("Tristate checkbox", "Tristate"); @@ -377,16 +377,16 @@ StdWidgetFactory::~StdWidgetFactory() { } -QWidget* -StdWidgetFactory::createWidget(const QCString &c, QWidget *p, const char *n, +TQWidget* +StdWidgetFactory::createWidget(const TQCString &c, TQWidget *p, const char *n, KFormDesigner::Container *container, int options) { - QWidget *w=0; - QString text( container->form()->library()->textForWidgetName(n, c) ); + TQWidget *w=0; + TQString text( container->form()->library()->textForWidgetName(n, c) ); const bool designMode = options & KFormDesigner::WidgetFactory::DesignViewMode; - if(c == "QLabel") - w = new QLabel(text, p, n); + if(c == TQLABEL_OBJECT_NAME_STRING) + w = new TQLabel(text, p, n); else if(c == "KexiPictureLabel") w = new KexiPictureLabel(DesktopIcon("image"), p, n); @@ -394,16 +394,16 @@ StdWidgetFactory::createWidget(const QCString &c, QWidget *p, const char *n, { w = new KLineEdit(p, n); if (designMode) - w->setCursor(QCursor(Qt::ArrowCursor)); + w->setCursor(TQCursor(TQt::ArrowCursor)); } else if(c == "KPushButton") w = new KPushButton(/*i18n("Button")*/text, p, n); - else if(c == "QRadioButton") - w = new QRadioButton(/*i18n("Radio Button")*/text, p, n); + else if(c == TQRADIOBUTTON_OBJECT_NAME_STRING) + w = new TQRadioButton(/*i18n("Radio Button")*/text, p, n); - else if(c == "QCheckBox") - w = new QCheckBox(/*i18n("Check Box")*/text, p, n); + else if(c == TQCHECKBOX_OBJECT_NAME_STRING) + w = new TQCheckBox(/*i18n("Check Box")*/text, p, n); else if(c == "KIntSpinBox") w = new KIntSpinBox(p, n); @@ -415,7 +415,7 @@ StdWidgetFactory::createWidget(const QCString &c, QWidget *p, const char *n, w = new KListBox(p, n); else if(c == "KTextEdit") - w = new KTextEdit(/*i18n("Enter your text here")*/text, QString::null, p, n); + w = new KTextEdit(/*i18n("Enter your text here")*/text, TQString(), p, n); else if(c == "KListView") { @@ -424,23 +424,23 @@ StdWidgetFactory::createWidget(const QCString &c, QWidget *p, const char *n, ((KListView*)w)->addColumn(i18n("Column 1")); ((KListView*)w)->setRootIsDecorated(true); } - else if(c == "QSlider") - w = new QSlider(Qt::Horizontal, p, n); + else if(c == TQSLIDER_OBJECT_NAME_STRING) + w = new TQSlider(Qt::Horizontal, p, n); else if(c == "KProgress") w = new KProgress(p, n); else if(c == "KDateWidget") - w = new KDateWidget(QDate::currentDate(), p, n); + w = new KDateWidget(TQDate::tqcurrentDate(), p, n); else if(c == "KTimeWidget") - w = new KTimeWidget(QTime::currentTime(), p, n); + w = new KTimeWidget(TQTime::currentTime(), p, n); else if(c == "KDateTimeWidget") - w = new KDateTimeWidget(QDateTime::currentDateTime(), p, n); + w = new KDateTimeWidget(TQDateTime::tqcurrentDateTime(), p, n); else if(c == "Line") - w = new Line(options & WidgetFactory::VerticalOrientation ? Line::Vertical : Line::Horizontal, p, n); + w = new Line(options & WidgetFactory::VerticalOrientation ? Qt::Vertical : Qt::Horizontal, p, n); else if(c == "Spring") { w = new Spring(p, n); @@ -457,7 +457,7 @@ StdWidgetFactory::createWidget(const QCString &c, QWidget *p, const char *n, } bool -StdWidgetFactory::previewWidget(const QCString &classname, QWidget *widget, KFormDesigner::Container *) +StdWidgetFactory::previewWidget(const TQCString &classname, TQWidget *widget, KFormDesigner::Container *) { if(classname == "Spring") { ((Spring*)widget)->setPreviewMode(); @@ -467,17 +467,17 @@ StdWidgetFactory::previewWidget(const QCString &classname, QWidget *widget, KFor } bool -StdWidgetFactory::createMenuActions(const QCString &classname, QWidget *, QPopupMenu *menu, +StdWidgetFactory::createMenuActions(const TQCString &classname, TQWidget *, TQPopupMenu *menu, KFormDesigner::Container *) { - if((classname == "QLabel") || (classname == "KTextEdit")) + if((classname == TQLABEL_OBJECT_NAME_STRING) || (classname == "KTextEdit")) { - menu->insertItem(SmallIconSet("edit"), i18n("Edit Rich Text"), this, SLOT(editText())); + menu->insertItem(SmallIconSet("edit"), i18n("Edit Rich Text"), this, TQT_SLOT(editText())); return true; } else if(classname == "KListView") { - menu->insertItem(SmallIconSet("edit"), i18n("Edit Listview Contents"), this, SLOT(editListContents())); + menu->insertItem(SmallIconSet("edit"), i18n("Edit Listview Contents"), this, TQT_SLOT(editListContents())); return true; } @@ -485,19 +485,19 @@ StdWidgetFactory::createMenuActions(const QCString &classname, QWidget *, QPopup } bool -StdWidgetFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner::Container *container) +StdWidgetFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container) { setWidget(w, container); // m_container = container; if(classname == "KLineEdit") { KLineEdit *lineedit = static_cast<KLineEdit*>(w); - createEditor(classname, lineedit->text(), lineedit, container, lineedit->geometry(), lineedit->alignment(), true); + createEditor(classname, lineedit->text(), lineedit, container, lineedit->tqgeometry(), lineedit->tqalignment(), true); return true; } - else if(classname == "QLabel") + else if(classname == TQLABEL_OBJECT_NAME_STRING) { - QLabel *label = static_cast<QLabel*>(w); + TQLabel *label = static_cast<TQLabel*>(w); if(label->textFormat() == RichText) { //m_widget = w; @@ -505,42 +505,42 @@ StdWidgetFactory::startEditing(const QCString &classname, QWidget *w, KFormDesig editText(); } else - createEditor(classname, label->text(), label, container, label->geometry(), label->alignment()); + createEditor(classname, label->text(), label, container, label->tqgeometry(), label->tqalignment()); return true; } else if(classname == "KPushButton") { KPushButton *push = static_cast<KPushButton*>(w); - QRect r = w->style().subRect(QStyle::SR_PushButtonContents, w); - QRect editorRect = QRect(push->x() + r.x(), push->y() + r.y(), r.width(), r.height()); + TQRect r = w->tqstyle().subRect(TQStyle::SR_PushButtonContents, w); + TQRect editorRect = TQRect(push->x() + r.x(), push->y() + r.y(), r.width(), r.height()); //r.setX(r.x() + 5); //r.setY(r.y() + 5); //r.setWidth(r.width()-10); //r.setHeight(r.height() - 10); - createEditor(classname, push->text(), push, container, editorRect, Qt::AlignCenter, false, false, Qt::PaletteButton); + createEditor(classname, push->text(), push, container, editorRect, TQt::AlignCenter, false, false, TQt::PaletteButton); return true; } - else if(classname == "QRadioButton") + else if(classname == TQRADIOBUTTON_OBJECT_NAME_STRING) { - QRadioButton *radio = static_cast<QRadioButton*>(w); - QRect r = w->style().subRect(QStyle::SR_RadioButtonContents, w); - QRect editorRect = QRect(radio->x() + r.x(), radio->y() + r.y(), r.width(), r.height()); - createEditor(classname, radio->text(), radio, container, editorRect, Qt::AlignAuto); + TQRadioButton *radio = static_cast<TQRadioButton*>(w); + TQRect r = w->tqstyle().subRect(TQStyle::SR_RadioButtonContents, w); + TQRect editorRect = TQRect(radio->x() + r.x(), radio->y() + r.y(), r.width(), r.height()); + createEditor(classname, radio->text(), radio, container, editorRect, TQt::AlignAuto); return true; } - else if(classname == "QCheckBox") + else if(classname == TQCHECKBOX_OBJECT_NAME_STRING) { - QCheckBox *check = static_cast<QCheckBox*>(w); - //QRect r(check->geometry()); + TQCheckBox *check = static_cast<TQCheckBox*>(w); + //TQRect r(check->tqgeometry()); //r.setX(r.x() + 20); - QRect r = w->style().subRect(QStyle::SR_CheckBoxContents, w); - QRect editorRect = QRect(check->x() + r.x(), check->y() + r.y(), r.width(), r.height()); - createEditor(classname, check->text(), check, container, editorRect, Qt::AlignAuto); + TQRect r = w->tqstyle().subRect(TQStyle::SR_CheckBoxContents, w); + TQRect editorRect = TQRect(check->x() + r.x(), check->y() + r.y(), r.width(), r.height()); + createEditor(classname, check->text(), check, container, editorRect, TQt::AlignAuto); return true; } else if((classname == "KComboBox") || (classname == "KListBox")) { - QStringList list; + TQStringList list; if(classname == "KListBox") { KListBox *listbox = (KListBox*)w; @@ -578,7 +578,7 @@ StdWidgetFactory::startEditing(const QCString &classname, QWidget *w, KFormDesig } bool -StdWidgetFactory::clearWidgetContent(const QCString &classname, QWidget *w) +StdWidgetFactory::clearWidgetContent(const TQCString &classname, TQWidget *w) { if(classname == "KLineEdit") ((KLineEdit*)w)->clear(); @@ -596,35 +596,35 @@ StdWidgetFactory::clearWidgetContent(const QCString &classname, QWidget *w) } bool -StdWidgetFactory::changeText(const QString &text) +StdWidgetFactory::changeText(const TQString &text) { - QCString n = WidgetFactory::widget()->className(); - QWidget *w = WidgetFactory::widget(); + TQCString n = WidgetFactory::widget()->className(); + TQWidget *w = WidgetFactory::widget(); if(n == "KIntSpinBox") ((KIntSpinBox*)w)->setValue(text.toInt()); else changeProperty("text", text, m_container->form()); - /* By-hand method not needed as sizeHint() can do that for us - QFontMetrics fm = w->fontMetrics(); - QSize s(fm.width( text ), fm.height()); + /* By-hand method not needed as tqsizeHint() can do that for us + TQFontMetrics fm = w->fontMetrics(); + TQSize s(fm.width( text ), fm.height()); int width; - if(n == "QLabel") // labels are resized to fit the text + if(n == TQLABEL_OBJECT_NAME_STRING) // labels are resized to fit the text { - w->resize(w->sizeHint()); + w->resize(w->tqsizeHint()); WidgetFactory::m_editor->resize(w->size()); return; } // and other widgets are just enlarged if needed else if(n == "KPushButton") - width = w->style().sizeFromContents( QStyle::CT_PushButton, w, s).width(); - else if(n == "QCheckBox") - width = w->style().sizeFromContents( QStyle::CT_CheckBox, w, s).width(); - else if(n == "QRadioButton") - width = w->style().sizeFromContents( QStyle::CT_RadioButton, w, s).width(); + width = w->style().sizeFromContents( TQStyle::CT_PushButton, w, s).width(); + else if(n == TQCHECKBOX_OBJECT_NAME_STRING) + width = w->style().sizeFromContents( TQStyle::CT_CheckBox, w, s).width(); + else if(n == TQRADIOBUTTON_OBJECT_NAME_STRING) + width = w->style().sizeFromContents( TQStyle::CT_RadioButton, w, s).width(); else return; - int width = w->sizeHint().width();*/ + int width = w->tqsizeHint().width();*/ #if 0 //not needed here, size hint is used on creation in InsertWidgetCommand::execute() if(w->width() < width) @@ -637,27 +637,27 @@ StdWidgetFactory::changeText(const QString &text) } void -StdWidgetFactory::resizeEditor(QWidget *editor, QWidget *widget, const QCString &classname) +StdWidgetFactory::resizeEditor(TQWidget *editor, TQWidget *widget, const TQCString &classname) { - QSize s = widget->size(); - QPoint p = widget->pos(); - QRect r; + TQSize s = widget->size(); + TQPoint p = widget->pos(); + TQRect r; - if(classname == "QRadioButton") + if(classname == TQRADIOBUTTON_OBJECT_NAME_STRING) { - r = widget->style().subRect(QStyle::SR_RadioButtonContents, widget); + r = widget->tqstyle().subRect(TQStyle::SR_RadioButtonContents, widget); p += r.topLeft(); s.setWidth(r.width()); } - else if(classname == "QCheckBox") + else if(classname == TQCHECKBOX_OBJECT_NAME_STRING) { - r = widget->style().subRect(QStyle::SR_CheckBoxContents, widget); + r = widget->tqstyle().subRect(TQStyle::SR_CheckBoxContents, widget); p += r.topLeft(); s.setWidth(r.width()); } else if(classname == "KPushButton") { - r = widget->style().subRect(QStyle::SR_PushButtonContents, widget); + r = widget->tqstyle().subRect(TQStyle::SR_PushButtonContents, widget); p += r.topLeft(); s = r.size(); } @@ -667,16 +667,16 @@ StdWidgetFactory::resizeEditor(QWidget *editor, QWidget *widget, const QCString } bool -StdWidgetFactory::saveSpecialProperty(const QCString &classname, const QString &name, const QVariant &, QWidget *w, QDomElement &parentNode, QDomDocument &domDoc) +StdWidgetFactory::saveSpecialProperty(const TQCString &classname, const TQString &name, const TQVariant &, TQWidget *w, TQDomElement &tqparentNode, TQDomDocument &domDoc) { if(name == "list_items" && classname == "KComboBox") { KComboBox *combo = (KComboBox*)w; for(int i=0; i < combo->count(); i++) { - QDomElement item = domDoc.createElement("item"); + TQDomElement item = domDoc.createElement("item"); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", combo->text(i)); - parentNode.appendChild(item); + tqparentNode.appendChild(item); } return true; } @@ -685,9 +685,9 @@ StdWidgetFactory::saveSpecialProperty(const QCString &classname, const QString & KListBox *listbox = (KListBox*)w; for(uint i=0; i < listbox->count(); i++) { - QDomElement item = domDoc.createElement("item"); + TQDomElement item = domDoc.createElement("item"); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", listbox->text(i)); - parentNode.appendChild(item); + tqparentNode.appendChild(item); } return true; } @@ -697,20 +697,20 @@ StdWidgetFactory::saveSpecialProperty(const QCString &classname, const QString & // First we save the columns for(int i = 0; i < listview->columns(); i++) { - QDomElement item = domDoc.createElement("column"); + TQDomElement item = domDoc.createElement("column"); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", listview->columnText(i)); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "width", listview->columnWidth(i)); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "resizable", listview->header()->isResizeEnabled(i)); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "clickable", listview->header()->isClickEnabled(i)); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "fullwidth", listview->header()->isStretchEnabled(i)); - parentNode.appendChild(item); + tqparentNode.appendChild(item); } // Then we save the list view items - QListViewItem *item = listview->firstChild(); + TQListViewItem *item = listview->firstChild(); while(item) { - saveListItem(item, parentNode, domDoc); + saveListItem(item, tqparentNode, domDoc); item = item->nextSibling(); } return true; @@ -720,17 +720,17 @@ StdWidgetFactory::saveSpecialProperty(const QCString &classname, const QString & } void -StdWidgetFactory::saveListItem(QListViewItem *item, QDomNode &parentNode, QDomDocument &domDoc) +StdWidgetFactory::saveListItem(TQListViewItem *item, TQDomNode &tqparentNode, TQDomDocument &domDoc) { - QDomElement element = domDoc.createElement("item"); - parentNode.appendChild(element); + TQDomElement element = domDoc.createElement("item"); + tqparentNode.appendChild(element); // We save the text of each column for(int i = 0; i < item->listView()->columns(); i++) KFormDesigner::FormIO::savePropertyElement(element, domDoc, "property", "text", item->text(i)); // Then we save every sub items - QListViewItem *child = item->firstChild(); + TQListViewItem *child = item->firstChild(); while(child) { saveListItem(child, element, domDoc); @@ -739,16 +739,16 @@ StdWidgetFactory::saveListItem(QListViewItem *item, QDomNode &parentNode, QDomDo } bool -StdWidgetFactory::readSpecialProperty(const QCString &classname, QDomElement &node, QWidget *w, KFormDesigner::ObjectTreeItem *) +StdWidgetFactory::readSpecialProperty(const TQCString &classname, TQDomElement &node, TQWidget *w, KFormDesigner::ObjectTreeItem *) { - QString tag = node.tagName(); - QString name = node.attribute("name"); + TQString tag = node.tagName(); + TQString name = node.attribute("name"); if((tag == "item") && (classname == "KComboBox")) { KComboBox *combo = (KComboBox*)w; - QVariant val = KFormDesigner::FormIO::readPropertyValue(node.firstChild().firstChild(), w, name); - if(val.canCast(QVariant::Pixmap)) + TQVariant val = KFormDesigner::FormIO::readPropertyValue(node.firstChild().firstChild(), TQT_TQOBJECT(w), name); + if(val.canCast(TQVariant::Pixmap)) combo->insertItem(val.toPixmap()); else combo->insertItem(val.toString()); @@ -758,8 +758,8 @@ StdWidgetFactory::readSpecialProperty(const QCString &classname, QDomElement &no if((tag == "item") && (classname == "KListBox")) { KListBox *listbox = (KListBox*)w; - QVariant val = KFormDesigner::FormIO::readPropertyValue(node.firstChild().firstChild(), w, name); - if(val.canCast(QVariant::Pixmap)) + TQVariant val = KFormDesigner::FormIO::readPropertyValue(node.firstChild().firstChild(), TQT_TQOBJECT(w), name); + if(val.canCast(TQVariant::Pixmap)) listbox->insertItem(val.toPixmap()); else listbox->insertItem(val.toString()); @@ -770,10 +770,10 @@ StdWidgetFactory::readSpecialProperty(const QCString &classname, QDomElement &no { KListView *listview = (KListView*)w; int id=0; - for(QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { - QString prop = n.toElement().attribute("name"); - QVariant val = KFormDesigner::FormIO::readPropertyValue(n.firstChild(), w, name); + TQString prop = n.toElement().attribute("name"); + TQVariant val = KFormDesigner::FormIO::readPropertyValue(n.firstChild(), TQT_TQOBJECT(w), name); if(prop == "text") id = listview->addColumn(val.toString()); else if(prop == "width") @@ -798,18 +798,18 @@ StdWidgetFactory::readSpecialProperty(const QCString &classname, QDomElement &no } void -StdWidgetFactory::readListItem(QDomElement &node, QListViewItem *parent, KListView *listview) +StdWidgetFactory::readListItem(TQDomElement &node, TQListViewItem *tqparent, KListView *listview) { - QListViewItem *item; - if(parent) - item = new KListViewItem(parent); + TQListViewItem *item; + if(tqparent) + item = new KListViewItem(tqparent); else item = new KListViewItem(listview); // We need to move the item at the end of the list - QListViewItem *last; - if(parent) - last = parent->firstChild(); + TQListViewItem *last; + if(tqparent) + last = tqparent->firstChild(); else last = listview->firstChild(); @@ -818,11 +818,11 @@ StdWidgetFactory::readListItem(QDomElement &node, QListViewItem *parent, KListVi item->moveItem(last); int i = 0; - for(QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement childEl = n.toElement(); - QString prop = childEl.attribute("name"); - QString tag = childEl.tagName(); + TQDomElement childEl = n.toElement(); + TQString prop = childEl.attribute("name"); + TQString tag = childEl.tagName(); // We read sub items if(tag == "item") @@ -833,7 +833,7 @@ StdWidgetFactory::readListItem(QDomElement &node, QListViewItem *parent, KListVi // and column texts else if((tag == "property") && (prop == "text")) { - QVariant val = KFormDesigner::FormIO::readPropertyValue(n.firstChild(), listview, "item"); + TQVariant val = KFormDesigner::FormIO::readPropertyValue(n.firstChild(), TQT_TQOBJECT(listview), "item"); item->setText(i, val.toString()); i++; } @@ -841,8 +841,8 @@ StdWidgetFactory::readListItem(QDomElement &node, QListViewItem *parent, KListVi } bool -StdWidgetFactory::isPropertyVisibleInternal(const QCString &classname, - QWidget *w, const QCString &property, bool isTopLevel) +StdWidgetFactory::isPropertyVisibleInternal(const TQCString &classname, + TQWidget *w, const TQCString &property, bool isTopLevel) { bool ok = true; if(classname == "FormWidgetBase") @@ -860,10 +860,10 @@ StdWidgetFactory::isPropertyVisibleInternal(const QCString &classname, } else if(classname == "KexiPictureLabel") { - if((property == "text") || (property == "indent") || (property == "textFormat") || (property == "font") || (property == "alignment")) + if((property == "text") || (property == "indent") || (property == "textFormat") || (property == "font") || (property == "tqalignment")) return false; } - else if(classname == "QLabel") + else if(classname == TQLABEL_OBJECT_NAME_STRING) { if(property == "pixmap") return false; @@ -890,11 +890,11 @@ StdWidgetFactory::isPropertyVisibleInternal(const QCString &classname, if((property == "frameShape") || (property == "font") || (property == "margin")) return false; } - else if(classname=="QCheckBox") + else if(classname==TQCHECKBOX_OBJECT_NAME_STRING) { ok = m_showAdvancedProperties || (property != "autoRepeat"); } - else if(classname=="QRadioButton") + else if(classname==TQRADIOBUTTON_OBJECT_NAME_STRING) { ok = m_showAdvancedProperties || (property != "autoRepeat"); } @@ -906,12 +906,12 @@ StdWidgetFactory::isPropertyVisibleInternal(const QCString &classname, return ok && WidgetFactory::isPropertyVisibleInternal(classname, w, property, isTopLevel); } -QValueList<QCString> -StdWidgetFactory::autoSaveProperties(const QCString &classname) +TQValueList<TQCString> +StdWidgetFactory::autoSaveProperties(const TQCString &classname) { - QValueList<QCString> l; + TQValueList<TQCString> l; - if(classname == "QLabel") + if(classname == TQLABEL_OBJECT_NAME_STRING) l << "text"; if(classname == "KPushButton") l << "text"; @@ -942,12 +942,12 @@ StdWidgetFactory::autoSaveProperties(const QCString &classname) void StdWidgetFactory::editText() { - QCString classname = widget()->className(); - QString text; + TQCString classname = widget()->className(); + TQString text; if(classname == "KTextEdit") text = ((KTextEdit*)widget())->text(); - else if(classname == "QLabel") - text = ((QLabel*)widget())->text(); + else if(classname == TQLABEL_OBJECT_NAME_STRING) + text = ((TQLabel*)widget())->text(); if(editRichText(widget(), text)) { @@ -955,24 +955,24 @@ StdWidgetFactory::editText() changeProperty("text", text, m_container->form()); } - if(classname == "QLabel") - widget()->resize(widget()->sizeHint()); + if(classname == TQLABEL_OBJECT_NAME_STRING) + widget()->resize(widget()->tqsizeHint()); } void StdWidgetFactory::editListContents() { - if(widget()->inherits("QListView")) - editListView((QListView*)widget()); + if(widget()->inherits(TQLISTVIEW_OBJECT_NAME_STRING)) + editListView((TQListView*)widget()); } void -StdWidgetFactory::setPropertyOptions( KFormDesigner::WidgetPropertySet& buf, const KFormDesigner::WidgetInfo& info, QWidget *w ) +StdWidgetFactory::setPropertyOptions( KFormDesigner::WidgetPropertySet& buf, const KFormDesigner::WidgetInfo& info, TQWidget *w ) { Q_UNUSED( info ); Q_UNUSED( w ); - if (buf.contains("indent")) { + if (buf.tqcontains("indent")) { buf["indent"].setOption("min", -1); buf["indent"].setOption("minValueText", i18n("default indent value", "default")); } diff --git a/kexi/formeditor/factories/stdwidgetfactory.h b/kexi/formeditor/factories/stdwidgetfactory.h index c0e56c5b..f5bd5528 100644 --- a/kexi/formeditor/factories/stdwidgetfactory.h +++ b/kexi/formeditor/factories/stdwidgetfactory.h @@ -20,80 +20,83 @@ #ifndef STDWIDGETFACTORY_H #define STDWIDGETFACTORY_H -#include <qframe.h> +#include <tqframe.h> #include "widgetfactory.h" #include "container.h" -class KFORMEDITOR_EXPORT KexiPictureLabel : public QLabel +class KFORMEDITOR_EXPORT KexiPictureLabel : public TQLabel { Q_OBJECT + TQ_OBJECT public: - KexiPictureLabel(const QPixmap &pix, QWidget *parent, const char *name); + KexiPictureLabel(const TQPixmap &pix, TQWidget *tqparent, const char *name); ~KexiPictureLabel(){;} - virtual bool setProperty(const char *name, const QVariant &value); + virtual bool setProperty(const char *name, const TQVariant &value); }; -class KFORMEDITOR_EXPORT Line : public QFrame +class KFORMEDITOR_EXPORT Line : public TQFrame { Q_OBJECT - Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation) + TQ_OBJECT + TQ_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) public: - Line(Orientation orient, QWidget *parent, const char *name); + Line(Qt::Orientation orient, TQWidget *tqparent, const char *name); ~Line(){;} - void setOrientation(Orientation orient); - Orientation orientation() const; + void setOrientation(Qt::Orientation orient); + Qt::Orientation orientation() const; }; //! Factory for all basic widgets, including Spring (not containers) class StdWidgetFactory : public KFormDesigner::WidgetFactory { Q_OBJECT + TQ_OBJECT public: - StdWidgetFactory(QObject *parent, const char *name, const QStringList &args); + StdWidgetFactory(TQObject *tqparent, const char *name, const TQStringList &args); ~StdWidgetFactory(); - virtual QWidget *createWidget(const QCString &c, QWidget *p, const char *n, + virtual TQWidget *createWidget(const TQCString &c, TQWidget *p, const char *n, KFormDesigner::Container *container, int options = DefaultOptions); - virtual bool createMenuActions(const QCString &classname, QWidget *w, QPopupMenu *menu, + virtual bool createMenuActions(const TQCString &classname, TQWidget *w, TQPopupMenu *menu, KFormDesigner::Container *container); - virtual bool startEditing(const QCString &classname, QWidget *w, + virtual bool startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container); - virtual bool previewWidget(const QCString &classname, QWidget *widget, + virtual bool previewWidget(const TQCString &classname, TQWidget *widget, KFormDesigner::Container *container); - virtual bool clearWidgetContent(const QCString &classname, QWidget *w); + virtual bool clearWidgetContent(const TQCString &classname, TQWidget *w); - virtual bool saveSpecialProperty(const QCString &classname, - const QString &name, const QVariant &value, QWidget *w, - QDomElement &parentNode, QDomDocument &parent); - virtual bool readSpecialProperty(const QCString &classname, QDomElement &node, - QWidget *w, KFormDesigner::ObjectTreeItem *item); - virtual QValueList<QCString> autoSaveProperties(const QCString &classname); + virtual bool saveSpecialProperty(const TQCString &classname, + const TQString &name, const TQVariant &value, TQWidget *w, + TQDomElement &tqparentNode, TQDomDocument &tqparent); + virtual bool readSpecialProperty(const TQCString &classname, TQDomElement &node, + TQWidget *w, KFormDesigner::ObjectTreeItem *item); + virtual TQValueList<TQCString> autoSaveProperties(const TQCString &classname); virtual void setPropertyOptions( KFormDesigner::WidgetPropertySet& buf, - const KFormDesigner::WidgetInfo& info, QWidget *w ); + const KFormDesigner::WidgetInfo& info, TQWidget *w ); public slots: void editText(); void editListContents(); protected: - virtual bool isPropertyVisibleInternal(const QCString &classname, QWidget *w, - const QCString &property, bool isTopLevel); - virtual bool changeText(const QString &newText); - virtual void resizeEditor(QWidget *editor, QWidget *widget, const QCString &classname); - void saveListItem(QListViewItem *item, QDomNode &parentNode, QDomDocument &domDoc); - void readListItem(QDomElement &node, QListViewItem *parent, KListView *listview); + virtual bool isPropertyVisibleInternal(const TQCString &classname, TQWidget *w, + const TQCString &property, bool isTopLevel); + virtual bool changeText(const TQString &newText); + virtual void resizeEditor(TQWidget *editor, TQWidget *widget, const TQCString &classname); + void saveListItem(TQListViewItem *item, TQDomNode &tqparentNode, TQDomDocument &domDoc); + void readListItem(TQDomElement &node, TQListViewItem *tqparent, KListView *listview); private: // KFormDesigner::Container *m_container; -// QWidget *m_widget; +// TQWidget *m_widget; }; #endif diff --git a/kexi/formeditor/form.cpp b/kexi/formeditor/form.cpp index a5d57002..41afdf37 100644 --- a/kexi/formeditor/form.cpp +++ b/kexi/formeditor/form.cpp @@ -19,10 +19,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qwidget.h> -#include <qlabel.h> -#include <qobjectlist.h> -#include <qptrdict.h> +#include <tqwidget.h> +#include <tqlabel.h> +#include <tqobjectlist.h> +#include <tqptrdict.h> #include <kdebug.h> #include <klocale.h> @@ -89,7 +89,7 @@ FormWidget::~FormWidget() //-------------------------------------- Form::Form(WidgetLibrary* library, const char *name, bool designMode) - : QObject(library, name) + : TQObject(library, name) , m_lib(library) { d = new FormPrivate(); @@ -99,8 +99,8 @@ Form::Form(WidgetLibrary* library, const char *name, bool designMode) // Init actions d->collection = new KActionCollection(0, this); d->history = new KCommandHistory(d->collection, true); - connect(d->history, SIGNAL(commandExecuted()), this, SLOT(slotCommandExecuted())); - connect(d->history, SIGNAL(documentRestored()), this, SLOT(slotFormRestored())); + connect(d->history, TQT_SIGNAL(commandExecuted()), this, TQT_SLOT(slotCommandExecuted())); + connect(d->history, TQT_SIGNAL(documentRestored()), this, TQT_SLOT(slotFormRestored())); } Form::~Form() @@ -110,7 +110,7 @@ Form::~Form() d = 0; } -QWidget* +TQWidget* Form::widget() const { if(d->topTree) @@ -124,7 +124,7 @@ Form::widget() const //////////////// Container -related functions /////////////////////// void -Form::createToplevel(QWidget *container, FormWidget *formWidget, const QCString &) +Form::createToplevel(TQWidget *container, FormWidget *formWidget, const TQCString &) { kdDebug() << "Form::createToplevel() container= "<< (container ? container->name() : "<NULL>") << " formWidget=" << formWidget << "className=" << name() << endl; @@ -141,7 +141,7 @@ Form::createToplevel(QWidget *container, FormWidget *formWidget, const QCString // d->topTree->addModifiedProperty("caption", name()); //m_topTree->addModifiedProperty("icon"); - connect(container, SIGNAL(destroyed()), this, SLOT(formDeleted())); + connect(container, TQT_SIGNAL(destroyed()), this, TQT_SLOT(formDeleted())); kdDebug() << "Form::createToplevel(): d->toplevel=" << d->toplevel << endl; } @@ -164,7 +164,7 @@ Form::activeContainer() if(it->container()) return it->container(); else - return it->parent()->container(); + return it->tqparent()->container(); } ObjectTreeItem* @@ -173,11 +173,11 @@ Form::commonParentContainer(WidgetList *wlist) ObjectTreeItem *item = 0; WidgetList *list = new WidgetList(); - // Creates a list of all widget parents - for(QWidget *w = wlist->first(); w; w = wlist->next()) + // Creates a list of all widget tqparents + for(TQWidget *w = wlist->first(); w; w = wlist->next()) { - if(list->findRef(w->parentWidget()) == -1) - list->append(w->parentWidget()); + if(list->tqfindRef(w->tqparentWidget()) == -1) + list->append(w->tqparentWidget()); } removeChildrenFromList(*list); @@ -193,7 +193,7 @@ Form::commonParentContainer(WidgetList *wlist) } Container* -Form::parentContainer(QWidget *w) +Form::tqparentContainer(TQWidget *w) { ObjectTreeItem *it; if(!w) @@ -202,10 +202,10 @@ Form::parentContainer(QWidget *w) //else it = d->topTree->lookup(w->name()); - if(it->parent()->container()) - return it->parent()->container(); + if(it->tqparent()->container()) + return it->tqparent()->container(); else - return it->parent()->parent()->container(); + return it->tqparent()->tqparent()->container(); } @@ -234,7 +234,7 @@ Form::setDesignMode(bool design) ///////////////////////////// Selection stuff /////////////////////// void -Form::setSelectedWidget(QWidget *w, bool add, bool dontRaise, bool moreWillBeSelected) +Form::setSelectedWidget(TQWidget *w, bool add, bool dontRaise, bool moreWillBeSelected) { if((d->selected.isEmpty()) || (w == widget()) || (d->selected.first() == widget())) add = false; @@ -245,14 +245,14 @@ Form::setSelectedWidget(QWidget *w, bool add, bool dontRaise, bool moreWillBeSel return; } - //raise selected widget and all possible parents - QWidget *wtmp = w; - while(!dontRaise && wtmp && wtmp->parentWidget() && (wtmp != widget())) + //raise selected widget and all possible tqparents + TQWidget *wtmp = w; + while(!dontRaise && wtmp && wtmp->tqparentWidget() && (wtmp != widget())) { wtmp->raise(); if(d->resizeHandles[ wtmp->name() ]) d->resizeHandles[ wtmp->name() ]->raise(); - wtmp = wtmp->parentWidget(); + wtmp = wtmp->tqparentWidget(); } if (wtmp) @@ -267,12 +267,12 @@ Form::setSelectedWidget(QWidget *w, bool add, bool dontRaise, bool moreWillBeSel emit selectionChanged(w, add, moreWillBeSelected); emitActionSignals(false); - // WidgetStack and TabWidget pages widgets shouldn't have resize handles, but their parent - if(!FormManager::self()->isTopLevel(w) && w->parentWidget() && w->parentWidget()->isA("QWidgetStack")) + // WidgetStack and TabWidget pages widgets shouldn't have resize handles, but their tqparent + if(!FormManager::self()->isTopLevel(w) && w->tqparentWidget() && w->tqparentWidget()->isA(TQWIDGETSTACK_OBJECT_NAME_STRING)) { - w = w->parentWidget(); - if(w->parentWidget() && w->parentWidget()->inherits("QTabWidget")) - w = w->parentWidget(); + w = w->tqparentWidget(); + if(w->tqparentWidget() && w->tqparentWidget()->inherits(TQTABWIDGET_OBJECT_NAME_STRING)) + w = w->tqparentWidget(); } if(w && w != widget()) @@ -280,13 +280,13 @@ Form::setSelectedWidget(QWidget *w, bool add, bool dontRaise, bool moreWillBeSel } ResizeHandleSet* -Form::resizeHandlesForWidget(QWidget* w) +Form::resizeHandlesForWidget(TQWidget* w) { return d->resizeHandles[w->name()]; } void -Form::unSelectWidget(QWidget *w) +Form::unSelectWidget(TQWidget *w) { d->selected.remove(w); d->resizeHandles.remove(w->name()); @@ -334,7 +334,7 @@ void Form::emitSelectionSignals() { emit selectionChanged(selectedWidgets()->first(), false); -// for(QWidget *w = selectedWidgets()->next(); w; w = selectedWidgets()->next()) +// for(TQWidget *w = selectedWidgets()->next(); w; w = selectedWidgets()->next()) // emit selectionChanged(selectedWidgets()->first(), true); for (WidgetListIterator it(*selectedWidgets()); it.current(); ++it) emit selectionChanged(it.current(), true); @@ -358,20 +358,20 @@ Form::formDeleted() } void -Form::changeName(const QCString &oldname, const QCString &newname) +Form::changeName(const TQCString &oldname, const TQCString &newname) { if(oldname == newname) return; if(!d->topTree->rename(oldname, newname)) // rename failed { - KMessageBox::sorry(widget()->topLevelWidget(), - i18n("Renaming widget \"%1\" to \"%2\" failed.").arg(oldname).arg(newname)); + KMessageBox::sorry(widget()->tqtopLevelWidget(), + i18n("Renaming widget \"%1\" to \"%2\" failed.").tqarg(TQString(oldname)).tqarg(TQString(newname))); //moved to WidgetPropertySet::slotChangeProperty() -// KMessageBox::sorry(widget()->topLevelWidget(), +// KMessageBox::sorry(widget()->tqtopLevelWidget(), // i18n("A widget with this name already exists. " // "Please choose another name or rename existing widget.")); kdDebug() << "Form::changeName() : ERROR : A widget named " << newname << " already exists" << endl; - FormManager::self()->propertySet()->property("name") = QVariant(oldname); + FormManager::self()->propertySet()->property("name") = TQVariant(oldname); } else { @@ -411,8 +411,8 @@ void Form::clearCommandHistory() { d->history->clear(); - FormManager::self()->emitUndoEnabled(false, QString::null); - FormManager::self()->emitRedoEnabled(false, QString::null); + FormManager::self()->emitUndoEnabled(false, TQString()); + FormManager::self()->emitRedoEnabled(false, TQString()); } void @@ -421,8 +421,8 @@ Form::slotCommandExecuted() emit FormManager::self()->dirty(this, true); d->dirty = true; // because actions text is changed after the commandExecuted() signal is emitted - QTimer::singleShot(10, this, SLOT(emitUndoEnabled())); - QTimer::singleShot(10, this, SLOT(emitRedoEnabled())); + TQTimer::singleShot(10, this, TQT_SLOT(emitUndoEnabled())); + TQTimer::singleShot(10, this, TQT_SLOT(emitRedoEnabled())); } void @@ -454,24 +454,25 @@ Form::slotFormRestored() void Form::addWidgetToTabStops(ObjectTreeItem *it) { - QWidget *w = it->widget(); + TQWidget *w = it->widget(); if(!w) return; - if(!(w->focusPolicy() & QWidget::TabFocus)) + if(!(w->focusPolicy() & TQ_TabFocus)) { - if (!w->children()) + TQObjectList clo = w->childrenListObject(); + if (clo.isEmpty()) return; // For composed widgets, we check if one of the child can have focus - for(QObjectListIterator chIt(*w->children()); chIt.current(); ++chIt) { - if(chIt.current()->isWidgetType()) {//QWidget::TabFocus flag will be checked later! - if(d->tabstops.findRef(it) == -1) { + for(TQObjectListIterator chIt(clo); chIt.current(); ++chIt) { + if(chIt.current()->isWidgetType()) {//TQ_TabFocus flag will be checked later! + if(d->tabstops.tqfindRef(it) == -1) { d->tabstops.append(it); return; } } } } - else if(d->tabstops.findRef(it) == -1) // not yet in the list + else if(d->tabstops.tqfindRef(it) == -1) // not yet in the list d->tabstops.append(it); } @@ -479,7 +480,7 @@ void Form::updateTabStopsOrder() { for (ObjectTreeListIterator it(d->tabstops);it.current();) { - if(!(it.current()->widget()->focusPolicy() & QWidget::TabFocus)) { + if(!(it.current()->widget()->focusPolicy() & TQ_TabFocus)) { kexidbg << "Form::updateTabStopsOrder(): widget removed because has no TabFocus: " << it.current()->widget()->name() << endl; d->tabstops.remove( it.current() ); } @@ -489,7 +490,7 @@ Form::updateTabStopsOrder() } //! Collects all the containers reculsively. Used by Form::autoAssignTabStops(). -void collectContainers(ObjectTreeItem* item, QPtrDict<char>& containers) +void collectContainers(ObjectTreeItem* item, TQPtrDict<char>& containers) { if (!item->container()) return; @@ -498,7 +499,7 @@ void collectContainers(ObjectTreeItem* item, QPtrDict<char>& containers) << " " << item->container()->objectTree()->name() << endl; containers.insert( item->container(), (const char *)1 ); } - for (ObjectTreeListIterator it(*item->children()); it.current(); ++it) + for (ObjectTreeListIterator it(*item->tqchildren()); it.current(); ++it) collectContainers(it.current(), containers); } @@ -509,7 +510,7 @@ Form::autoAssignTabStops() HorWidgetList hlist(toplevelContainer()->widget()); // 1. Collect all the containers, as we'll be sorting widgets groupped by containers - QPtrDict<char> containers; + TQPtrDict<char> containers; collectContainers( toplevelContainer()->objectTree(), containers ); @@ -521,29 +522,29 @@ Form::autoAssignTabStops() } list.sort(); - foreach_list(QPtrListIterator<QWidget>, iter, list) + foreach_list(TQPtrListIterator<TQWidget>, iter, list) kdDebug() << iter.current()->className() << " " << iter.current()->name() << endl; d->tabstops.clear(); /// We automatically sort widget from the top-left to bottom-right corner - //! \todo Handle RTL layout (ie from top-right to bottom-left) + //! \todo Handle RTL tqlayout (ie from top-right to bottom-left) foreach_list(WidgetListIterator, it, list) { - QWidget *w = it.current(); + TQWidget *w = it.current(); hlist.append(w); ++it; - QWidget *nextw = it.current(); - QObject *page_w = 0; - KFormDesigner::TabWidget *tab_w = KFormDesigner::findParent<KFormDesigner::TabWidget>(w, "KFormDesigner::TabWidget", page_w); + TQWidget *nextw = it.current(); + TQObject *page_w = 0; + KFormDesigner::TabWidget *tab_w = KFormDesigner::findParent<KFormDesigner::TabWidget>(TQT_TQOBJECT(w), "KFormDesigner::TabWidget", page_w); while (nextw) { - if (KexiUtils::hasParent(w, nextw)) // do not group (sort) widgets where on is a child of another + if (KexiUtils::hasParent(TQT_TQOBJECT(w), TQT_TQOBJECT(nextw))) // do not group (sort) widgets where on is a child of another break; if (nextw->y() >= (w->y() + 20)) break; if (tab_w) { - QObject *page_nextw = 0; - KFormDesigner::TabWidget *tab_nextw = KFormDesigner::findParent<KFormDesigner::TabWidget>(nextw, "KFormDesigner::TabWidget", page_nextw); + TQObject *page_nextw = 0; + KFormDesigner::TabWidget *tab_nextw = KFormDesigner::findParent<KFormDesigner::TabWidget>(TQT_TQOBJECT(nextw), "KFormDesigner::TabWidget", page_nextw); if (tab_w == tab_nextw) { if (page_w != page_nextw) // 'nextw' widget within different tab page break; diff --git a/kexi/formeditor/form.h b/kexi/formeditor/form.h index 899da955..dbe64b52 100644 --- a/kexi/formeditor/form.h +++ b/kexi/formeditor/form.h @@ -22,15 +22,15 @@ #ifndef KFORMDESIGNERFORM_H #define KFORMDESIGNERFORM_H -#include <qobject.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqptrlist.h> #include "resizehandle.h" #include "utils.h" #include "objecttree.h" -class QWidget; -class QDomElement; +class TQWidget; +class TQDomElement; class KActionCollection; class KCommandHistory; class KCommand; @@ -48,7 +48,7 @@ class ConnectionBuffer; //! Base (virtual) class for all form widgets /*! You need to inherit this class, and implement the drawing functions. This is necessary - because you cannot inherit QWidget twice, and we want form widgets to be any widget. + because you cannot inherit TQWidget twice, and we want form widgets to be any widget. See FormWidgetBase in test/kfd_part.cpp and just copy functions there. */ class KFORMEDITOR_EXPORT FormWidget { @@ -60,19 +60,19 @@ class KFORMEDITOR_EXPORT FormWidget using double-buffering. \a type can be 1 (selection rect) or 2 (insert rect, dotted). */ - virtual void drawRects(const QValueList<QRect> &list, int type) = 0; + virtual void drawRects(const TQValueList<TQRect> &list, int type) = 0; - virtual void drawRect(const QRect &r, int type) = 0; + virtual void drawRect(const TQRect &r, int type) = 0; /*! This function inits the buffer used for double-buffering. Called before drawing rect. */ virtual void initBuffer() = 0; - /*! Clears the form, ie pastes the whole buffer to repaint the Form. */ + /*! Clears the form, ie pastes the whole buffer to tqrepaint the Form. */ virtual void clearForm() = 0; /*! This function highlights two widgets (to is optional), which are sender and receiver, and draws a link between them. */ - virtual void highlightWidgets(QWidget *from, QWidget *to) = 0; + virtual void highlightWidgets(TQWidget *from, TQWidget *to) = 0; protected: Form *m_form; @@ -88,9 +88,9 @@ class FormPrivate ~FormPrivate(); // FormManager *manager; - QGuardedPtr<Container> toplevel; + TQGuardedPtr<Container> toplevel; ObjectTree *topTree; - QGuardedPtr<QWidget> widget; + TQGuardedPtr<TQWidget> widget; WidgetList selected; ResizeHandleSet::Dict resizeHandles; @@ -98,7 +98,7 @@ class FormPrivate bool dirty; bool interactive; bool design; - QString filename; + TQString filename; KCommandHistory *history; KActionCollection *collection; @@ -109,17 +109,17 @@ class FormPrivate PixmapCollection *pixcollection; - //! This map is used to store cursor shapes before inserting (so we can restore them later) - QMap<QObject*,QCursor> cursors; + //! This map is used to store cursor tqshapes before inserting (so we can restore them later) + TQMap<TQObject*,TQCursor> cursors; //!This string list is used to store the widgets which hasMouseTracking() == true (eg lineedits) - QStringList *mouseTrackers; + TQStringList *mouseTrackers; FormWidget *formWidget; //! A set of head properties to be stored in a .ui file. //! This includes KFD format version. - QMap<QCString,QString> headerProperties; + TQMap<TQCString,TQString> headerProperties; //! Format version, set by FormIO or on creating a new form. uint formatVersion; @@ -132,9 +132,10 @@ class FormPrivate It takes care of widget selection and pasting widgets. **/ //! A simple class representing a form -class KFORMEDITOR_EXPORT Form : public QObject +class KFORMEDITOR_EXPORT Form : public TQObject { Q_OBJECT + TQ_OBJECT public: /*! Creates a simple Form, child of the FormManager \a manager. @@ -149,11 +150,11 @@ class KFORMEDITOR_EXPORT Form : public QObject Creates a toplevel widget out of another widget. \a container will become the Form toplevel widget, will be associated to an ObjectTree and so on. - \code QWidget *toplevel = new QWidget(this); + \code TQWidget *toplevel = new TQWidget(this); form->createToplevel(toplevel); \endcode */ - void createToplevel(QWidget *container, FormWidget *formWidget =0, - const QCString &classname="QWidget"); + void createToplevel(TQWidget *container, FormWidget *formWidget =0, + const TQCString &classname=TQWIDGET_OBJECT_NAME_STRING); /*! \return the toplevel Container or 0 if this is a preview Form or createToplevel() has not been called yet. */ @@ -166,23 +167,23 @@ class KFORMEDITOR_EXPORT Form : public QObject ObjectTree* objectTree() const { return d->topTree; } //! \return the form's toplevel widget, or 0 if designMode() == false. - QWidget* widget() const; + TQWidget* widget() const; -// //! \return the FormManager parent of this form. +// //! \return the FormManager tqparent of this form. // FormManager* manager() const { return d->manager; } - /*! \return A pointer to the currently active Container, ie the parent Container for a simple widget, + /*! \return A pointer to the currently active Container, ie the tqparent Container for a simple widget, and the widget's Container if it is itself a container. */ Container* activeContainer(); - /*! \return A pointer to the parent Container of the currently selected widget. + /*! \return A pointer to the tqparent Container of the currently selected widget. It is the same as activeContainer() for a simple widget, but unlike this function - it will also return the parent Container if the widget itself is a Container. + it will also return the tqparent Container if the widget itself is a Container. */ - Container* parentContainer(QWidget *w=0); + Container* tqparentContainer(TQWidget *w=0); - /*! \return The \ref Container which is a parent of all widgets in \a wlist. + /*! \return The \ref Container which is a tqparent of all widgets in \a wlist. Used by \ref activeContainer(), and to find where to paste widgets when multiple widgets are selected. */ ObjectTreeItem* commonParentContainer(WidgetList *wlist); @@ -193,7 +194,7 @@ class KFORMEDITOR_EXPORT Form : public QObject /*! \return currently selected widget in this form, or 0 if there is no widget selected or more than one widget selected. \see selectedWidgets() */ - QWidget* selectedWidget() const { return d->selected.count()==1 ? d->selected.first() : 0; } + TQWidget* selectedWidget() const { return d->selected.count()==1 ? d->selected.first() : 0; } /*! Emits the action signals, and optionaly the undo/redo related signals if \a withUndoAction == true. See \a FormManager for signals description. */ @@ -212,7 +213,7 @@ class KFORMEDITOR_EXPORT Form : public QObject widget were drawn on the Form. \return false if the Form is being updated by the program, ie the widget are created by FormIO, and so composed widgets - should not be populated automatically (such as QTabWidget). + should not be populated automatically (such as TQTabWidget). */ bool interactiveMode() const { return d->interactive; } @@ -230,24 +231,24 @@ class KFORMEDITOR_EXPORT Form : public QObject //! @todo make gridSize configurable at global level int gridSize() { return 10; } - //! \return the default margin for all the layout inside this Form. + //! \return the default margin for all the tqlayout inside this Form. int defaultMargin() { return 11;} - //! \return the default spacing for all the layout inside this Form. + //! \return the default spacing for all the tqlayout inside this Form. int defaultSpacing() { return 6;} - /*! This function is used by ObjectTree to emit childAdded() signal (as it is not a QObject). */ + /*! This function is used by ObjectTree to emit childAdded() signal (as it is not a TQObject). */ void emitChildAdded(ObjectTreeItem *item); - /*! This function is used by ObjectTree to emit childRemoved() signal (as it is not a QObject). */ + /*! This function is used by ObjectTree to emit childRemoved() signal (as it is not a TQObject). */ void emitChildRemoved(ObjectTreeItem *item); /*! \return The filename of the UI file this Form was saved to, - or QString::null if the Form hasn't be saved yet. */ - QString filename() const { return d->filename; } + or TQString() if the Form hasn't be saved yet. */ + TQString filename() const { return d->filename; } //! Sets the filename of this Form to \a filename. - void setFilename(const QString &file) { d->filename = file; } + void setFilename(const TQString &file) { d->filename = file; } KCommandHistory* commandHistory() const { return d->history; } ConnectionBuffer* connectionBuffer() const { return d->connBuffer; } @@ -284,28 +285,28 @@ class KFORMEDITOR_EXPORT Form : public QObject (which are by default in order of creation).*/ void setAutoTabStops(bool autoTab) { d->autoTabstops = autoTab;} - /*! Tells the Form to reassign the tab stops because the widget layout has changed + /*! Tells the Form to reassign the tab stops because the widget tqlayout has changed (called for example before saving or displaying the tab order dialog). Automatically sorts widget from the top-left to bottom-right corner. Widget can be grouped with containers. In paticular, for tab widgets, - child widgets should ordered by parent tab's order. */ + child widgets should ordered by tqparent tab's order. */ void autoAssignTabStops(); #ifdef KEXI_DEBUG_GUI //! For debugging purposes - QString m_recentlyLoadedUICode; + TQString m_recentlyLoadedUICode; #endif /*! Internal: called by ResizeHandle when mouse move event causes first resize handle's dragging. As a result, current widget's editing (if any) is finished - see WidgetFactory::resetEditor(). */ -// void resizeHandleDraggingStarted(QWidget *draggedWidget); +// void resizeHandleDraggingStarted(TQWidget *draggedWidget); - ResizeHandleSet* resizeHandlesForWidget(QWidget* w); + ResizeHandleSet* resizeHandlesForWidget(TQWidget* w); /*! A set of value/key pairs provided to be stored as attributes in <kfd:customHeader/> XML element (saved as a first child of \<UI> element). */ - QMap<QCString,QString>* headerProperties() const { return &d->headerProperties; } + TQMap<TQCString,TQString>* headerProperties() const { return &d->headerProperties; } //! \return format version number for this form. //! For new forms it is equal to KFormDesigner::version(). @@ -321,7 +322,7 @@ class KFORMEDITOR_EXPORT Form : public QObject /*! This slot is called when the name of a widget was changed in Property Editor. It renames the ObjectTreeItem associated to this widget. */ - void changeName(const QCString &oldname, const QCString &newname); + void changeName(const TQCString &oldname, const TQCString &newname); /*! Sets \a selected to be the selected widget of this Form. If \a add is true, the formerly selected widget is still selected, @@ -329,12 +330,12 @@ class KFORMEDITOR_EXPORT Form : public QObject The form widget is always selected alone. \a moreWillBeSelected indicates whether more widgets will be selected soon (so for multiselection we should not update the property pane before the last widget is selected) */ - void setSelectedWidget(QWidget *selected, bool add=false, bool dontRaise=false, + void setSelectedWidget(TQWidget *selected, bool add=false, bool dontRaise=false, bool moreWillBeSelected = false); /*! Unselects the widget \a w. Te widget is removed from the Cntainer 's list and its resizeHandle is removed. */ - void unSelectWidget(QWidget *w); + void unSelectWidget(TQWidget *w); /*! Sets the form widget (it will be uniquely selected widget). */ void selectFormWidget(); @@ -364,7 +365,7 @@ class KFORMEDITOR_EXPORT Form : public QObject to update both Property Editor and ObjectTreeView. \a w is the newly selected widget. */ - void selectionChanged(QWidget *w, bool add, bool moreWillBeSelected = false); + void selectionChanged(TQWidget *w, bool add, bool moreWillBeSelected = false); /*! This signal is emitted when a new widget is created, to update ObjectTreeView. \a it is the ObjectTreeItem representing this new widget. diff --git a/kexi/formeditor/formIO.cpp b/kexi/formeditor/formIO.cpp index 2327fb91..4b46f8fe 100644 --- a/kexi/formeditor/formIO.cpp +++ b/kexi/formeditor/formIO.cpp @@ -20,18 +20,18 @@ #include <kdebug.h> -#include <qmetaobject.h> -#include <qdom.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qcursor.h> -#include <qbuffer.h> -#include <qimage.h> -#include <qlayout.h> -#include <qobjectlist.h> -#include <qdatetime.h> -#include <qlabel.h> -#include <qpainter.h> +#include <tqmetaobject.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqcursor.h> +#include <tqbuffer.h> +#include <tqimage.h> +#include <tqlayout.h> +#include <tqobjectlist.h> +#include <tqdatetime.h> +#include <tqlabel.h> +#include <tqpainter.h> #include <kfiledialog.h> #include <klocale.h> @@ -52,10 +52,10 @@ #include "formIO.h" /// A blank widget used when the class name is not supported -CustomWidget::CustomWidget(const QCString &className, QWidget *parent, const char *name) -: QWidget(parent, name), m_className(className) +CustomWidget::CustomWidget(const TQCString &className, TQWidget *tqparent, const char *name) +: TQWidget(tqparent, name), m_className(className) { - setBackgroundMode(Qt::PaletteDark); + setBackgroundMode(TQt::PaletteDark); } CustomWidget::~CustomWidget() @@ -63,18 +63,18 @@ CustomWidget::~CustomWidget() } void -CustomWidget::paintEvent(QPaintEvent *) +CustomWidget::paintEvent(TQPaintEvent *) { - QPainter p(this); - p.setPen(palette().active().text()); - QRect r(rect()); + TQPainter p(this); + p.setPen(tqpalette().active().text()); + TQRect r(rect()); r.setX(r.x()+2); - p.drawText(r, Qt::AlignTop, m_className); + p.drawText(r, TQt::AlignTop, m_className); } using namespace KFormDesigner; -QDict<QLabel> *FormIO::m_buddies = 0; +TQDict<TQLabel> *FormIO::m_buddies = 0; ObjectTreeItem *FormIO::m_currentItem = 0; Form *FormIO::m_currentForm = 0; bool FormIO::m_savePixmapsInline = false; @@ -99,15 +99,15 @@ FormIO::~FormIO() } bool -FormIO::saveFormToFile(Form *form, const QString &filename) +FormIO::saveFormToFile(Form *form, const TQString &filename) { - QString m_filename; + TQString m_filename; if(!form->filename().isNull() && filename.isNull()) m_filename = form->filename(); if(filename.isNull()) { - m_filename = KFileDialog::getSaveFileName(QString::null, i18n("*.ui|Qt Designer UI Files")); + m_filename = KFileDialog::getSaveFileName(TQString(), i18n("*.ui|TQt Designer UI Files")); if(m_filename.isNull()) return false; } @@ -115,15 +115,15 @@ FormIO::saveFormToFile(Form *form, const QString &filename) m_filename = filename; form->setFilename(m_filename); - QDomDocument domDoc; + TQDomDocument domDoc; if (!saveFormToDom(form, domDoc)) return false; - QFile file(m_filename); + TQFile file(m_filename); if (!file.open(IO_WriteOnly)) return false; - QTextStream stream(&file); + TQTextStream stream(&file); stream << domDoc.toString(3) << endl; file.close(); @@ -131,9 +131,9 @@ FormIO::saveFormToFile(Form *form, const QString &filename) } bool -FormIO::saveFormToByteArray(Form *form, QByteArray &dest) +FormIO::saveFormToByteArray(Form *form, TQByteArray &dest) { - QDomDocument domDoc; + TQDomDocument domDoc; if (!saveFormToDom(form, domDoc)) return false; dest = domDoc.toCString(); @@ -141,9 +141,9 @@ FormIO::saveFormToByteArray(Form *form, QByteArray &dest) } bool -FormIO::saveFormToString(Form *form, QString &dest, int indent) +FormIO::saveFormToString(Form *form, TQString &dest, int indent) { - QDomDocument domDoc; + TQDomDocument domDoc; if (!saveFormToDom(form, domDoc)) return false; dest = domDoc.toString(indent); @@ -151,54 +151,54 @@ FormIO::saveFormToString(Form *form, QString &dest, int indent) } bool -FormIO::saveFormToDom(Form *form, QDomDocument &domDoc) +FormIO::saveFormToDom(Form *form, TQDomDocument &domDoc) { m_currentForm = form; - domDoc = QDomDocument("UI"); - QDomElement uiElement = domDoc.createElement("UI"); + domDoc = TQDomDocument("UI"); + TQDomElement uiElement = domDoc.createElement("UI"); domDoc.appendChild(uiElement); uiElement.setAttribute("version", "3.1"); uiElement.setAttribute("stdsetdef", 1); //update format version information - form->headerProperties()->insert("version", QString::number(form->formatVersion())); + form->headerProperties()->insert("version", TQString::number(form->formatVersion())); //custom properties - QDomElement headerPropertiesEl = domDoc.createElement("kfd:customHeader"); - for (QMapConstIterator<QCString,QString> it=form->headerProperties()->constBegin(); it!=form->headerProperties()->constEnd(); ++it) { + TQDomElement headerPropertiesEl = domDoc.createElement("kfd:customHeader"); + for (TQMapConstIterator<TQCString,TQString> it=form->headerProperties()->constBegin(); it!=form->headerProperties()->constEnd(); ++it) { headerPropertiesEl.setAttribute(it.key(), it.data()); } uiElement.appendChild(headerPropertiesEl); /// We save the savePixmapsInline property in the Form - QDomElement inlinePix = domDoc.createElement("pixmapinproject"); + TQDomElement inlinePix = domDoc.createElement("pixmapinproject"); uiElement.appendChild(inlinePix); // We create the top class element - QDomElement baseClass = domDoc.createElement("class"); + TQDomElement baseClass = domDoc.createElement("class"); uiElement.appendChild(baseClass); - QDomText baseClassV = domDoc.createTextNode("QWidget"); + TQDomText baseClassV = domDoc.createTextNode(TQWIDGET_OBJECT_NAME_STRING); baseClass.appendChild(baseClassV); // Save the toplevel widgets, and so the whole Form saveWidget(form->objectTree(), uiElement, domDoc); - // We then save the layoutdefaults element - QDomElement layoutDefaults = domDoc.createElement("layoutDefaults"); - layoutDefaults.setAttribute("spacing", QString::number(form->defaultSpacing())); - layoutDefaults.setAttribute("margin", QString::number(form->defaultMargin())); - uiElement.appendChild(layoutDefaults); + // We then save the tqlayoutdefaults element + TQDomElement tqlayoutDefaults = domDoc.createElement("tqlayoutDefaults"); + tqlayoutDefaults.setAttribute("spacing", TQString::number(form->defaultSpacing())); + tqlayoutDefaults.setAttribute("margin", TQString::number(form->defaultMargin())); + uiElement.appendChild(tqlayoutDefaults); /// Save tab Stops if(form->autoTabStops()) form->autoAssignTabStops(); - QDomElement tabStops = domDoc.createElement("tabstops"); + TQDomElement tabStops = domDoc.createElement("tabstops"); uiElement.appendChild(tabStops); for(ObjectTreeListIterator it( form->tabStopsIterator() ); it.current(); ++it) { - QDomElement tabstop = domDoc.createElement("tabstop"); + TQDomElement tabstop = domDoc.createElement("tabstop"); tabStops.appendChild(tabstop); - QDomText tabStopText = domDoc.createTextNode(it.current()->name()); + TQDomText tabStopText = domDoc.createTextNode(it.current()->name()); tabstop.appendChild(tabStopText); } @@ -217,13 +217,13 @@ FormIO::saveFormToDom(Form *form, QDomDocument &domDoc) } bool -FormIO::loadFormFromByteArray(Form *form, QWidget *container, QByteArray &src, bool preview) +FormIO::loadFormFromByteArray(Form *form, TQWidget *container, TQByteArray &src, bool preview) { - QString errMsg; + TQString errMsg; int errLine; int errCol; - QDomDocument inBuf; + TQDomDocument inBuf; bool parsed = inBuf.setContent(src, false, &errMsg, &errLine, &errCol); if(!parsed) @@ -241,9 +241,9 @@ FormIO::loadFormFromByteArray(Form *form, QWidget *container, QByteArray &src, b } bool -FormIO::loadFormFromString(Form *form, QWidget *container, QString &src, bool preview) +FormIO::loadFormFromString(Form *form, TQWidget *container, TQString &src, bool preview) { - QString errMsg; + TQString errMsg; int errLine; int errCol; @@ -251,7 +251,7 @@ FormIO::loadFormFromString(Form *form, QWidget *container, QString &src, bool pr form->m_recentlyLoadedUICode = src; #endif - QDomDocument inBuf; + TQDomDocument inBuf; bool parsed = inBuf.setContent(src, false, &errMsg, &errLine, &errCol); if(!parsed) @@ -269,32 +269,32 @@ FormIO::loadFormFromString(Form *form, QWidget *container, QString &src, bool pr } bool -FormIO::loadFormFromFile(Form *form, QWidget *container, const QString &filename) +FormIO::loadFormFromFile(Form *form, TQWidget *container, const TQString &filename) { - QString errMsg; + TQString errMsg; int errLine; int errCol; - QString m_filename; + TQString m_filename; if(filename.isNull()) { - m_filename = KFileDialog::getOpenFileName(QString::null, i18n("*.ui|Qt Designer UI Files")); + m_filename = KFileDialog::getOpenFileName(TQString(), i18n("*.ui|TQt Designer UI Files")); if(m_filename.isNull()) return false; } else m_filename = filename; - QFile file(m_filename); + TQFile file(m_filename); if(!file.open(IO_ReadOnly)) { kdDebug() << "Cannot open the file " << filename << endl; return false; } - QTextStream stream(&file); - QString text = stream.read(); + TQTextStream stream(&file); + TQString text = stream.read(); - QDomDocument inBuf; + TQDomDocument inBuf; bool parsed = inBuf.setContent(text, false, &errMsg, &errLine, &errCol); if(!parsed) @@ -308,23 +308,23 @@ FormIO::loadFormFromFile(Form *form, QWidget *container, const QString &filename } bool -FormIO::loadFormFromDom(Form *form, QWidget *container, QDomDocument &inBuf) +FormIO::loadFormFromDom(Form *form, TQWidget *container, TQDomDocument &inBuf) { m_currentForm = form; - QDomElement ui = inBuf.namedItem("UI").toElement(); + TQDomElement ui = inBuf.namedItem("UI").toElement(); //custom properties form->headerProperties()->clear(); - QDomElement headerPropertiesEl = ui.namedItem("kfd:customHeader").toElement(); - QDomAttr attr = headerPropertiesEl.firstChild().toAttr(); + TQDomElement headerPropertiesEl = ui.namedItem("kfd:customHeader").toElement(); + TQDomAttr attr = headerPropertiesEl.firstChild().toAttr(); while (!attr.isNull() && attr.isAttr()) { form->headerProperties()->insert(attr.name().latin1(), attr.value()); attr = attr.nextSibling().toAttr(); } //update format version information uint ver = 1; //the default - if (form->headerProperties()->contains("version")) { + if (form->headerProperties()->tqcontains("version")) { bool ok; uint v = (*form->headerProperties())["version"].toUInt(&ok); if (ok) @@ -350,26 +350,26 @@ FormIO::loadFormFromDom(Form *form, QWidget *container, QDomDocument &inBuf) m_savePixmapsInline = ( (ui.namedItem("pixmapinproject").isNull()) || (!ui.namedItem("images").isNull()) ); form->pixmapCollection()->load(ui.namedItem("collection")); - QDomElement element = ui.namedItem("widget").toElement(); + TQDomElement element = ui.namedItem("widget").toElement(); createToplevelWidget(form, container, element); // Loading the tabstops - QDomElement tabStops = ui.namedItem("tabstops").toElement(); + TQDomElement tabStops = ui.namedItem("tabstops").toElement(); // if(tabStops.isNull()) // return 1; if(!tabStops.isNull()) { int i = 0; uint itemsNotFound = 0; - for(QDomNode n = tabStops.firstChild(); !n.isNull(); n = n.nextSibling(), i++) + for(TQDomNode n = tabStops.firstChild(); !n.isNull(); n = n.nextSibling(), i++) { - QString name = n.toElement().text(); + TQString name = n.toElement().text(); ObjectTreeItem *item = form->objectTree()->lookup(name); if(!item) { kdDebug() << "FormIO::loadFormFromDom ERROR : no ObjectTreeItem " << endl; continue; } - const int index = form->tabStops()->findRef(item); + const int index = form->tabStops()->tqfindRef(item); /* Compute a real destination index: "a number of not found items so far". */ const int realIndex = i - itemsNotFound; if((index != -1) && (index != realIndex)) // the widget is not in the same place, so we move it @@ -398,32 +398,32 @@ FormIO::loadFormFromDom(Form *form, QWidget *container, QDomDocument &inBuf) ///////////////////////////////////////////////////////////////////////////// void -FormIO::savePropertyValue(QDomElement &parentNode, QDomDocument &parent, const char *name, - const QVariant &value, QWidget *w, WidgetLibrary *lib) +FormIO::savePropertyValue(TQDomElement &tqparentNode, TQDomDocument &tqparent, const char *name, + const TQVariant &value, TQWidget *w, WidgetLibrary *lib) { // Widget specific properties and attributes /////////////// // kdDebug() << "FormIO::savePropertyValue() Saving the property: " << name << endl; WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(w); - QWidget *subwidget = w; + TQWidget *subwidget = w; bool addSubwidgetFlag = false; - int propertyId = w->metaObject()->findProperty(name, true); + int propertyId = w->tqmetaObject()->tqfindProperty(name, true); if (propertyId == -1 && subpropIface && subpropIface->subwidget()) { // try property from subwidget subwidget = subpropIface->subwidget(); - propertyId = subpropIface->subwidget()->metaObject()->findProperty(name, true); + propertyId = subpropIface->subwidget()->tqmetaObject()->tqfindProperty(name, true); addSubwidgetFlag = true; } if(propertyId == -1) { kdDebug() << "FormIO::savePropertyValue() The object doesn't have this property. Let's try the WidgetLibrary." << endl; if(lib) - lib->saveSpecialProperty(w->className(), name, value, w, parentNode, parent); + lib->saveSpecialProperty(w->className(), name, value, w, tqparentNode, tqparent); return; } - const QMetaProperty *meta = subwidget->metaObject()->property(propertyId, true); + const TQMetaProperty *meta = subwidget->tqmetaObject()->property(propertyId, true); if (!meta->stored( subwidget )) //not storable return; - QDomElement propertyE = parent.createElement("property"); + TQDomElement propertyE = tqparent.createElement("property"); propertyE.setAttribute("name", name); if (addSubwidgetFlag) propertyE.setAttribute("subwidget", "true"); @@ -431,81 +431,81 @@ FormIO::savePropertyValue(QDomElement &parentNode, QDomDocument &parent, const c if(meta && meta->isEnumType()) { // this property is enum or set type - QDomElement type; - QDomText valueE; + TQDomElement type; + TQDomText valueE; if(meta->isSetType()) { - QStringList list = QStringList::fromStrList(meta->valueToKeys(value.toInt())); - type = parent.createElement("set"); - valueE = parent.createTextNode(list.join("|")); + TQStringList list = TQStringList::fromStrList(meta->valueToKeys(value.toInt())); + type = tqparent.createElement("set"); + valueE = tqparent.createTextNode(list.join("|")); type.appendChild(valueE); } else { - QString s = meta->valueToKey(value.toInt()); - type = parent.createElement("enum"); - valueE = parent.createTextNode(s); + TQString s = meta->valueToKey(value.toInt()); + type = tqparent.createElement("enum"); + valueE = tqparent.createTextNode(s); type.appendChild(valueE); } propertyE.appendChild(type); - parentNode.appendChild(propertyE); + tqparentNode.appendChild(propertyE); return; } - if(value.type() == QVariant::Pixmap) { - QDomText valueE; - QDomElement type = parent.createElement("pixmap"); - QCString property = propertyE.attribute("name").latin1(); -//todo QCString pixmapName = m_currentItem->widget()->property("pixmapName").toCString(); + if(value.type() == TQVariant::Pixmap) { + TQDomText valueE; + TQDomElement type = tqparent.createElement("pixmap"); + TQCString property = propertyE.attribute("name").latin1(); +//todo TQCString pixmapName = m_currentItem->widget()->property("pixmapName").toCString(); if(m_savePixmapsInline /* (js)too risky: || m_currentItem->pixmapName(property).isNull() */) - valueE = parent.createTextNode(saveImage(parent, value.toPixmap())); + valueE = tqparent.createTextNode(saveImage(tqparent, value.toPixmap())); else - valueE = parent.createTextNode(m_currentItem->pixmapName(property)); + valueE = tqparent.createTextNode(m_currentItem->pixmapName(property)); type.appendChild(valueE); propertyE.appendChild(type); - parentNode.appendChild(propertyE); + tqparentNode.appendChild(propertyE); return; } // Saving a "normal" property - writeVariant(parent, propertyE, value); - parentNode.appendChild(propertyE); + writeVariant(tqparent, propertyE, value); + tqparentNode.appendChild(propertyE); } void -FormIO::writeVariant(QDomDocument &parent, QDomElement &parentNode, QVariant value) +FormIO::writeVariant(TQDomDocument &tqparent, TQDomElement &tqparentNode, TQVariant value) { - QDomElement type; - QDomText valueE; + TQDomElement type; + TQDomText valueE; switch(value.type()) { - case QVariant::String: + case TQVariant::String: { - type = parent.createElement("string"); - valueE = parent.createTextNode(value.toString()); + type = tqparent.createElement("string"); + valueE = tqparent.createTextNode(value.toString()); type.appendChild(valueE); break; } - case QVariant::CString: + case TQVariant::CString: { - type = parent.createElement("cstring"); - valueE = parent.createTextNode(value.toString()); + type = tqparent.createElement("cstring"); + valueE = tqparent.createTextNode(value.toString()); type.appendChild(valueE); break; } - case QVariant::Rect: + case TQVariant::Rect: { - type = parent.createElement("rect"); - QDomElement x = parent.createElement("x"); - QDomElement y = parent.createElement("y"); - QDomElement w = parent.createElement("width"); - QDomElement h = parent.createElement("height"); - QDomText valueX = parent.createTextNode(QString::number(value.toRect().x())); - QDomText valueY = parent.createTextNode(QString::number(value.toRect().y())); - QDomText valueW = parent.createTextNode(QString::number(value.toRect().width())); - QDomText valueH = parent.createTextNode(QString::number(value.toRect().height())); + type = tqparent.createElement("rect"); + TQDomElement x = tqparent.createElement("x"); + TQDomElement y = tqparent.createElement("y"); + TQDomElement w = tqparent.createElement("width"); + TQDomElement h = tqparent.createElement("height"); + TQDomText valueX = tqparent.createTextNode(TQString::number(value.toRect().x())); + TQDomText valueY = tqparent.createTextNode(TQString::number(value.toRect().y())); + TQDomText valueW = tqparent.createTextNode(TQString::number(value.toRect().width())); + TQDomText valueH = tqparent.createTextNode(TQString::number(value.toRect().height())); x.appendChild(valueX); y.appendChild(valueY); @@ -518,15 +518,15 @@ FormIO::writeVariant(QDomDocument &parent, QDomElement &parentNode, QVariant val type.appendChild(h); break; } - case QVariant::Color: + case TQVariant::Color: { - type = parent.createElement("color"); - QDomElement r = parent.createElement("red"); - QDomElement g = parent.createElement("green"); - QDomElement b = parent.createElement("blue"); - QDomText valueR = parent.createTextNode(QString::number(value.toColor().red())); - QDomText valueG = parent.createTextNode(QString::number(value.toColor().green())); - QDomText valueB = parent.createTextNode(QString::number(value.toColor().blue())); + type = tqparent.createElement("color"); + TQDomElement r = tqparent.createElement("red"); + TQDomElement g = tqparent.createElement("green"); + TQDomElement b = tqparent.createElement("blue"); + TQDomText valueR = tqparent.createTextNode(TQString::number(value.toColor().red())); + TQDomText valueG = tqparent.createTextNode(TQString::number(value.toColor().green())); + TQDomText valueB = tqparent.createTextNode(TQString::number(value.toColor().blue())); r.appendChild(valueR); g.appendChild(valueG); @@ -537,29 +537,29 @@ FormIO::writeVariant(QDomDocument &parent, QDomElement &parentNode, QVariant val type.appendChild(b); break; } - case QVariant::Bool: + case TQVariant::Bool: { - type = parent.createElement("bool"); - //valueE = parent.createTextNode(QString::number(value.toBool())); - valueE = parent.createTextNode(value.toBool() ? "true" : "false"); + type = tqparent.createElement("bool"); + //valueE = tqparent.createTextNode(TQString::number(value.toBool())); + valueE = tqparent.createTextNode(value.toBool() ? "true" : "false"); type.appendChild(valueE); break; } - case QVariant::Int: - case QVariant::UInt: + case TQVariant::Int: + case TQVariant::UInt: { - type = parent.createElement("number"); - valueE = parent.createTextNode(QString::number(value.toInt())); + type = tqparent.createElement("number"); + valueE = tqparent.createTextNode(TQString::number(value.toInt())); type.appendChild(valueE); break; } - case QVariant::Size: + case TQVariant::Size: { - type = parent.createElement("size"); - QDomElement w = parent.createElement("width"); - QDomElement h = parent.createElement("height"); - QDomText valueW = parent.createTextNode(QString::number(value.toSize().width())); - QDomText valueH = parent.createTextNode(QString::number(value.toSize().height())); + type = tqparent.createElement("size"); + TQDomElement w = tqparent.createElement("width"); + TQDomElement h = tqparent.createElement("height"); + TQDomText valueW = tqparent.createTextNode(TQString::number(value.toSize().width())); + TQDomText valueH = tqparent.createTextNode(TQString::number(value.toSize().height())); w.appendChild(valueW); h.appendChild(valueH); @@ -568,13 +568,13 @@ FormIO::writeVariant(QDomDocument &parent, QDomElement &parentNode, QVariant val type.appendChild(h); break; } - case QVariant::Point: + case TQVariant::Point: { - type = parent.createElement("point"); - QDomElement x = parent.createElement("x"); - QDomElement y = parent.createElement("y"); - QDomText valueX = parent.createTextNode(QString::number(value.toPoint().x())); - QDomText valueY = parent.createTextNode(QString::number(value.toPoint().y())); + type = tqparent.createElement("point"); + TQDomElement x = tqparent.createElement("x"); + TQDomElement y = tqparent.createElement("y"); + TQDomText valueX = tqparent.createTextNode(TQString::number(value.toPoint().x())); + TQDomText valueY = tqparent.createTextNode(TQString::number(value.toPoint().y())); x.appendChild(valueX); y.appendChild(valueY); @@ -583,23 +583,23 @@ FormIO::writeVariant(QDomDocument &parent, QDomElement &parentNode, QVariant val type.appendChild(y); break; } - case QVariant::Font: + case TQVariant::Font: { - type = parent.createElement("font"); - QDomElement f = parent.createElement("family"); - QDomElement p = parent.createElement("pointsize"); - QDomElement w = parent.createElement("weight"); - QDomElement b = parent.createElement("bold"); - QDomElement i = parent.createElement("italic"); - QDomElement u = parent.createElement("underline"); - QDomElement s = parent.createElement("strikeout"); - QDomText valueF = parent.createTextNode(value.toFont().family()); - QDomText valueP = parent.createTextNode(QString::number(value.toFont().pointSize())); - QDomText valueW = parent.createTextNode(QString::number(value.toFont().weight())); - QDomText valueB = parent.createTextNode(QString::number(value.toFont().bold())); - QDomText valueI = parent.createTextNode(QString::number(value.toFont().italic())); - QDomText valueU = parent.createTextNode(QString::number(value.toFont().underline())); - QDomText valueS = parent.createTextNode(QString::number(value.toFont().strikeOut())); + type = tqparent.createElement("font"); + TQDomElement f = tqparent.createElement("family"); + TQDomElement p = tqparent.createElement("pointsize"); + TQDomElement w = tqparent.createElement("weight"); + TQDomElement b = tqparent.createElement("bold"); + TQDomElement i = tqparent.createElement("italic"); + TQDomElement u = tqparent.createElement("underline"); + TQDomElement s = tqparent.createElement("strikeout"); + TQDomText valueF = tqparent.createTextNode(value.toFont().family()); + TQDomText valueP = tqparent.createTextNode(TQString::number(value.toFont().pointSize())); + TQDomText valueW = tqparent.createTextNode(TQString::number(value.toFont().weight())); + TQDomText valueB = tqparent.createTextNode(TQString::number(value.toFont().bold())); + TQDomText valueI = tqparent.createTextNode(TQString::number(value.toFont().italic())); + TQDomText valueU = tqparent.createTextNode(TQString::number(value.toFont().underline())); + TQDomText valueS = tqparent.createTextNode(TQString::number(value.toFont().strikeOut())); f.appendChild(valueF); p.appendChild(valueP); @@ -618,24 +618,24 @@ FormIO::writeVariant(QDomDocument &parent, QDomElement &parentNode, QVariant val type.appendChild(s); break; } - case QVariant::Cursor: + case TQVariant::Cursor: { - type = parent.createElement("cursor"); - valueE = parent.createTextNode(QString::number(value.toCursor().shape())); + type = tqparent.createElement("cursor"); + valueE = tqparent.createTextNode(TQString::number(value.toCursor().tqshape())); type.appendChild(valueE); break; } - case QVariant::SizePolicy: + case TQVariant::SizePolicy: { - type = parent.createElement("sizepolicy"); - QDomElement h = parent.createElement("hsizetype"); - QDomElement v = parent.createElement("vsizetype"); - QDomElement hs = parent.createElement("horstretch"); - QDomElement vs = parent.createElement("verstretch"); - QDomText valueH = parent.createTextNode(QString::number(value.toSizePolicy().horData())); - QDomText valueV = parent.createTextNode(QString::number(value.toSizePolicy().verData())); - QDomText valueHS = parent.createTextNode(QString::number(value.toSizePolicy().horStretch())); - QDomText valueVS = parent.createTextNode(QString::number(value.toSizePolicy().verStretch())); + type = tqparent.createElement("sizepolicy"); + TQDomElement h = tqparent.createElement("hsizetype"); + TQDomElement v = tqparent.createElement("vsizetype"); + TQDomElement hs = tqparent.createElement("horstretch"); + TQDomElement vs = tqparent.createElement("verstretch"); + TQDomText valueH = tqparent.createTextNode(TQString::number(value.toSizePolicy().horData())); + TQDomText valueV = tqparent.createTextNode(TQString::number(value.toSizePolicy().verData())); + TQDomText valueHS = tqparent.createTextNode(TQString::number(value.toSizePolicy().horStretch())); + TQDomText valueVS = tqparent.createTextNode(TQString::number(value.toSizePolicy().verStretch())); h.appendChild(valueH); v.appendChild(valueV); @@ -648,15 +648,15 @@ FormIO::writeVariant(QDomDocument &parent, QDomElement &parentNode, QVariant val type.appendChild(vs); break; } - case QVariant::Time: + case TQVariant::Time: { - type = parent.createElement("time"); - QDomElement h = parent.createElement("hour"); - QDomElement m = parent.createElement("minute"); - QDomElement s = parent.createElement("second"); - QDomText valueH = parent.createTextNode(QString::number(value.toTime().hour())); - QDomText valueM = parent.createTextNode(QString::number(value.toTime().minute())); - QDomText valueS = parent.createTextNode(QString::number(value.toTime().second())); + type = tqparent.createElement("time"); + TQDomElement h = tqparent.createElement("hour"); + TQDomElement m = tqparent.createElement("minute"); + TQDomElement s = tqparent.createElement("second"); + TQDomText valueH = tqparent.createTextNode(TQString::number(value.toTime().hour())); + TQDomText valueM = tqparent.createTextNode(TQString::number(value.toTime().minute())); + TQDomText valueS = tqparent.createTextNode(TQString::number(value.toTime().second())); h.appendChild(valueH); m.appendChild(valueM); @@ -667,15 +667,15 @@ FormIO::writeVariant(QDomDocument &parent, QDomElement &parentNode, QVariant val type.appendChild(s); break; } - case QVariant::Date: + case TQVariant::Date: { - type = parent.createElement("date"); - QDomElement y = parent.createElement("year"); - QDomElement m = parent.createElement("month"); - QDomElement d = parent.createElement("day"); - QDomText valueY = parent.createTextNode(QString::number(value.toDate().year())); - QDomText valueM = parent.createTextNode(QString::number(value.toDate().month())); - QDomText valueD = parent.createTextNode(QString::number(value.toDate().day())); + type = tqparent.createElement("date"); + TQDomElement y = tqparent.createElement("year"); + TQDomElement m = tqparent.createElement("month"); + TQDomElement d = tqparent.createElement("day"); + TQDomText valueY = tqparent.createTextNode(TQString::number(value.toDate().year())); + TQDomText valueM = tqparent.createTextNode(TQString::number(value.toDate().month())); + TQDomText valueD = tqparent.createTextNode(TQString::number(value.toDate().day())); y.appendChild(valueY); m.appendChild(valueM); @@ -686,21 +686,21 @@ FormIO::writeVariant(QDomDocument &parent, QDomElement &parentNode, QVariant val type.appendChild(d); break; } - case QVariant::DateTime: + case TQVariant::DateTime: { - type = parent.createElement("datetime"); - QDomElement h = parent.createElement("hour"); - QDomElement m = parent.createElement("minute"); - QDomElement s = parent.createElement("second"); - QDomElement y = parent.createElement("year"); - QDomElement mo = parent.createElement("month"); - QDomElement d = parent.createElement("day"); - QDomText valueH = parent.createTextNode(QString::number(value.toDateTime().time().hour())); - QDomText valueM = parent.createTextNode(QString::number(value.toDateTime().time().minute())); - QDomText valueS = parent.createTextNode(QString::number(value.toDateTime().time().second())); - QDomText valueY = parent.createTextNode(QString::number(value.toDateTime().date().year())); - QDomText valueMo = parent.createTextNode(QString::number(value.toDateTime().date().month())); - QDomText valueD = parent.createTextNode(QString::number(value.toDateTime().date().day())); + type = tqparent.createElement("datetime"); + TQDomElement h = tqparent.createElement("hour"); + TQDomElement m = tqparent.createElement("minute"); + TQDomElement s = tqparent.createElement("second"); + TQDomElement y = tqparent.createElement("year"); + TQDomElement mo = tqparent.createElement("month"); + TQDomElement d = tqparent.createElement("day"); + TQDomText valueH = tqparent.createTextNode(TQString::number(value.toDateTime().time().hour())); + TQDomText valueM = tqparent.createTextNode(TQString::number(value.toDateTime().time().minute())); + TQDomText valueS = tqparent.createTextNode(TQString::number(value.toDateTime().time().second())); + TQDomText valueY = tqparent.createTextNode(TQString::number(value.toDateTime().date().year())); + TQDomText valueMo = tqparent.createTextNode(TQString::number(value.toDateTime().date().month())); + TQDomText valueD = tqparent.createTextNode(TQString::number(value.toDateTime().date().day())); h.appendChild(valueH); m.appendChild(valueM); @@ -721,60 +721,60 @@ FormIO::writeVariant(QDomDocument &parent, QDomElement &parentNode, QVariant val break; } - parentNode.appendChild(type); + tqparentNode.appendChild(type); } void -FormIO::savePropertyElement(QDomElement &parentNode, QDomDocument &domDoc, const QString &tagName, const QString &property, const QVariant &value) +FormIO::savePropertyElement(TQDomElement &tqparentNode, TQDomDocument &domDoc, const TQString &tagName, const TQString &property, const TQVariant &value) { - QDomElement propertyE = domDoc.createElement(tagName); + TQDomElement propertyE = domDoc.createElement(tagName); propertyE.setAttribute("name", property); writeVariant(domDoc, propertyE, value); - parentNode.appendChild(propertyE); + tqparentNode.appendChild(propertyE); } -QVariant -FormIO::readPropertyValue(QDomNode node, QObject *obj, const QString &name) +TQVariant +FormIO::readPropertyValue(TQDomNode node, TQObject *obj, const TQString &name) { - QDomElement tag = node.toElement(); - QString text = tag.text(); - QString type = tag.tagName(); + TQDomElement tag = node.toElement(); + TQString text = tag.text(); + TQString type = tag.tagName(); if(type == "string" || type == "cstring") return text; else if(type == "rect") { - QDomElement x = node.namedItem("x").toElement(); - QDomElement y = node.namedItem("y").toElement(); - QDomElement w = node.namedItem("width").toElement(); - QDomElement h = node.namedItem("height").toElement(); + TQDomElement x = node.namedItem("x").toElement(); + TQDomElement y = node.namedItem("y").toElement(); + TQDomElement w = node.namedItem("width").toElement(); + TQDomElement h = node.namedItem("height").toElement(); int rx = x.text().toInt(); int ry = y.text().toInt(); int rw = w.text().toInt(); int rh = h.text().toInt(); - return QRect(rx, ry, rw, rh); + return TQRect(rx, ry, rw, rh); } else if(type == "color") { - QDomElement r = node.namedItem("red").toElement(); - QDomElement g = node.namedItem("green").toElement(); - QDomElement b = node.namedItem("blue").toElement(); + TQDomElement r = node.namedItem("red").toElement(); + TQDomElement g = node.namedItem("green").toElement(); + TQDomElement b = node.namedItem("blue").toElement(); int red = r.text().toInt(); int green = g.text().toInt(); int blue = b.text().toInt(); - return QColor(red, green, blue); + return TQColor(red, green, blue); } else if(type == "bool") { if(text == "true") - return QVariant(true, 3); + return TQVariant(true, 3); else if(text == "false") - return QVariant(false, 3); - return QVariant(text.toInt(), 3); + return TQVariant(false, 3); + return TQVariant(text.toInt(), 3); } else if(type == "number") { @@ -782,29 +782,29 @@ FormIO::readPropertyValue(QDomNode node, QObject *obj, const QString &name) } else if(type == "size") { - QDomElement w = node.namedItem("width").toElement(); - QDomElement h = node.namedItem("height").toElement(); + TQDomElement w = node.namedItem("width").toElement(); + TQDomElement h = node.namedItem("height").toElement(); - return QSize(w.text().toInt(), h.text().toInt()); + return TQSize(w.text().toInt(), h.text().toInt()); } else if(type == "point") { - QDomElement x = node.namedItem("x").toElement(); - QDomElement y = node.namedItem("y").toElement(); + TQDomElement x = node.namedItem("x").toElement(); + TQDomElement y = node.namedItem("y").toElement(); - return QPoint(x.text().toInt(), y.text().toInt()); + return TQPoint(x.text().toInt(), y.text().toInt()); } else if(type == "font") { - QDomElement fa = node.namedItem("family").toElement(); - QDomElement p = node.namedItem("pointsize").toElement(); - QDomElement w = node.namedItem("weight").toElement(); - QDomElement b = node.namedItem("bold").toElement(); - QDomElement i = node.namedItem("italic").toElement(); - QDomElement u = node.namedItem("underline").toElement(); - QDomElement s = node.namedItem("strikeout").toElement(); - - QFont f; + TQDomElement fa = node.namedItem("family").toElement(); + TQDomElement p = node.namedItem("pointsize").toElement(); + TQDomElement w = node.namedItem("weight").toElement(); + TQDomElement b = node.namedItem("bold").toElement(); + TQDomElement i = node.namedItem("italic").toElement(); + TQDomElement u = node.namedItem("underline").toElement(); + TQDomElement s = node.namedItem("strikeout").toElement(); + + TQFont f; f.setFamily(fa.text()); f.setPointSize(p.text().toInt()); f.setWeight(w.text().toInt()); @@ -817,77 +817,77 @@ FormIO::readPropertyValue(QDomNode node, QObject *obj, const QString &name) } else if(type == "cursor") { - return QCursor(text.toInt()); + return TQCursor(text.toInt()); } else if(type == "time") { - QDomElement h = node.namedItem("hour").toElement(); - QDomElement m = node.namedItem("minute").toElement(); - QDomElement s = node.namedItem("second").toElement(); + TQDomElement h = node.namedItem("hour").toElement(); + TQDomElement m = node.namedItem("minute").toElement(); + TQDomElement s = node.namedItem("second").toElement(); - return QTime(h.text().toInt(), m.text().toInt(), s.text().toInt()); + return TQTime(h.text().toInt(), m.text().toInt(), s.text().toInt()); } else if(type == "date") { - QDomElement y = node.namedItem("year").toElement(); - QDomElement m = node.namedItem("month").toElement(); - QDomElement d = node.namedItem("day").toElement(); + TQDomElement y = node.namedItem("year").toElement(); + TQDomElement m = node.namedItem("month").toElement(); + TQDomElement d = node.namedItem("day").toElement(); - return QDate(y.text().toInt(), m.text().toInt(), d.text().toInt()); + return TQDate(y.text().toInt(), m.text().toInt(), d.text().toInt()); } else if(type == "datetime") { - QDomElement h = node.namedItem("hour").toElement(); - QDomElement m = node.namedItem("minute").toElement(); - QDomElement s = node.namedItem("second").toElement(); - QDomElement y = node.namedItem("year").toElement(); - QDomElement mo = node.namedItem("month").toElement(); - QDomElement d = node.namedItem("day").toElement(); + TQDomElement h = node.namedItem("hour").toElement(); + TQDomElement m = node.namedItem("minute").toElement(); + TQDomElement s = node.namedItem("second").toElement(); + TQDomElement y = node.namedItem("year").toElement(); + TQDomElement mo = node.namedItem("month").toElement(); + TQDomElement d = node.namedItem("day").toElement(); - QTime t(h.text().toInt(), m.text().toInt(), s.text().toInt()); - QDate da(y.text().toInt(), mo.text().toInt(), d.text().toInt()); + TQTime t(h.text().toInt(), m.text().toInt(), s.text().toInt()); + TQDate da(y.text().toInt(), mo.text().toInt(), d.text().toInt()); - return QDateTime(da, t); + return TQDateTime(da, t); } else if(type == "sizepolicy") { - QDomElement h = node.namedItem("hsizetype").toElement(); - QDomElement v = node.namedItem("vsizetype").toElement(); - QDomElement hs = node.namedItem("horstretch").toElement(); - QDomElement vs = node.namedItem("verstretch").toElement(); - - QSizePolicy s; - s.setHorData((QSizePolicy::SizeType)h.text().toInt()); - s.setVerData((QSizePolicy::SizeType)v.text().toInt()); + TQDomElement h = node.namedItem("hsizetype").toElement(); + TQDomElement v = node.namedItem("vsizetype").toElement(); + TQDomElement hs = node.namedItem("horstretch").toElement(); + TQDomElement vs = node.namedItem("verstretch").toElement(); + + TQSizePolicy s; + s.setHorData((TQSizePolicy::SizeType)h.text().toInt()); + s.setVerData((TQSizePolicy::SizeType)v.text().toInt()); s.setHorStretch(hs.text().toInt()); s.setVerStretch(vs.text().toInt()); return s; } else if(type == "pixmap") { - if(m_savePixmapsInline || !m_currentForm || !m_currentItem || !m_currentForm->pixmapCollection()->contains(text)) + if(m_savePixmapsInline || !m_currentForm || !m_currentItem || !m_currentForm->pixmapCollection()->tqcontains(text)) return loadImage(tag.ownerDocument(), text); else { m_currentItem->setPixmapName(name.latin1(), text); return m_currentForm->pixmapCollection()->getPixmap(text); } - return QVariant(QPixmap()); + return TQVariant(TQPixmap()); } else if(type == "enum") return text; else if(type == "set") { WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(obj); - QObject *subobject = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : obj; - const int count = subobject->metaObject()->findProperty(name.latin1(), true); - const QMetaProperty *meta = count!=-1 ? subobject->metaObject()->property(count, true) : 0; + TQObject *subobject = (subpropIface && subpropIface->subwidget()) ? TQT_TQOBJECT(subpropIface->subwidget()) : obj; + const int count = subobject->tqmetaObject()->tqfindProperty(name.latin1(), true); + const TQMetaProperty *meta = count!=-1 ? subobject->tqmetaObject()->property(count, true) : 0; if (meta) { if (meta->isSetType()) { - QStrList keys; - const QStringList list( QStringList::split("|", text) ); - for (QStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it) + TQStrList keys; + const TQStringList list( TQStringList::split("|", text) ); + for (TQStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it) keys.append((*it).latin1()); return meta->keysToValue(keys); @@ -898,10 +898,10 @@ FormIO::readPropertyValue(QDomNode node, QObject *obj, const QString &name) // We will return a string list here with hope that names will // be resolved and translated into an integer value later when subwidget is created, // e.g. near KexiFormView::updateValuesForSubproperties() - return QStringList::split("|", text); + return TQStringList::split("|", text); } } - return QVariant(); + return TQVariant(); } ///////////////////////////////////////////////////////////////////////////// @@ -909,7 +909,7 @@ FormIO::readPropertyValue(QDomNode node, QObject *obj, const QString &name) ///////////////////////////////////////////////////////////////////////////// void -FormIO::saveWidget(ObjectTreeItem *item, QDomElement &parent, QDomDocument &domDoc, bool insideGridLayout) +FormIO::saveWidget(ObjectTreeItem *item, TQDomElement &tqparent, TQDomDocument &domDoc, bool insideGridLayout) { if (!item) return; @@ -917,7 +917,7 @@ FormIO::saveWidget(ObjectTreeItem *item, QDomElement &parent, QDomDocument &domD // we let Spring class handle saving itself if(item->className() == "Spring") { - Spring::saveSpring(item, parent, domDoc, insideGridLayout); + Spring::saveSpring(item, tqparent, domDoc, insideGridLayout); return; } @@ -926,7 +926,7 @@ FormIO::saveWidget(ObjectTreeItem *item, QDomElement &parent, QDomDocument &domD if(!m_currentForm) // copying widget { resetCurrentForm = true; - m_currentForm = item->container() ? item->container()->form() : item->parent()->container()->form(); + m_currentForm = item->container() ? item->container()->form() : item->tqparent()->container()->form(); } @@ -934,11 +934,11 @@ FormIO::saveWidget(ObjectTreeItem *item, QDomElement &parent, QDomDocument &domD // if(item->container()) // lib = item->container()->form()->manager()->lib(); // else -// lib = item->parent()->container()->form()->manager()->lib(); +// lib = item->tqparent()->container()->form()->manager()->lib(); // We create the "widget" element - QDomElement tclass = domDoc.createElement("widget"); - parent.appendChild(tclass); + TQDomElement tclass = domDoc.createElement("widget"); + tqparent.appendChild(tclass); if(insideGridLayout) { @@ -951,12 +951,12 @@ FormIO::saveWidget(ObjectTreeItem *item, QDomElement &parent, QDomDocument &domD } } - if(!item->parent()) // Toplevel widget - tclass.setAttribute("class", "QWidget"); - // For compatibility, HBox, VBox and Grid are saved as "QLayoutWidget" + if(!item->tqparent()) // Toplevel widget + tclass.setAttribute("class", TQWIDGET_OBJECT_NAME_STRING); + // For compatibility, HBox, VBox and Grid are saved as TQLAYOUTWIDGET_OBJECT_NAME_STRING else if(item->widget()->isA("HBox") || item->widget()->isA("VBox") || item->widget()->isA("Grid") || item->widget()->isA("HFlow") || item->widget()->isA("VFlow")) - tclass.setAttribute("class", "QLayoutWidget"); + tclass.setAttribute("class", TQLAYOUTWIDGET_OBJECT_NAME_STRING); else if(item->widget()->isA("CustomWidget")) tclass.setAttribute("class", item->className()); else // Normal widgets @@ -964,42 +964,42 @@ FormIO::saveWidget(ObjectTreeItem *item, QDomElement &parent, QDomDocument &domD savePropertyValue(tclass, domDoc, "name", item->widget()->property("name"), item->widget()); - // Important: save dataSource property FIRST before properties like "alignment" + // Important: save dataSource property FIRST before properties like "tqalignment" // - needed when subproperties are defined after subwidget creation, and subwidget is created after setting "dataSource" // (this is the case for KexiDBAutoField) //! @todo more properties like "dataSource" may needed here... -// if (-1 != item->widget()->metaObject()->findProperty("dataSource")) +// if (-1 != item->widget()->tqmetaObject()->findProperty("dataSource")) // savePropertyValue(tclass, domDoc, "dataSource", item->widget()->property("dataSource"), item->widget()); - // We don't want to save the geometry if the widget is inside a layout (so parent.tagName() == "grid" for example) - if(item && !item->parent()) { + // We don't want to save the tqgeometry if the widget is inside a tqlayout (so tqparent.tagName() == "grid" for example) + if(item && !item->tqparent()) { // save form widget size, but not its position savePropertyValue(tclass, domDoc, "geometry", - QRect( QPoint(0,0), item->widget()->size()), + TQRect( TQPoint(0,0), item->widget()->size()), item->widget()); } // normal widget (if == "UI', it means we're copying widget) - else if(parent.tagName() == "widget" || parent.tagName() == "UI") + else if(tqparent.tagName() == "widget" || tqparent.tagName() == "UI") savePropertyValue(tclass, domDoc, "geometry", item->widget()->property("geometry"), item->widget()); // Save the buddy widget for a label - if(item->widget()->inherits("QLabel") && ((QLabel*)item->widget())->buddy()) - savePropertyElement(tclass, domDoc, "property", "buddy", ((QLabel*)item->widget())->buddy()->name()); + if(item->widget()->inherits(TQLABEL_OBJECT_NAME_STRING) && ((TQLabel*)item->widget())->buddy()) + savePropertyElement(tclass, domDoc, "property", "buddy", ((TQLabel*)item->widget())->buddy()->name()); // We save every property in the modifProp list of the ObjectTreeItem - QVariantMap *map = new QVariantMap( *(item->modifiedProperties()) ); - QMap<QString,QVariant>::ConstIterator endIt = map->constEnd(); - for(QMap<QString,QVariant>::ConstIterator it = map->constBegin(); it != endIt; ++it) + TQVariantMap *map = new TQVariantMap( *(item->modifiedProperties()) ); + TQMap<TQString,TQVariant>::ConstIterator endIt = map->constEnd(); + for(TQMap<TQString,TQVariant>::ConstIterator it = map->constBegin(); it != endIt; ++it) { - const QCString name( it.key().latin1() ); - if(name == "hAlign" || name == "vAlign" || name == "wordbreak" || name == "alignment") { + const TQCString name( it.key().latin1() ); + if(name == "hAlign" || name == "vAlign" || name == "wordbreak" || name == "tqalignment") { if(!savedAlignment) // not to save it twice { - savePropertyValue(tclass, domDoc, "alignment", item->widget()->property("alignment"), item->widget()); + savePropertyValue(tclass, domDoc, "tqalignment", item->widget()->property("tqalignment"), item->widget()); savedAlignment = true; } } - else if(name == "name" || name == "geometry" || name == "layout") { + else if(name == "name" || name == "geometry" || name == "tqlayout") { // these have already been saved } else { @@ -1010,87 +1010,87 @@ FormIO::saveWidget(ObjectTreeItem *item, QDomElement &parent, QDomDocument &domD delete map; if(item->widget()->isA("CustomWidget")) { - QDomDocument doc("TEMP"); + TQDomDocument doc("TEMP"); doc.setContent(item->m_unknownProps); - for(QDomNode n = doc.firstChild(); !n.isNull(); n = n.nextSibling()) { + for(TQDomNode n = doc.firstChild(); !n.isNull(); n = n.nextSibling()) { tclass.appendChild(n.cloneNode()); } } - // Saving container 's layout if there is one - QDomElement layout; - if(item->container() && item->container()->layoutType() != Container::NoLayout) + // Saving container 's tqlayout if there is one + TQDomElement tqlayout; + if(item->container() && item->container()->tqlayoutType() != Container::NoLayout) { - if(item->container()->layout()) // there is a layout + if(item->container()->tqlayout()) // there is a tqlayout { - layout = domDoc.createElement("temp"); - savePropertyValue(layout, domDoc, "name", "unnamed", item->widget()); - if(item->modifiedProperties()->contains("layoutMargin")) - savePropertyElement(layout, domDoc, "property", "margin", item->container()->layoutMargin()); - if(item->modifiedProperties()->contains("layoutSpacing")) - savePropertyElement(layout, domDoc, "property", "spacing", item->container()->layoutSpacing()); - tclass.appendChild(layout); + tqlayout = domDoc.createElement("temp"); + savePropertyValue(tqlayout, domDoc, "name", "unnamed", item->widget()); + if(item->modifiedProperties()->tqcontains("tqlayoutMargin")) + savePropertyElement(tqlayout, domDoc, "property", "margin", item->container()->tqlayoutMargin()); + if(item->modifiedProperties()->tqcontains("tqlayoutSpacing")) + savePropertyElement(tqlayout, domDoc, "property", "spacing", item->container()->tqlayoutSpacing()); + tclass.appendChild(tqlayout); } } - int layoutType = item->container() ? item->container()->layoutType() : Container::NoLayout; - switch(layoutType) { - case Container::Grid: // grid layout + int tqlayoutType = item->container() ? item->container()->tqlayoutType() : Container::NoLayout; + switch(tqlayoutType) { + case Container::Grid: // grid tqlayout { - layout.setTagName("grid"); - for(ObjectTreeItem *objIt = item->children()->first(); objIt; objIt = item->children()->next()) - saveWidget(objIt, layout, domDoc, true); + tqlayout.setTagName("grid"); + for(ObjectTreeItem *objIt = item->tqchildren()->first(); objIt; objIt = item->tqchildren()->next()) + saveWidget(objIt, tqlayout, domDoc, true); break; } case Container::HBox: case Container::VBox: { - // as we don't save geometry, we need to sort widgets in the right order, not creation order + // as we don't save tqgeometry, we need to sort widgets in the right order, not creation order WidgetList *list; - if(layout.tagName() == "hbox") { + if(tqlayout.tagName() == "hbox") { list = new HorWidgetList(item->container()->form()->toplevelContainer()->widget()); - layout.setTagName("hbox"); + tqlayout.setTagName("hbox"); } else { list = new VerWidgetList(item->container()->form()->toplevelContainer()->widget()); - layout.setTagName("vbox"); + tqlayout.setTagName("vbox"); } - for(ObjectTreeItem *objTree = item->children()->first(); objTree; objTree = item->children()->next()) + for(ObjectTreeItem *objTree = item->tqchildren()->first(); objTree; objTree = item->tqchildren()->next()) list->append(objTree->widget()); list->sort(); - for(QWidget *obj = list->first(); obj; obj = list->next()) { + for(TQWidget *obj = list->first(); obj; obj = list->next()) { ObjectTreeItem *titem = item->container()->form()->objectTree()->lookup(obj->name()); if(item) - saveWidget(titem, layout, domDoc); + saveWidget(titem, tqlayout, domDoc); } delete list; break; } case Container::HFlow: case Container::VFlow: { - layout.setTagName("grid"); - KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->layout()); + tqlayout.setTagName("grid"); + KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->tqlayout()); if(!flow) break; WidgetList *list = (WidgetList*)flow->widgetList(); // save some special properties - savePropertyElement(layout, domDoc, "property", "customLayout", Container::layoutTypeToString(item->container()->layoutType()) ); - savePropertyElement(layout, domDoc, "property", "justify", QVariant(static_cast<KexiFlowLayout*>(item->container()->layout())->isJustified(), 3) ); + savePropertyElement(tqlayout, domDoc, "property", "customLayout", Container::tqlayoutTypeToString(item->container()->tqlayoutType()) ); + savePropertyElement(tqlayout, domDoc, "property", "justify", TQVariant(static_cast<KexiFlowLayout*>(item->container()->tqlayout())->isJustified(), 3) ); - // fill the widget's grid info, ie just simulate grid layout + // fill the widget's grid info, ie just simulate grid tqlayout item->container()->createGridLayout(true); - for(QWidget *obj = list->first(); obj; obj = list->next()) { + for(TQWidget *obj = list->first(); obj; obj = list->next()) { ObjectTreeItem *titem = item->container()->form()->objectTree()->lookup(obj->name()); if(item) - saveWidget(titem, layout, domDoc, true); // save grid info for compatibility with QtDesigner + saveWidget(titem, tqlayout, domDoc, true); // save grid info for compatibility with TQtDesigner } delete list; break; } default: { - for(ObjectTreeItem *objIt = item->children()->first(); objIt; objIt = item->children()->next()) + for(ObjectTreeItem *objIt = item->tqchildren()->first(); objIt; objIt = item->tqchildren()->next()) saveWidget(objIt, tclass, domDoc); } } @@ -1103,20 +1103,20 @@ FormIO::saveWidget(ObjectTreeItem *item, QDomElement &parent, QDomDocument &domD } void -FormIO::cleanClipboard(QDomElement &uiElement) +FormIO::cleanClipboard(TQDomElement &uiElement) { // remove includehints element not needed if(!uiElement.namedItem("includehints").isNull()) uiElement.removeChild(uiElement.namedItem("includehints")); // and ensure images and connection are at the end if(!uiElement.namedItem("connections").isNull()) - uiElement.insertAfter(uiElement.namedItem("connections"), QDomNode()); + uiElement.insertAfter(uiElement.namedItem("connections"), TQDomNode()); if(!uiElement.namedItem("images").isNull()) - uiElement.insertAfter(uiElement.namedItem("images"), QDomNode()); + uiElement.insertAfter(uiElement.namedItem("images"), TQDomNode()); } void -FormIO::loadWidget(Container *container, const QDomElement &el, QWidget *parent) +FormIO::loadWidget(Container *container, const TQDomElement &el, TQWidget *tqparent) { bool resetCurrentForm = false; if(!m_currentForm) // pasting widget @@ -1126,8 +1126,8 @@ FormIO::loadWidget(Container *container, const QDomElement &el, QWidget *parent) } // We first look for the widget's name - 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")) { @@ -1136,16 +1136,16 @@ FormIO::loadWidget(Container *container, const QDomElement &el, QWidget *parent) } } - QWidget *w; - QCString classname, alternate; + TQWidget *w; + TQCString classname, alternate; // We translate some name (for compatibility) if(el.tagName() == "spacer") classname = "Spring"; - else if(el.attribute("class") == "QLayoutWidget") + else if(el.attribute("class") == TQLAYOUTWIDGET_OBJECT_NAME_STRING) { - for(QDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) { - QString tagName = n.toElement().tagName(); + TQString tagName = n.toElement().tagName(); if(tagName == "property") continue; if(tagName == "hbox") @@ -1153,8 +1153,8 @@ FormIO::loadWidget(Container *container, const QDomElement &el, QWidget *parent) else if(tagName == "vbox") classname = "VBox"; else if(tagName == "grid") { - // first, see if it is flow layout - for(QDomNode child = n.firstChild(); !child.isNull(); child = child.nextSibling()) { + // first, see if it is flow tqlayout + for(TQDomNode child = n.firstChild(); !child.isNull(); child = child.nextSibling()) { if((child.toElement().tagName() == "property") && (child.toElement().attribute("name") == "customLayout")) { @@ -1187,11 +1187,11 @@ FormIO::loadWidget(Container *container, const QDomElement &el, QWidget *parent) widgetOptions ^= WidgetFactory::DesignViewMode; } - if(!parent) + if(!tqparent) w = container->form()->library()->createWidget(classname, container->widget(), wname.latin1(), container, widgetOptions); else - w = container->form()->library()->createWidget(classname, parent, wname.latin1(), + w = container->form()->library()->createWidget(classname, tqparent, wname.latin1(), container, widgetOptions); } @@ -1204,7 +1204,7 @@ FormIO::loadWidget(Container *container, const QDomElement &el, QWidget *parent) KAcceleratorManager::setNoAccel(w); } #endif - w->setStyle(&(container->widget()->style())); + w->setStyle(&(container->widget()->tqstyle())); w->show(); // We create and insert the ObjectTreeItem at the good place in the ObjectTree @@ -1213,12 +1213,12 @@ FormIO::loadWidget(Container *container, const QDomElement &el, QWidget *parent) // not yet created item = new ObjectTreeItem(container->form()->library()->displayName(classname), wname, w, container); - if(parent) { - ObjectTreeItem *titem = container->form()->objectTree()->lookup(parent->name()); + if(tqparent) { + ObjectTreeItem *titem = container->form()->objectTree()->lookup(tqparent->name()); if(titem) container->form()->objectTree()->addItem(titem, item); else - kdDebug() << "FORMIO :: ERROR no parent widget " << endl; + kdDebug() << "FORMIO :: ERROR no tqparent widget " << endl; } else container->form()->objectTree()->addItem(container->objectTree(), item); @@ -1231,37 +1231,37 @@ FormIO::loadWidget(Container *container, const QDomElement &el, QWidget *parent) m_currentItem = item; // if we are inside a Grid, we need to insert the widget in the good cell - if(container->layoutType() == Container::Grid) { - QGridLayout *layout = (QGridLayout*)container->layout(); + if(container->tqlayoutType() == Container::Grid) { + TQGridLayout *tqlayout = (TQGridLayout*)container->tqlayout(); if(el.hasAttribute("rowspan")) { // widget spans multiple cells - if(layout) - layout->addMultiCellWidget(w, el.attribute("row").toInt(), el.attribute("row").toInt() + el.attribute("rowspan").toInt()-1, + if(tqlayout) + tqlayout->addMultiCellWidget(w, el.attribute("row").toInt(), el.attribute("row").toInt() + el.attribute("rowspan").toInt()-1, el.attribute("column").toInt(), el.attribute("column").toInt() + el.attribute("colspan").toInt()-1); item->setGridPos(el.attribute("row").toInt(), el.attribute("column").toInt(), el.attribute("rowspan").toInt(), el.attribute("colspan").toInt()); } else { - if(layout) - layout->addWidget(w, el.attribute("row").toInt(), el.attribute("column").toInt()); + if(tqlayout) + tqlayout->addWidget(w, el.attribute("row").toInt(), el.attribute("column").toInt()); item->setGridPos(el.attribute("row").toInt(), el.attribute("column").toInt(), 0, 0); } } - else if(container->layout()) - container->layout()->add(w); + else if(container->tqlayout()) + container->tqlayout()->add(w); readChildNodes(item, container, el, w); - if(item->container() && item->container()->layout()) - item->container()->layout()->activate(); + if(item->container() && item->container()->tqlayout()) + item->container()->tqlayout()->activate(); // We add the autoSaveProperties in the modifProp list of the ObjectTreeItem, so that they are saved later - QValueList<QCString> list(container->form()->library()->autoSaveProperties(w->className())); - QValueList<QCString>::ConstIterator endIt = list.constEnd(); + TQValueList<TQCString> list(container->form()->library()->autoSaveProperties(w->className())); + TQValueList<TQCString>::ConstIterator endIt = list.constEnd(); KFormDesigner::WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<KFormDesigner::WidgetWithSubpropertiesInterface*>(w); - QWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : w; - for(QValueList<QCString>::ConstIterator it = list.constBegin(); it != endIt; ++it) { - if(subwidget->metaObject()->findProperty(*it, true) != -1) + TQWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : w; + for(TQValueList<TQCString>::ConstIterator it = list.constBegin(); it != endIt; ++it) { + if(subwidget->tqmetaObject()->tqfindProperty(*it, true) != -1) item->addModifiedProperty(*it, subwidget->property(*it)); } @@ -1271,11 +1271,11 @@ FormIO::loadWidget(Container *container, const QDomElement &el, QWidget *parent) } void -FormIO::createToplevelWidget(Form *form, QWidget *container, QDomElement &el) +FormIO::createToplevelWidget(Form *form, TQWidget *container, TQDomElement &el) { // We first look for the widget's name - 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")) { @@ -1290,16 +1290,16 @@ FormIO::createToplevelWidget(Form *form, QWidget *container, QDomElement &el) form->objectTree()->rename(form->objectTree()->name(), wname); form->setInteractiveMode(false); - QDict<QLabel> *oldBuddies = 0; + TQDict<TQLabel> *oldBuddies = 0; if(m_buddies) // save old buddies (for subforms) oldBuddies = m_buddies; - m_buddies = new QDict<QLabel>(); + m_buddies = new TQDict<TQLabel>(); m_currentItem = form->objectTree(); readChildNodes(form->objectTree(), form->toplevelContainer(), el, container); // Now the Form is fully loaded, we can assign the buddies - QDictIterator<QLabel> it(*m_buddies); + TQDictIterator<TQLabel> it(*m_buddies); for(; it.current(); ++it) { ObjectTreeItem *item = form->objectTree()->lookup(it.currentKey()); @@ -1319,31 +1319,31 @@ FormIO::createToplevelWidget(Form *form, QWidget *container, QDomElement &el) } void -FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const QDomElement &el, QWidget *w) +FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const TQDomElement &el, TQWidget *w) { - QString eltag = el.tagName(); + TQString eltag = el.tagName(); WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(w); - QWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : w; + TQWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : w; - for(QDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) { - QString tag = n.toElement().tagName(); - QDomElement node = n.toElement(); + TQString tag = n.toElement().tagName(); + TQDomElement node = n.toElement(); if((tag == "property") || (tag == "attribute")) { - QString name = node.attribute("name"); + TQString name = node.attribute("name"); //if(name == "geometry") // hasGeometryProp = true; if( ((eltag == "grid") || (eltag == "hbox") || (eltag == "vbox")) && - (name == "name")) // we don't care about layout names + (name == "name")) // we don't care about tqlayout names continue; if (node.attribute("subwidget")=="true") { //this is property for subwidget: remember it for delayed setting //because now the subwidget could be not created yet (true e.g. for KexiDBAutoField) - const QVariant val( readPropertyValue(node.firstChild(), w, name) ); + const TQVariant val( readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name) ); kdDebug() << val.toStringList() << endl; item->addSubproperty( name.latin1(), val ); //subwidget->setProperty(name.latin1(), val); @@ -1353,32 +1353,32 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const QDomEle // We cannot assign the buddy now as the buddy widget may not be created yet if(name == "buddy") - m_buddies->insert(readPropertyValue(node.firstChild(), w, name).toString(), (QLabel*)w); + m_buddies->insert(readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toString(), (TQLabel*)w); else if(((eltag == "grid") || (eltag == "hbox") || (eltag == "vbox")) && - item->container() && item->container()->layout()) { + item->container() && item->container()->tqlayout()) { // We load the margin of a Layout if(name == "margin") { - int margin = readPropertyValue(node.firstChild(), w, name).toInt(); + int margin = readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toInt(); item->container()->setLayoutMargin(margin); - item->container()->layout()->setMargin(margin); + item->container()->tqlayout()->setMargin(margin); } // We load the spacing of a Layout else if(name == "spacing") { - int spacing = readPropertyValue(node.firstChild(), w, name).toInt(); + int spacing = readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toInt(); item->container()->setLayoutSpacing(spacing); - item->container()->layout()->setSpacing(spacing); + item->container()->tqlayout()->setSpacing(spacing); } else if((name == "justify")){ - bool justify = readPropertyValue(node.firstChild(), w, name).toBool(); - KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->layout()); + bool justify = readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toBool(); + KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->tqlayout()); if(flow) flow->setJustified(justify); } } // If the object doesn't have this property, we let the Factory handle it (maybe a special property) - else if(subwidget->metaObject()->findProperty(name.latin1(), true) == -1) + else if(subwidget->tqmetaObject()->tqfindProperty(name.latin1(), true) == -1) { - if(w->className() == QString::fromLatin1("CustomWidget")) + if(w->className() == TQString::tqfromLatin1("CustomWidget")) item->storeUnknownProperty(node); else { bool read = container->form()->library()->readSpecialProperty( @@ -1389,10 +1389,10 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const QDomEle } else // we have a normal property, let's load it { - QVariant val( readPropertyValue(node.firstChild(), w, name) ); + TQVariant val( readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name) ); if(name == "geometry" && dynamic_cast<FormWidget*>(w)) { - //fix geometry if needed - this is top level form widget - QRect r( val.toRect() ); + //fix tqgeometry if needed - this is top level form widget + TQRect r( val.toRect() ); if (r.left()<0) //negative X! r.moveLeft(0); if (r.top()<0) //negative Y! @@ -1400,8 +1400,8 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const QDomEle val = r; } subwidget->setProperty(name.latin1(), val); -// int count = w->metaObject()->findProperty(name, true); -// const QMetaProperty *meta = w->metaObject()->property(count, true); +// int count = w->tqmetaObject()->findProperty(name, true); +// const TQMetaProperty *meta = w->tqmetaObject()->property(count, true); // if(meta && meta->isEnumType()) { // val = w->property(name.latin1()); //update: we want a numeric value of enum // } @@ -1419,48 +1419,48 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const QDomEle loadWidget(container, node, w); } else if(tag == "grid") { - // first, see if it is flow layout - QString layoutName; - for(QDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) { + // first, see if it is flow tqlayout + TQString tqlayoutName; + for(TQDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) { if((child.toElement().tagName() == "property") && (child.toElement().attribute("name") == "customLayout")) { - layoutName = child.toElement().text(); + tqlayoutName = child.toElement().text(); break; } } - if(layoutName == "HFlow") { + if(tqlayoutName == "HFlow") { item->container()->m_layType = Container::HFlow; - KexiFlowLayout *layout = new KexiFlowLayout(item->widget()); - layout->setOrientation(Horizontal); - item->container()->m_layout = (QLayout*)layout; + KexiFlowLayout *tqlayout = new KexiFlowLayout(item->widget()); + tqlayout->setOrientation(Qt::Horizontal); + item->container()->m_layout = (TQLayout*)tqlayout; } - else if(layoutName == "VFlow") { + else if(tqlayoutName == "VFlow") { item->container()->m_layType = Container::VFlow; - KexiFlowLayout *layout = new KexiFlowLayout(item->widget()); - layout->setOrientation(Vertical); - item->container()->m_layout = (QLayout*)layout; + KexiFlowLayout *tqlayout = new KexiFlowLayout(item->widget()); + tqlayout->setOrientation(Qt::Vertical); + item->container()->m_layout = (TQLayout*)tqlayout; } - else { // grid layout + else { // grid tqlayout item->container()->m_layType = Container::Grid; - QGridLayout *layout = new QGridLayout(item->widget(), 1, 1); - item->container()->m_layout = (QLayout*)layout; + TQGridLayout *tqlayout = new TQGridLayout(item->widget(), 1, 1); + item->container()->m_layout = (TQLayout*)tqlayout; } readChildNodes(item, container, node, w); } else if(tag == "vbox") { item->container()->m_layType = Container::VBox; - QVBoxLayout *layout = new QVBoxLayout(item->widget()); - item->container()->m_layout = (QLayout*)layout; + TQVBoxLayout *tqlayout = new TQVBoxLayout(item->widget()); + item->container()->m_layout = (TQLayout*)tqlayout; readChildNodes(item, container, node, w); } else if(tag == "hbox") { item->container()->m_layType = Container::HBox; - QHBoxLayout *layout = new QHBoxLayout(item->widget()); - item->container()->m_layout = (QLayout*)layout; + TQHBoxLayout *tqlayout = new TQHBoxLayout(item->widget()); + item->container()->m_layout = (TQLayout*)tqlayout; readChildNodes(item, container, node, w); } else {// unknown tag, we let the Factory handle it - if(w->className() == QString::fromLatin1("CustomWidget")) + if(w->className() == TQString::tqfromLatin1("CustomWidget")) item->storeUnknownProperty(node); else { bool read = container->form()->library()->readSpecialProperty( @@ -1477,13 +1477,13 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const QDomEle ///////////////////////////////////////////////////////////////////////////// void -FormIO::addIncludeFileName(const QString &include, QDomDocument &domDoc) +FormIO::addIncludeFileName(const TQString &include, TQDomDocument &domDoc) { if(include.isEmpty()) return; - QDomElement includes; - QDomElement uiEl = domDoc.namedItem("UI").toElement(); + TQDomElement includes; + TQDomElement uiEl = domDoc.namedItem("UI").toElement(); if(uiEl.namedItem("includehints").isNull()) { includes = domDoc.createElement("includehints"); @@ -1493,57 +1493,57 @@ FormIO::addIncludeFileName(const QString &include, QDomDocument &domDoc) includes = uiEl.namedItem("includehints").toElement(); // Check if this include has already been saved, and return if it is the case - for(QDomNode n = includes.firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = includes.firstChild(); !n.isNull(); n = n.nextSibling()) { if(n.toElement().text() == include) return; } - QDomElement includeHint = domDoc.createElement("includehint"); + TQDomElement includeHint = domDoc.createElement("includehint"); includes.appendChild(includeHint); - QDomText includeText = domDoc.createTextNode(include); + TQDomText includeText = domDoc.createTextNode(include); includeHint.appendChild(includeText); } -//////// Qt Designer code: these two functions were copied (and adapted) from Qt Designer for compatibility //////// +//////// TQt Designer code: these two functions were copied (and adapted) from TQt Designer for compatibility //////// -QString -FormIO::saveImage(QDomDocument &domDoc, const QPixmap &pixmap) +TQString +FormIO::saveImage(TQDomDocument &domDoc, const TQPixmap &pixmap) { - QDomNode node = domDoc.namedItem("images"); - QDomElement images; + TQDomNode node = domDoc.namedItem("images"); + TQDomElement images; if(node.isNull()) { images = domDoc.createElement("images"); - QDomElement ui = domDoc.namedItem("UI").toElement(); + TQDomElement ui = domDoc.namedItem("UI").toElement(); ui.appendChild(images); } else images = node.toElement(); int count = images.childNodes().count(); - QDomElement image = domDoc.createElement("image"); - QString name = "image" + QString::number(count); + TQDomElement image = domDoc.createElement("image"); + TQString name = "image" + TQString::number(count); image.setAttribute("name", name); - QImage img = pixmap.convertToImage(); - QByteArray ba; - QBuffer buf(ba); + TQImage img = pixmap.convertToImage(); + TQByteArray ba; + TQBuffer buf(ba); buf.open( IO_WriteOnly | IO_Translate ); - QString format = img.depth() > 1 ? "XPM" : "XBM"; - QImageIO iio( &buf, format.latin1() ); + TQString format = img.depth() > 1 ? "XPM" : "XBM"; + TQImageIO iio( &buf, format.latin1() ); iio.setImage( img ); iio.write(); buf.close(); - QByteArray bazip = qCompress( ba ); + TQByteArray bazip = tqCompress( ba ); ulong len = bazip.size(); - QDomElement data = domDoc.createElement("data"); + TQDomElement data = domDoc.createElement("data"); data.setAttribute("format", format + ".GZ"); data.setAttribute("length", ba.size()); static const char hexchars[] = "0123456789abcdef"; - QString content; + TQString content; for(int i = 4; i < (int)len; ++i) { uchar s = (uchar) bazip[i]; @@ -1551,7 +1551,7 @@ FormIO::saveImage(QDomDocument &domDoc, const QPixmap &pixmap) content += hexchars[s & 0x0f]; } - QDomText text = domDoc.createTextNode(content); + TQDomText text = domDoc.createTextNode(content); data.appendChild(text); image.appendChild(data); images.appendChild(image); @@ -1559,15 +1559,15 @@ FormIO::saveImage(QDomDocument &domDoc, const QPixmap &pixmap) return name; } -QPixmap -FormIO::loadImage(QDomDocument domDoc, const QString& name) +TQPixmap +FormIO::loadImage(TQDomDocument domDoc, const TQString& name) { - QDomElement images = domDoc.namedItem("UI").namedItem("images").toElement(); + TQDomElement images = domDoc.namedItem("UI").namedItem("images").toElement(); if(images.isNull()) return 0; - QDomElement image; - for(QDomNode n = images.firstChild(); !n.isNull(); n = n.nextSibling()) + TQDomElement image; + for(TQDomNode n = images.firstChild(); !n.isNull(); n = n.nextSibling()) { if((n.toElement().tagName() == "image") && (n.toElement().attribute("name") == name)) { @@ -1576,8 +1576,8 @@ FormIO::loadImage(QDomDocument domDoc, const QString& name) } } - QPixmap pix; - QString data = image.namedItem("data").toElement().text(); + TQPixmap pix; + TQString data = image.namedItem("data").toElement().text(); const int lengthOffset = 4; int baSize = data.length() / 2 + lengthOffset; uchar *ba = new uchar[baSize]; @@ -1598,20 +1598,20 @@ FormIO::loadImage(QDomDocument domDoc, const QString& name) ba[i] = r; } - QString format = image.namedItem("data").toElement().attribute("format", "PNG"); + TQString format = image.namedItem("data").toElement().attribute("format", "PNG"); if((format == "XPM.GZ") || (format == "XBM.GZ")) { ulong len = image.attribute("length").toULong(); if(len < data.length() * 5) len = data.length() * 5; - // qUncompress() expects the first 4 bytes to be the expected length of + // tqUncompress() expects the first 4 bytes to be the expected length of // the uncompressed data ba[0] = ( len & 0xff000000 ) >> 24; ba[1] = ( len & 0x00ff0000 ) >> 16; ba[2] = ( len & 0x0000ff00 ) >> 8; ba[3] = ( len & 0x000000ff ); - QByteArray baunzip = qUncompress(ba, baSize); - pix.loadFromData( (const uchar*)baunzip.data(), baunzip.size(), format.left(format.find('.')).latin1() ); + TQByteArray baunzip = tqUncompress(ba, baSize); + pix.loadFromData( (const uchar*)baunzip.data(), baunzip.size(), format.left(format.tqfind('.')).latin1() ); } else pix.loadFromData( (const uchar*)ba+lengthOffset, baSize-lengthOffset, format.latin1() ); @@ -1621,6 +1621,6 @@ FormIO::loadImage(QDomDocument domDoc, const QString& name) return pix; } -//////// End of Qt Designer code //////////////////////////////////////////////////////// +//////// End of TQt Designer code //////////////////////////////////////////////////////// #include "formIO.moc" diff --git a/kexi/formeditor/formIO.h b/kexi/formeditor/formIO.h index b7337182..f2308433 100644 --- a/kexi/formeditor/formIO.h +++ b/kexi/formeditor/formIO.h @@ -21,33 +21,34 @@ #ifndef FORMIO_H #define FORMIO_H -#include <qobject.h> -#include <qdict.h> -#include <qstring.h> -#include <qwidget.h> -#include <qmap.h> - -class QString; -class QDomElement; -class QDomNode; -class QDomDocument; -class QDomText; -class QVariant; -class QLabel; +#include <tqobject.h> +#include <tqdict.h> +#include <tqstring.h> +#include <tqwidget.h> +#include <tqmap.h> + +class TQString; +class TQDomElement; +class TQDomNode; +class TQDomDocument; +class TQDomText; +class TQVariant; +class TQLabel; //! A blank widget displayed when class is not supported -class KFORMEDITOR_EXPORT CustomWidget : public QWidget +class KFORMEDITOR_EXPORT CustomWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: - CustomWidget(const QCString &className, QWidget *parent, const char *name); + CustomWidget(const TQCString &className, TQWidget *tqparent, const char *name); virtual ~CustomWidget(); - virtual void paintEvent(QPaintEvent *ev); + virtual void paintEvent(TQPaintEvent *ev); private: - QCString m_className; + TQCString m_className; }; namespace KFormDesigner { @@ -68,53 +69,54 @@ KFORMEDITOR_EXPORT uint version(); /** This class act as a namespace for all .ui files related functions, ie saving/loading .ui files. You don't need to create a FormIO object, as all methods are static.\n This class is able to read and write Forms to .ui files, and to save each type of properties, including set and enum - properties, and pixmaps(pixmap-related code was taken from Qt Designer). + properties, and pixmaps(pixmap-related code was taken from TQt Designer). **/ //! A class to save/load forms from .ui files -class KFORMEDITOR_EXPORT FormIO : public QObject +class KFORMEDITOR_EXPORT FormIO : public TQObject { Q_OBJECT + TQ_OBJECT public: FormIO(); ~FormIO(); - /*! Save the Form in the \a domDoc QDomDocument. Called by saveForm(). + /*! Save the Form in the \a domDoc TQDomDocument. Called by saveForm(). \return true if saving succeeded. \sa saveForm() */ - static bool saveFormToDom(Form *form, QDomDocument &domDoc); + static bool saveFormToDom(Form *form, TQDomDocument &domDoc); /*! Save the Form \a form to the file \a filename. If \a filename is null or not given, a Save File dialog will be shown to choose dest file. \return true if saving succeeded. \todo Add errors code and error dialog */ - static bool saveFormToFile(Form *form, const QString &filename=QString::null); + static bool saveFormToFile(Form *form, const TQString &filename=TQString()); /*! Saves the Form to the \a dest string. \a indent can be specified to apply indentation. \return true if saving succeeded. \sa saveForm() */ - static bool saveFormToString(Form *form, QString &dest, int indent = 0); + static bool saveFormToString(Form *form, TQString &dest, int indent = 0); - /*! Saves the \a form inside the \a dest QByteArray. + /*! Saves the \a form inside the \a dest TQByteArray. \return true if saving succeeded. \sa saveFormToDom(), saveForm() */ - static bool saveFormToByteArray(Form *form, QByteArray &dest); + static bool saveFormToByteArray(Form *form, TQByteArray &dest); - /*! Loads a form from the \a domDoc QDomDocument. Called by loadForm() and loadFormData(). + /*! Loads a form from the \a domDoc TQDomDocument. Called by loadForm() and loadFormData(). \return true if loading succeeded. */ - static bool loadFormFromDom(Form *form, QWidget *container, QDomDocument &domDoc); + static bool loadFormFromDom(Form *form, TQWidget *container, TQDomDocument &domDoc); - /*! Loads a form from the \a src QByteArray. + /*! Loads a form from the \a src TQByteArray. \sa loadFormFromDom(), loadForm(). \return true if loading succeeded. */ - static bool loadFormFromByteArray(Form *form, QWidget *container, QByteArray &src, + static bool loadFormFromByteArray(Form *form, TQWidget *container, TQByteArray &src, bool preview=false); - static bool loadFormFromString(Form *form, QWidget *container, QString &src, bool preview=false); + static bool loadFormFromString(Form *form, TQWidget *container, TQString &src, bool preview=false); /*! Loads the .ui file \a filename in the Form \a form. If \a filename is null or not given, a Open File dialog will be shown to select the file to open. @@ -122,48 +124,48 @@ class KFORMEDITOR_EXPORT FormIO : public QObject \return true if loading succeeded. \todo Add errors code and error dialog */ - static bool loadFormFromFile(Form *form, QWidget *container, const QString &filename=QString::null); + static bool loadFormFromFile(Form *form, TQWidget *container, const TQString &filename=TQString()); /*! Saves the widget associated to the ObjectTreeItem \a item into DOM document \a domDoc, - with \a parent as parent node. + with \a tqparent as tqparent node. It calls readPropertyValue() for each object property, readAttribute() for each attribute and itself to save child widgets.\n \return true if saving succeeded. This is used to copy/paste widgets. */ - static void saveWidget(ObjectTreeItem *item, QDomElement &parent, QDomDocument &domDoc, + static void saveWidget(ObjectTreeItem *item, TQDomElement &tqparent, TQDomDocument &domDoc, bool insideGridLayout=false); - /*! Cleans the "UI" QDomElement after saving widget. It deletes the "includes" element + /*! Cleans the "UI" TQDomElement after saving widget. It deletes the "includes" element not needed when pasting, and make sure all the "widget" elements are at the beginning. Call this after copying a widget, before pasting.*/ - static void cleanClipboard(QDomElement &uiElement); + static void cleanClipboard(TQDomElement &uiElement); - /*! Loads the widget associated to the QDomElement \a el into the Container \a container, - with \a parent as parent widget. - If parent = 0, the Container::widget() is used as parent widget. + /*! Loads the widget associated to the TQDomElement \a el into the Container \a container, + with \a tqparent as tqparent widget. + If tqparent = 0, the Container::widget() is used as tqparent widget. This is used to copy/paste widgets. */ static void loadWidget(Container *container, - const QDomElement &el, QWidget *parent=0); + const TQDomElement &el, TQWidget *tqparent=0); - /*! Save an element in the \a domDoc as child of \a parentNode. + /*! Save an element in the \a domDoc as child of \a tqparentNode. The element will be saved like this : \code <$(tagName) name = "$(property)">< value_as_XML ><$(tagName)/> \endcode */ - static void savePropertyElement(QDomElement &parentNode, QDomDocument &domDoc, const QString &tagName, - const QString &property, const QVariant &value); + static void savePropertyElement(TQDomElement &tqparentNode, TQDomDocument &domDoc, const TQString &tagName, + const TQString &property, const TQVariant &value); /*! Read an object property in the DOM doc. - \param node the QDomNode of the property + \param node the TQDomNode of the property \param obj the widget whose property is being read \param name the name of the property being read */ - static QVariant readPropertyValue(QDomNode node, QObject *obj, const QString &name); + static TQVariant readPropertyValue(TQDomNode node, TQObject *obj, const TQString &name); /*! Write an object property in the DOM doc. - \param parentNode the DOM document to write to + \param tqparentNode the DOM document to write to \param name the name of the property being saved \param value the value of this property \param w the widget whose property is being saved @@ -172,46 +174,46 @@ class KFORMEDITOR_EXPORT FormIO : public QObject Properties of subwidget are saved with subwidget="true" arribute added to 'property' XML element. */ - static void savePropertyValue(QDomElement &parentNode, QDomDocument &parent, const char *name, - const QVariant &value, QWidget *w, WidgetLibrary *lib=0); + static void savePropertyValue(TQDomElement &tqparentNode, TQDomDocument &tqparent, const char *name, + const TQVariant &value, TQWidget *w, WidgetLibrary *lib=0); protected: - /*! Saves the QVariant \a value as text to be included in an xml file, with \a parentNode.*/ - static void writeVariant(QDomDocument &parent, QDomElement &parentNode, QVariant value); + /*! Saves the TQVariant \a value as text to be included in an xml file, with \a tqparentNode.*/ + static void writeVariant(TQDomDocument &tqparent, TQDomElement &tqparentNode, TQVariant value); - /*! Creates a toplevel widget from the QDomElement \a element in the Form \a form, - with \a parent as parent widget. + /*! Creates a toplevel widget from the TQDomElement \a element in the Form \a form, + with \a tqparent as tqparent widget. It calls readPropertyValue() and loadWidget() to load child widgets. */ - static void createToplevelWidget(Form *form, QWidget *container, QDomElement &element); + static void createToplevelWidget(Form *form, TQWidget *container, TQDomElement &element); /*! \return the name of the pixmap saved, to use to access it - This function save the QPixmap \a pixmap into the DOM document \a domDoc. - The pixmap is converted to XPM and compressed for compatibility with Qt Designer. + This function save the TQPixmap \a pixmap into the DOM document \a domDoc. + The pixmap is converted to XPM and compressed for compatibility with TQt Designer. Encoding code is taken from Designer. */ - static QString saveImage(QDomDocument &domDoc, const QPixmap &pixmap); + static TQString saveImage(TQDomDocument &domDoc, const TQPixmap &pixmap); /*! \return the loaded pixmap This function loads the pixmap named \a name in the DOM document \a domDoc. Decoding code is taken from QT Designer. */ - static QPixmap loadImage(QDomDocument domDoc, const QString& name); + static TQPixmap loadImage(TQDomDocument domDoc, const TQString& name); /*! Reads the child nodes of a "widget" element. */ static void readChildNodes(ObjectTreeItem *tree, Container *container, - const QDomElement &el, QWidget *w); + const TQDomElement &el, TQWidget *w); /*! Adds an include file name to be saved in the "includehints" part of .ui file, which is needed by uic. */ - static void addIncludeFileName(const QString &include, QDomDocument &domDoc); + static void addIncludeFileName(const TQString &include, TQDomDocument &domDoc); private: // This dict stores buddies associations until the Form is completely loaded. - static QDict<QLabel> *m_buddies; + static TQDict<TQLabel> *m_buddies; /// Instead of having to pass these for every functions, we just store them in the class - //static QWidgdet *m_currentWidget; + //static TQWidgdet *m_currentWidget; static ObjectTreeItem *m_currentItem; static Form *m_currentForm; static bool m_savePixmapsInline; diff --git a/kexi/formeditor/formmanager.cpp b/kexi/formeditor/formmanager.cpp index 20b40cf9..85001f5e 100644 --- a/kexi/formeditor/formmanager.cpp +++ b/kexi/formeditor/formmanager.cpp @@ -20,16 +20,16 @@ #include <kdebug.h> -#include <qworkspace.h> -#include <qcursor.h> -#include <qstring.h> -#include <qlabel.h> -#include <qobjectlist.h> -#include <qstylefactory.h> -#include <qmetaobject.h> -#include <qregexp.h> -#include <qvaluevector.h> -#include <qvbox.h> +#include <tqworkspace.h> +#include <tqcursor.h> +#include <tqstring.h> +#include <tqlabel.h> +#include <tqobjectlist.h> +#include <tqstylefactory.h> +#include <tqmetaobject.h> +#include <tqregexp.h> +#include <tqvaluevector.h> +#include <tqvbox.h> #include <klocale.h> #include <kiconloader.h> @@ -51,7 +51,7 @@ #include <kfontdialog.h> #include <kdeversion.h> -#if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) && !defined(Q_WS_WIN) +#if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) && !defined(TQ_WS_WIN) # include <kactioncollection.h> #endif @@ -83,8 +83,8 @@ namespace KFormDesigner { class PropertyFactory : public KoProperty::CustomPropertyFactory { public: - PropertyFactory(QObject *parent) - : KoProperty::CustomPropertyFactory(parent) + PropertyFactory(TQObject *tqparent) + : KoProperty::CustomPropertyFactory(tqparent) // m_manager(manager) { } @@ -105,8 +105,8 @@ using namespace KFormDesigner; static KStaticDeleter<FormManager> m_managerDeleter; FormManager* FormManager::_self = 0L; -FormManager::FormManager(QObject *parent, int options, const char *name) - : QObject(parent, name) +FormManager::FormManager(TQObject *tqparent, int options, const char *name) + : TQObject(tqparent, name) #ifdef KEXI_DEBUG_GUI , m_uiCodeDialog(0) , m_options(options) @@ -121,7 +121,7 @@ FormManager::FormManager(QObject *parent, int options, const char *name) KGlobal::locale()->insertCatalogue("kformdesigner"); #endif - connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) ); + connect( kapp, TQT_SIGNAL( settingsChanged(int) ), TQT_SLOT( slotSettingsChanged(int) ) ); slotSettingsChanged(KApplication::SETTINGS_SHORTCUTS); //moved to createWidgetLibrary() m_lib = new WidgetLibrary(this, supportedFactoryGroups); @@ -139,9 +139,9 @@ FormManager::FormManager(QObject *parent, int options, const char *name) m_domDoc.appendChild(m_domDoc.createElement("UI")); m_deleteWidgetLater_list.setAutoDelete(true); - connect( &m_deleteWidgetLater_timer, SIGNAL(timeout()), this, SLOT(deleteWidgetLaterTimeout())); - connect( this, SIGNAL(connectionCreated(KFormDesigner::Form*, KFormDesigner::Connection&)), - this, SLOT(slotConnectionCreated(KFormDesigner::Form*, KFormDesigner::Connection&))); + connect( &m_deleteWidgetLater_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(deleteWidgetLaterTimeout())); + connect( this, TQT_SIGNAL(connectionCreated(KFormDesigner::Form*, KFormDesigner::Connection&)), + this, TQT_SLOT(slotConnectionCreated(KFormDesigner::Form*, KFormDesigner::Connection&))); // register kfd custom editors KoProperty::FactoryManager::self()->registerFactoryForEditor(KoProperty::Pixmap, @@ -166,7 +166,7 @@ FormManager* FormManager::self() } WidgetLibrary* -FormManager::createWidgetLibrary(FormManager* m, const QStringList& supportedFactoryGroups) +FormManager::createWidgetLibrary(FormManager* m, const TQStringList& supportedFactoryGroups) { if(!_self) m_managerDeleter.setObject( _self, m ); @@ -187,8 +187,8 @@ FormManager::setObjectTreeView(ObjectTreeView *treeview) { m_treeview = treeview; if (m_treeview) - connect(m_propSet, SIGNAL(widgetNameChanged(const QCString&, const QCString&)), - m_treeview, SLOT(renameItem(const QCString&, const QCString&))); + connect(m_propSet, TQT_SIGNAL(widgetNameChanged(const TQCString&, const TQCString&)), + m_treeview, TQT_SLOT(renameItem(const TQCString&, const TQCString&))); } ActionList @@ -196,13 +196,13 @@ FormManager::createActions(WidgetLibrary *lib, KActionCollection* collection, KX { m_collection = collection; - ActionList actions = lib->createWidgetActions(client, m_collection, this, SLOT(insertWidget(const QCString &))); + ActionList actions = lib->createWidgetActions(client, m_collection, this, TQT_SLOT(insertWidget(const TQCString &))); if (m_options & HideSignalSlotConnections) m_dragConnection = 0; else { m_dragConnection = new KToggleAction(i18n("Connect Signals/Slots"), - "signalslot", KShortcut(0), this, SLOT(startCreatingConnection()), m_collection, + "signalslot", KShortcut(0), this, TQT_SLOT(startCreatingConnection()), m_collection, "drag_connection"); //to be exclusive with any 'widget' action m_dragConnection->setExclusiveGroup("LibActionWidgets"); @@ -211,30 +211,30 @@ FormManager::createActions(WidgetLibrary *lib, KActionCollection* collection, KX } m_pointer = new KToggleAction(i18n("Pointer"), "mouse_pointer", KShortcut(0), - this, SLOT(slotPointerClicked()), m_collection, "pointer"); + this, TQT_SLOT(slotPointerClicked()), m_collection, "pointer"); m_pointer->setExclusiveGroup("LibActionWidgets"); //to be exclusive with any 'widget' action m_pointer->setChecked(true); actions.append(m_pointer); - m_snapToGrid = new KToggleAction(i18n("Snap to Grid"), QString::null, KShortcut(0), + m_snapToGrid = new KToggleAction(i18n("Snap to Grid"), TQString(), KShortcut(0), 0, 0, m_collection, "snap_to_grid"); m_snapToGrid->setChecked(true); actions.append(m_snapToGrid); // Create the Style selection action (with a combo box in toolbar and submenu items) KSelectAction *m_style = new KSelectAction( i18n("Style"), KShortcut(0), - this, SLOT(slotStyle()), m_collection, "change_style"); + this, TQT_SLOT(slotStyle()), m_collection, "change_style"); m_style->setEditable(false); KGlobal::config()->setGroup("General"); - QString currentStyle = QString::fromLatin1(kapp->style().name()).lower(); - const QStringList styles = QStyleFactory::keys(); + TQString currentStyle = TQString::tqfromLatin1(kapp->tqstyle().name()).lower(); + const TQStringList styles = TQStyleFactory::keys(); m_style->setItems(styles); m_style->setCurrentItem(0); - QStringList::ConstIterator endIt = styles.constEnd(); + TQStringList::ConstIterator endIt = styles.constEnd(); int idx = 0; - for (QStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) + for (TQStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) { if ((*it).lower() == currentStyle) { m_style->setCurrentItem(idx); @@ -278,7 +278,7 @@ FormManager::redo() } void -FormManager::insertWidget(const QCString &classname) +FormManager::insertWidget(const TQCString &classname) { if(m_drawingSlot) stopCreatingConnection(); @@ -288,17 +288,17 @@ FormManager::insertWidget(const QCString &classname) Form *form; for(form = m_forms.first(); form; form = m_forms.next()) { -// form->d->cursors = new QMap<QString, QCursor>(); +// form->d->cursors = new TQMap<TQString, TQCursor>(); if (form->toplevelContainer()) - form->widget()->setCursor(QCursor(CrossCursor)); - QObjectList *l = form->widget()->queryList( "QWidget" ); - for(QObject *o = l->first(); o; o = l->next()) + form->widget()->setCursor(TQCursor(CrossCursor)); + TQObjectList *l = form->widget()->queryList( TQWIDGET_OBJECT_NAME_STRING ); + for(TQObject *o = l->first(); o; o = l->next()) { - if( ((QWidget*)o)->ownCursor() ) + if( ((TQWidget*)o)->ownCursor() ) { -// form->d->cursors->insert(o->name(), ((QWidget*)o)->cursor()); - form->d->cursors.insert(o, static_cast<QWidget*>(o)->cursor()); - static_cast<QWidget*>(o)->setCursor(QCursor(Qt::CrossCursor)); +// form->d->cursors->insert(o->name(), ((TQWidget*)o)->cursor()); + form->d->cursors.insert(o, TQT_TQWIDGET(o)->cursor()); + TQT_TQWIDGET(o)->setCursor(TQCursor(TQt::CrossCursor)); } } @@ -322,16 +322,16 @@ FormManager::stopInsert() for(form = m_forms.first(); form; form = m_forms.next()) { form->widget()->unsetCursor(); - QObjectList *l = form->widget()->queryList( "QWidget" ); - for(QObject *o = l->first(); o; o = l->next()) + TQObjectList *l = form->widget()->queryList( TQWIDGET_OBJECT_NAME_STRING ); + for(TQObject *o = l->first(); o; o = l->next()) { - static_cast<QWidget*>(o)->unsetCursor(); + TQT_TQWIDGET(o)->unsetCursor(); #if 0 - if( ((QWidget*)o)->ownCursor()) { - QMap<QObject*,QCursor>::ConstIterator curIt( form->d->cursors.find(o) ); + if( ((TQWidget*)o)->ownCursor()) { + TQMap<TQObject*,TQCursor>::ConstIterator curIt( form->d->cursors.tqfind(o) ); if (curIt!=form->d->cursors.constEnd()) - static_cast<QWidget*>(o)->setCursor( *curIt ); -// ((QWidget*)o)->setCursor( (*(form->d->cursors))[o->name()] ) ; + TQT_TQWIDGET(o)->setCursor( *curIt ); +// ((TQWidget*)o)->setCursor( (*(form->d->cursors))[o->name()] ) ; } #endif } @@ -366,22 +366,22 @@ FormManager::startCreatingConnection() Form *form; for(form = m_forms.first(); form; form = m_forms.next()) { -// form->d->cursors = new QMap<QString, QCursor>(); - form->d->mouseTrackers = new QStringList(); +// form->d->cursors = new TQMap<TQString, TQCursor>(); + form->d->mouseTrackers = new TQStringList(); if (form->toplevelContainer()) { - form->widget()->setCursor(QCursor(PointingHandCursor)); + form->widget()->setCursor(TQCursor(PointingHandCursor)); form->widget()->setMouseTracking(true); } - QObjectList *l = form->widget()->queryList( "QWidget" ); - for(QObject *o = l->first(); o; o = l->next()) + TQObjectList *l = form->widget()->queryList( TQWIDGET_OBJECT_NAME_STRING ); + for(TQObject *o = l->first(); o; o = l->next()) { - QWidget *w = static_cast<QWidget*>(o); + TQWidget *w = TQT_TQWIDGET(o); if( w->ownCursor() ) { - form->d->cursors.insert(w, w->cursor()); -// form->d->cursors->insert(w->name(), w->cursor()); - w->setCursor(QCursor(PointingHandCursor )); + form->d->cursors.insert(TQT_TQOBJECT(w), w->cursor()); +// form->d->cursors->insert(TQT_TQOBJECT(w)->name(), w->cursor()); + w->setCursor(TQCursor(PointingHandCursor )); } if(w->hasMouseTracking()) form->d->mouseTrackers->append(w->name()); @@ -413,7 +413,7 @@ FormManager::resetCreatedConnection() m_active->formWidget()->clearForm(); } if (m_active && m_active->widget()) - m_active->widget()->repaint(); + m_active->widget()->tqrepaint(); } void @@ -432,14 +432,14 @@ FormManager::stopCreatingConnection() { form->widget()->unsetCursor(); form->widget()->setMouseTracking(false); - QObjectList *l = form->widget()->queryList( "QWidget" ); - for(QObject *o = l->first(); o; o = l->next()) + TQObjectList *l = form->widget()->queryList( TQWIDGET_OBJECT_NAME_STRING ); + for(TQObject *o = l->first(); o; o = l->next()) { - QWidget *w = (QWidget*)o; + TQWidget *w = (TQWidget*)o; if( w->ownCursor()) { - QMap<QObject*,QCursor>::ConstIterator curIt( form->d->cursors.find(o) ); + TQMap<TQObject*,TQCursor>::ConstIterator curIt( form->d->cursors.tqfind(o) ); if (curIt!=form->d->cursors.constEnd()) - static_cast<QWidget*>(o)->setCursor( *curIt ); + TQT_TQWIDGET(o)->setCursor( *curIt ); } // w->setCursor( (*(form->d->cursors))[o->name()] ) ; w->setMouseTracking( !form->d->mouseTrackers->grep(w->name()).isEmpty() ); @@ -466,10 +466,10 @@ FormManager::snapWidgetsToGrid() } void -FormManager::windowChanged(QWidget *w) +FormManager::windowChanged(TQWidget *w) { kdDebug() << "FormManager::windowChanged(" - << (w ? (QString(w->className())+" "+w->name()) : QString("0")) << ")" << endl; + << (w ? (TQString(w->className())+" "+w->name()) : TQString("0")) << ")" << endl; if(!w) { @@ -502,12 +502,12 @@ FormManager::windowChanged(QWidget *w) #ifndef KFD_NO_STYLES // update the 'style' action KSelectAction *m_style = (KSelectAction*)m_collection->action("change_style", "KSelectAction"); - const QString currentStyle = form->widget()->style().name(); - const QStringList styles = m_style->items(); + const TQString currentStyle = form->widget()->style().name(); + const TQStringList styles = m_style->items(); int idx = 0; - QStringList::ConstIterator endIt = styles.constEnd(); - for (QStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) + TQStringList::ConstIterator endIt = styles.constEnd(); + for (TQStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) { if ((*it).lower() == currentStyle) { kdDebug() << "Updating the style to " << currentStyle << endl; @@ -545,12 +545,12 @@ FormManager::windowChanged(QWidget *w) #ifndef KFD_NO_STYLES // update the 'style' action KSelectAction *m_style = (KSelectAction*)m_collection->action("change_style", "KSelectAction"); - const QString currentStyle = form->widget()->style().name(); - const QStringList styles = m_style->items(); + const TQString currentStyle = form->widget()->style().name(); + const TQStringList styles = m_style->items(); int idx = 0; - QStringList::ConstIterator endIt = styles.constEnd(); - for (QStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) + TQStringList::ConstIterator endIt = styles.constEnd(); + for (TQStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) { if ((*it).lower() == currentStyle) { kdDebug() << "Updating the style to " << currentStyle << endl; @@ -580,7 +580,7 @@ FormManager::activeForm() const } Form* -FormManager::formForWidget(QWidget *w) +FormManager::formForWidget(TQWidget *w) { for(Form *form = m_forms.first(); form; form = m_forms.next()) { if(form->toplevelContainer() && form->widget() == w) @@ -595,7 +595,7 @@ FormManager::deleteForm(Form *form) { if (!form) return; - if(m_forms.find(form) == -1) + if(m_forms.tqfind(form) == -1) m_preview.remove(form); else m_forms.remove(form); @@ -628,28 +628,28 @@ FormManager::initForm(Form *form) m_active = form; - connect(form, SIGNAL(selectionChanged(QWidget*, bool, bool)), - m_propSet, SLOT(setSelectedWidgetWithoutReload(QWidget*, bool, bool))); + connect(form, TQT_SIGNAL(selectionChanged(TQWidget*, bool, bool)), + m_propSet, TQT_SLOT(setSelectedWidgetWithoutReload(TQWidget*, bool, bool))); if(m_treeview) { - connect(form, SIGNAL(selectionChanged(QWidget*, bool, bool)), - m_treeview, SLOT(setSelectedWidget(QWidget*, bool))); - connect(form, SIGNAL(childAdded(ObjectTreeItem* )), m_treeview, SLOT(addItem(ObjectTreeItem*))); - connect(form, SIGNAL(childRemoved(ObjectTreeItem* )), m_treeview, SLOT(removeItem(ObjectTreeItem*))); + connect(form, TQT_SIGNAL(selectionChanged(TQWidget*, bool, bool)), + m_treeview, TQT_SLOT(setSelectedWidget(TQWidget*, bool))); + connect(form, TQT_SIGNAL(childAdded(ObjectTreeItem* )), m_treeview, TQT_SLOT(addItem(ObjectTreeItem*))); + connect(form, TQT_SIGNAL(childRemoved(ObjectTreeItem* )), m_treeview, TQT_SLOT(removeItem(ObjectTreeItem*))); } - connect(m_propSet, SIGNAL(widgetNameChanged(const QCString&, const QCString&)), - form, SLOT(changeName(const QCString&, const QCString&))); + connect(m_propSet, TQT_SIGNAL(widgetNameChanged(const TQCString&, const TQCString&)), + form, TQT_SLOT(changeName(const TQCString&, const TQCString&))); form->setSelectedWidget(form->widget()); windowChanged(form->widget()); } void -FormManager::previewForm(Form *form, QWidget *container, Form *toForm) +FormManager::previewForm(Form *form, TQWidget *container, Form *toForm) { if(!form || !container || !form->objectTree()) return; - QDomDocument domDoc; + TQDomDocument domDoc; if (!FormIO::saveFormToDom(form, domDoc)) return; @@ -660,7 +660,7 @@ FormManager::previewForm(Form *form, QWidget *container, Form *toForm) else myform = toForm; myform->createToplevel(container); - container->setStyle( &(form->widget()->style()) ); + container->setStyle( &(form->widget()->tqstyle()) ); if (!FormIO::loadFormFromDom(myform, container, domDoc)) { delete myform; @@ -674,19 +674,19 @@ FormManager::previewForm(Form *form, QWidget *container, Form *toForm) /* bool -FormManager::loadFormFromDomInternal(Form *form, QWidget *container, QDomDocument &inBuf) +FormManager::loadFormFromDomInternal(Form *form, TQWidget *container, TQDomDocument &inBuf) { return FormIO::loadFormFromDom(myform, container, domDoc); } bool -FormManager::saveFormToStringInternal(Form *form, QString &dest, int indent) +FormManager::saveFormToStringInternal(Form *form, TQString &dest, int indent) { return KFormDesigner::FormIO::saveFormToString(form, dest, indent); }*/ bool -FormManager::isTopLevel(QWidget *w) +FormManager::isTopLevel(TQWidget *w) { if(!activeForm() || !activeForm()->objectTree()) return false; @@ -698,7 +698,7 @@ FormManager::isTopLevel(QWidget *w) if(!item) return true; - return (!item->parent()); + return (!item->tqparent()); } void @@ -707,7 +707,7 @@ FormManager::deleteWidget() if(!activeForm() || !activeForm()->objectTree()) return; - QPtrList<QWidget> *list = activeForm()->selectedWidgets(); + TQPtrList<TQWidget> *list = activeForm()->selectedWidgets(); if(list->isEmpty()) return; @@ -726,28 +726,28 @@ FormManager::copyWidget() if (!activeForm() || !activeForm()->objectTree()) return; - QPtrList<QWidget> *list = activeForm()->selectedWidgets(); + TQPtrList<TQWidget> *list = activeForm()->selectedWidgets(); if(list->isEmpty()) return; removeChildrenFromList(*list); // We clear the current clipboard - m_domDoc.setContent(QString(), true); - QDomElement parent = m_domDoc.createElement("UI"); - m_domDoc.appendChild(parent); + m_domDoc.setContent(TQString(), true); + TQDomElement tqparent = m_domDoc.createElement("UI"); + m_domDoc.appendChild(tqparent); - QWidget *w; + TQWidget *w; for(w = list->first(); w; w = list->next()) { ObjectTreeItem *it = activeForm()->objectTree()->lookup(w->name()); if (!it) continue; - FormIO::saveWidget(it, parent, m_domDoc); + FormIO::saveWidget(it, tqparent, m_domDoc); } - FormIO::cleanClipboard(parent); + FormIO::cleanClipboard(tqparent); activeForm()->emitActionSignals(); // to update 'Paste' item state } @@ -758,7 +758,7 @@ FormManager::cutWidget() if(!activeForm() || !activeForm()->objectTree()) return; - QPtrList<QWidget> *list = activeForm()->selectedWidgets(); + TQPtrList<TQWidget> *list = activeForm()->selectedWidgets(); if(list->isEmpty()) return; @@ -779,23 +779,23 @@ FormManager::pasteWidget() } void -FormManager::setInsertPoint(const QPoint &p) +FormManager::setInsertPoint(const TQPoint &p) { m_insertPoint = p; } void -FormManager::createSignalMenu(QWidget *w) +FormManager::createSignalMenu(TQWidget *w) { m_sigSlotMenu = new KPopupMenu(); m_sigSlotMenu->insertTitle(SmallIcon("connection"), i18n("Signals")); - QStrList list = w->metaObject()->signalNames(true); - QStrListIterator it(list); + TQStrList list = w->tqmetaObject()->signalNames(true); + TQStrListIterator it(list); for(; it.current() != 0; ++it) m_sigSlotMenu->insertItem(*it); - int result = m_sigSlotMenu->exec(QCursor::pos()); + int result = m_sigSlotMenu->exec(TQCursor::pos()); if(result == -1) resetCreatedConnection(); else @@ -806,27 +806,27 @@ FormManager::createSignalMenu(QWidget *w) } void -FormManager::createSlotMenu(QWidget *w) +FormManager::createSlotMenu(TQWidget *w) { m_sigSlotMenu = new KPopupMenu(); m_sigSlotMenu->insertTitle(SmallIcon("connection"), i18n("Slots")); - QString signalArg( m_connection->signal().remove( QRegExp(".*[(]|[)]") ) ); + TQString signalArg( m_connection->signal().remove( TQRegExp(".*[(]|[)]") ) ); - QStrList list = w->metaObject()->slotNames(true); - QStrListIterator it(list); + TQStrList list = w->tqmetaObject()->slotNames(true); + TQStrListIterator it(list); for(; it.current() != 0; ++it) { // we add the slot only if it is compatible with the signal - QString slotArg(*it); - slotArg = slotArg.remove( QRegExp(".*[(]|[)]") ); - if(!signalArg.startsWith(slotArg, true)) // args not compatible + TQString slotArg(*it); + slotArg = slotArg.remove( TQRegExp(".*[(]|[)]") ); + if(!signalArg.tqstartsWith(slotArg, true)) // args not compatible continue; m_sigSlotMenu->insertItem(*it); } - int result = m_sigSlotMenu->exec(QCursor::pos()); + int result = m_sigSlotMenu->exec(TQCursor::pos()); if(result == -1) resetCreatedConnection(); else @@ -837,7 +837,7 @@ FormManager::createSlotMenu(QWidget *w) } void -FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCursor) +FormManager::createContextMenu(TQWidget *w, Container *container, bool popupAtCursor) { if(!activeForm() || !activeForm()->widget()) return; @@ -845,12 +845,12 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur const uint widgetsCount = container->form()->selectedWidgets()->count(); const bool multiple = widgetsCount > 1; //const bool enableRemove = w != m_active->widget(); - // We only enablelayout creation if more than one widget with the same parent are selected + // We only enabletqlayout creation if more than one widget with the same tqparent are selected const bool enableLayout = multiple || w == container->widget(); m_menuWidget = w; - QString n = container->form()->library()->displayName(w->className()); -// QValueVector<int> menuIds(); + TQString n = container->form()->library()->displayName(w->className()); +// TQValueVector<int> menuIds(); if (!m_popup) { m_popup = new KPopupMenu(); @@ -863,14 +863,14 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur if(!multiple) { if(w == container->form()->widget()) - m_popup->insertTitle(SmallIcon("form"), i18n("%1 : Form").arg(w->name()) ); + m_popup->insertTitle(SmallIcon("form"), i18n("%1 : Form").tqarg(w->name()) ); else m_popup->insertTitle( SmallIcon( - container->form()->library()->iconName(w->className())), QString(w->name()) + " : " + n ); + container->form()->library()->iconName(w->className())), TQString(w->name()) + " : " + n ); } else m_popup->insertTitle(SmallIcon("multiple_obj"), i18n("Multiple Widgets") - + QString(" (%1)").arg(widgetsCount)); + + TQString(" (%1)").tqarg(widgetsCount)); KAction *a; #define PLUG_ACTION(_name, forceVisible) \ @@ -890,7 +890,7 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur PLUG_ACTION("edit_paste", true); PLUG_ACTION("edit_delete", !toplevelWidgetSelected); separatorNeeded = true; - PLUG_ACTION("layout_menu", enableLayout); + PLUG_ACTION("tqlayout_menu", enableLayout); PLUG_ACTION("break_layout", enableLayout); separatorNeeded = true; PLUG_ACTION("align_menu", !toplevelWidgetSelected); @@ -898,13 +898,13 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur separatorNeeded = true; // We create the buddy menu - if(!multiple && w->inherits("QLabel") && ((QLabel*)w)->text().contains("&") && (((QLabel*)w)->textFormat() != RichText)) + if(!multiple && w->inherits(TQLABEL_OBJECT_NAME_STRING) && ((TQLabel*)w)->text().tqcontains("&") && (((TQLabel*)w)->textFormat() != RichText)) { if (separatorNeeded) m_popup->insertSeparator(); KPopupMenu *sub = new KPopupMenu(w); - QWidget *buddy = ((QLabel*)w)->buddy(); + TQWidget *buddy = ((TQLabel*)w)->buddy(); sub->insertItem(i18n("No Buddy"), MenuNoBuddy); if(!buddy) @@ -923,7 +923,7 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur /*int id =*/ m_popup->insertItem(i18n("Choose Buddy..."), sub); // menuIds->append(id); - connect(sub, SIGNAL(activated(int)), this, SLOT(buddyChosen(int))); + connect(sub, TQT_SIGNAL(activated(int)), this, TQT_SLOT(buddyChosen(int))); separatorNeeded = true; } @@ -937,8 +937,8 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur // We create the signals menu KPopupMenu *sigMenu = new KPopupMenu(); - QStrList list = w->metaObject()->signalNames(true); - QStrListIterator it(list); + TQStrList list = w->tqmetaObject()->signalNames(true); + TQStrListIterator it(list); for(; it.current() != 0; ++it) sigMenu->insertItem(*it); @@ -946,7 +946,7 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur // menuIds->append(id); if(list.isEmpty()) m_popup->setItemEnabled(id, false); - connect(sigMenu, SIGNAL(activated(int)), this, SLOT(menuSignalChosen(int))); + connect(sigMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(menuSignalChosen(int))); separatorNeeded = true; } #endif @@ -975,20 +975,20 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur } //show the popup at the selected widget - QPoint popupPos; + TQPoint popupPos; if (popupAtCursor) { - popupPos = QCursor::pos(); + popupPos = TQCursor::pos(); } else { WidgetList *lst = container->form()->selectedWidgets(); - QWidget * sel_w = lst ? lst->first() : container->form()->selectedWidget(); - popupPos = sel_w ? sel_w->mapToGlobal(QPoint(sel_w->width()/2, sel_w->height()/2)) : QCursor::pos(); + TQWidget * sel_w = lst ? lst->first() : container->form()->selectedWidget(); + popupPos = sel_w ? sel_w->mapToGlobal(TQPoint(sel_w->width()/2, sel_w->height()/2)) : TQCursor::pos(); } m_insertPoint = container->widget()->mapFromGlobal(popupPos); - m_popup->exec(popupPos);//QCursor::pos()); - m_insertPoint = QPoint(); + m_popup->exec(popupPos);//TQCursor::pos()); + m_insertPoint = TQPoint(); -// QValueVector<int>::iterator it; +// TQValueVector<int>::iterator it; // for(it = menuIds->begin(); it != menuIds->end(); ++it) // m_popup->removeItem(*it); } @@ -998,7 +998,7 @@ FormManager::buddyChosen(int id) { if(!m_menuWidget) return; - QLabel *label = static_cast<QLabel*>((QWidget*)m_menuWidget); + TQLabel *label = static_cast<TQLabel*>((TQWidget*)m_menuWidget); if(id == MenuNoBuddy) { @@ -1050,52 +1050,52 @@ FormManager::slotConnectionCreated(Form *form, Connection &connection) } void -FormManager::layoutHBox() +FormManager::tqlayoutHBox() { createLayout(Container::HBox); } void -FormManager::layoutVBox() +FormManager::tqlayoutVBox() { createLayout(Container::VBox); } void -FormManager::layoutGrid() +FormManager::tqlayoutGrid() { createLayout(Container::Grid); } void -FormManager::layoutHSplitter() +FormManager::tqlayoutHSplitter() { createLayout(Container::HSplitter); } void -FormManager::layoutVSplitter() +FormManager::tqlayoutVSplitter() { createLayout(Container::VSplitter); } void -FormManager::layoutHFlow() +FormManager::tqlayoutHFlow() { createLayout(Container::HFlow); } void -FormManager::layoutVFlow() +FormManager::tqlayoutVFlow() { createLayout(Container::VFlow); } void -FormManager::createLayout(int layoutType) +FormManager::createLayout(int tqlayoutType) { WidgetList *list = m_active->selectedWidgets(); - // if only one widget is selected (a container), we modify its layout + // if only one widget is selected (a container), we modify its tqlayout if (list->isEmpty()) {//sanity check kdWarning() << "FormManager::createLayout(): list is empty!" << endl; return; @@ -1103,26 +1103,26 @@ FormManager::createLayout(int layoutType) if(list->count() == 1) { ObjectTreeItem *item = m_active->objectTree()->lookup(list->first()->name()); - if(!item || !item->container() || !m_propSet->contains("layout")) + if(!item || !item->container() || !m_propSet->tqcontains("tqlayout")) return; - (*m_propSet)["layout"] = Container::layoutTypeToString(layoutType); + (*m_propSet)["tqlayout"] = Container::tqlayoutTypeToString(tqlayoutType); return; } - QWidget *parent = list->first()->parentWidget(); - for(QWidget *w = list->first(); w; w = list->next()) + TQWidget *tqparent = list->first()->tqparentWidget(); + for(TQWidget *w = list->first(); w; w = list->next()) { - kdDebug() << "comparing widget " << w->name() << " whose parent is " << w->parentWidget()->name() << " insteaed of " << parent->name() << endl; - if(w->parentWidget() != parent) + kdDebug() << "comparing widget " << w->name() << " whose tqparent is " << w->tqparentWidget()->name() << " insteaed of " << tqparent->name() << endl; + if(w->tqparentWidget() != tqparent) { - KMessageBox::sorry(m_active->widget()->topLevelWidget(), i18n("<b>Cannot create the layout.</b>\n" - "All selected widgets must have the same parent.")); - kdDebug() << "FormManager::createLayout() widgets don't have the same parent widget" << endl; + KMessageBox::sorry(m_active->widget()->tqtopLevelWidget(), i18n("<b>Cannot create the tqlayout.</b>\n" + "All selected widgets must have the same tqparent.")); + kdDebug() << "FormManager::createLayout() widgets don't have the same tqparent widget" << endl; return; } } - KCommand *com = new CreateLayoutCommand(layoutType, *list, m_active); + KCommand *com = new CreateLayoutCommand(tqlayoutType, *list, m_active); m_active->addCommand(com, true); } @@ -1133,7 +1133,7 @@ FormManager::breakLayout() return; Container *container = activeForm()->activeContainer(); - QCString c( container->widget()->className() ); + TQCString c( container->widget()->className() ); if((c == "Grid") || (c == "VBox") || (c == "HBox") || (c == "HFlow") || (c == "VFlow")) { @@ -1143,14 +1143,14 @@ FormManager::breakLayout() else // normal container { if(activeForm()->selectedWidgets()->count() == 1) - (*m_propSet)["layout"] = "NoLayout"; + (*m_propSet)["tqlayout"] = "NoLayout"; else container->setLayout(Container::NoLayout); } } void -FormManager::showPropertySet(WidgetPropertySet *set, bool forceReload, const QCString& propertyToSelect) +FormManager::showPropertySet(WidgetPropertySet *set, bool forceReload, const TQCString& propertyToSelect) { if (m_objectBlockingPropertyEditorUpdating) return; @@ -1188,10 +1188,10 @@ FormManager::editTabOrder() { if(!activeForm() || !activeForm()->objectTree()) return; - QWidget *topLevel = m_active->widget()->topLevelWidget(); + TQWidget *topLevel = m_active->widget()->tqtopLevelWidget(); TabStopDialog dlg(topLevel); //const bool oldAutoTabStops = m_active->autoTabStops(); - if (dlg.exec(m_active) == QDialog::Accepted) { + if (dlg.exec(m_active) == TQDialog::Accepted) { //inform about changing "autoTabStop" property // -- this will be received eg. by Kexi, so custom "autoTabStop" property can be updated emit autoTabStopsSet(m_active, dlg.autoTabStops()); @@ -1207,12 +1207,12 @@ FormManager::slotStyle() return; KSelectAction *m_style = (KSelectAction*)m_collection->action("change_style", "KSelectAction"); - QString style = m_style->currentText(); - activeForm()->widget()->setStyle( style); + TQString style = m_style->currentText(); + activeForm()->widget()->setStyle( style ); - QObjectList *l = activeForm()->widget()->queryList( "QWidget" ); - for(QObject *o = l->first(); o; o = l->next()) - (static_cast<QWidget*>(o))->setStyle( style ); + TQObjectList *l = activeForm()->widget()->queryList( TQWIDGET_OBJECT_NAME_STRING ); + for(TQObject *o = l->first(); o; o = l->next()) + (TQT_TQWIDGET(o))->setStyle( style ); delete l; } @@ -1222,7 +1222,7 @@ FormManager::editFormPixmapCollection() if(!activeForm() || !activeForm()->objectTree()) return; - PixmapCollectionEditor dialog(activeForm()->pixmapCollection(), activeForm()->widget()->topLevelWidget()); + PixmapCollectionEditor dialog(activeForm()->pixmapCollection(), activeForm()->widget()->tqtopLevelWidget()); dialog.exec(); } @@ -1234,7 +1234,7 @@ FormManager::editConnections() if(!activeForm() || !activeForm()->objectTree()) return; - ConnectionDialog dialog(activeForm()->widget()->topLevelWidget()); + ConnectionDialog dialog(activeForm()->widget()->tqtopLevelWidget()); dialog.exec(activeForm()); } @@ -1244,13 +1244,13 @@ FormManager::alignWidgets(int type) if(!activeForm() || !activeForm()->objectTree() || (activeForm()->selectedWidgets()->count() < 2)) return; - QWidget *parentWidget = activeForm()->selectedWidgets()->first()->parentWidget(); + TQWidget *tqparentWidget = activeForm()->selectedWidgets()->first()->tqparentWidget(); - for(QWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) + for(TQWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) { - if(w->parentWidget() != parentWidget) + if(w->tqparentWidget() != tqparentWidget) { - kdDebug() << "FormManager::alignWidgets() type ==" << type << " widgets don't have the same parent widget" << endl; + kdDebug() << "FormManager::alignWidgets() type ==" << type << " widgets don't have the same tqparent widget" << endl; return; } } @@ -1359,7 +1359,7 @@ FormManager::bringWidgetToFront() if(!activeForm() || !activeForm()->objectTree()) return; - for(QWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) + for(TQWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) w->raise(); } @@ -1369,7 +1369,7 @@ FormManager::sendWidgetToBack() if(!activeForm() || !activeForm()->objectTree()) return; - for(QWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) + for(TQWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) w->lower(); } @@ -1380,9 +1380,9 @@ FormManager::selectAll() return; activeForm()->selectFormWidget(); - uint count = activeForm()->objectTree()->children()->count(); - for(ObjectTreeItem *it = activeForm()->objectTree()->children()->first(); it; - it = activeForm()->objectTree()->children()->next(), count--) + uint count = activeForm()->objectTree()->tqchildren()->count(); + for(ObjectTreeItem *it = activeForm()->objectTree()->tqchildren()->first(); it; + it = activeForm()->objectTree()->tqchildren()->next(), count--) { activeForm()->setSelectedWidget(it->widget(), /*add*/true, /*raise*/false, /*moreWillBeSelected*/count>1); } @@ -1394,15 +1394,15 @@ FormManager::clearWidgetContent() if(!activeForm() || !activeForm()->objectTree()) return; - for(QWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) + for(TQWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) activeForm()->library()->clearWidgetContent(w->className(), w); } void -FormManager::deleteWidgetLater( QWidget *w ) +FormManager::deleteWidgetLater( TQWidget *w ) { w->hide(); - w->reparent(0, WType_TopLevel, QPoint(0,0)); + w->reparent(0, WType_TopLevel, TQPoint(0,0)); m_deleteWidgetLater_list.append( w ); m_deleteWidgetLater_timer.start( 100, true ); } @@ -1420,7 +1420,7 @@ FormManager::showFormUICode() if(!activeForm()) return; - QString uiCode; + TQString uiCode; if (!FormIO::saveFormToString(activeForm(), uiCode, 3)) { //! @todo show err? return; @@ -1430,26 +1430,26 @@ FormManager::showFormUICode() m_uiCodeDialog = new KDialogBase(0, "uiwindow", true, i18n("Form's UI Code"), KDialogBase::Close, KDialogBase::Close); m_uiCodeDialog->resize(700, 600); - QVBox *box = m_uiCodeDialog->makeVBoxMainWidget(); + TQVBox *box = m_uiCodeDialog->makeVBoxMainWidget(); KTabWidget* tab = new KTabWidget(box); - m_currentUICodeDialogEditor = new KTextEdit(QString::null, QString::null, tab); + m_currentUICodeDialogEditor = new KTextEdit(TQString(), TQString(), tab); tab->addTab( m_currentUICodeDialogEditor, i18n("Current")); m_currentUICodeDialogEditor->setReadOnly(true); - QFont f( m_currentUICodeDialogEditor->font() ); + TQFont f( m_currentUICodeDialogEditor->font() ); f.setFamily("courier"); m_currentUICodeDialogEditor->setFont(f); - m_currentUICodeDialogEditor->setTextFormat(Qt::PlainText); + m_currentUICodeDialogEditor->setTextFormat(TQt::PlainText); - m_originalUICodeDialogEditor = new KTextEdit(QString::null, QString::null, tab); + m_originalUICodeDialogEditor = new KTextEdit(TQString(), TQString(), tab); tab->addTab( m_originalUICodeDialogEditor, i18n("Original")); m_originalUICodeDialogEditor->setReadOnly(true); m_originalUICodeDialogEditor->setFont(f); - m_originalUICodeDialogEditor->setTextFormat(Qt::PlainText); + m_originalUICodeDialogEditor->setTextFormat(TQt::PlainText); } m_currentUICodeDialogEditor->setText( uiCode ); //indent and set our original doc as well: - QDomDocument doc; + TQDomDocument doc; doc.setContent( activeForm()->m_recentlyLoadedUICode ); m_originalUICodeDialogEditor->setText( doc.toString( 3 ) ); m_uiCodeDialog->show(); @@ -1493,14 +1493,14 @@ FormManager::emitWidgetSelected( KFormDesigner::Form* form, bool multiple ) WidgetList *wlist = form->selectedWidgets(); bool fontEnabled = false; for (WidgetListIterator it(*wlist); it.current(); ++it) { - if (-1 != it.current()->metaObject()->findProperty("font", true)) { + if (-1 != it.current()->tqmetaObject()->tqfindProperty("font", true)) { fontEnabled = true; break; } } enableAction("format_font", fontEnabled); - // If the widgets selected is a container, we enable layout actions + // If the widgets selected is a container, we enable tqlayout actions bool containerSelected = false; if(!multiple) { @@ -1512,16 +1512,16 @@ FormManager::emitWidgetSelected( KFormDesigner::Form* form, bool multiple ) } const bool twoSelected = form->selectedWidgets()->count()==2; // Layout actions - enableAction("layout_menu", multiple || containerSelected); - enableAction("layout_hbox", multiple || containerSelected); - enableAction("layout_vbox", multiple || containerSelected); - enableAction("layout_grid", multiple || containerSelected); - enableAction("layout_hsplitter", twoSelected); - enableAction("layout_vsplitter", twoSelected); + enableAction("tqlayout_menu", multiple || containerSelected); + enableAction("tqlayout_hbox", multiple || containerSelected); + enableAction("tqlayout_vbox", multiple || containerSelected); + enableAction("tqlayout_grid", multiple || containerSelected); + enableAction("tqlayout_hsplitter", twoSelected); + enableAction("tqlayout_vsplitter", twoSelected); KFormDesigner::Container *container = activeForm() ? activeForm()->activeContainer() : 0; if (container) - enableAction("break_layout", (container->layoutType() != KFormDesigner::Container::NoLayout)); + enableAction("break_layout", (container->tqlayoutType() != KFormDesigner::Container::NoLayout)); emit widgetSelected(form, true); } @@ -1550,16 +1550,16 @@ FormManager::emitFormWidgetSelected( KFormDesigner::Form* form ) enableFormActions(); const bool twoSelected = form->selectedWidgets()->count()==2; - const bool hasChildren = !form->objectTree()->children()->isEmpty(); + const bool hasChildren = !form->objectTree()->tqchildren()->isEmpty(); // Layout actions - enableAction("layout_menu", hasChildren); - enableAction("layout_hbox", hasChildren); - enableAction("layout_vbox", hasChildren); - enableAction("layout_grid", hasChildren); - enableAction("layout_hsplitter", twoSelected); - enableAction("layout_vsplitter", twoSelected); - enableAction("break_layout", (form->toplevelContainer()->layoutType() != KFormDesigner::Container::NoLayout)); + enableAction("tqlayout_menu", hasChildren); + enableAction("tqlayout_hbox", hasChildren); + enableAction("tqlayout_vbox", hasChildren); + enableAction("tqlayout_grid", hasChildren); + enableAction("tqlayout_hsplitter", twoSelected); + enableAction("tqlayout_vsplitter", twoSelected); + enableAction("break_layout", (form->toplevelContainer()->tqlayoutType() != KFormDesigner::Container::NoLayout)); emit formWidgetSelected( form ); } @@ -1631,24 +1631,24 @@ FormManager::disableWidgetActions() enableAction("format_raise", false); enableAction("format_lower", false); - enableAction("layout_menu", false); - enableAction("layout_hbox", false); - enableAction("layout_vbox", false); - enableAction("layout_grid", false); - enableAction("layout_hsplitter", false); - enableAction("layout_vsplitter", false); + enableAction("tqlayout_menu", false); + enableAction("tqlayout_hbox", false); + enableAction("tqlayout_vbox", false); + enableAction("tqlayout_grid", false); + enableAction("tqlayout_hsplitter", false); + enableAction("tqlayout_vsplitter", false); enableAction("break_layout", false); } void -FormManager::emitUndoEnabled(bool enabled, const QString &text) +FormManager::emitUndoEnabled(bool enabled, const TQString &text) { enableAction("edit_undo", enabled); emit undoEnabled(enabled, text); } void -FormManager::emitRedoEnabled(bool enabled, const QString &text) +FormManager::emitRedoEnabled(bool enabled, const TQString &text) { enableAction("edit_redo", enabled); emit redoEnabled(enabled, text); @@ -1661,8 +1661,8 @@ FormManager::changeFont() return; WidgetList *wlist = m_active->selectedWidgets(); WidgetList widgetsWithFontProperty; - QWidget *widget; - QFont font; + TQWidget *widget; + TQFont font; bool oneFontSelected = true; for (WidgetListIterator it(*wlist); (widget = it.current()); ++it) { if (m_active->library()->isPropertyVisible(widget->className(), widget, "font")) { @@ -1684,19 +1684,19 @@ FormManager::changeFont() //single widget's settings widget = widgetsWithFontProperty.first(); KoProperty::Property &fontProp = m_propSet->property("font"); - if (QDialog::Accepted != KFontDialog::getFont(font, false, m_active->widget())) + if (TQDialog::Accepted != KFontDialog::getFont(font, false, m_active->widget())) return; fontProp = font; return; } //multiple widgets int diffFlags=0; - if (QDialog::Accepted != KFontDialog::getFontDiff(font, diffFlags, false, m_active->widget()) + if (TQDialog::Accepted != KFontDialog::getFontDiff(font, diffFlags, false, m_active->widget()) || 0==diffFlags) return; //update font for (WidgetListIterator it(widgetsWithFontProperty); (widget = it.current()); ++it) { - QFont prevFont( widget->font() ); + TQFont prevFont( widget->font() ); if (diffFlags & KFontChooser::FontDiffFamily) prevFont.setFamily( font.family() ); if (diffFlags & KFontChooser::FontDiffStyle) { diff --git a/kexi/formeditor/formmanager.h b/kexi/formeditor/formmanager.h index 48e00b0f..a4622d1b 100644 --- a/kexi/formeditor/formmanager.h +++ b/kexi/formeditor/formmanager.h @@ -21,15 +21,15 @@ #ifndef FORMMANAGER_H #define FORMMANAGER_H -#include <qobject.h> -#include <qdom.h> -#include <qptrlist.h> -#include <qtimer.h> -#include <qguardedptr.h> -#include <qstringlist.h> - -class QWidget; -class QWorkspace; +#include <tqobject.h> +#include <tqdom.h> +#include <tqptrlist.h> +#include <tqtimer.h> +#include <tqguardedptr.h> +#include <tqstringlist.h> + +class TQWidget; +class TQWorkspace; class KPopupMenu; class KActionCollection; class KAction; @@ -55,7 +55,7 @@ class WidgetLibrary; class ObjectTreeView; class Connection; class FormManager; -typedef QPtrList<KAction> ActionList; +typedef TQPtrList<KAction> ActionList; //! @internal //static FormManager* FormManager_static = 0; @@ -69,21 +69,22 @@ typedef QPtrList<KAction> ActionList; It holds the WidgetLibrary, the WidgetPropertySet, links to ObjectTreeView and PropertyEditor, as well as the copied widget and the insert state. **/ -class KFORMEDITOR_EXPORT FormManager : public QObject +class KFORMEDITOR_EXPORT FormManager : public TQObject { Q_OBJECT + TQ_OBJECT public: /*! Constructs FormManager object. Using \a options you can control manager's behaviour, see Options. */ - FormManager(QObject *parent = 0, int options = 0, const char *name = 0); + FormManager(TQObject *tqparent = 0, int options = 0, const char *name = 0); virtual ~FormManager(); //! Creates widget library for supportedFactoryGroups //! and initializes FormManager singleton. \a m should be always the same for every call. static WidgetLibrary* createWidgetLibrary(FormManager* m, - const QStringList& supportedFactoryGroups); + const TQStringList& supportedFactoryGroups); //! Access to FormManager singleton static FormManager* self(); @@ -98,7 +99,7 @@ class KFORMEDITOR_EXPORT FormManager : public QObject into the \a collection. \a client XML GUI client is used to call lib->addCustomWidgetActions(client). These actions are automatically connected to \ref insertWidget() slot. - \return a QPtrList of the created actions. + \return a TQPtrList of the created actions. */ ActionList createActions(WidgetLibrary *lib, KActionCollection* collection, KXMLGUIClient *client); @@ -124,10 +125,10 @@ class KFORMEDITOR_EXPORT FormManager : public QObject /*! \return The name of the class being inserted, corresponding to the menu item or the toolbar button clicked. */ - QCString selectedClass() const { return m_selectedClass; } + TQCString selectedClass() const { return m_selectedClass; } /*! Sets the point where the pasted widget should be moved to. */ - void setInsertPoint(const QPoint &p); + void setInsertPoint(const TQPoint &p); //! \return If we are creating a Connection by drag-and-drop or not. bool isCreatingConnection() { return m_drawingSlot; } @@ -141,13 +142,13 @@ class KFORMEDITOR_EXPORT FormManager : public QObject void resetCreatedConnection(); //! Creates and display a menu with all the signals of widget \a w. - void createSignalMenu(QWidget *w); + void createSignalMenu(TQWidget *w); //! Creates and display a menu with all the slots of widget \a w. - void createSlotMenu(QWidget *w); + void createSlotMenu(TQWidget *w); //! Emits the signal \ref createFormSlot(). Used by WidgetPropertySet. - void emitCreateSlot(const QString &widget, const QString &value) + void emitCreateSlot(const TQString &widget, const TQString &value) { emit createFormSlot(m_active, widget, value); } /*! \return The Form actually active and focused. @@ -156,12 +157,12 @@ class KFORMEDITOR_EXPORT FormManager : public QObject /*! \return the Form whose toplevel widget is \a w, or 0 if there is not or the Form is in preview mode. */ - Form* formForWidget(QWidget *w); + Form* formForWidget(TQWidget *w); /*! \return true if \a w is a toplevel widget, ie. it is the main widget of a Form (so it should have a caption , an icon ...) */ - bool isTopLevel(QWidget *w); + bool isTopLevel(TQWidget *w); //! \return A pointer to the KoProperty::Editor we use. //unused KoProperty::Editor* propertyEditor() const { return m_editor; } @@ -173,7 +174,7 @@ class KFORMEDITOR_EXPORT FormManager : public QObject If \a propertyToSelect is not empty, an item for this name will be selected (usable when previously there was no set visible). */ virtual void showPropertySet(WidgetPropertySet *set, bool forceReload = false, - const QCString& propertyToSelect = QCString()); + const TQCString& propertyToSelect = TQCString()); void blockPropertyEditorUpdating(void *blockingObject); @@ -188,7 +189,7 @@ class KFORMEDITOR_EXPORT FormManager : public QObject void setObjectTreeView(ObjectTreeView *treeview); /*! Previews the Form \a form using the widget \a w as toplevel container for this Form. */ - void previewForm(Form *form, QWidget *w, Form *toForm=0); + void previewForm(Form *form, TQWidget *w, Form *toForm=0); /*! Adds a existing form w and changes it to a container */ void importForm(Form *form=0, bool preview=false); @@ -199,7 +200,7 @@ class KFORMEDITOR_EXPORT FormManager : public QObject /*! This function creates and displays the context menu corresponding to the widget \a w. The menu item are disabled if necessary, and the widget specific part is added (menu from the factory and buddy selection). */ - void createContextMenu(QWidget *w, Container *container, bool popupAtCursor = true); + void createContextMenu(TQWidget *w, Container *container, bool popupAtCursor = true); //! \return If we align widgets to grid or not. bool snapWidgetsToGrid(); @@ -220,13 +221,13 @@ class KFORMEDITOR_EXPORT FormManager : public QObject bool isRedoing() const { return m_isRedoing; } public slots: - /*! Deletes the selected widget in active Form and all of its children. */ + /*! Deletes the selected widget in active Form and all of its tqchildren. */ void deleteWidget(); - /*! Copies the slected widget and all its children of the active Form using an XML representation. */ + /*! Copies the slected widget and all its tqchildren of the active Form using an XML representation. */ void copyWidget(); - /*! Cuts (ie Copies and deletes) the selected widget and all its children of + /*! Cuts (ie Copies and deletes) the selected widget and all its tqchildren of the active Form using an XML representation. */ void cutWidget(); @@ -257,22 +258,22 @@ class KFORMEDITOR_EXPORT FormManager : public QObject /*! Creates a dialog to edit the Connection of \ref activeForm(). */ void editConnections(); - //! Lay out selected widgets using HBox layout (calls \ref CreateLayoutCommand). - void layoutHBox(); - //! Lay out selected widgets using VBox layout. - void layoutVBox(); - //! Lay out selected widgets using Grid layout. - void layoutGrid(); + //! Lay out selected widgets using HBox tqlayout (calls \ref CreateLayoutCommand). + void tqlayoutHBox(); + //! Lay out selected widgets using VBox tqlayout. + void tqlayoutVBox(); + //! Lay out selected widgets using Grid tqlayout. + void tqlayoutGrid(); //! Lay out selected widgets in an horizontal splitter - void layoutHSplitter(); + void tqlayoutHSplitter(); //! Lay out selected widgets in a verticak splitter - void layoutVSplitter(); - //! Lay out selected widgets using HFlow layout - void layoutHFlow(); - //! Lay out selected widgets using VFlow layout. - void layoutVFlow(); + void tqlayoutVSplitter(); + //! Lay out selected widgets using HFlow tqlayout + void tqlayoutHFlow(); + //! Lay out selected widgets using VFlow tqlayout. + void tqlayoutVFlow(); - //! Breaks selected layout(calls \ref BreakLayoutCommand). + //! Breaks selected tqlayout(calls \ref BreakLayoutCommand). void breakLayout(); void alignWidgetsToLeft(); @@ -302,7 +303,7 @@ class KFORMEDITOR_EXPORT FormManager : public QObject or a "Widget" menu item. Prepares all Forms for creation of a new widget (ie changes cursor ...). */ - void insertWidget(const QCString &classname); + void insertWidget(const TQCString &classname); /*! Stops the current widget insertion (ie unset the cursor ...). */ void stopInsert(); @@ -317,13 +318,13 @@ class KFORMEDITOR_EXPORT FormManager : public QObject void stopCreatingConnection(); /*! Calls this slot when the window activated changes (eg connect - to QWorkspace::windowActivated(QWidget*)). You <b>need</b> to connect + to TQWorkspace::windowActivated(TQWidget*)). You <b>need</b> to connect to this slot, it will crash otherwise. */ - void windowChanged(QWidget *w); + void windowChanged(TQWidget *w); //! Used to delayed widgets' deletion (in Container::deleteItem()) - void deleteWidgetLater( QWidget *w ); + void deleteWidgetLater( TQWidget *w ); /*! For debugging purposes only: shows a text window containing contents of .ui XML definition of the current form. */ @@ -336,7 +337,7 @@ class KFORMEDITOR_EXPORT FormManager : public QObject /*! This signal is emitted as the property set switched. If \a forceReload is true, the set needs to be reloaded even if it's the same as previous one. */ - void propertySetSwitched(KoProperty::Set *set, bool forceReload = false, const QCString& propertyToSelect = QCString()); + void propertySetSwitched(KoProperty::Set *set, bool forceReload = false, const TQCString& propertyToSelect = TQCString()); /*! This signal is emitted when any change is made to the Form \a form, so it will need to be saved. */ @@ -357,16 +358,16 @@ class KFORMEDITOR_EXPORT FormManager : public QObject /*! Signal emitted when undo action activation changes. \a text is the full text of the action (including command name). */ - void undoEnabled(bool enabled, const QString &text = QString::null); + void undoEnabled(bool enabled, const TQString &text = TQString()); /*! Signal emitted when redo action activation changes. \a text is the full text of the action (including command name). */ - void redoEnabled(bool enabled, const QString &text = QString::null); + void redoEnabled(bool enabled, const TQString &text = TQString()); /*! Signal emitted when the user choose a signal in 'Events' menu in context menu, or in 'Events' in property editor. The code editor should then create the slot connected to this signal. */ - void createFormSlot(KFormDesigner::Form *form, const QString &widget, const QString &signal); + void createFormSlot(KFormDesigner::Form *form, const TQString &widget, const TQString &signal); /*! Signal emitted when the Connection creation by drag-and-drop ends. \a connection is the created Connection. You should copy it, @@ -411,24 +412,24 @@ class KFORMEDITOR_EXPORT FormManager : public QObject #if 0 /*! Default implementation just calls FormIO::loadFormFromDom(). Change this if you need to handle, eg. custom UI XML tags, as in Kexi's Form Designer. */ - virtual bool loadFormFromDomInternal(Form *form, QWidget *container, QDomDocument &inBuf); + virtual bool loadFormFromDomInternal(Form *form, TQWidget *container, TQDomDocument &inBuf); /*! Default implementation just calls FormIO::saveFormToString(). Change this if you need to handle, eg. custom UI XML tags, as in Kexi's Form Designer. */ - virtual bool saveFormToStringInternal(Form *form, QString &dest, int indent = 0); + virtual bool saveFormToStringInternal(Form *form, TQString &dest, int indent = 0); #endif - /*! Function called by the "Lay out in..." menu items. It creates a layout from the - currently selected widgets (that must have the same parent). + /*! Function called by the "Lay out in..." menu items. It creates a tqlayout from the + currently selected widgets (that must have the same tqparent). Calls \ref CreateLayoutCommand. */ - void createLayout(int layoutType); + void createLayout(int tqlayoutType); /*! Function called by all other AlignWidgets*() function. Calls \ref AlignWidgetsCommand. */ void alignWidgets(int type); void enableFormActions(); void disableWidgetActions(); - void emitUndoEnabled(bool enabled, const QString &text); - void emitRedoEnabled(bool enabled, const QString &text); + void emitUndoEnabled(bool enabled, const TQString &text); + void emitRedoEnabled(bool enabled, const TQString &text); /*! True if emitSelectionSignals() updates property set so showPropertySet() will not be needed in windowChanged(). False by default. Set to true in KexiFormManager. */ @@ -443,22 +444,22 @@ class KFORMEDITOR_EXPORT FormManager : public QObject WidgetPropertySet *m_propSet; // WidgetLibrary *m_lib; - QGuardedPtr<KoProperty::Editor> m_editor; - QGuardedPtr<ObjectTreeView> m_treeview; + TQGuardedPtr<KoProperty::Editor> m_editor; + TQGuardedPtr<ObjectTreeView> m_treeview; // Forms - QPtrList<Form> m_forms; - QPtrList<Form> m_preview; - QGuardedPtr<Form> m_active; + TQPtrList<Form> m_forms; + TQPtrList<Form> m_preview; + TQGuardedPtr<Form> m_active; // Copy/Paste - QDomDocument m_domDoc; + TQDomDocument m_domDoc; KPopupMenu *m_popup; - QPoint m_insertPoint; - QGuardedPtr<QWidget> m_menuWidget; + TQPoint m_insertPoint; + TQGuardedPtr<TQWidget> m_menuWidget; // Insertion bool m_inserting; - QCString m_selectedClass; + TQCString m_selectedClass; // Connection stuff bool m_drawingSlot; @@ -470,8 +471,8 @@ class KFORMEDITOR_EXPORT FormManager : public QObject KToggleAction *m_pointer, *m_dragConnection, *m_snapToGrid; //! Used to delayed widgets deletion - QTimer m_deleteWidgetLater_timer; - QPtrList<QWidget> m_deleteWidgetLater_list; + TQTimer m_deleteWidgetLater_timer; + TQPtrList<TQWidget> m_deleteWidgetLater_list; #ifdef KEXI_DEBUG_GUI KDialogBase *m_uiCodeDialog; diff --git a/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.cpp b/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.cpp index c3b6e448..2c7d2f01 100644 --- a/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.cpp +++ b/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.cpp @@ -17,13 +17,13 @@ * Boston, MA 02110-1301, USA. */ -#include <qworkspace.h> -#include <qdockarea.h> -#include <qdockwindow.h> -#include <qhbox.h> -#include <qpainter.h> -#include <qevent.h> -#include <qobjectlist.h> +#include <tqworkspace.h> +#include <tqdockarea.h> +#include <tqdockwindow.h> +#include <tqhbox.h> +#include <tqpainter.h> +#include <tqevent.h> +#include <tqobjectlist.h> #include <kdeversion.h> #include <kaction.h> @@ -69,11 +69,11 @@ KFDFactory::~KFDFactory() } KParts::Part* -KFDFactory::createPartObject( QWidget *parentWidget, const char *, QObject *, const char *name, - const char *classname, const QStringList &args) +KFDFactory::createPartObject( TQWidget *tqparentWidget, const char *, TQObject *, const char *name, + const char *classname, const TQStringList &args) { bool readOnly = (classname == "KParts::ReadOnlyPart"); - KFormDesignerKDevPart *part = new KFormDesignerKDevPart(parentWidget, name, readOnly, args); + KFormDesignerKDevPart *part = new KFormDesignerKDevPart(tqparentWidget, name, readOnly, args); return part; } @@ -123,8 +123,8 @@ class KFDPart_FormManager : public KFormDesigner::FormManager KFormDesigner::WidgetLibrary* KFormDesignerKDevPart::static_formsLibrary = 0L; -KFormDesignerKDevPart::KFormDesignerKDevPart(QWidget *parent, const char *name, bool readOnly, const QStringList &args) -: Designer(parent, name), m_count(0) +KFormDesignerKDevPart::KFormDesignerKDevPart(TQWidget *tqparent, const char *name, bool readOnly, const TQStringList &args) +: Designer(tqparent, name), m_count(0) { setInstance(KFDFactory::instance()); instance()->iconLoader()->addAppDir("kexi"); @@ -138,28 +138,28 @@ KFormDesignerKDevPart::KFormDesignerKDevPart(QWidget *parent, const char *name, setUniqueFormMode(false); m_inShell = (!args.grep("shell").isEmpty()); - QHBox *container = new QHBox(parent, "kfd_container_widget"); - container->setFocusPolicy(QWidget::ClickFocus); + TQHBox *container = new TQHBox(tqparent, "kfd_container_widget"); + container->setFocusPolicy(TQ_ClickFocus); - m_workspace = new QWorkspace(container, "kfd_workspace"); + m_workspace = new TQWorkspace(container, "kfd_workspace"); m_workspace->show(); - QStringList supportedFactoryGroups; + TQStringList supportedFactoryGroups; /* @todo add configuration for supported factory groups */ static_formsLibrary = KFormDesigner::FormManager::createWidgetLibrary( new KFDPart_FormManager(this, 0, "kfd_manager"), supportedFactoryGroups ); if(!readOnly) { - QDockArea *dockArea = new QDockArea(Vertical, QDockArea::Reverse, container, "kfd_part_dockarea"); + TQDockArea *dockArea = new TQDockAreaQt::Vertical, TQDockArea::Reverse, container, "kfd_part_dockarea"); - QDockWindow *dockTree = new QDockWindow(dockArea); + TQDockWindow *dockTree = new TQDockWindow(dockArea); KFormDesigner::ObjectTreeView *view = new KFormDesigner::ObjectTreeView(dockTree); dockTree->setWidget(view); dockTree->setCaption(i18n("Objects")); dockTree->setResizeEnabled(true); dockTree->setFixedExtentWidth(256); - QDockWindow *dockEditor = new QDockWindow(dockArea); + TQDockWindow *dockEditor = new TQDockWindow(dockArea); KoProperty::Editor *editor = new KoProperty::Editor(dockEditor); dockEditor->setWidget(editor); dockEditor->setCaption(i18n("Properties")); @@ -172,21 +172,21 @@ KFormDesignerKDevPart::KFormDesignerKDevPart(QWidget *parent, const char *name, setModified(false); // action stuff - connect(KFormDesigner::FormManager::self(), SIGNAL(widgetSelected(KFormDesigner::Form*, bool)), SLOT(slotWidgetSelected(KFormDesigner::Form*, bool))); - connect(KFormDesigner::FormManager::self(), SIGNAL(formWidgetSelected(KFormDesigner::Form*)), SLOT(slotFormWidgetSelected(KFormDesigner::Form*))); - connect(KFormDesigner::FormManager::self(), SIGNAL(noFormSelected()), SLOT(slotNoFormSelected())); - connect(KFormDesigner::FormManager::self(), SIGNAL(undoEnabled(bool, const QString&)), SLOT(setUndoEnabled(bool, const QString&))); - connect(KFormDesigner::FormManager::self(), SIGNAL(redoEnabled(bool, const QString&)), SLOT(setRedoEnabled(bool, const QString&))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(widgetSelected(KFormDesigner::Form*, bool)), TQT_SLOT(slotWidgetSelected(KFormDesigner::Form*, bool))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(formWidgetSelected(KFormDesigner::Form*)), TQT_SLOT(slotFormWidgetSelected(KFormDesigner::Form*))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(noFormSelected()), TQT_SLOT(slotNoFormSelected())); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(undoEnabled(bool, const TQString&)), TQT_SLOT(setUndoEnabled(bool, const TQString&))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(redoEnabled(bool, const TQString&)), TQT_SLOT(setRedoEnabled(bool, const TQString&))); - connect(KFormDesigner::FormManager::self(), SIGNAL(dirty(KFormDesigner::Form*, bool)), this, SLOT(slotFormModified(KFormDesigner::Form*, bool))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(dirty(KFormDesigner::Form*, bool)), this, TQT_SLOT(slotFormModified(KFormDesigner::Form*, bool))); - connect(KFormDesigner::FormManager::self(), SIGNAL(createFormSlot(KFormDesigner::Form*, const QString&, const QString&)), - this, SLOT(slotCreateFormSlot(KFormDesigner::Form*, const QString&, const QString &))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(createFormSlot(KFormDesigner::Form*, const TQString&, const TQString&)), + this, TQT_SLOT(slotCreateFormSlot(KFormDesigner::Form*, const TQString&, const TQString &))); } container->show(); setWidget(container); - connect(m_workspace, SIGNAL(windowActivated(QWidget*)), KFormDesigner::FormManager::self(), SLOT(windowChanged(QWidget*))); + connect(m_workspace, TQT_SIGNAL(windowActivated(TQWidget*)), KFormDesigner::FormManager::self(), TQT_SLOT(windowChanged(TQWidget*))); slotNoFormSelected(); } @@ -198,45 +198,45 @@ KFormDesigner::WidgetLibrary* KFormDesignerKDevPart::formsLibrary() void KFormDesignerKDevPart::setupActions() { - KStdAction::open(this, SLOT(open()), actionCollection()); - KStdAction::openNew(this, SLOT(createBlankForm()), actionCollection()); - KStdAction::save(this, SLOT(save()), actionCollection()); - KStdAction::saveAs(this, SLOT(saveAs()), actionCollection()); - KStdAction::cut(KFormDesigner::FormManager::self(), SLOT(cutWidget()), actionCollection()); - KStdAction::copy(KFormDesigner::FormManager::self(), SLOT(copyWidget()), actionCollection()); - KStdAction::paste(KFormDesigner::FormManager::self(), SLOT(pasteWidget()), actionCollection()); - KStdAction::undo(KFormDesigner::FormManager::self(), SLOT(undo()), actionCollection()); - KStdAction::redo(KFormDesigner::FormManager::self(), SLOT(redo()), actionCollection()); - KStdAction::selectAll(KFormDesigner::FormManager::self(), SLOT(selectAll()), actionCollection()); - new KAction(i18n("Clear Widget Contents"), "editclear", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(clearWidgetContent()), actionCollection(), "clear_contents"); - new KAction(i18n("Delete Widget"), "editdelete", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(deleteWidget()), actionCollection(), "edit_delete"); - new KAction(i18n("Preview Form"), "filequickprint", "Ctrl+T", this, SLOT(slotPreviewForm()), actionCollection(), "preview_form"); - new KAction(i18n("Edit Tab Order"), "tab_order", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(editTabOrder()), actionCollection(), "taborder"); - new KAction(i18n("Edit Pixmap Collection"), "icons", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(editFormPixmapCollection()), actionCollection(), "pixmap_collection"); - new KAction(i18n("Edit Form Connections"), "connections", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(editConnections()), actionCollection(), "form_connections"); - - new KAction(i18n("Lay Out Widgets &Horizontally"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutHBox()), actionCollection(), "layout_hbox"); - new KAction(i18n("Lay Out Widgets &Vertically"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutVBox()), actionCollection(), "layout_vbox"); - new KAction(i18n("Lay Out Widgets in &Grid"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutGrid()), actionCollection(), "layout_grid"); - new KAction(i18n("&Break Layout"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(breakLayout()), actionCollection(), "break_layout"); - - new KAction(i18n("Bring Widget to Front"), "raise", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(bringWidgetToFront()), actionCollection(), "format_raise"); - new KAction(i18n("Send Widget to Back"), "lower", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(sendWidgetToBack()), actionCollection(), "format_lower"); + KStdAction::open(this, TQT_SLOT(open()), actionCollection()); + KStdAction::openNew(this, TQT_SLOT(createBlankForm()), actionCollection()); + KStdAction::save(this, TQT_SLOT(save()), actionCollection()); + KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection()); + KStdAction::cut(KFormDesigner::FormManager::self(), TQT_SLOT(cutWidget()), actionCollection()); + KStdAction::copy(KFormDesigner::FormManager::self(), TQT_SLOT(copyWidget()), actionCollection()); + KStdAction::paste(KFormDesigner::FormManager::self(), TQT_SLOT(pasteWidget()), actionCollection()); + KStdAction::undo(KFormDesigner::FormManager::self(), TQT_SLOT(undo()), actionCollection()); + KStdAction::redo(KFormDesigner::FormManager::self(), TQT_SLOT(redo()), actionCollection()); + KStdAction::selectAll(KFormDesigner::FormManager::self(), TQT_SLOT(selectAll()), actionCollection()); + new KAction(i18n("Clear Widget Contents"), "editclear", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(clearWidgetContent()), actionCollection(), "clear_contents"); + new KAction(i18n("Delete Widget"), "editdelete", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(deleteWidget()), actionCollection(), "edit_delete"); + new KAction(i18n("Preview Form"), "filequickprint", "Ctrl+T", this, TQT_SLOT(slotPreviewForm()), actionCollection(), "preview_form"); + new KAction(i18n("Edit Tab Order"), "tab_order", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(editTabOrder()), actionCollection(), "taborder"); + new KAction(i18n("Edit Pixmap Collection"), "icons", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(editFormPixmapCollection()), actionCollection(), "pixmap_collection"); + new KAction(i18n("Edit Form Connections"), "connections", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(editConnections()), actionCollection(), "form_connections"); + + new KAction(i18n("Lay Out Widgets &Horizontally"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutHBox()), actionCollection(), "tqlayout_hbox"); + new KAction(i18n("Lay Out Widgets &Vertically"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutVBox()), actionCollection(), "tqlayout_vbox"); + new KAction(i18n("Lay Out Widgets in &Grid"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutGrid()), actionCollection(), "tqlayout_grid"); + new KAction(i18n("&Break Layout"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(breakLayout()), actionCollection(), "break_layout"); + + new KAction(i18n("Bring Widget to Front"), "raise", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(bringWidgetToFront()), actionCollection(), "format_raise"); + new KAction(i18n("Send Widget to Back"), "lower", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(sendWidgetToBack()), actionCollection(), "format_lower"); KActionMenu *alignMenu = new KActionMenu(i18n("Align Widgets' Positions"), "aopos2grid", actionCollection(), "align_menu"); - alignMenu->insert( new KAction(i18n("To Left"), "aoleft", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToLeft()), actionCollection(), "align_to_left") ); - alignMenu->insert( new KAction(i18n("To Right"), "aoright", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToRight()), actionCollection(), "align_to_right") ); - alignMenu->insert( new KAction(i18n("To Top"), "aotop", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToTop()), actionCollection(), "align_to_top") ); - alignMenu->insert( new KAction(i18n("To Bottom"), "aobottom", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToBottom()), actionCollection(), "align_to_bottom") ); - alignMenu->insert( new KAction(i18n("To Grid"), "aopos2grid", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToGrid()), actionCollection(), "align_to_grid") ); + alignMenu->insert( new KAction(i18n("To Left"), "aoleft", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToLeft()), actionCollection(), "align_to_left") ); + alignMenu->insert( new KAction(i18n("To Right"), "aoright", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToRight()), actionCollection(), "align_to_right") ); + alignMenu->insert( new KAction(i18n("To Top"), "aotop", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToTop()), actionCollection(), "align_to_top") ); + alignMenu->insert( new KAction(i18n("To Bottom"), "aobottom", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToBottom()), actionCollection(), "align_to_bottom") ); + alignMenu->insert( new KAction(i18n("To Grid"), "aopos2grid", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToGrid()), actionCollection(), "align_to_grid") ); KActionMenu *sizeMenu = new KActionMenu(i18n("Adjust Widgets' Sizes"), "aogrid", actionCollection(), "adjust_size_menu"); - sizeMenu->insert( new KAction(i18n("To Fit"), "aofit", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustWidgetSize()), actionCollection(), "adjust_to_fit") ); - sizeMenu->insert( new KAction(i18n("To Grid"), "aogrid", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustSizeToGrid()), actionCollection(), "adjust_size_grid") ); - sizeMenu->insert( new KAction(i18n("To Shortest"), "aoshortest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustHeightToSmall()), actionCollection(), "adjust_height_small") ); - sizeMenu->insert( new KAction(i18n("To Tallest"), "aotallest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustHeightToBig()), actionCollection(), "adjust_height_big") ); - sizeMenu->insert( new KAction(i18n("To Narrowest"), "aonarrowest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustWidthToSmall()), actionCollection(), "adjust_width_small") ); - sizeMenu->insert( new KAction(i18n("To Widest"), "aowidest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustWidthToBig()), actionCollection(), "adjust_width_big") ); + sizeMenu->insert( new KAction(i18n("To Fit"), "aofit", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidgetSize()), actionCollection(), "adjust_to_fit") ); + sizeMenu->insert( new KAction(i18n("To Grid"), "aogrid", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustSizeToGrid()), actionCollection(), "adjust_size_grid") ); + sizeMenu->insert( new KAction(i18n("To Shortest"), "aoshortest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustHeightToSmall()), actionCollection(), "adjust_height_small") ); + sizeMenu->insert( new KAction(i18n("To Tallest"), "aotallest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustHeightToBig()), actionCollection(), "adjust_height_big") ); + sizeMenu->insert( new KAction(i18n("To Narrowest"), "aonarrowest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidthToSmall()), actionCollection(), "adjust_width_small") ); + sizeMenu->insert( new KAction(i18n("To Widest"), "aowidest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidthToBig()), actionCollection(), "adjust_width_big") ); if(m_inShell) setXMLFile("kformdesigner_part_shell.rc"); @@ -258,7 +258,7 @@ KFormDesignerKDevPart::createBlankForm() if(m_uniqueFormMode && KFormDesigner::FormManager::self()->activeForm() && !KFormDesigner::FormManager::self()->activeForm()->isModified() && KFormDesigner::FormManager::self()->activeForm()->filename().isNull()) return; // active form is already a blank one - QString n = i18n("Form") + QString::number(++m_count); + TQString n = i18n("Form") + TQString::number(++m_count); Form *form = new Form(formsLibrary(), n.latin1()); FormWidgetBase *w = new FormWidgetBase(this, m_workspace, n.latin1()); @@ -276,7 +276,7 @@ void KFormDesignerKDevPart::open() { m_openingFile = true; - KURL url = KFileDialog::getOpenURL("::kformdesigner", i18n("*.ui|Qt Designer UI Files"), m_workspace->topLevelWidget()); + KURL url = KFileDialog::getOpenURL("::kformdesigner", i18n("*.ui|TQt Designer UI Files"), m_workspace->tqtopLevelWidget()); if(!url.isEmpty()) ReadWritePart::openURL(url); m_openingFile = false; @@ -311,7 +311,7 @@ KFormDesignerKDevPart::saveFile() void KFormDesignerKDevPart::saveAs() { - KURL url = KFileDialog::getSaveURL("::kformdesigner", i18n("*.ui|Qt Designer UI Files"), m_workspace); + KURL url = KFileDialog::getSaveURL("::kformdesigner", i18n("*.ui|TQt Designer UI Files"), m_workspace); if(url.isEmpty()) return; else @@ -321,9 +321,9 @@ KFormDesignerKDevPart::saveAs() bool KFormDesignerKDevPart::closeForm(Form *form) { - int res = KMessageBox::warningYesNoCancel( m_workspace->topLevelWidget(), + int res = KMessageBox::warningYesNoCancel( m_workspace->tqtopLevelWidget(), i18n( "The form \"%1\" has been modified.\n" - "Do you want to save your changes or discard them?" ).arg( form->objectTree()->name() ), + "Do you want to save your changes or discard them?" ).tqarg( form->objectTree()->name() ), i18n( "Close Form" ), KStdGuiItem::save(), KStdGuiItem::discard() ); if(res == KMessageBox::Yes) @@ -335,8 +335,8 @@ KFormDesignerKDevPart::closeForm(Form *form) bool KFormDesignerKDevPart::closeForms() { - QWidgetList list = m_workspace->windowList(QWorkspace::CreationOrder); - for(QWidget *w = list.first(); w; w = list.next()) + TQWidgetList list = m_workspace->windowList(TQWorkspace::CreationOrder); + for(TQWidget *w = list.first(); w; w = list.next()) if(w->close() == false) return false; @@ -397,7 +397,7 @@ KFormDesignerKDevPart::slotWidgetSelected(Form *form, bool multiple) ENABLE_ACTION("format_raise", true); ENABLE_ACTION("format_lower", true); - // If the widgets selected is a container, we enable layout actions + // If the widgets selected is a container, we enable tqlayout actions if(!multiple) { KFormDesigner::ObjectTreeItem *item = form->objectTree()->lookup( form->selectedWidgets()->first()->name() ); @@ -405,12 +405,12 @@ KFormDesignerKDevPart::slotWidgetSelected(Form *form, bool multiple) multiple = true; } // Layout actions - ENABLE_ACTION("layout_hbox", multiple); - ENABLE_ACTION("layout_vbox", multiple); - ENABLE_ACTION("layout_grid", multiple); + ENABLE_ACTION("tqlayout_hbox", multiple); + ENABLE_ACTION("tqlayout_vbox", multiple); + ENABLE_ACTION("tqlayout_grid", multiple); KFormDesigner::Container *container = KFormDesigner::FormManager::self()->activeForm()->activeContainer(); - ENABLE_ACTION("break_layout", (container->layoutType() != KFormDesigner::Container::NoLayout)); + ENABLE_ACTION("break_layout", (container->tqlayoutType() != KFormDesigner::Container::NoLayout)); } void @@ -420,10 +420,10 @@ KFormDesignerKDevPart::slotFormWidgetSelected(Form *form) enableFormActions(); // Layout actions - ENABLE_ACTION("layout_hbox", true); - ENABLE_ACTION("layout_vbox", true); - ENABLE_ACTION("layout_grid", true); - ENABLE_ACTION("break_layout", (form->toplevelContainer()->layoutType() != KFormDesigner::Container::NoLayout)); + ENABLE_ACTION("tqlayout_hbox", true); + ENABLE_ACTION("tqlayout_vbox", true); + ENABLE_ACTION("tqlayout_grid", true); + ENABLE_ACTION("break_layout", (form->toplevelContainer()->tqlayoutType() != KFormDesigner::Container::NoLayout)); } void @@ -486,14 +486,14 @@ KFormDesignerKDevPart::disableWidgetActions() ENABLE_ACTION("format_raise", false); ENABLE_ACTION("format_lower", false); - ENABLE_ACTION("layout_hbox", false); - ENABLE_ACTION("layout_vbox", false); - ENABLE_ACTION("layout_grid", false); + ENABLE_ACTION("tqlayout_hbox", false); + ENABLE_ACTION("tqlayout_vbox", false); + ENABLE_ACTION("tqlayout_grid", false); ENABLE_ACTION("break_layout", false); } void -KFormDesignerKDevPart::setUndoEnabled(bool enabled, const QString &text) +KFormDesignerKDevPart::setUndoEnabled(bool enabled, const TQString &text) { KAction *undoAction = actionCollection()->action("edit_undo"); if(undoAction) @@ -505,7 +505,7 @@ KFormDesignerKDevPart::setUndoEnabled(bool enabled, const QString &text) } void -KFormDesignerKDevPart::setRedoEnabled(bool enabled, const QString &text) +KFormDesignerKDevPart::setRedoEnabled(bool enabled, const TQString &text) { KAction *redoAction = actionCollection()->action("edit_redo"); if(redoAction) @@ -517,14 +517,14 @@ KFormDesignerKDevPart::setRedoEnabled(bool enabled, const QString &text) } void -KFormDesignerKDevPart::slotCreateFormSlot(Form *form, const QString &widget, const QString &signal) +KFormDesignerKDevPart::slotCreateFormSlot(Form *form, const TQString &widget, const TQString &signal) { Function f; f.returnType = "void"; f.function = widget + "_" + signal; f.specifier = "non virtual"; f.access = "public"; - f.type = ftQtSlot; + f.type = ftTQtSlot; emit addedFunction(designerType(), form->objectTree()->name(), f); } @@ -535,39 +535,39 @@ KFormDesignerKDevPart::~KFormDesignerKDevPart() ////// FormWidgetBase : helper widget to draw rects on top of widgets -//repaint all children widgets -static void repaintAll(QWidget *w) +//tqrepaint all tqchildren widgets +static void tqrepaintAll(TQWidget *w) { - QObjectList *list = w->queryList("QWidget"); - QObjectListIt it(*list); - for (QObject *obj; (obj=it.current()); ++it ) { - static_cast<QWidget*>(obj)->repaint(); + TQObjectList *list = w->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectListIt it(*list); + for (TQObject *obj; (obj=it.current()); ++it ) { + static_cast<TQWidget*>(obj)->tqrepaint(); } delete list; } void -FormWidgetBase::drawRects(const QValueList<QRect> &list, int type) +FormWidgetBase::drawRects(const TQValueList<TQRect> &list, int type) { - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); if (prev_rect.isValid()) { //redraw prev. selection's rectangle - p.drawPixmap( QPoint(prev_rect.x()-2, prev_rect.y()-2), buffer, QRect(prev_rect.x()-2, prev_rect.y()-2, prev_rect.width()+4, prev_rect.height()+4)); + p.drawPixmap( TQPoint(prev_rect.x()-2, prev_rect.y()-2), buffer, TQRect(prev_rect.x()-2, prev_rect.y()-2, prev_rect.width()+4, prev_rect.height()+4)); } - p.setBrush(QBrush::NoBrush); + p.setBrush(TQBrush::NoBrush); if(type == 1) // selection rect - p.setPen(QPen(white, 1, Qt::DotLine)); + p.setPen(TQPen(white, 1, TQt::DotLine)); else if(type == 2) // insert rect - p.setPen(QPen(white, 2)); + p.setPen(TQPen(white, 2)); p.setRasterOp(XorROP); - prev_rect = QRect(); - QValueList<QRect>::ConstIterator endIt = list.constEnd(); - for(QValueList<QRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) { + prev_rect = TQRect(); + TQValueList<TQRect>::ConstIterator endIt = list.constEnd(); + for(TQValueList<TQRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) { p.drawRect(*it); prev_rect = prev_rect.unite(*it); } @@ -578,9 +578,9 @@ FormWidgetBase::drawRects(const QValueList<QRect> &list, int type) } void -FormWidgetBase::drawRect(const QRect& r, int type) +FormWidgetBase::drawRect(const TQRect& r, int type) { - QValueList<QRect> l; + TQValueList<TQRect> l; l.append(r); drawRects(l, type); } @@ -588,58 +588,58 @@ FormWidgetBase::drawRect(const QRect& r, int type) void FormWidgetBase::initRect() { - repaintAll(this); + tqrepaintAll(this); buffer.resize( width(), height() ); - buffer = QPixmap::grabWindow( winId() ); - prev_rect = QRect(); + buffer = TQPixmap::grabWindow( winId() ); + prev_rect = TQRect(); } void FormWidgetBase::clearRect() { - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); //redraw entire form surface - p.drawPixmap( QPoint(0,0), buffer, QRect(0,0,buffer.width(), buffer.height()) ); + p.drawPixmap( TQPoint(0,0), buffer, TQRect(0,0,buffer.width(), buffer.height()) ); if (!unclipped) clearWFlags( WPaintUnclipped ); p.end(); - repaintAll(this); + tqrepaintAll(this); } void -FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &point) +FormWidgetBase::highlightWidgets(TQWidget *from, TQWidget *to)//, const TQPoint &point) { - QPoint fromPoint, toPoint; - if(from && from->parentWidget() && (from != this)) - fromPoint = from->parentWidget()->mapTo(this, from->pos()); - if(to && to->parentWidget() && (to != this)) - toPoint = to->parentWidget()->mapTo(this, to->pos()); + TQPoint fromPoint, toPoint; + if(from && from->tqparentWidget() && (from != this)) + fromPoint = from->tqparentWidget()->mapTo(this, from->pos()); + if(to && to->tqparentWidget() && (to != this)) + toPoint = to->tqparentWidget()->mapTo(this, to->pos()); - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); if (prev_rect.isValid()) { //redraw prev. selection's rectangle - p.drawPixmap( QPoint(prev_rect.x(), prev_rect.y()), buffer, QRect(prev_rect.x(), prev_rect.y(), prev_rect.width(), prev_rect.height())); + p.drawPixmap( TQPoint(prev_rect.x(), prev_rect.y()), buffer, TQRect(prev_rect.x(), prev_rect.y(), prev_rect.width(), prev_rect.height())); } - p.setPen( QPen(Qt::red, 2) ); + p.setPen( TQPen(TQt::red, 2) ); if(to) { - QPixmap pix1 = QPixmap::grabWidget(from); - QPixmap pix2 = QPixmap::grabWidget(to); + TQPixmap pix1 = TQPixmap::grabWidget(from); + TQPixmap pix2 = TQPixmap::grabWidget(to); if((from != this) && (to != this)) - p.drawLine( from->parentWidget()->mapTo(this, from->geometry().center()), to->parentWidget()->mapTo(this, to->geometry().center()) ); + p.drawLine( from->tqparentWidget()->mapTo(this, from->tqgeometry().center()), to->tqparentWidget()->mapTo(this, to->tqgeometry().center()) ); p.drawPixmap(fromPoint.x(), fromPoint.y(), pix1); p.drawPixmap(toPoint.x(), toPoint.y(), pix2); @@ -656,7 +656,7 @@ FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po p.drawRoundRect(fromPoint.x(), fromPoint.y(), from->width(), from->height(), 5, 5); if((to == this) || (from == this)) - prev_rect = QRect(0, 0, buffer.width(), buffer.height()); + prev_rect = TQRect(0, 0, buffer.width(), buffer.height()); else if(to) { prev_rect.setX( (fromPoint.x() < toPoint.x()) ? (fromPoint.x() - 5) : (toPoint.x() - 5) ); @@ -665,7 +665,7 @@ FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po prev_rect.setBottom( (fromPoint.y() < toPoint.y()) ? (toPoint.y() + to->height() + 10) : (fromPoint.y() + from->height() + 10) ) ; } else - prev_rect = QRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10); + prev_rect = TQRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10); if (!unclipped) clearWFlags( WPaintUnclipped ); @@ -673,7 +673,7 @@ FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po } void -FormWidgetBase::closeEvent(QCloseEvent *ev) +FormWidgetBase::closeEvent(TQCloseEvent *ev) { Form *form = KFormDesigner::FormManager::self()->formForWidget(this); if(!form || !form->isModified() || !form->objectTree()) // == preview form diff --git a/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.h b/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.h index 52ce5f27..548b4a35 100644 --- a/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.h +++ b/kexi/formeditor/kdevelop_plugin/kfd_kdev_part.h @@ -20,8 +20,8 @@ #ifndef KFORMDESIGNER_KDEVELOP_PART_H #define KFORMDESIGNER_KDEVELOP_PART_H -#include <qwidget.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqpixmap.h> #include <kinterfacedesigner/designer.h> #include <kparts/factory.h> @@ -30,8 +30,8 @@ class KAboutData; class KInstance; -class QWorkspace; -class QCloseEvent; +class TQWorkspace; +class TQCloseEvent; using KFormDesigner::Form; using namespace KInterfaceDesigner; @@ -39,13 +39,14 @@ using namespace KInterfaceDesigner; class KFORMEDITOR_EXPORT KFDFactory : public KParts::Factory { Q_OBJECT + TQ_OBJECT public: KFDFactory(); virtual ~KFDFactory(); - virtual KParts::Part* createPartObject(QWidget *parentWidget=0, const char *widgetName=0, QObject *parent=0, const char *name=0, - const char *classname="KParts::Part", const QStringList &args=QStringList()); + virtual KParts::Part* createPartObject(TQWidget *tqparentWidget=0, const char *widgetName=0, TQObject *tqparent=0, const char *name=0, + const char *classname="KParts::Part", const TQStringList &args=TQStringList()); static KInstance *instance(); static KAboutData *aboutData(); @@ -57,13 +58,14 @@ class KFORMEDITOR_EXPORT KFDFactory : public KParts::Factory class KFORMEDITOR_EXPORT KFormDesignerKDevPart : public Designer { Q_OBJECT + TQ_OBJECT public: - KFormDesignerKDevPart(QWidget *parent, const char *name, bool readOnly=true, const QStringList &args=QStringList()); + KFormDesignerKDevPart(TQWidget *tqparent, const char *name, bool readOnly=true, const TQStringList &args=TQStringList()); virtual ~KFormDesignerKDevPart(); - virtual DesignerType designerType() { return QtDesigner; } - virtual void openProject(const QString &) {} + virtual DesignerType designerType() { return TQtDesigner; } + virtual void openProject(const TQString &) {} // KFormDesigner::FormManager* manager() { return m_manager; } void setUniqueFormMode(bool enable) { m_uniqueFormMode = enable; } @@ -83,15 +85,15 @@ class KFORMEDITOR_EXPORT KFormDesignerKDevPart : public Designer void open(); void slotPreviewForm(); void saveAs(); - void slotCreateFormSlot(KFormDesigner::Form *form, const QString &widget, const QString &signal); + void slotCreateFormSlot(KFormDesigner::Form *form, const TQString &widget, const TQString &signal); protected slots: void slotWidgetSelected(KFormDesigner::Form *form, bool multiple); void slotFormWidgetSelected(KFormDesigner::Form *form); void slotNoFormSelected(); void slotFormModified(KFormDesigner::Form *form, bool isDirty); - void setUndoEnabled(bool enabled, const QString &text); - void setRedoEnabled(bool enabled, const QString &text); + void setUndoEnabled(bool enabled, const TQString &text); + void setRedoEnabled(bool enabled, const TQString &text); protected: virtual bool openFile(); @@ -103,7 +105,7 @@ class KFORMEDITOR_EXPORT KFormDesignerKDevPart : public Designer private: static KFormDesigner::WidgetLibrary* static_formsLibrary; // KFormDesigner::FormManager *m_manager; - QWorkspace *m_workspace; + TQWorkspace *m_workspace; int m_count; bool m_uniqueFormMode; bool m_openingFile; @@ -111,27 +113,28 @@ class KFORMEDITOR_EXPORT KFormDesignerKDevPart : public Designer }; //! Helper: this widget is used to create form's surface -class KFORMEDITOR_EXPORT FormWidgetBase : public QWidget, public KFormDesigner::FormWidget +class KFORMEDITOR_EXPORT FormWidgetBase : public TQWidget, public KFormDesigner::FormWidget { Q_OBJECT + TQ_OBJECT public: - FormWidgetBase(KFormDesignerKDevPart *part, QWidget *parent = 0, const char *name = 0, int WFlags = WDestructiveClose) - : QWidget(parent, name, WFlags), m_part(part) {} + FormWidgetBase(KFormDesignerKDevPart *part, TQWidget *tqparent = 0, const char *name = 0, int WFlags = WDestructiveClose) + : TQWidget(tqparent, name, WFlags), m_part(part) {} ~FormWidgetBase() {;} - void drawRect(const QRect& r, int type); - void drawRects(const QValueList<QRect> &list, int type); + void drawRect(const TQRect& r, int type); + void drawRects(const TQValueList<TQRect> &list, int type); void initRect(); void clearRect(); - void highlightWidgets(QWidget *from, QWidget *to);//, const QPoint &p); + void highlightWidgets(TQWidget *from, TQWidget *to);//, const TQPoint &p); protected: - void closeEvent(QCloseEvent *ev); + void closeEvent(TQCloseEvent *ev); private: - QPixmap buffer; //!< stores grabbed entire form's area for redraw - QRect prev_rect; //!< previously selected rectangle + TQPixmap buffer; //!< stores grabbed entire form's area for redraw + TQRect prev_rect; //!< previously selected rectangle KFormDesignerKDevPart *m_part; }; diff --git a/kexi/formeditor/kfdpixmapedit.cpp b/kexi/formeditor/kfdpixmapedit.cpp index e8a96761..caadca85 100644 --- a/kexi/formeditor/kfdpixmapedit.cpp +++ b/kexi/formeditor/kfdpixmapedit.cpp @@ -29,8 +29,8 @@ using namespace KFormDesigner; -KFDPixmapEdit::KFDPixmapEdit(KoProperty::Property *property, QWidget *parent, const char *name) - : KoProperty::PixmapEdit(property, parent, name) +KFDPixmapEdit::KFDPixmapEdit(KoProperty::Property *property, TQWidget *tqparent, const char *name) + : KoProperty::PixmapEdit(property, tqparent, name) { // m_manager = manager; } @@ -47,9 +47,9 @@ KFDPixmapEdit::selectPixmap() return; ObjectTreeItem *item = m_manager->activeForm()->objectTree()->lookup(m_manager->activeForm()->selectedWidget()->name()); - QString name = item ? item->pixmapName(property()->name()) : ""; - PixmapCollectionChooser dialog( m_manager->activeForm()->pixmapCollection(), name, topLevelWidget() ); - if(dialog.exec() == QDialog::Accepted) { + TQString name = item ? item->pixmapName(property()->name()) : ""; + PixmapCollectionChooser dialog( m_manager->activeForm()->pixmapCollection(), name, tqtopLevelWidget() ); + if(dialog.exec() == TQDialog::Accepted) { setValue(dialog.pixmap(), true); item->setPixmapName(property()->name(), dialog.pixmapName()); } diff --git a/kexi/formeditor/kfdpixmapedit.h b/kexi/formeditor/kfdpixmapedit.h index 0d183ea4..181ed043 100644 --- a/kexi/formeditor/kfdpixmapedit.h +++ b/kexi/formeditor/kfdpixmapedit.h @@ -27,9 +27,10 @@ namespace KFormDesigner { class KFORMEDITOR_EXPORT KFDPixmapEdit : public KoProperty::PixmapEdit { Q_OBJECT + TQ_OBJECT public: - KFDPixmapEdit(KoProperty::Property *property, QWidget *parent=0, const char *name=0); + KFDPixmapEdit(KoProperty::Property *property, TQWidget *tqparent=0, const char *name=0); virtual ~KFDPixmapEdit(); public slots: diff --git a/kexi/formeditor/libactionwidget.cpp b/kexi/formeditor/libactionwidget.cpp index 8a17c3c3..0edc2433 100644 --- a/kexi/formeditor/libactionwidget.cpp +++ b/kexi/formeditor/libactionwidget.cpp @@ -26,15 +26,15 @@ using namespace KFormDesigner; LibActionWidget::LibActionWidget(WidgetInfo *w, KActionCollection *c) - : KToggleAction(w->name(), w->pixmap(), 0/*Key_F5*/, 0, 0 /*SLOT(slotWidget())*/, - c, QString("library_widget_" + w->className()).latin1()) + : KToggleAction(w->name(), w->pixmap(), 0/*Key_F5*/, 0, 0 /*TQT_SLOT(slotWidget())*/, + c, TQString("library_widget_" + w->className()).latin1()) { -// kdDebug() << "LibActionWidget::LibActionWidget(): " << QString("library_widget_" + w->className()).latin1() << endl; +// kdDebug() << "LibActionWidget::LibActionWidget(): " << TQString("library_widget_" + w->className()).latin1() << endl; m_className = w->className(); setExclusiveGroup("LibActionWidgets"); setToolTip(w->name()); setWhatsThis(w->description()); -// connect(this, SIGNAL(activated()), this, SLOT(slotWidget())); +// connect(this, TQT_SIGNAL(activated()), this, TQT_SLOT(slotWidget())); } void diff --git a/kexi/formeditor/libactionwidget.h b/kexi/formeditor/libactionwidget.h index bfa45f6a..e2ef2762 100644 --- a/kexi/formeditor/libactionwidget.h +++ b/kexi/formeditor/libactionwidget.h @@ -35,6 +35,7 @@ class WidgetInfo; class KFORMEDITOR_EXPORT LibActionWidget : public KToggleAction { Q_OBJECT + TQ_OBJECT public: /** LibActionWidget object is initialized to be mutually exclusive with all other LibActionWidget objects */ @@ -45,14 +46,14 @@ class KFORMEDITOR_EXPORT LibActionWidget : public KToggleAction /** * emits a signal containing the class name */ - void prepareInsert(const QCString &className); + void prepareInsert(const TQCString &className); protected slots: /** reimplemented from KToggleAction */ virtual void slotActivated(); private: - QCString m_className; + TQCString m_className; }; } diff --git a/kexi/formeditor/objecttree.cpp b/kexi/formeditor/objecttree.cpp index d5708773..5f17d849 100644 --- a/kexi/formeditor/objecttree.cpp +++ b/kexi/formeditor/objecttree.cpp @@ -19,10 +19,10 @@ */ #include <kdebug.h> -#include <qwidget.h> -#include <qvariant.h> -#include <qdom.h> -#include <qtextstream.h> +#include <tqwidget.h> +#include <tqvariant.h> +#include <tqdom.h> +#include <tqtextstream.h> #include "form.h" #include "container.h" @@ -36,15 +36,15 @@ using namespace KFormDesigner; //////////////////////////////////////////////////////////////////////////////////////// -ObjectTreeItem::ObjectTreeItem(const QString &classn, const QString &name, QWidget *widget, - Container *parentContainer, Container *container) +ObjectTreeItem::ObjectTreeItem(const TQString &classn, const TQString &name, TQWidget *widget, + Container *tqparentContainer, Container *container) : m_enabled(true), m_row(-1), m_col(-1), m_rowspan(-1), m_colspan(-1), m_span(false) { m_className = classn; m_name = name; m_widget = widget; m_container = container; - m_eater = new EventEater(widget, parentContainer); + m_eater = new EventEater(widget, tqparentContainer); m_parent = 0; m_subprops = 0; } @@ -56,7 +56,7 @@ ObjectTreeItem::~ObjectTreeItem() } void -ObjectTreeItem::rename(const QString &name) +ObjectTreeItem::rename(const TQString &name) { m_name = name; } @@ -64,58 +64,58 @@ ObjectTreeItem::rename(const QString &name) void ObjectTreeItem::addChild(ObjectTreeItem *c) { - m_children.append(c); + m_tqchildren.append(c); c->setParent(this); } void ObjectTreeItem::removeChild(ObjectTreeItem *c) { - m_children.remove(c); + m_tqchildren.remove(c); } void -ObjectTreeItem::addModifiedProperty(const QCString &property, const QVariant &oldValue) +ObjectTreeItem::addModifiedProperty(const TQCString &property, const TQVariant &oldValue) { if(property == "name") return; - if(!m_props.contains(property)) { + if(!m_props.tqcontains(property)) { m_props.insert(property, oldValue); kdDebug() << "ObjectTree::adModProperty(): Added this property in the list: " << property << " oldValue: " << oldValue << endl; } } void -ObjectTreeItem::addSubproperty(const QCString &property, const QVariant& value) +ObjectTreeItem::addSubproperty(const TQCString &property, const TQVariant& value) { if (!m_subprops) - m_subprops = new QMap<QString, QVariant>(); - if (!m_props.contains(property)) + m_subprops = new TQMap<TQString, TQVariant>(); + if (!m_props.tqcontains(property)) m_subprops->insert( property, value ); } void -ObjectTreeItem::storeUnknownProperty(QDomElement &el) +ObjectTreeItem::storeUnknownProperty(TQDomElement &el) { if(!el.isNull()) { - QTextStream ts(m_unknownProps, IO_WriteOnly|IO_Append ); + TQTextStream ts(m_unknownProps, IO_WriteOnly|IO_Append ); el.save(ts, 0); } } void -ObjectTreeItem::setPixmapName(const QCString &property, const QString &name) +ObjectTreeItem::setPixmapName(const TQCString &property, const TQString &name) { m_pixmapNames[property] = name; } -QString -ObjectTreeItem::pixmapName(const QCString &property) +TQString +ObjectTreeItem::pixmapName(const TQCString &property) { - if(m_pixmapNames.contains(property)) + if(m_pixmapNames.tqcontains(property)) return m_pixmapNames[property]; - return QString::null; + return TQString(); } void @@ -134,22 +134,22 @@ ObjectTreeItem::setGridPos(int row, int col, int rowspan, int colspan) /// ObjectTree ///////// //////////////////////////////////////////////////////////////////////////////////////// -ObjectTree::ObjectTree(const QString &classn, const QString &name, QWidget *widget, Container *container) +ObjectTree::ObjectTree(const TQString &classn, const TQString &name, TQWidget *widget, Container *container) : ObjectTreeItem(classn, name, widget, container, container) { } ObjectTree::~ObjectTree() { -// for(ObjectTreeItem *it = children()->first(); it; it = children()->next()) +// for(ObjectTreeItem *it = tqchildren()->first(); it; it = tqchildren()->next()) // removeItem(it->name()); - while (children()->first()) { - removeItem(children()->first()); + while (tqchildren()->first()) { + removeItem(tqchildren()->first()); } } bool -ObjectTree::rename(const QString &oldname, const QString &newname) +ObjectTree::rename(const TQString &oldname, const TQString &newname) { if(oldname == m_name) { @@ -169,20 +169,20 @@ ObjectTree::rename(const QString &oldname, const QString &newname) } bool -ObjectTree::reparent(const QString &name, const QString &newparent) +ObjectTree::reparent(const TQString &name, const TQString &newtqparent) { ObjectTreeItem *item = lookup(name); if(!item) return false; - ObjectTreeItem *parent = lookup(newparent); - if(!parent) return false; + ObjectTreeItem *tqparent = lookup(newtqparent); + if(!tqparent) return false; - item->parent()->removeChild(item); - parent->addChild(item); + item->tqparent()->removeChild(item); + tqparent->addChild(item); return true; } ObjectTreeItem* -ObjectTree::lookup(const QString &name) +ObjectTree::lookup(const TQString &name) { if(name == this->name()) return this; @@ -191,20 +191,20 @@ ObjectTree::lookup(const QString &name) } void -ObjectTree::addItem(ObjectTreeItem *parent, ObjectTreeItem *c) +ObjectTree::addItem(ObjectTreeItem *tqparent, ObjectTreeItem *c) { m_treeDict.insert(c->name(), c); - if(!parent) - parent = this; - parent->addChild(c); + if(!tqparent) + tqparent = this; + tqparent->addChild(c); m_container->form()->emitChildAdded(c); - kdDebug() << "ObjectTree::addItem(): adding " << c->name() << " to " << parent->name() << endl; + kdDebug() << "ObjectTree::addItem(): adding " << c->name() << " to " << tqparent->name() << endl; } void -ObjectTree::removeItem(const QString &name) +ObjectTree::removeItem(const TQString &name) { ObjectTreeItem *c = lookup(name); removeItem(c); @@ -216,29 +216,29 @@ ObjectTree::removeItem(ObjectTreeItem *c) if (m_container && m_container->form()) m_container->form()->emitChildRemoved(c); - for(ObjectTreeItem *it = c->children()->first(); it; it = c->children()->next()) + for(ObjectTreeItem *it = c->tqchildren()->first(); it; it = c->tqchildren()->next()) removeItem(it->name()); m_treeDict.remove(c->name()); - c->parent()->removeChild(c); + c->tqparent()->removeChild(c); delete c; } -QCString -ObjectTree::generateUniqueName(const QCString &prefix, bool numberSuffixRequired) +TQCString +ObjectTree::generateUniqueName(const TQCString &prefix, bool numberSuffixRequired) { /* old way of naming widgets int appendix = m_names[c] + 1; - QString name(c); - name.append(QString::number(appendix)); + TQString name(c); + name.append(TQString::number(appendix)); m_names[c] = appendix;*/ if (!numberSuffixRequired && !lookup(prefix)) return prefix; - QString name( prefix ); + TQString name( prefix ); int i = 2; //start from 2, i.e. we have: "widget", "widget2", etc. - while(lookup(name + QString::number(i))) + while(lookup(name + TQString::number(i))) i++; - return (name + QString::number(i)).latin1(); + return (name + TQString::number(i)).latin1(); } diff --git a/kexi/formeditor/objecttree.h b/kexi/formeditor/objecttree.h index 252ee54c..ca301f4d 100644 --- a/kexi/formeditor/objecttree.h +++ b/kexi/formeditor/objecttree.h @@ -22,15 +22,15 @@ #ifndef KFORMDESIGNEROBJECTTREE_H #define KFORMDESIGNEROBJECTTREE_H -#include <qptrlist.h> -#include <qmap.h> -#include <qdict.h> -#include <qvariant.h> -#include <qstring.h> -#include <qguardedptr.h> +#include <tqptrlist.h> +#include <tqmap.h> +#include <tqdict.h> +#include <tqvariant.h> +#include <tqstring.h> +#include <tqguardedptr.h> -class QWidget; -class QDomElement; +class TQWidget; +class TQDomElement; namespace KFormDesigner { @@ -39,53 +39,53 @@ class Container; class EventEater; //! @short An list of ObjectTreeItem pointers. -typedef QPtrList<ObjectTreeItem> ObjectTreeList; +typedef TQPtrList<ObjectTreeItem> ObjectTreeList; //! @short An iterator for ObjectTreeList. -typedef QPtrListIterator<ObjectTreeItem> ObjectTreeListIterator; +typedef TQPtrListIterator<ObjectTreeItem> ObjectTreeListIterator; -//! @short A QString-based disctionary of ObjectTreeItem pointers. -typedef QDict<ObjectTreeItem> ObjectTreeDict; +//! @short A TQString-based disctionary of ObjectTreeItem pointers. +typedef TQDict<ObjectTreeItem> ObjectTreeDict; //! @short An iterator for ObjectTreeDict. -typedef QDictIterator<ObjectTreeItem> ObjectTreeDictIterator; +typedef TQDictIterator<ObjectTreeItem> ObjectTreeDictIterator; -//! @short A QString -> QVarinat map. -typedef QMap<QString, QVariant> QVariantMap; +//! @short A TQString -> TQVarinat map. +typedef TQMap<TQString, TQVariant> TQVariantMap; -//! @short A const iterator for QVariantMap. -typedef QMapConstIterator<QString, QVariant> QVariantMapConstIterator; +//! @short A const iterator for TQVariantMap. +typedef TQMapConstIterator<TQString, TQVariant> TQVariantMapConstIterator; /*! @short An item representing a widget - Holds the properties of a widget (classname, name, parent, children ..). + Holds the properties of a widget (classname, name, tqparent, tqchildren ..). @author Lucijan Busch <lucijan@kde.org> */ class KFORMEDITOR_EXPORT ObjectTreeItem { public: - ObjectTreeItem(const QString &className, const QString &name, QWidget *widget, Container *parentContainer, Container *container=0); + ObjectTreeItem(const TQString &className, const TQString &name, TQWidget *widget, Container *tqparentContainer, Container *container=0); virtual ~ObjectTreeItem(); - QString name() const { return m_name; } - QString className() const { return m_className; } - QWidget* widget() const { return m_widget; } + TQString name() const { return m_name; } + TQString className() const { return m_className; } + TQWidget* widget() const { return m_widget; } EventEater* eventEater() const { return m_eater; } - ObjectTreeItem* parent() const { return m_parent; } - ObjectTreeList* children() { return &m_children; } + ObjectTreeItem* tqparent() const { return m_parent; } + ObjectTreeList* tqchildren() { return &m_tqchildren; } - /*! \return a QMap<QString, QVariant> of all modified properties for this widget. - The QVariant is the old value (ie first value) of the property whose name is the QString. */ - const QVariantMap* modifiedProperties() const { return &m_props;} + /*! \return a TQMap<TQString, TQVariant> of all modified properties for this widget. + The TQVariant is the old value (ie first value) of the property whose name is the TQString. */ + const TQVariantMap* modifiedProperties() const { return &m_props;} //! \return the widget's Container, or 0 if the widget is not a Container. Container* container() const { return m_container;} - void setWidget(QWidget *w) { m_widget = w; } - void setParent(ObjectTreeItem *parent) { m_parent = parent;} + void setWidget(TQWidget *w) { m_widget = w; } + void setParent(ObjectTreeItem *tqparent) { m_parent = tqparent;} void debug(int ident); - void rename(const QString &name); + void rename(const TQString &name); void addChild(ObjectTreeItem *it); void removeChild(ObjectTreeItem *it); @@ -93,20 +93,20 @@ class KFORMEDITOR_EXPORT ObjectTreeItem /*! Adds \a property in the list of the modified properties for this object. These modified properties are written in the .ui files when saving the form. */ - void addModifiedProperty(const QCString &property, const QVariant &oldValue); - void storeUnknownProperty(QDomElement &el); + void addModifiedProperty(const TQCString &property, const TQVariant &oldValue); + void storeUnknownProperty(TQDomElement &el); /*! Adds subproperty \a property value \a value (a property of subwidget). Remembering it for delayed setting is needed because on loading the subwidget could be not created yet (true e.g. for KexiDBAutoField). */ - void addSubproperty(const QCString &property, const QVariant& value); + void addSubproperty(const TQCString &property, const TQVariant& value); /*! \return subproperties for this item, added by addSubproperty() or 0 is there are no subproperties. */ - QMap<QString, QVariant>* subproperties() const { return m_subprops; } + TQMap<TQString, TQVariant>* subproperties() const { return m_subprops; } - void setPixmapName(const QCString &property, const QString &name); - QString pixmapName(const QCString &property); + void setPixmapName(const TQCString &property, const TQString &name); + TQString pixmapName(const TQCString &property); void setEnabled(bool enabled) { m_enabled = enabled; } bool isEnabled() const { return m_enabled; } @@ -119,17 +119,17 @@ class KFORMEDITOR_EXPORT ObjectTreeItem void setGridPos(int row, int col, int rowspan, int colspan); protected: - QString m_className; - QString m_name; - ObjectTreeList m_children; - QGuardedPtr<Container> m_container; - QMap<QString, QVariant> m_props; - QMap<QString, QVariant> *m_subprops; - QString m_unknownProps; - QMap<QCString, QString> m_pixmapNames; + TQString m_className; + TQString m_name; + ObjectTreeList m_tqchildren; + TQGuardedPtr<Container> m_container; + TQMap<TQString, TQVariant> m_props; + TQMap<TQString, TQVariant> *m_subprops; + TQString m_unknownProps; + TQMap<TQCString, TQString> m_pixmapNames; ObjectTreeItem* m_parent; - QGuardedPtr<QWidget> m_widget; - QGuardedPtr<EventEater> m_eater; + TQGuardedPtr<TQWidget> m_widget; + TQGuardedPtr<EventEater> m_eater; bool m_enabled; @@ -145,25 +145,25 @@ class KFORMEDITOR_EXPORT ObjectTreeItem class KFORMEDITOR_EXPORT ObjectTree : public ObjectTreeItem { public: - ObjectTree(const QString &className=QString::null, const QString &name=QString::null, - QWidget *widget=0, Container *container=0); + ObjectTree(const TQString &className=TQString(), const TQString &name=TQString(), + TQWidget *widget=0, Container *container=0); virtual ~ObjectTree(); /*! Renames the item named \a oldname to \a newname. \return false if widget named \a newname already exists and renaming failed. */ - bool rename(const QString &oldname, const QString &newname ); - /*! Sets \a newparent as new parent for the item whose name is \a name. */ - bool reparent(const QString &name, const QString &newparent); + bool rename(const TQString &oldname, const TQString &newname ); + /*! Sets \a newtqparent as new tqparent for the item whose name is \a name. */ + bool reparent(const TQString &name, const TQString &newtqparent); /*! \return the ObjectTreeItem named \a name, or 0 if doesn't exist. */ - ObjectTreeItem* lookup(const QString &name); + ObjectTreeItem* lookup(const TQString &name); /*! \return a dict containing all ObjectTreeItem in this ObjectTree. If you want to iterate on this dict, use ObjectTreeDictIterator. */ ObjectTreeDict* dict() { return &m_treeDict; } - void addItem(ObjectTreeItem *parent, ObjectTreeItem *c); - void removeItem(const QString &name); + void addItem(ObjectTreeItem *tqparent, ObjectTreeItem *c); + void removeItem(const TQString &name); void removeItem(ObjectTreeItem *c); /*! Generates a new, unique name for a new widget using prefix \a prefix @@ -173,7 +173,7 @@ class KFORMEDITOR_EXPORT ObjectTree : public ObjectTreeItem If \a numberSuffixRequired is false and there's a widget prefix \a prefix, then \a prefix is returned (e.g. if \a prefix is "lineEdit", and "lineEdit" doesn't exist yet, "lineEdit" is returned). */ - QCString generateUniqueName(const QCString &prefix, bool numberSuffixRequired = true); + TQCString generateUniqueName(const TQCString &prefix, bool numberSuffixRequired = true); private: ObjectTreeDict m_treeDict; diff --git a/kexi/formeditor/objecttreeview.cpp b/kexi/formeditor/objecttreeview.cpp index 22ed6d7f..4f258446 100644 --- a/kexi/formeditor/objecttreeview.cpp +++ b/kexi/formeditor/objecttreeview.cpp @@ -19,7 +19,7 @@ #include <kdebug.h> -#include <qpainter.h> +#include <tqpainter.h> #include <kiconloader.h> #include <klocale.h> @@ -34,14 +34,14 @@ using namespace KFormDesigner; -ObjectTreeViewItem::ObjectTreeViewItem(ObjectTreeViewItem *parent, ObjectTreeItem *item) - : KListViewItem(parent, item->name(), item->className()) +ObjectTreeViewItem::ObjectTreeViewItem(ObjectTreeViewItem *tqparent, ObjectTreeItem *item) + : KListViewItem(tqparent, item->name(), item->className()) { m_item = item; } ObjectTreeViewItem::ObjectTreeViewItem(KListView *list, ObjectTreeItem *item) - : KListViewItem(list, item ? item->name() : QString::null, item ? item->className() : QString::null) + : KListViewItem(list, item ? item->name() : TQString(), item ? item->className() : TQString()) { m_item = item; } @@ -50,17 +50,17 @@ ObjectTreeViewItem::~ObjectTreeViewItem() { } -QString +TQString ObjectTreeViewItem::name() const { if(m_item) return m_item->name(); else - return QString::null; + return TQString(); } void -ObjectTreeViewItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align) +ObjectTreeViewItem::paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align) { int margin = listView()->itemMargin(); if(column == 1) @@ -74,42 +74,42 @@ ObjectTreeViewItem::paintCell(QPainter *p, const QColorGroup & cg, int column, i if(!m_item) return; - p->fillRect(0,0,width, height(), QBrush(backgroundColor())); + p->fillRect(0,0,width, height(), TQBrush(backgroundColor())); if(isSelected()) { - p->fillRect(0,0,width, height(), QBrush(cg.highlight())); + p->fillRect(0,0,width, height(), TQBrush(cg.highlight())); p->setPen(cg.highlightedText()); } - QFont f = listView()->font(); + TQFont f = listView()->font(); p->save(); if(isSelected()) f.setBold(true); p->setFont(f); if(depth() == 0) // for edit tab order dialog { - QString iconName + TQString iconName = ((ObjectTreeView*)listView())->iconNameForClass(m_item->widget()->className()); p->drawPixmap(margin, (height() - IconSize(KIcon::Small))/2 , SmallIcon(iconName)); p->drawText( - QRect(2*margin + IconSize(KIcon::Small),0,width, height()-1), - Qt::AlignVCenter, m_item->name()); + TQRect(2*margin + IconSize(KIcon::Small),0,width, height()-1), + TQt::AlignVCenter, m_item->name()); } else - p->drawText(QRect(margin,0,width, height()-1), Qt::AlignVCenter, m_item->name()); + p->drawText(TQRect(margin,0,width, height()-1), TQt::AlignVCenter, m_item->name()); p->restore(); - p->setPen( QColor(200,200,200) ); //like in t.v. + p->setPen( TQColor(200,200,200) ); //like in t.v. p->drawLine(width-1, 0, width-1, height()-1); } - p->setPen( QColor(200,200,200) ); //like in t.v. + p->setPen( TQColor(200,200,200) ); //like in t.v. p->drawLine(-150, height()-1, width, height()-1 ); } void -ObjectTreeViewItem::paintBranches(QPainter *p, const QColorGroup &cg, int w, int y, int h) +ObjectTreeViewItem::paintBranches(TQPainter *p, const TQColorGroup &cg, int w, int y, int h) { p->eraseRect(0,0,w,h); ObjectTreeViewItem *item = (ObjectTreeViewItem*)firstChild(); @@ -120,20 +120,20 @@ ObjectTreeViewItem::paintBranches(QPainter *p, const QColorGroup &cg, int w, int p->translate(0,y); while(item) { - p->fillRect(0,0,w, item->height(), QBrush(item->backgroundColor())); - p->fillRect(-150,0,150, item->height(), QBrush(item->backgroundColor())); + p->fillRect(0,0,w, item->height(), TQBrush(item->backgroundColor())); + p->fillRect(-150,0,150, item->height(), TQBrush(item->backgroundColor())); p->save(); - p->setPen( QColor(200,200,200) ); //like in t.v. + p->setPen( TQColor(200,200,200) ); //like in t.v. p->drawLine(-150, item->height()-1, w, item->height()-1 ); p->restore(); if(item->isSelected()) { - p->fillRect(0,0,w, item->height(), QBrush(cg.highlight())); - p->fillRect(-150,0,150, item->height(), QBrush(cg.highlight())); + p->fillRect(0,0,w, item->height(), TQBrush(cg.highlight())); + p->fillRect(-150,0,150, item->height(), TQBrush(cg.highlight())); } - QString iconName + TQString iconName = ((ObjectTreeView*)listView())->iconNameForClass(item->m_item->widget()->className()); p->drawPixmap( (w - IconSize(KIcon::Small))/2, (item->height() - IconSize(KIcon::Small))/2 , @@ -163,8 +163,8 @@ ObjectTreeViewItem::setOpen( bool o ) // ObjectTreeView itself ---------------- -ObjectTreeView::ObjectTreeView(QWidget *parent, const char *name, bool tabStop) - : KListView(parent, name) +ObjectTreeView::ObjectTreeView(TQWidget *tqparent, const char *name, bool tabStop) + : KListView(tqparent, name) , m_form(0) { addColumn(i18n("Name"), 130); @@ -172,12 +172,12 @@ ObjectTreeView::ObjectTreeView(QWidget *parent, const char *name, bool tabStop) installEventFilter(this); - connect((QObject*)header(), SIGNAL(sectionHandleDoubleClicked(int)), this, SLOT(slotColumnSizeChanged(int))); + connect((TQObject*)header(), TQT_SIGNAL(sectionHandleDoubleClicked(int)), this, TQT_SLOT(slotColumnSizeChanged(int))); if(!tabStop) { setSelectionModeExt(Extended); - connect(this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged())); - connect(this, SIGNAL(contextMenu(KListView *, QListViewItem *, const QPoint&)), this, SLOT(displayContextMenu(KListView*, QListViewItem*, const QPoint&))); + connect(this, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionChanged())); + connect(this, TQT_SIGNAL(contextMenu(KListView *, TQListViewItem *, const TQPoint&)), this, TQT_SLOT(displayContextMenu(KListView*, TQListViewItem*, const TQPoint&))); } setFullWidth(true); @@ -190,15 +190,15 @@ ObjectTreeView::~ObjectTreeView() { } -QSize -ObjectTreeView::sizeHint() const +TQSize +ObjectTreeView::tqsizeHint() const { - return QSize( QFontMetrics(font()).width(columnText(0)+columnText(1)+" "), - KListView::sizeHint().height()); + return TQSize( TQFontMetrics(font()).width(columnText(0)+columnText(1)+" "), + KListView::tqsizeHint().height()); } -QString -ObjectTreeView::iconNameForClass(const QCString &classname) +TQString +ObjectTreeView::iconNameForClass(const TQCString &classname) { return m_form->library()->iconName(classname); } @@ -210,12 +210,12 @@ ObjectTreeView::slotColumnSizeChanged(int) } void -ObjectTreeView::displayContextMenu(KListView *list, QListViewItem *item, const QPoint &) +ObjectTreeView::displayContextMenu(KListView *list, TQListViewItem *item, const TQPoint &) { if(list != this || !m_form || !item) return; - QWidget *w = ((ObjectTreeViewItem*)item)->m_item->widget(); + TQWidget *w = ((ObjectTreeViewItem*)item)->m_item->widget(); if(!w) return; @@ -223,9 +223,9 @@ ObjectTreeView::displayContextMenu(KListView *list, QListViewItem *item, const Q } ObjectTreeViewItem* -ObjectTreeView::findItem(const QString &name) +ObjectTreeView::findItem(const TQString &name) { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); while(it.current()) { ObjectTreeViewItem *item = static_cast<ObjectTreeViewItem*>(it.current()); @@ -239,7 +239,7 @@ ObjectTreeView::findItem(const QString &name) } void -ObjectTreeView::setSelectedWidget(QWidget *w, bool add) +ObjectTreeView::setSelectedWidget(TQWidget *w, bool add) { blockSignals(true); // to avoid recursion @@ -257,7 +257,7 @@ ObjectTreeView::setSelectedWidget(QWidget *w, bool add) clearSelection(); - QListViewItem *item = (QListViewItem*) findItem(w->name()); + TQListViewItem *item = (TQListViewItem*) findItem(w->name()); if(!add) { setCurrentItem(item); @@ -274,13 +274,13 @@ void ObjectTreeView::slotSelectionChanged() { const bool hadFocus = hasFocus(); - QPtrList<QListViewItem> list = selectedItems(); + TQPtrList<TQListViewItem> list = selectedItems(); m_form->selectFormWidget(); - for(QListViewItem *item = list.first(); item; item = list.next()) + for(TQListViewItem *item = list.first(); item; item = list.next()) { ObjectTreeViewItem *it = static_cast<ObjectTreeViewItem*>(item); - QWidget *w = it->objectTree()->widget(); - if(w && (m_form->selectedWidgets()->findRef(w) == -1)) + TQWidget *w = it->objectTree()->widget(); + if(w && (m_form->selectedWidgets()->tqfindRef(w) == -1)) m_form->setSelectedWidget(w, true, true); } if (hadFocus) @@ -290,13 +290,13 @@ ObjectTreeView::slotSelectionChanged() void ObjectTreeView::addItem(ObjectTreeItem *item) { - ObjectTreeViewItem *parent=0; + ObjectTreeViewItem *tqparent=0; - parent = findItem(item->parent()->name()); - if(!parent) + tqparent = findItem(item->tqparent()->name()); + if(!tqparent) return; - loadTree(item, parent); + loadTree(item, tqparent); } void @@ -309,7 +309,7 @@ ObjectTreeView::removeItem(ObjectTreeItem *item) } void -ObjectTreeView::renameItem(const QCString &oldname, const QCString &newname) +ObjectTreeView::renameItem(const TQCString &oldname, const TQCString &newname) { if(findItem(newname)) return; @@ -323,7 +323,7 @@ void ObjectTreeView::setForm(Form *form) { if (m_form) - disconnect(m_form, SIGNAL(destroying()), this, SLOT(slotBeforeFormDestroyed())); + disconnect(m_form, TQT_SIGNAL(destroying()), this, TQT_SLOT(slotBeforeFormDestroyed())); m_form = form; m_topItem = 0; clear(); @@ -331,7 +331,7 @@ ObjectTreeView::setForm(Form *form) if(!m_form) return; - connect(m_form, SIGNAL(destroying()), this, SLOT(slotBeforeFormDestroyed())); + connect(m_form, TQT_SIGNAL(destroying()), this, TQT_SLOT(slotBeforeFormDestroyed())); // Creates the hidden top Item m_topItem = new ObjectTreeViewItem(this); @@ -354,20 +354,20 @@ ObjectTreeView::slotBeforeFormDestroyed() } ObjectTreeViewItem* -ObjectTreeView::loadTree(ObjectTreeItem *item, ObjectTreeViewItem *parent) +ObjectTreeView::loadTree(ObjectTreeItem *item, ObjectTreeViewItem *tqparent) { if(!item) return 0; - ObjectTreeViewItem *treeItem = new ObjectTreeViewItem(parent, item); + ObjectTreeViewItem *treeItem = new ObjectTreeViewItem(tqparent, item); treeItem->setOpen(true); // The item is inserted by default at the beginning, but we want it to be at the end, so we move it - QListViewItem *last = parent->firstChild(); + TQListViewItem *last = tqparent->firstChild(); while(last->nextSibling()) last = last->nextSibling(); treeItem->moveItem(last); - ObjectTreeList *list = item->children(); + ObjectTreeList *list = item->tqchildren(); for(ObjectTreeItem *it = list->first(); it; it = list->next()) loadTree(it, treeItem); diff --git a/kexi/formeditor/objecttreeview.h b/kexi/formeditor/objecttreeview.h index 393f3ba0..46266144 100644 --- a/kexi/formeditor/objecttreeview.h +++ b/kexi/formeditor/objecttreeview.h @@ -31,12 +31,12 @@ class Form; class KFORMEDITOR_EXPORT ObjectTreeViewItem : public KListViewItem { public: - ObjectTreeViewItem(ObjectTreeViewItem *parent, ObjectTreeItem *item); + ObjectTreeViewItem(ObjectTreeViewItem *tqparent, ObjectTreeItem *item); ObjectTreeViewItem(KListView *list, ObjectTreeItem *item=0); virtual ~ObjectTreeViewItem(); //! \return the item name, ie the ObjectTreeItem name - QString name() const; + TQString name() const; //! \return the ObjectTreeItem associated to this item. ObjectTreeItem* objectTree() const { return m_item; } @@ -45,10 +45,10 @@ class KFORMEDITOR_EXPORT ObjectTreeViewItem : public KListViewItem protected: //! Reimplemented to draw custom contents (copied from Property Editor) - virtual void paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align); + virtual void paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align); //! Reimplemented to draw custom contents (copied from Property Editor) - virtual void paintBranches(QPainter *p, const QColorGroup &cg, int w, int y, int h); + virtual void paintBranches(TQPainter *p, const TQColorGroup &cg, int w, int y, int h); //! Reimplemented to draw custom contents (copied from Property Editor) virtual void setup(); @@ -67,12 +67,13 @@ class KFORMEDITOR_EXPORT ObjectTreeViewItem : public KListViewItem class KFORMEDITOR_EXPORT ObjectTreeView : public KListView { Q_OBJECT + TQ_OBJECT public: - ObjectTreeView(QWidget *parent=0, const char *name=0, bool tabStop = false); + ObjectTreeView(TQWidget *tqparent=0, const char *name=0, bool tabStop = false); virtual ~ObjectTreeView(); - virtual QSize sizeHint() const; + virtual TQSize tqsizeHint() const; /*! Sets \a form as the current Form in the list. The list will automatically be filled with an item for each widget in the Form, and selection will be synced. @@ -81,26 +82,26 @@ class KFORMEDITOR_EXPORT ObjectTreeView : public KListView void setForm(Form *form); //! \return the pixmap name for a given class, to be shown next to the widget name. - QString iconNameForClass(const QCString &classname); + TQString iconNameForClass(const TQCString &classname); public slots: /*! Sets the widget \a w as selected item, so it will be written bold. It is added to current selection if \a add is true. */ - void setSelectedWidget(QWidget *w, bool add=false); + void setSelectedWidget(TQWidget *w, bool add=false); - /*! Adds the ObjectTreeItem \a item in the list, with the appropriate parent. */ + /*! Adds the ObjectTreeItem \a item in the list, with the appropriate tqparent. */ void addItem(ObjectTreeItem *item); /*! Removess the ObjectTreeItem \a item from the list. */ void removeItem(ObjectTreeItem *item); /*! Just renames the list item from \a oldname to \a newname. */ - void renameItem(const QCString &oldname, const QCString &newname); + void renameItem(const TQCString &oldname, const TQCString &newname); protected slots: /*! This slot is called when the user right-click a list item. The widget context menu is shown, as inisde the Form. */ - void displayContextMenu(KListView *list, QListViewItem *item, const QPoint &p); + void displayContextMenu(KListView *list, TQListViewItem *item, const TQPoint &p); void slotColumnSizeChanged(int); @@ -112,10 +113,10 @@ class KFORMEDITOR_EXPORT ObjectTreeView : public KListView protected: //! Internal function to fill the list. - ObjectTreeViewItem* loadTree(ObjectTreeItem *item, ObjectTreeViewItem *parent); + ObjectTreeViewItem* loadTree(ObjectTreeItem *item, ObjectTreeViewItem *tqparent); //! \return The item whose name is \a name. - ObjectTreeViewItem* findItem(const QString &name); + ObjectTreeViewItem* findItem(const TQString &name); private: Form *m_form; diff --git a/kexi/formeditor/resizehandle.cpp b/kexi/formeditor/resizehandle.cpp index 0731926f..ac1cb4cb 100644 --- a/kexi/formeditor/resizehandle.cpp +++ b/kexi/formeditor/resizehandle.cpp @@ -20,8 +20,8 @@ #include <kdebug.h> #include <klocale.h> -#include <qpainter.h> -#include <qcursor.h> +#include <tqpainter.h> +#include <tqcursor.h> #include "form.h" #include "formmanager.h" @@ -36,9 +36,9 @@ using namespace KFormDesigner; ResizeHandle::ResizeHandle(ResizeHandleSet *set, HandlePos pos, bool editing) - : QWidget(set->m_widget->parentWidget()), m_set(set) + : TQWidget(set->m_widget->tqparentWidget()), m_set(set) { -// setBackgroundMode(Qt::NoBackground); +// setBackgroundMode(TQt::NoBackground); m_dragging = false; //m_editing = editing; setEditingMode(editing); @@ -72,53 +72,53 @@ void ResizeHandle::updatePos() { case TopLeft: move(m_set->m_widget->x() - 3, m_set->m_widget->y() - 3); - setCursor(QCursor(SizeFDiagCursor)); + setCursor(TQCursor(SizeFDiagCursor)); break; case TopCenter: move(m_set->m_widget->x() + m_set->m_widget->width()/2 - 3, m_set->m_widget->y() - 3); - setCursor(QCursor(SizeVerCursor)); + setCursor(TQCursor(SizeVerCursor)); break; case TopRight: move(m_set->m_widget->x() + m_set->m_widget->width() - 3, m_set->m_widget->y() - 3); - setCursor(QCursor(SizeBDiagCursor)); + setCursor(TQCursor(SizeBDiagCursor)); break; case LeftCenter: move(m_set->m_widget->x() - 3, m_set->m_widget->y() + m_set->m_widget->height()/2 - 3); - setCursor(QCursor(SizeHorCursor)); + setCursor(TQCursor(SizeHorCursor)); break; case RightCenter: move(m_set->m_widget->x() + m_set->m_widget->width() - 3, m_set->m_widget->y() + m_set->m_widget->height()/2 - 3); - setCursor(QCursor(SizeHorCursor)); + setCursor(TQCursor(SizeHorCursor)); break; case BottomLeft: move(m_set->m_widget->x() - 3, m_set->m_widget->y() + m_set->m_widget->height() - 3); - setCursor(QCursor(SizeBDiagCursor)); + setCursor(TQCursor(SizeBDiagCursor)); break; case BottomCenter: move(m_set->m_widget->x() + m_set->m_widget->width()/2 - 3, m_set->m_widget->y() + m_set->m_widget->height() - 3); - setCursor(QCursor(SizeVerCursor)); + setCursor(TQCursor(SizeVerCursor)); break; case BottomRight: move(m_set->m_widget->x() + m_set->m_widget->width() - 3, m_set->m_widget->y() + m_set->m_widget->height() - 3); - setCursor(QCursor(SizeFDiagCursor)); + setCursor(TQCursor(SizeFDiagCursor)); break; } } -bool ResizeHandle::eventFilter(QObject *o, QEvent *ev) +bool ResizeHandle::eventFilter(TQObject *o, TQEvent *ev) { - if (((ev->type() == QEvent::Move) || (ev->type() == QEvent::Resize)) && o == m_set->m_widget) + if (((ev->type() == TQEvent::Move) || (ev->type() == TQEvent::Resize)) && o == m_set->m_widget) { - //QTimer::singleShot(0,this,SLOT(updatePos())); + //TQTimer::singleShot(0,this,TQT_SLOT(updatePos())); updatePos(); } -/* else if (ev->type() == QEvent::Paint && o == this) { - QPainter p; +/* else if (ev->type() == TQEvent::Paint && o == this) { + TQPainter p; p.begin(m_set->m_widget, true); const bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); - p.setPen(QPen(white, 10)); + p.setPen(TQPen(white, 10)); p.setRasterOp(XorROP); p.drawRect( 20, 20, 100, 100 );//m_set->m_widget->x(), m_set->m_widget->y(), 150, 150 ); p.drawRect( m_set->m_widget->x(), m_set->m_widget->y(), 150, 150 ); @@ -131,7 +131,7 @@ bool ResizeHandle::eventFilter(QObject *o, QEvent *ev) return false; } -void ResizeHandle::mousePressEvent(QMouseEvent *ev) +void ResizeHandle::mousePressEvent(TQMouseEvent *ev) { const bool startDragging = !m_dragging; m_dragging = true; @@ -145,7 +145,7 @@ void ResizeHandle::mousePressEvent(QMouseEvent *ev) } } -void ResizeHandle::mouseMoveEvent(QMouseEvent *ev) +void ResizeHandle::mouseMoveEvent(TQMouseEvent *ev) { int gridX = m_set->m_form->gridSize(); int gridY = m_set->m_form->gridSize(); @@ -161,7 +161,7 @@ void ResizeHandle::mouseMoveEvent(QMouseEvent *ev) int dummyx = ev->x() - m_x; int dummyy = ev->y() - m_y; - if(FormManager::self()->snapWidgetsToGrid() && (ev->state() != (LeftButton|ControlButton|AltButton))) + if(FormManager::self()->snapWidgetsToGrid() && (ev->state() != (Qt::LeftButton|ControlButton|AltButton))) { dummyy = (int) ( ((float)dummyy) / ((float)gridY) + 0.5 ); dummyy *= gridY; @@ -220,22 +220,22 @@ void ResizeHandle::mouseMoveEvent(QMouseEvent *ev) tmph = MINIMUM_HEIGHT; } - // Do not resize a widget outside of parent boundaries + // Do not resize a widget outside of tqparent boundaries if(tmpx < 0) { tmpw += tmpx; tmpx = 0; } - else if(tmpx + tmpw > m_set->m_widget->parentWidget()->width()) - tmpw = m_set->m_widget->parentWidget()->width() - tmpx; + else if(tmpx + tmpw > m_set->m_widget->tqparentWidget()->width()) + tmpw = m_set->m_widget->tqparentWidget()->width() - tmpx; if(tmpy < 0) { tmph += tmpy; tmpy = 0; } - else if(tmpy + tmph > m_set->m_widget->parentWidget()->height()) - tmph = m_set->m_widget->parentWidget()->height() - tmpy; + else if(tmpy + tmph > m_set->m_widget->tqparentWidget()->height()) + tmph = m_set->m_widget->tqparentWidget()->height() - tmpy; const bool shouldBeMoved = (tmpx != m_set->m_widget->x()) || (tmpy != m_set->m_widget->y()); const bool shouldBeResized = (tmpw != m_set->m_widget->width()) || (tmph != m_set->m_widget->height()); @@ -246,7 +246,7 @@ void ResizeHandle::mouseMoveEvent(QMouseEvent *ev) // Resize it if (shouldBeResized) { - // Keep a QSize(10, 10) minimum size + // Keep a TQSize(10, 10) minimum size tmpw = (tmpw < MINIMUM_WIDTH) ? MINIMUM_WIDTH : tmpw; tmph = (tmph < MINIMUM_HEIGHT) ? MINIMUM_HEIGHT : tmph; m_set->m_widget->resize(tmpw,tmph); @@ -260,28 +260,28 @@ void ResizeHandle::mouseMoveEvent(QMouseEvent *ev) m_set->m_widget->show(); } -void ResizeHandle::mouseReleaseEvent(QMouseEvent *) +void ResizeHandle::mouseReleaseEvent(TQMouseEvent *) { m_dragging = false; } -void ResizeHandle::paintEvent( QPaintEvent * ) +void ResizeHandle::paintEvent( TQPaintEvent * ) { //draw XORed background - /*QPainter p(this); + /*TQPainter p(this); p.setRasterOp(XorROP); - p.fillRect(QRect(0, 0, 6, 6),white); - bitBlt( this, QPoint(0,0), parentWidget(), rect(), XorROP);*/ + p.fillRect(TQRect(0, 0, 6, 6),white); + bitBlt( this, TQPoint(0,0), tqparentWidget(), rect(), XorROP);*/ } /////////////// ResizeHandleSet ////////////////// -ResizeHandleSet::ResizeHandleSet(QWidget *modify, Form *form, bool editing) -: QObject(modify->parentWidget()), /*m_widget(modify),*/ m_form(form) +ResizeHandleSet::ResizeHandleSet(TQWidget *modify, Form *form, bool editing) +: TQObject(modify->tqparentWidget()), /*m_widget(modify),*/ m_form(form) { m_widget = 0; - /*QWidget *parent = modify->parentWidget(); + /*TQWidget *tqparent = modify->tqparentWidget(); handles[0] = new ResizeHandle( modify, ResizeHandle::TopLeft, editing); handles[1] = new ResizeHandle( modify, ResizeHandle::TopCenter, editing); @@ -301,7 +301,7 @@ ResizeHandleSet::~ResizeHandleSet() } void -ResizeHandleSet::setWidget(QWidget *modify, bool editing) +ResizeHandleSet::setWidget(TQWidget *modify, bool editing) { if(modify == m_widget) return; diff --git a/kexi/formeditor/resizehandle.h b/kexi/formeditor/resizehandle.h index 15ddbf36..85390fe1 100644 --- a/kexi/formeditor/resizehandle.h +++ b/kexi/formeditor/resizehandle.h @@ -20,9 +20,9 @@ #ifndef KFE_RESIZEHANDLER_H #define KFE_RESIZEHANDLER_H -#include <qdict.h> -#include <qguardedptr.h> -#include <qwidget.h> +#include <tqdict.h> +#include <tqguardedptr.h> +#include <tqwidget.h> /** *@author Joseph Wenninger @@ -38,9 +38,10 @@ class ResizeHandleSet; * a single widget which represents a dot for resizing a widget * @author Joseph Wenninger */ -class KFORMEDITOR_EXPORT ResizeHandle : public QWidget +class KFORMEDITOR_EXPORT ResizeHandle : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum HandlePos { TopLeft = 0, TopCenter = 2, TopRight = 4, LeftCenter = 8, RightCenter = 16, @@ -50,19 +51,19 @@ class KFORMEDITOR_EXPORT ResizeHandle : public QWidget void setEditingMode(bool editing); protected: - virtual void mousePressEvent(QMouseEvent *ev); - virtual void mouseMoveEvent(QMouseEvent *ev); - virtual void mouseReleaseEvent(QMouseEvent *ev); - virtual void paintEvent( QPaintEvent *ev ); + virtual void mousePressEvent(TQMouseEvent *ev); + virtual void mouseMoveEvent(TQMouseEvent *ev); + virtual void mouseReleaseEvent(TQMouseEvent *ev); + virtual void paintEvent( TQPaintEvent *ev ); protected slots: - bool eventFilter(QObject *obj, QEvent *ev); + bool eventFilter(TQObject *obj, TQEvent *ev); void updatePos(); private: ResizeHandleSet *m_set; HandlePos m_pos; - //QWidget *m_buddy; + //TQWidget *m_buddy; bool m_dragging; //bool m_editing; int m_x; @@ -73,25 +74,26 @@ class KFORMEDITOR_EXPORT ResizeHandle : public QWidget * a set of resize handles (for resizing widgets) * @author Joseph Wenninger */ -class KFORMEDITOR_EXPORT ResizeHandleSet: public QObject +class KFORMEDITOR_EXPORT ResizeHandleSet: public TQObject { Q_OBJECT + TQ_OBJECT public: - typedef QDict<ResizeHandleSet> Dict; + typedef TQDict<ResizeHandleSet> Dict; - ResizeHandleSet(QWidget *modify, Form *form, bool editing = false); + ResizeHandleSet(TQWidget *modify, Form *form, bool editing = false); ~ResizeHandleSet(); - void setWidget(QWidget *modify, bool editing = false); - QWidget *widget() const { return m_widget; } + void setWidget(TQWidget *modify, bool editing = false); + TQWidget *widget() const { return m_widget; } void raise(); void setEditingMode(bool editing); private: - QGuardedPtr<ResizeHandle> m_handles[8]; - QGuardedPtr<QWidget> m_widget; - QGuardedPtr<Form> m_form; + TQGuardedPtr<ResizeHandle> m_handles[8]; + TQGuardedPtr<TQWidget> m_widget; + TQGuardedPtr<Form> m_form; bool m_editing; friend class ResizeHandle; diff --git a/kexi/formeditor/richtextdialog.cpp b/kexi/formeditor/richtextdialog.cpp index f4596ed5..74a31ab0 100644 --- a/kexi/formeditor/richtextdialog.cpp +++ b/kexi/formeditor/richtextdialog.cpp @@ -16,7 +16,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include <qlayout.h> +#include <tqlayout.h> #include <ktoolbar.h> #include <kfontcombo.h> @@ -33,11 +33,11 @@ namespace KFormDesigner { //////////////// A simple dialog to edit rich text //////////////////////////// ////////////////////////////////////////////////////////////////////////////////// -RichTextDialog::RichTextDialog(QWidget *parent, const QString &text) -: KDialogBase(parent, "richtext_dialog", true, i18n("Edit Rich Text"), Ok|Cancel, Ok, false) +RichTextDialog::RichTextDialog(TQWidget *tqparent, const TQString &text) +: KDialogBase(tqparent, "richtext_dialog", true, i18n("Edit Rich Text"), Ok|Cancel, Ok, false) { - QFrame *frame = makeMainWidget(); - QVBoxLayout *l = new QVBoxLayout(frame); + TQFrame *frame = makeMainWidget(); + TQVBoxLayout *l = new TQVBoxLayout(frame); l->setAutoAdd(true); m_toolbar = new KToolBar(frame); @@ -46,13 +46,13 @@ RichTextDialog::RichTextDialog(QWidget *parent, const QString &text) m_fcombo = new KFontCombo(m_toolbar); m_toolbar->insertWidget(TBFont, 40, m_fcombo); - connect(m_fcombo, SIGNAL(textChanged(const QString&)), this, SLOT(changeFont(const QString &))); + connect(m_fcombo, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(changeFont(const TQString &))); m_toolbar->insertSeparator(); m_colCombo = new KColorCombo(m_toolbar); m_toolbar->insertWidget(TBColor, 30, m_colCombo); - connect(m_colCombo, SIGNAL(activated(const QColor&)), this, SLOT(changeColor(const QColor&))); + connect(m_colCombo, TQT_SIGNAL(activated(const TQColor&)), this, TQT_SLOT(changeColor(const TQColor&))); m_toolbar->insertButton("text_bold", TBBold, true, i18n("Bold")); m_toolbar->insertButton("text_italic", TBItalic, true, i18n("Italic")); @@ -82,36 +82,36 @@ RichTextDialog::RichTextDialog(QWidget *parent, const QString &text) m_toolbar->setToggle(TBJustify, true); group->addButton(TBJustify); - connect(m_toolbar, SIGNAL(toggled(int)), this, SLOT(buttonToggled(int))); + connect(m_toolbar, TQT_SIGNAL(toggled(int)), this, TQT_SLOT(buttonToggled(int))); - m_edit = new KTextEdit(text, QString::null, frame, "richtext_edit"); + m_edit = new KTextEdit(text, TQString(), frame, "richtext_edit"); m_edit->setTextFormat(RichText); m_edit->setFocus(); - connect(m_edit, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(cursorPositionChanged(int, int))); - connect(m_edit, SIGNAL(clicked(int, int)), this, SLOT(cursorPositionChanged(int, int))); - connect(m_edit, SIGNAL(currentVerticalAlignmentChanged(VerticalAlignment)), this, SLOT(slotVerticalAlignmentChanged(VerticalAlignment))); + connect(m_edit, TQT_SIGNAL(cursorPositionChanged(int, int)), this, TQT_SLOT(cursorPositionChanged(int, int))); + connect(m_edit, TQT_SIGNAL(clicked(int, int)), this, TQT_SLOT(cursorPositionChanged(int, int))); + connect(m_edit, TQT_SIGNAL(currentVerticalAlignmentChanged(VerticalAlignment)), this, TQT_SLOT(slotVerticalAlignmentChanged(VerticalAlignment))); - m_edit->moveCursor(QTextEdit::MoveEnd, false); + m_edit->moveCursor(TQTextEdit::MoveEnd, false); cursorPositionChanged(0, 0); m_edit->show(); frame->show(); } -QString +TQString RichTextDialog::text() { return m_edit->text(); } void -RichTextDialog::changeFont(const QString &font) +RichTextDialog::changeFont(const TQString &font) { m_edit->setFamily(font); } void -RichTextDialog::changeColor(const QColor &color) +RichTextDialog::changeColor(const TQColor &color) { m_edit->setColor(color); } @@ -130,14 +130,14 @@ RichTextDialog::buttonToggled(int id) { if(isOn && m_toolbar->isButtonOn(TBSub)) m_toolbar->setButton(TBSub, false); - m_edit->setVerticalAlignment(isOn ? QTextEdit::AlignSuperScript : QTextEdit::AlignNormal); + m_edit->setVerticalAlignment(isOn ? TQTextEdit::AlignSuperScript : TQTextEdit::AlignNormal); break; } case TBSub: { if(isOn && m_toolbar->isButtonOn(TBSuper)) m_toolbar->setButton(TBSuper, false); - m_edit->setVerticalAlignment(isOn ? QTextEdit::AlignSubScript : QTextEdit::AlignNormal); + m_edit->setVerticalAlignment(isOn ? TQTextEdit::AlignSubScript : TQTextEdit::AlignNormal); break; } case TBLeft: case TBCenter: @@ -146,10 +146,10 @@ RichTextDialog::buttonToggled(int id) if(!isOn) break; switch(id) { - case TBLeft: m_edit->setAlignment(Qt::AlignLeft); break; - case TBCenter: m_edit->setAlignment(Qt::AlignCenter); break; - case TBRight: m_edit->setAlignment(Qt::AlignRight); break; - case TBJustify: m_edit->setAlignment(Qt::AlignJustify); break; + case TBLeft: m_edit->tqsetAlignment(TQt::AlignLeft); break; + case TBCenter: m_edit->tqsetAlignment(TQt::AlignCenter); break; + case TBRight: m_edit->tqsetAlignment(TQt::AlignRight); break; + case TBJustify: m_edit->tqsetAlignment(TQt::AlignJustify); break; default: break; } } @@ -168,12 +168,12 @@ RichTextDialog::cursorPositionChanged(int, int) m_toolbar->setButton(TBUnder, m_edit->underline()); int id = 0; - switch(m_edit->alignment()) + switch(m_edit->tqalignment()) { - case Qt::AlignLeft: id = TBLeft; break; - case Qt::AlignCenter: id = TBCenter; break; - case Qt::AlignRight: id = TBRight; break; - case Qt::AlignJustify: id = TBJustify; break; + case TQt::AlignLeft: id = TBLeft; break; + case TQt::AlignCenter: id = TBCenter; break; + case TQt::AlignRight: id = TBRight; break; + case TQt::AlignJustify: id = TBJustify; break; default: id = TBLeft; break; } m_toolbar->setButton(id, true); @@ -184,13 +184,13 @@ RichTextDialog::slotVerticalAlignmentChanged(VerticalAlignment align) { switch(align) { - case QTextEdit::AlignSuperScript: + case TQTextEdit::AlignSuperScript: { m_toolbar->setButton(TBSuper, true); m_toolbar->setButton(TBSub, false); break; } - case QTextEdit::AlignSubScript: + case TQTextEdit::AlignSubScript: { m_toolbar->setButton(TBSub, true); m_toolbar->setButton(TBSuper, false); diff --git a/kexi/formeditor/richtextdialog.h b/kexi/formeditor/richtextdialog.h index 83c96464..66a04e16 100644 --- a/kexi/formeditor/richtextdialog.h +++ b/kexi/formeditor/richtextdialog.h @@ -30,22 +30,23 @@ class KColorCombo; namespace KFormDesigner { //! A simple dialog to edit rich text -/*! It allows to change font name, style and color, alignment. */ +/*! It allows to change font name, style and color, tqalignment. */ class KFORMEDITOR_EXPORT RichTextDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - RichTextDialog(QWidget *parent, const QString &text); + RichTextDialog(TQWidget *tqparent, const TQString &text); ~RichTextDialog(){;} - QString text(); + TQString text(); - enum VerticalAlignment{AlignNormal = QTextEdit::AlignNormal, AlignSuperScript = QTextEdit::AlignSuperScript, AlignSubScript = QTextEdit::AlignSubScript}; + enum VerticalAlignment{AlignNormal = TQTextEdit::AlignNormal, AlignSuperScript = TQTextEdit::AlignSuperScript, AlignSubScript = TQTextEdit::AlignSubScript}; public slots: - void changeFont(const QString &); - void changeColor(const QColor&); + void changeFont(const TQString &); + void changeColor(const TQColor&); void buttonToggled(int); void cursorPositionChanged(int, int); void slotVerticalAlignmentChanged(VerticalAlignment align); diff --git a/kexi/formeditor/scripting/formscript.cpp b/kexi/formeditor/scripting/formscript.cpp index b598066e..1123e093 100644 --- a/kexi/formeditor/scripting/formscript.cpp +++ b/kexi/formeditor/scripting/formscript.cpp @@ -32,7 +32,7 @@ using namespace KFormDesigner; FormScript::FormScript(Form *form, ScriptManager *manager, const char *name) - : QObject(manager, name), m_manager(manager), m_form(form) + : TQObject(manager, name), m_manager(manager), m_form(form) { m_script = manager->krossManager()->getScriptContainer(form->widget()->name()); } @@ -41,37 +41,37 @@ FormScript::~FormScript() { } -QString -FormScript::getCode(const QString &) +TQString +FormScript::getCode(const TQString &) { /// \todo Allow to select only one function return m_script->getCode(); } void -FormScript::setCode(const QString &code) +FormScript::setCode(const TQString &code) { m_script->setCode(code); } void -FormScript::appendCode(const QString &code) +FormScript::appendCode(const TQString &code) { - QString s = m_script->getCode(); + TQString s = m_script->getCode(); s.append("\n"); s.append(code); m_script->setCode(s); } bool -FormScript::execute(const QString &functionName) +FormScript::execute(const TQString &functionName) { /// \todo support return value and arguments try { m_script->callFunction(functionName); } catch(Kross::Api::Exception& e) { - kdDebug() << QString("EXCEPTION type='%1' description='%2'").arg(e.type()).arg(e.description()) << endl; + kdDebug() << TQString("EXCEPTION type='%1' description='%2'").tqarg(e.type()).tqarg(e.description()) << endl; return false; } return true; @@ -82,16 +82,16 @@ FormScript::connectEvents() { if(!m_form || !m_form->objectTree()) return; - // first call addQObject for each widget in the Form + // first call addTQObject for each widget in the Form ObjectTreeDict *dict = m_form->objectTree()->dict(); ObjectTreeDictIterator it(*dict); for(; it.current(); ++it) - m_script->addQObject(it.current()->widget()); - m_script->addQObject(m_form->widget()); + m_script->addTQObject(it.current()->widget()); + m_script->addTQObject(m_form->widget()); // Then we connect all signals - QValueListConstIterator<Event*> endIt = m_list.constEnd(); - for(QValueListConstIterator<Event*> it = m_list.constBegin(); it != endIt; ++it) { + TQValueListConstIterator<Event*> endIt = m_list.constEnd(); + for(TQValueListConstIterator<Event*> it = m_list.constBegin(); it != endIt; ++it) { if( (*it)->type() == Event::Slot) { connect((*it)->sender(), (*it)->signal(), (*it)->receiver(), (*it)->slot()); } diff --git a/kexi/formeditor/scripting/formscript.h b/kexi/formeditor/scripting/formscript.h index e3d63d74..4247ca85 100644 --- a/kexi/formeditor/scripting/formscript.h +++ b/kexi/formeditor/scripting/formscript.h @@ -22,8 +22,8 @@ #include "kexievents.h" -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include <ksharedptr.h> class ScriptManager; @@ -41,9 +41,10 @@ namespace Kross { using namespace KFormDesigner; //! A class that stores the code and events related to a single form -class FormScript : public QObject +class FormScript : public TQObject { Q_OBJECT + TQ_OBJECT public: FormScript(Form *form, ScriptManager *manager, const char *name=0); @@ -53,16 +54,16 @@ class FormScript : public QObject Kross::Api::ScriptContainer* scriptContainer() { return m_script; } /*! \return The code of funtionName. If parameter is empty, it returns the full code of this form.*/ - QString getCode(const QString &functionName=QString::null); + TQString getCode(const TQString &functionName=TQString()); /*! Replaces the actual form code with the string \a code. Called eg by (future) script editor. */ - void setCode(const QString &code); + void setCode(const TQString &code); /*! Adds the string \a code at the end of current code. Used to add a function in the script. */ - void appendCode(const QString &code); + void appendCode(const TQString &code); /*! Executes the \a functionName. \todo how do we give parameters? */ - bool execute(const QString &functionName); + bool execute(const TQString &functionName); /*! Really connects all events in the list. Also calls Kross;;Api::Manager::addObject for each widget in the form to allow the user to use these widgets in the script. */ diff --git a/kexi/formeditor/scripting/scriptIO.cpp b/kexi/formeditor/scripting/scriptIO.cpp index 8620a8ae..ee0b1f59 100644 --- a/kexi/formeditor/scripting/scriptIO.cpp +++ b/kexi/formeditor/scripting/scriptIO.cpp @@ -27,30 +27,30 @@ #include "main/scriptcontainer.h" bool -ScriptIO::saveFormEvents(QDomNode &parentNode, FormScript *formScript) +ScriptIO::saveFormEvents(TQDomNode &tqparentNode, FormScript *formScript) { - QDomDocument domDoc = parentNode.ownerDocument(); + TQDomDocument domDoc = tqparentNode.ownerDocument(); // Save the form's code if(!formScript->getCode().isEmpty()) { - QDomElement script = domDoc.createElement("script"); + TQDomElement script = domDoc.createElement("script"); script.setAttribute("language", formScript->scriptContainer()->getInterpreterName()); - parentNode.appendChild(script); - QDomText scriptCode = domDoc.createTextNode(formScript->getCode()); + tqparentNode.appendChild(script); + TQDomText scriptCode = domDoc.createTextNode(formScript->getCode()); script.appendChild(scriptCode); } // Save all form events if(!formScript->eventList()->isEmpty()) - saveEventList(formScript->eventList(), parentNode); + saveEventList(formScript->eventList(), tqparentNode); return true; } bool -ScriptIO::loadFormEvents(QDomNode &parentNode, Form *form, ScriptManager *manager) +ScriptIO::loadFormEvents(TQDomNode &tqparentNode, Form *form, ScriptManager *manager) { - QDomElement script = parentNode.namedItem("script").toElement(); - QDomElement events = parentNode.namedItem("events").toElement(); + TQDomElement script = tqparentNode.namedItem("script").toElement(); + TQDomElement events = tqparentNode.namedItem("events").toElement(); // Load script code FormScript *formScript = new FormScript(form, manager); @@ -61,14 +61,14 @@ ScriptIO::loadFormEvents(QDomNode &parentNode, Form *form, ScriptManager *manage // Load all events in the EventList if(!events.isNull()) { - for(QDomNode n = events.firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = events.firstChild(); !n.isNull(); n = n.nextSibling()) loadEvent(n, formScript->eventList(), form); } return true; } bool -ScriptIO::saveAllEventsForWidget(QObject *widget, FormScript *formScript, QDomNode &node) +ScriptIO::saveAllEventsForWidget(TQObject *widget, FormScript *formScript, TQDomNode &node) { EventList *l = formScript->eventList()->allEventsForObject(widget); saveEventList(l, node); @@ -76,54 +76,54 @@ ScriptIO::saveAllEventsForWidget(QObject *widget, FormScript *formScript, QDomNo } void -ScriptIO::saveEvent(Event *event, QDomNode &parentNode) +ScriptIO::saveEvent(Event *event, TQDomNode &tqparentNode) { if(!event) return; - QDomDocument domDoc = parentNode.ownerDocument(); - QDomElement eventNode = domDoc.createElement("event"); + TQDomDocument domDoc = tqparentNode.ownerDocument(); + TQDomElement eventNode = domDoc.createElement("event"); eventNode.setAttribute("type", event->type()); - parentNode.appendChild(eventNode); + tqparentNode.appendChild(eventNode); switch(event->type()) { case Event::Slot: { - QDomElement sender = domDoc.createElement("sender"); + TQDomElement sender = domDoc.createElement("sender"); eventNode.appendChild(sender); - QDomText senderText = domDoc.createTextNode(event->sender() ? event->sender()->name() : ""); + TQDomText senderText = domDoc.createTextNode(event->sender() ? event->sender()->name() : ""); sender.appendChild(senderText); - QDomElement signal = domDoc.createElement("signal"); + TQDomElement signal = domDoc.createElement("signal"); eventNode.appendChild(signal); - QDomText signalText = domDoc.createTextNode(event->signal()); + TQDomText signalText = domDoc.createTextNode(event->signal()); signal.appendChild(signalText); - QDomElement receiver = domDoc.createElement("receiver"); + TQDomElement receiver = domDoc.createElement("receiver"); eventNode.appendChild(receiver); - QDomText receiverText = domDoc.createTextNode(event->receiver() ? event->receiver()->name() : ""); + TQDomText receiverText = domDoc.createTextNode(event->receiver() ? event->receiver()->name() : ""); receiver.appendChild(receiverText); - QDomElement slot = domDoc.createElement("slot"); + TQDomElement slot = domDoc.createElement("slot"); eventNode.appendChild(slot); - QDomText slotText = domDoc.createTextNode(event->slot()); + TQDomText slotText = domDoc.createTextNode(event->slot()); slot.appendChild(slotText); break; } case Event::UserFunction: { - QDomElement sender = domDoc.createElement("sender"); + TQDomElement sender = domDoc.createElement("sender"); eventNode.appendChild(sender); - QDomText senderText = domDoc.createTextNode(event->sender() ? event->sender()->name() : ""); + TQDomText senderText = domDoc.createTextNode(event->sender() ? event->sender()->name() : ""); sender.appendChild(senderText); - QDomElement signal = domDoc.createElement("signal"); + TQDomElement signal = domDoc.createElement("signal"); eventNode.appendChild(signal); - QDomText signalText = domDoc.createTextNode(event->signal()); + TQDomText signalText = domDoc.createTextNode(event->signal()); signal.appendChild(signalText); - QDomElement function = domDoc.createElement("function"); + TQDomElement function = domDoc.createElement("function"); eventNode.appendChild(function); - QDomText functionText = domDoc.createTextNode(event->slot()); + TQDomText functionText = domDoc.createTextNode(event->slot()); function.appendChild(functionText); break; } @@ -138,22 +138,22 @@ ScriptIO::saveEvent(Event *event, QDomNode &parentNode) } void -ScriptIO::saveEventList(EventList *list, QDomNode &parentNode) +ScriptIO::saveEventList(EventList *list, TQDomNode &tqparentNode) { if(!list || list->isEmpty()) return; - QDomDocument domDoc = parentNode.ownerDocument(); - QDomElement events = domDoc.createElement("events"); - parentNode.appendChild(events); + TQDomDocument domDoc = tqparentNode.ownerDocument(); + TQDomElement events = domDoc.createElement("events"); + tqparentNode.appendChild(events); - QValueListConstIterator<Event*> endIt = list->constEnd(); - for(QValueListConstIterator<Event*> it = list->constBegin(); it != endIt; ++it) + TQValueListConstIterator<Event*> endIt = list->constEnd(); + for(TQValueListConstIterator<Event*> it = list->constBegin(); it != endIt; ++it) saveEvent((*it), events); } void -ScriptIO::loadEvent(QDomNode &node, EventList *list, Form *form) +ScriptIO::loadEvent(TQDomNode &node, EventList *list, Form *form) { int type = node.toElement().attribute("type").toInt(); Event *event = new Event(); diff --git a/kexi/formeditor/scripting/scriptIO.h b/kexi/formeditor/scripting/scriptIO.h index 9fed06a6..319de0fd 100644 --- a/kexi/formeditor/scripting/scriptIO.h +++ b/kexi/formeditor/scripting/scriptIO.h @@ -20,10 +20,10 @@ #ifndef SCRIPTIO_H #define SCRIPTIO_H -#include <qdom.h> +#include <tqdom.h> -class QString; -class QObject; +class TQString; +class TQObject; class Event; class EventList; class ScriptManager; @@ -41,19 +41,19 @@ class ScriptIO public: /*! Save the evnts of a form. Creates an \<events\> tag, and then one \<event\> tag for each event. - Each event contains \<sender\> and \<receiver\> tags, with attributes depending on event type. */ - static bool saveFormEvents(QDomNode &parentNode, FormScript *script); - /*! Reads the \<events\> tag (\a parentNode), then creates and fills a FormScript object linked to this \a form. + Each event tqcontains \<sender\> and \<receiver\> tags, with attributes depending on event type. */ + static bool saveFormEvents(TQDomNode &tqparentNode, FormScript *script); + /*! Reads the \<events\> tag (\a tqparentNode), then creates and fills a FormScript object linked to this \a form. The new FormScript object is then added to ScriptManager list.*/ - static bool loadFormEvents(QDomNode &parentNode, Form *form, ScriptManager *manager); + static bool loadFormEvents(TQDomNode &tqparentNode, Form *form, ScriptManager *manager); /*! Save only the events related to widget \a name in the FormScript \a fscript. Used eg when copying/pasting widgets to keep also events related to it.*/ - static bool saveAllEventsForWidget(QObject *widget, FormScript *fscript, QDomNode &node); + static bool saveAllEventsForWidget(TQObject *widget, FormScript *fscript, TQDomNode &node); - static void saveEvent(Event *event, QDomNode &parentNode); - static void saveEventList(EventList *list, QDomNode &parentNode); - static void loadEvent(QDomNode &node, EventList *list, Form *form); + static void saveEvent(Event *event, TQDomNode &tqparentNode); + static void saveEventList(EventList *list, TQDomNode &tqparentNode); + static void loadEvent(TQDomNode &node, EventList *list, Form *form); protected: ScriptIO() {;} diff --git a/kexi/formeditor/scripting/scriptmanager.cpp b/kexi/formeditor/scripting/scriptmanager.cpp index c572c685..cfc5df04 100644 --- a/kexi/formeditor/scripting/scriptmanager.cpp +++ b/kexi/formeditor/scripting/scriptmanager.cpp @@ -27,8 +27,8 @@ using KFormDesigner::Form; -ScriptManager::ScriptManager(QObject *parent, const char *name) - : QObject(parent, name) +ScriptManager::ScriptManager(TQObject *tqparent, const char *name) + : TQObject(tqparent, name) { m_manager = Kross::Api::Manager::scriptManager(); m_dict.setAutoDelete(true); @@ -56,8 +56,8 @@ void ScriptManager::setFormManager(FormManager *manager) { m_formManager = manager; - connect(m_formManager, SIGNAL(aboutToDeleteForm(KFormDesigner::Form*)), this, SLOT(slotFormDeleted(KFormDesigner::Form*))); - connect(m_formManager, SIGNAL(formCreated(KFormDesigner::Form*)), this, SLOT(newFormScript(KFormDesigner::Form*))); + connect(m_formManager, TQT_SIGNAL(aboutToDeleteForm(KFormDesigner::Form*)), this, TQT_SLOT(slotFormDeleted(KFormDesigner::Form*))); + connect(m_formManager, TQT_SIGNAL(formCreated(KFormDesigner::Form*)), this, TQT_SLOT(newFormScript(KFormDesigner::Form*))); } void diff --git a/kexi/formeditor/scripting/scriptmanager.h b/kexi/formeditor/scripting/scriptmanager.h index 258ce2cc..bc97ec3c 100644 --- a/kexi/formeditor/scripting/scriptmanager.h +++ b/kexi/formeditor/scripting/scriptmanager.h @@ -20,8 +20,8 @@ #ifndef SCRIPTMANAGER_H #define SCRIPTMANAGER_H -#include <qobject.h> -#include <qptrdict.h> +#include <tqobject.h> +#include <tqptrdict.h> class FormScript; @@ -38,12 +38,13 @@ namespace KFormDesigner { using namespace KFormDesigner; -class ScriptManager : public QObject +class ScriptManager : public TQObject { Q_OBJECT + TQ_OBJECT public: - ScriptManager(QObject *parent=0, const char *name=0); + ScriptManager(TQObject *tqparent=0, const char *name=0); ~ScriptManager(); /*! \return The FormScript object associated to this Form. */ @@ -62,7 +63,7 @@ class ScriptManager : public QObject private: Kross::Api::Manager *m_manager; KFormDesigner::FormManager *m_formManager; - QPtrDict<FormScript> m_dict; + TQPtrDict<FormScript> m_dict; }; #endif diff --git a/kexi/formeditor/spring.cpp b/kexi/formeditor/spring.cpp index e09cc2d7..4bea0294 100644 --- a/kexi/formeditor/spring.cpp +++ b/kexi/formeditor/spring.cpp @@ -18,10 +18,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qsizepolicy.h> -#include <qpainter.h> -#include <qdom.h> -#include <qvariant.h> +#include <tqsizepolicy.h> +#include <tqpainter.h> +#include <tqdom.h> +#include <tqvariant.h> #include <kdebug.h> @@ -33,54 +33,54 @@ #include "spring.h" -Spring::Spring(QWidget *parent, const char *name) - : QWidget(parent, name) +Spring::Spring(TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name) { m_edit = true; - m_orient = Horizontal; - setSizeType((SizeType)QSizePolicy::Expanding); + m_orient =Qt::Horizontal; + setSizeType((SizeType)TQSizePolicy::Expanding); } void -Spring::setOrientation(Orientation orient) +Spring::setOrientation(Qt::Orientation orient) { SizeType type = sizeType(); m_orient = orient; setSizeType(type); - repaint(); + tqrepaint(); } Spring::SizeType Spring::sizeType() const { - if(m_orient == Vertical) - return (SizeType)sizePolicy().verData(); + if(m_orient ==Qt::Vertical) + return (SizeType)tqsizePolicy().verData(); else - return (SizeType)sizePolicy().horData(); + return (SizeType)tqsizePolicy().horData(); } void Spring::setSizeType(SizeType size) { - if(m_orient == Vertical) - setSizePolicy(QSizePolicy::Minimum, (QSizePolicy::SizeType)size); + if(m_orient ==Qt::Vertical) + tqsetSizePolicy(TQSizePolicy::Minimum, (TQSizePolicy::SizeType)size); else - setSizePolicy( (QSizePolicy::SizeType)size, QSizePolicy::Minimum); + tqsetSizePolicy( (TQSizePolicy::SizeType)size, TQSizePolicy::Minimum); } void -Spring::paintEvent(QPaintEvent *ev) +Spring::paintEvent(TQPaintEvent *ev) { if(!m_edit) return; - QPainter p(this); + TQPainter p(this); if(!ev->erased()) p.eraseRect(0,0,width(), height()); - p.setPen(QPen(Qt::white, 1)); - p.setRasterOp(Qt::XorROP); - QPointArray pa(4); - if(m_orient == Vertical) { + p.setPen(TQPen(TQt::white, 1)); + p.setRasterOp(TQt::XorROP); + TQPointArray pa(4); + if(m_orient ==Qt::Vertical) { uint part = (height()+16) / 16; if (part<3) part=3; @@ -113,7 +113,7 @@ Spring::paintEvent(QPaintEvent *ev) } bool -Spring::isPropertyVisible(const QCString &name) +Spring::isPropertyVisible(const TQCString &name) { if((name == "name") || (name == "sizeType") || (name == "orientation") || (name == "geometry")) return true; @@ -123,10 +123,10 @@ Spring::isPropertyVisible(const QCString &name) void -Spring::saveSpring(KFormDesigner::ObjectTreeItem *item, QDomElement &parentNode, QDomDocument &domDoc, bool insideGridLayout) +Spring::saveSpring(KFormDesigner::ObjectTreeItem *item, TQDomElement &tqparentNode, TQDomDocument &domDoc, bool insideGridLayout) { - QDomElement tclass = domDoc.createElement("spacer"); - parentNode.appendChild(tclass); + TQDomElement tclass = domDoc.createElement("spacer"); + tqparentNode.appendChild(tclass); if(insideGridLayout) { @@ -141,13 +141,13 @@ Spring::saveSpring(KFormDesigner::ObjectTreeItem *item, QDomElement &parentNode, KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "name", item->widget()->property("name"), item->widget()); - if(parentNode.tagName() == "widget") + if(tqparentNode.tagName() == "widget") KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "geometry", item->widget()->property("geometry"), item->widget()); - if(!item->widget()->sizeHint().isValid()) - KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "sizeHint", item->widget()->property("size"), item->widget()); + if(!item->widget()->tqsizeHint().isValid()) + KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "tqsizeHint", item->widget()->property("size"), item->widget()); else - KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "sizeHint", item->widget()->property("sizeHint"), item->widget()); + KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "tqsizeHint", item->widget()->property("tqsizeHint"), item->widget()); KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "orientation", item->widget()->property("orientation"), item->widget()); KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "sizeType", item->widget()->property("sizeType"), item->widget()); diff --git a/kexi/formeditor/spring.h b/kexi/formeditor/spring.h index 7ca3d35f..b75249d9 100644 --- a/kexi/formeditor/spring.h +++ b/kexi/formeditor/spring.h @@ -20,10 +20,10 @@ #ifndef SPACER_H #define SPACER_H -#include <qwidget.h> +#include <tqwidget.h> -class QDomElement; -class QDomDocument; +class TQDomElement; +class TQDomDocument; namespace KFormDesigner { @@ -33,12 +33,13 @@ class WidgetLibrary; } -class KFORMEDITOR_EXPORT Spring : public QWidget +class KFORMEDITOR_EXPORT Spring : public TQWidget { Q_OBJECT + TQ_OBJECT Q_ENUMS(SizeType) - Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation) - Q_PROPERTY(SizeType sizeType READ sizeType WRITE setSizeType) + TQ_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) + TQ_PROPERTY(SizeType sizeType READ sizeType WRITE setSizeType) private: enum {HSize = 6, HMask = 0x3f, VMask = HMask << HSize, MayGrow = 1, ExpMask = 2, MayShrink = 4 }; @@ -47,24 +48,24 @@ class KFORMEDITOR_EXPORT Spring : public QWidget Expanding = MinimumExpanding|MayShrink }; public: - Spring(QWidget *parent, const char *name); + Spring(TQWidget *tqparent, const char *name); ~Spring() {;} - static bool isPropertyVisible(const QCString &name); - static void saveSpring(KFormDesigner::ObjectTreeItem *item, QDomElement &parent, QDomDocument &domDoc, bool insideGridLayout); + static bool isPropertyVisible(const TQCString &name); + static void saveSpring(KFormDesigner::ObjectTreeItem *item, TQDomElement &tqparent, TQDomDocument &domDoc, bool insideGridLayout); - void setOrientation(Orientation orient); - Orientation orientation() const { return m_orient;} + void setOrientation(Qt::Orientation orient); + Qt::Orientation orientation() const { return m_orient;} void setSizeType(SizeType size); SizeType sizeType() const; void setPreviewMode() { m_edit = false; } private: - void paintEvent(QPaintEvent *ev); + void paintEvent(TQPaintEvent *ev); private: - Orientation m_orient; + Qt::Orientation m_orient; bool m_edit; }; diff --git a/kexi/formeditor/tabstopdialog.cpp b/kexi/formeditor/tabstopdialog.cpp index 067c333a..6de89b71 100644 --- a/kexi/formeditor/tabstopdialog.cpp +++ b/kexi/formeditor/tabstopdialog.cpp @@ -17,9 +17,9 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include <qlayout.h> -#include <qcheckbox.h> -#include <qtooltip.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqtooltip.h> #include <kiconloader.h> #include <kdebug.h> @@ -37,11 +37,11 @@ using namespace KFormDesigner; ////////// The Tab Stop Dialog to edit tab order /////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// -TabStopDialog::TabStopDialog(QWidget *parent) -: KDialogBase(parent, "tabstop_dialog", true, i18n("Edit Tab Order"), Ok|Cancel, Ok, false) +TabStopDialog::TabStopDialog(TQWidget *tqparent) +: KDialogBase(tqparent, "tabstop_dialog", true, i18n("Edit Tab Order"), Ok|Cancel, Ok, false) { - QFrame *frame = makeMainWidget(); - QGridLayout *l = new QGridLayout(frame, 2, 2, 0, 6); + TQFrame *frame = makeMainWidget(); + TQGridLayout *l = new TQGridLayout(frame, 2, 2, 0, 6); m_treeview = new ObjectTreeView(frame, "tabstops_treeview", true); m_treeview->setItemsMovable(true); m_treeview->setDragEnabled(true); @@ -51,28 +51,28 @@ TabStopDialog::TabStopDialog(QWidget *parent) l->addWidget(m_treeview, 0, 0); m_treeview->m_form = 0; - connect(m_treeview, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(updateButtons(QListViewItem*))); - connect(m_treeview, SIGNAL(moved(QListViewItem*, QListViewItem*, QListViewItem*)), this, SLOT(updateButtons(QListViewItem*))); + connect(m_treeview, TQT_SIGNAL(currentChanged(TQListViewItem*)), this, TQT_SLOT(updateButtons(TQListViewItem*))); + connect(m_treeview, TQT_SIGNAL(moved(TQListViewItem*, TQListViewItem*, TQListViewItem*)), this, TQT_SLOT(updateButtons(TQListViewItem*))); - QVBoxLayout *vbox = new QVBoxLayout(); + TQVBoxLayout *vbox = new TQVBoxLayout(); l->addLayout(vbox, 0, 1); m_btnUp = new KPushButton(SmallIconSet("1uparrow"), i18n("Move Up"), frame); - QToolTip::add( m_btnUp, i18n("Move widget up") ); + TQToolTip::add( m_btnUp, i18n("Move widget up") ); vbox->addWidget(m_btnUp); - connect(m_btnUp, SIGNAL(clicked()), this, SLOT(moveItemUp())); + connect(m_btnUp, TQT_SIGNAL(clicked()), this, TQT_SLOT(moveItemUp())); m_btnDown = new KPushButton(SmallIconSet("1downarrow"), i18n("Move Down"), frame); - QToolTip::add( m_btnDown, i18n("Move widget down") ); + TQToolTip::add( m_btnDown, i18n("Move widget down") ); vbox->addWidget(m_btnDown); - connect(m_btnDown, SIGNAL(clicked()), this, SLOT(moveItemDown())); + connect(m_btnDown, TQT_SIGNAL(clicked()), this, TQT_SLOT(moveItemDown())); vbox->addStretch(); - m_check = new QCheckBox(i18n("Handle tab order automatically"), frame, "tabstops_check"); - connect(m_check, SIGNAL(toggled(bool)), this, SLOT(slotRadioClicked(bool))); + m_check = new TQCheckBox(i18n("Handle tab order automatically"), frame, "tabstops_check"); + connect(m_check, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotRadioClicked(bool))); l->addMultiCellWidget(m_check, 1, 1, 0, 1); updateGeometry(); - setInitialSize(QSize(500+m_btnUp->width(), QMAX(400,m_treeview->height()))); + setInitialSize(TQSize(500+m_btnUp->width(), TQMAX(400,m_treeview->height()))); } TabStopDialog::~TabStopDialog() @@ -99,15 +99,15 @@ int TabStopDialog::exec(Form *form) m_treeview->setSelected(m_treeview->firstChild(), true); } - if (QDialog::Rejected == KDialogBase::exec()) - return QDialog::Rejected; + if (TQDialog::Rejected == KDialogBase::exec()) + return TQDialog::Rejected; //accepted form->setAutoTabStops(m_check->isChecked()); if(form->autoTabStops()) { form->autoAssignTabStops(); - return QDialog::Accepted; + return TQDialog::Accepted; } //add items to the order list @@ -120,7 +120,7 @@ int TabStopDialog::exec(Form *form) form->tabStops()->append(tree); item = (ObjectTreeViewItem*)item->nextSibling(); } - return QDialog::Accepted; + return TQDialog::Accepted; } void @@ -128,7 +128,7 @@ TabStopDialog::moveItemUp() { if (!m_treeview->selectedItem()) return; - QListViewItem *before = m_treeview->selectedItem()->itemAbove(); + TQListViewItem *before = m_treeview->selectedItem()->itemAbove(); before->moveItem(m_treeview->selectedItem()); updateButtons(m_treeview->selectedItem()); } @@ -136,7 +136,7 @@ TabStopDialog::moveItemUp() void TabStopDialog::moveItemDown() { - QListViewItem *item = m_treeview->selectedItem(); + TQListViewItem *item = m_treeview->selectedItem(); if (!item) return; item->moveItem( item->nextSibling()); @@ -144,10 +144,10 @@ TabStopDialog::moveItemDown() } void -TabStopDialog::updateButtons(QListViewItem *item) +TabStopDialog::updateButtons(TQListViewItem *item) { m_btnUp->setEnabled( item && (item->itemAbove() && m_treeview->isEnabled() - /*&& (item->itemAbove()->parent() == item->parent()))*/ )); + /*&& (item->itemAbove()->tqparent() == item->tqparent()))*/ )); m_btnDown->setEnabled( item && item->nextSibling() && m_treeview->isEnabled() ); } diff --git a/kexi/formeditor/tabstopdialog.h b/kexi/formeditor/tabstopdialog.h index 9ae6a88a..52b919be 100644 --- a/kexi/formeditor/tabstopdialog.h +++ b/kexi/formeditor/tabstopdialog.h @@ -22,9 +22,9 @@ #include <kdialogbase.h> -class QListViewItem; -class QCheckBox; -class QToolButton; +class TQListViewItem; +class TQCheckBox; +class TQToolButton; class KPushButton; namespace KFormDesigner { @@ -38,16 +38,17 @@ class ObjectTreeView; class KFORMEDITOR_EXPORT TabStopDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - TabStopDialog(QWidget *parent); + TabStopDialog(TQWidget *tqparent); virtual ~TabStopDialog(); public slots: int exec(KFormDesigner::Form *form); void moveItemUp(); void moveItemDown(); - void updateButtons(QListViewItem*); + void updateButtons(TQListViewItem*); void slotRadioClicked(bool isOn); bool autoTabStops() const; @@ -55,7 +56,7 @@ class KFORMEDITOR_EXPORT TabStopDialog : public KDialogBase protected: ObjectTreeView *m_treeview; KPushButton *m_btnUp, *m_btnDown; - QCheckBox *m_check; + TQCheckBox *m_check; }; } diff --git a/kexi/formeditor/test/kfd_mainwindow.cpp b/kexi/formeditor/test/kfd_mainwindow.cpp index e9d52e47..ab1592e1 100644 --- a/kexi/formeditor/test/kfd_mainwindow.cpp +++ b/kexi/formeditor/test/kfd_mainwindow.cpp @@ -38,7 +38,7 @@ KFDMainWindow::KFDMainWindow() KLibFactory *factory = KLibLoader::self()->factory("libkformdesigner_part"); if (factory) { - QStringList list; + TQStringList list; list << "shell" << "multipleMode"; m_part = static_cast<KParts::ReadWritePart *>( factory->create(this, "kformdesigner_part", "KParts::ReadWritePart", list) ); @@ -59,7 +59,7 @@ KFDMainWindow::KFDMainWindow() } void -KFDMainWindow::loadUIFile(const QString &filename) +KFDMainWindow::loadUIFile(const TQString &filename) { loadUIFile(KURL::fromPathOrURL(filename)); } @@ -73,7 +73,7 @@ KFDMainWindow::loadUIFile(const KURL &url) void KFDMainWindow::setupActions() { - KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); } bool diff --git a/kexi/formeditor/test/kfd_mainwindow.h b/kexi/formeditor/test/kfd_mainwindow.h index 03892a1e..6368c8f2 100644 --- a/kexi/formeditor/test/kfd_mainwindow.h +++ b/kexi/formeditor/test/kfd_mainwindow.h @@ -25,13 +25,14 @@ class KFDMainWindow : public KParts::MainWindow { Q_OBJECT + TQ_OBJECT public: KFDMainWindow(); ~KFDMainWindow() {;} /** @todo change it to bool */ - void loadUIFile(const QString &filename); + void loadUIFile(const TQString &filename); /** @todo change it to bool */ void loadUIFile(const KURL &url); virtual bool queryClose(); diff --git a/kexi/formeditor/test/kfd_part.cpp b/kexi/formeditor/test/kfd_part.cpp index 48832be8..bc481594 100644 --- a/kexi/formeditor/test/kfd_part.cpp +++ b/kexi/formeditor/test/kfd_part.cpp @@ -17,13 +17,13 @@ * Boston, MA 02110-1301, USA. */ -#include <qworkspace.h> -#include <qdockarea.h> -#include <qdockwindow.h> -#include <qhbox.h> -#include <qpainter.h> -#include <qevent.h> -#include <qobjectlist.h> +#include <tqworkspace.h> +#include <tqdockarea.h> +#include <tqdockwindow.h> +#include <tqhbox.h> +#include <tqpainter.h> +#include <tqevent.h> +#include <tqobjectlist.h> #include <kdeversion.h> #include <kaction.h> @@ -98,11 +98,11 @@ KFDFactory::~KFDFactory() } KParts::Part* -KFDFactory::createPartObject( QWidget *parentWidget, const char *, QObject *, const char *name, - const char *classname, const QStringList &args) +KFDFactory::createPartObject( TQWidget *tqparentWidget, const char *, TQObject *, const char *name, + const char *classname, const TQStringList &args) { bool readOnly = (classname == "KParts::ReadOnlyPart"); - KFormDesignerPart *part = new KFormDesignerPart(parentWidget, name, readOnly, args); + KFormDesignerPart *part = new KFormDesignerPart(tqparentWidget, name, readOnly, args); return part; } @@ -123,8 +123,8 @@ KFDFactory::aboutData() KFormDesigner::WidgetLibrary* KFormDesignerPart::static_formsLibrary = 0L; -KFormDesignerPart::KFormDesignerPart(QWidget *parent, const char *name, bool readOnly, const QStringList &args) -: KParts::ReadWritePart(parent, name), m_count(0) +KFormDesignerPart::KFormDesignerPart(TQWidget *tqparent, const char *name, bool readOnly, const TQStringList &args) +: KParts::ReadWritePart(tqparent, name), m_count(0) { setInstance(KFDFactory::instance()); instance()->iconLoader()->addAppDir("kexi"); @@ -138,28 +138,28 @@ KFormDesignerPart::KFormDesignerPart(QWidget *parent, const char *name, bool rea setUniqueFormMode(false); m_inShell = (!args.grep("shell").isEmpty()); - QHBox *container = new QHBox(parent, "kfd_container_widget"); + TQHBox *container = new TQHBox(tqparent, "kfd_container_widget"); - m_workspace = new QWorkspace(container, "kfd_workspace"); + m_workspace = new TQWorkspace(container, "kfd_workspace"); m_workspace->show(); - QStringList supportedFactoryGroups; + TQStringList supportedFactoryGroups; /* @todo add configuration for supported factory groups */ static_formsLibrary = KFormDesigner::FormManager::createWidgetLibrary( new KFDPart_FormManager(this, 0, "kfd_manager"), supportedFactoryGroups ); if(!readOnly) { - QDockArea *dockArea = new QDockArea(Vertical, QDockArea::Reverse, container, "kfd_part_dockarea"); + TQDockArea *dockArea = new TQDockAreaQt::Vertical, TQDockArea::Reverse, container, "kfd_part_dockarea"); - QDockWindow *dockTree = new QDockWindow(dockArea); + TQDockWindow *dockTree = new TQDockWindow(dockArea); KFormDesigner::ObjectTreeView *view = new KFormDesigner::ObjectTreeView(dockTree); dockTree->setWidget(view); dockTree->setCaption(i18n("Objects")); dockTree->setResizeEnabled(true); dockTree->setFixedExtentWidth(256); - QDockWindow *dockEditor = new QDockWindow(dockArea); + TQDockWindow *dockEditor = new TQDockWindow(dockArea); m_editor = new KoProperty::Editor(dockEditor); dockEditor->setWidget(m_editor); dockEditor->setCaption(i18n("Properties")); @@ -172,19 +172,19 @@ KFormDesignerPart::KFormDesignerPart(QWidget *parent, const char *name, bool rea setModified(false); // action stuff -// connect(m_manager, SIGNAL(widgetSelected(KFormDesigner::Form*, bool)), SLOT(slotWidgetSelected(KFormDesigner::Form*, bool))); -// connect(m_manager, SIGNAL(formWidgetSelected(KFormDesigner::Form*)), SLOT(slotFormWidgetSelected(KFormDesigner::Form*))); -// connect(m_manager, SIGNAL(noFormSelected()), SLOT(slotNoFormSelected())); - connect(KFormDesigner::FormManager::self(), SIGNAL(undoEnabled(bool, const QString&)), SLOT(setUndoEnabled(bool, const QString&))); - connect(KFormDesigner::FormManager::self(), SIGNAL(redoEnabled(bool, const QString&)), SLOT(setRedoEnabled(bool, const QString&))); - connect(KFormDesigner::FormManager::self(), SIGNAL(dirty(KFormDesigner::Form*, bool)), this, SLOT(slotFormModified(KFormDesigner::Form*, bool))); +// connect(m_manager, TQT_SIGNAL(widgetSelected(KFormDesigner::Form*, bool)), TQT_SLOT(slotWidgetSelected(KFormDesigner::Form*, bool))); +// connect(m_manager, TQT_SIGNAL(formWidgetSelected(KFormDesigner::Form*)), TQT_SLOT(slotFormWidgetSelected(KFormDesigner::Form*))); +// connect(m_manager, TQT_SIGNAL(noFormSelected()), TQT_SLOT(slotNoFormSelected())); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(undoEnabled(bool, const TQString&)), TQT_SLOT(setUndoEnabled(bool, const TQString&))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(redoEnabled(bool, const TQString&)), TQT_SLOT(setRedoEnabled(bool, const TQString&))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(dirty(KFormDesigner::Form*, bool)), this, TQT_SLOT(slotFormModified(KFormDesigner::Form*, bool))); } container->show(); setWidget(container); - connect(m_workspace, SIGNAL(windowActivated(QWidget*)), KFormDesigner::FormManager::self(), SLOT(windowChanged(QWidget*))); - connect(KFormDesigner::FormManager::self(), SIGNAL(propertySetSwitched(KoProperty::Set*, bool, const QCString&)), - this, SLOT(slotPropertySetSwitched(KoProperty::Set*, bool, const QCString&))); + connect(m_workspace, TQT_SIGNAL(windowActivated(TQWidget*)), KFormDesigner::FormManager::self(), TQT_SLOT(windowChanged(TQWidget*))); + connect(KFormDesigner::FormManager::self(), TQT_SIGNAL(propertySetSwitched(KoProperty::Set*, bool, const TQCString&)), + this, TQT_SLOT(slotPropertySetSwitched(KoProperty::Set*, bool, const TQCString&))); // slotNoFormSelected(); KFormDesigner::FormManager::self()->emitNoFormSelected(); @@ -202,58 +202,58 @@ KFormDesigner::WidgetLibrary* KFormDesignerPart::formsLibrary() void KFormDesignerPart::setupActions() { - KStdAction::open(this, SLOT(open()), actionCollection()); - KStdAction::openNew(this, SLOT(createBlankForm()), actionCollection()); - KStdAction::save(this, SLOT(save()), actionCollection()); - KStdAction::saveAs(this, SLOT(saveAs()), actionCollection()); - KStdAction::cut(KFormDesigner::FormManager::self(), SLOT(cutWidget()), actionCollection()); - KStdAction::copy(KFormDesigner::FormManager::self(), SLOT(copyWidget()), actionCollection()); - KStdAction::paste(KFormDesigner::FormManager::self(), SLOT(pasteWidget()), actionCollection()); - KStdAction::undo(KFormDesigner::FormManager::self(), SLOT(undo()), actionCollection()); - KStdAction::redo(KFormDesigner::FormManager::self(), SLOT(redo()), actionCollection()); - KStdAction::selectAll(KFormDesigner::FormManager::self(), SLOT(selectAll()), actionCollection()); - new KAction(i18n("Clear Widget Contents"), "editclear", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(clearWidgetContent()), actionCollection(), "clear_contents"); - new KAction(i18n("Delete Widget"), "editdelete", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(deleteWidget()), actionCollection(), "edit_delete"); - new KAction(i18n("Preview Form"), "filequickprint", CTRL+Key_T, this, SLOT(slotPreviewForm()), actionCollection(), "preview_form"); - new KAction(i18n("Edit Tab Order"), "tab_order", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(editTabOrder()), actionCollection(), "taborder"); - new KAction(i18n("Edit Pixmap Collection"), "icons", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(editFormPixmapCollection()), actionCollection(), "pixmap_collection"); - new KAction(i18n("Edit Form Connections"), "connections", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(editConnections()), actionCollection(), "form_connections"); - - KActionMenu *layoutMenu = new KActionMenu(i18n("Group Widgets"), "", actionCollection(), "layout_menu"); - layoutMenu->insert(new KAction(i18n("&Horizontally"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutHBox()), actionCollection(), "layout_hbox")); - layoutMenu->insert(new KAction(i18n("&Vertically"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutVBox()), actionCollection(), "layout_vbox")); - layoutMenu->insert(new KAction(i18n("In &Grid"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutGrid()), actionCollection(), "layout_grid")); - layoutMenu->insert(new KAction(i18n("By &Rows"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutHFlow()), actionCollection(), "layout_hflow")); - layoutMenu->insert(new KAction(i18n("By &Columns"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutVFlow()), actionCollection(), "layout_vflow")); - layoutMenu->insert(new KAction(i18n("Horizontally in &Splitter"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutHSplitter()), actionCollection(), "layout_hsplitter")); - layoutMenu->insert(new KAction(i18n("Verti&cally in Splitter"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutVSplitter()), actionCollection(), "layout_vsplitter")); - new KAction(i18n("&Ungroup Widgets"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(breakLayout()), actionCollection(), "break_layout"); + KStdAction::open(this, TQT_SLOT(open()), actionCollection()); + KStdAction::openNew(this, TQT_SLOT(createBlankForm()), actionCollection()); + KStdAction::save(this, TQT_SLOT(save()), actionCollection()); + KStdAction::saveAs(this, TQT_SLOT(saveAs()), actionCollection()); + KStdAction::cut(KFormDesigner::FormManager::self(), TQT_SLOT(cutWidget()), actionCollection()); + KStdAction::copy(KFormDesigner::FormManager::self(), TQT_SLOT(copyWidget()), actionCollection()); + KStdAction::paste(KFormDesigner::FormManager::self(), TQT_SLOT(pasteWidget()), actionCollection()); + KStdAction::undo(KFormDesigner::FormManager::self(), TQT_SLOT(undo()), actionCollection()); + KStdAction::redo(KFormDesigner::FormManager::self(), TQT_SLOT(redo()), actionCollection()); + KStdAction::selectAll(KFormDesigner::FormManager::self(), TQT_SLOT(selectAll()), actionCollection()); + new KAction(i18n("Clear Widget Contents"), "editclear", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(clearWidgetContent()), actionCollection(), "clear_contents"); + new KAction(i18n("Delete Widget"), "editdelete", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(deleteWidget()), actionCollection(), "edit_delete"); + new KAction(i18n("Preview Form"), "filequickprint", CTRL+Key_T, this, TQT_SLOT(slotPreviewForm()), actionCollection(), "preview_form"); + new KAction(i18n("Edit Tab Order"), "tab_order", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(editTabOrder()), actionCollection(), "taborder"); + new KAction(i18n("Edit Pixmap Collection"), "icons", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(editFormPixmapCollection()), actionCollection(), "pixmap_collection"); + new KAction(i18n("Edit Form Connections"), "connections", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(editConnections()), actionCollection(), "form_connections"); + + KActionMenu *tqlayoutMenu = new KActionMenu(i18n("Group Widgets"), "", actionCollection(), "tqlayout_menu"); + tqlayoutMenu->insert(new KAction(i18n("&Horizontally"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutHBox()), actionCollection(), "tqlayout_hbox")); + tqlayoutMenu->insert(new KAction(i18n("&Vertically"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutVBox()), actionCollection(), "tqlayout_vbox")); + tqlayoutMenu->insert(new KAction(i18n("In &Grid"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutGrid()), actionCollection(), "tqlayout_grid")); + tqlayoutMenu->insert(new KAction(i18n("By &Rows"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutHFlow()), actionCollection(), "tqlayout_hflow")); + tqlayoutMenu->insert(new KAction(i18n("By &Columns"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutVFlow()), actionCollection(), "tqlayout_vflow")); + tqlayoutMenu->insert(new KAction(i18n("Horizontally in &Splitter"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutHSplitter()), actionCollection(), "tqlayout_hsplitter")); + tqlayoutMenu->insert(new KAction(i18n("Verti&cally in Splitter"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutVSplitter()), actionCollection(), "tqlayout_vsplitter")); + new KAction(i18n("&Ungroup Widgets"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(breakLayout()), actionCollection(), "break_layout"); /* - new KAction(i18n("Lay Out Widgets &Horizontally"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutHBox()), actionCollection(), "layout_hbox"); - new KAction(i18n("Lay Out Widgets &Vertically"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutVBox()), actionCollection(), "layout_vbox"); - new KAction(i18n("Lay Out Widgets in &Grid"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutGrid()), actionCollection(), "layout_grid"); - new KAction(i18n("Lay Out Widgets H&orizontally in Splitter"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutHSplitter()), actionCollection(), "layout_hsplitter"); - new KAction(i18n("Lay Out Widgets Verti&cally in Splitter"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(layoutVSplitter()), actionCollection(), "layout_vsplitter"); - new KAction(i18n("&Break Layout"), QString::null, KShortcut(0), KFormDesigner::FormManager::self(), SLOT(breakLayout()), actionCollection(), "break_layout"); + new KAction(i18n("Lay Out Widgets &Horizontally"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutHBox()), actionCollection(), "tqlayout_hbox"); + new KAction(i18n("Lay Out Widgets &Vertically"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutVBox()), actionCollection(), "tqlayout_vbox"); + new KAction(i18n("Lay Out Widgets in &Grid"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutGrid()), actionCollection(), "tqlayout_grid"); + new KAction(i18n("Lay Out Widgets H&orizontally in Splitter"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutHSplitter()), actionCollection(), "tqlayout_hsplitter"); + new KAction(i18n("Lay Out Widgets Verti&cally in Splitter"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(tqlayoutVSplitter()), actionCollection(), "tqlayout_vsplitter"); + new KAction(i18n("&Break Layout"), TQString(), KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(breakLayout()), actionCollection(), "break_layout"); */ - new KAction(i18n("Bring Widget to Front"), "raise", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(bringWidgetToFront()), actionCollection(), "format_raise"); - new KAction(i18n("Send Widget to Back"), "lower", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(sendWidgetToBack()), actionCollection(), "format_lower"); + new KAction(i18n("Bring Widget to Front"), "raise", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(bringWidgetToFront()), actionCollection(), "format_raise"); + new KAction(i18n("Send Widget to Back"), "lower", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(sendWidgetToBack()), actionCollection(), "format_lower"); KActionMenu *alignMenu = new KActionMenu(i18n("Align Widgets' Positions"), "aopos2grid", actionCollection(), "align_menu"); - alignMenu->insert( new KAction(i18n("To Left"), "aoleft", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToLeft()), actionCollection(), "align_to_left") ); - alignMenu->insert( new KAction(i18n("To Right"), "aoright", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToRight()), actionCollection(), "align_to_right") ); - alignMenu->insert( new KAction(i18n("To Top"), "aotop", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToTop()), actionCollection(), "align_to_top") ); - alignMenu->insert( new KAction(i18n("To Bottom"), "aobottom", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToBottom()), actionCollection(), "align_to_bottom") ); - alignMenu->insert( new KAction(i18n("To Grid"), "aopos2grid", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(alignWidgetsToGrid()), actionCollection(), "align_to_grid") ); + alignMenu->insert( new KAction(i18n("To Left"), "aoleft", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToLeft()), actionCollection(), "align_to_left") ); + alignMenu->insert( new KAction(i18n("To Right"), "aoright", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToRight()), actionCollection(), "align_to_right") ); + alignMenu->insert( new KAction(i18n("To Top"), "aotop", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToTop()), actionCollection(), "align_to_top") ); + alignMenu->insert( new KAction(i18n("To Bottom"), "aobottom", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToBottom()), actionCollection(), "align_to_bottom") ); + alignMenu->insert( new KAction(i18n("To Grid"), "aopos2grid", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(alignWidgetsToGrid()), actionCollection(), "align_to_grid") ); KActionMenu *sizeMenu = new KActionMenu(i18n("Adjust Widgets' Sizes"), "aogrid", actionCollection(), "adjust_size_menu"); - sizeMenu->insert( new KAction(i18n("To Fit"), "aofit", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustWidgetSize()), actionCollection(), "adjust_to_fit") ); - sizeMenu->insert( new KAction(i18n("To Grid"), "aogrid", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustSizeToGrid()), actionCollection(), "adjust_size_grid") ); - sizeMenu->insert( new KAction(i18n("To Shortest"), "aoshortest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustHeightToSmall()), actionCollection(), "adjust_height_small") ); - sizeMenu->insert( new KAction(i18n("To Tallest"), "aotallest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustHeightToBig()), actionCollection(), "adjust_height_big") ); - sizeMenu->insert( new KAction(i18n("To Narrowest"), "aonarrowest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustWidthToSmall()), actionCollection(), "adjust_width_small") ); - sizeMenu->insert( new KAction(i18n("To Widest"), "aowidest", KShortcut(0), KFormDesigner::FormManager::self(), SLOT(adjustWidthToBig()), actionCollection(), "adjust_width_big") ); + sizeMenu->insert( new KAction(i18n("To Fit"), "aofit", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidgetSize()), actionCollection(), "adjust_to_fit") ); + sizeMenu->insert( new KAction(i18n("To Grid"), "aogrid", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustSizeToGrid()), actionCollection(), "adjust_size_grid") ); + sizeMenu->insert( new KAction(i18n("To Shortest"), "aoshortest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustHeightToSmall()), actionCollection(), "adjust_height_small") ); + sizeMenu->insert( new KAction(i18n("To Tallest"), "aotallest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustHeightToBig()), actionCollection(), "adjust_height_big") ); + sizeMenu->insert( new KAction(i18n("To Narrowest"), "aonarrowest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidthToSmall()), actionCollection(), "adjust_width_small") ); + sizeMenu->insert( new KAction(i18n("To Widest"), "aowidest", KShortcut(0), KFormDesigner::FormManager::self(), TQT_SLOT(adjustWidthToBig()), actionCollection(), "adjust_width_big") ); if(m_inShell) setXMLFile("kformdesigner_part_shell.rc"); @@ -277,7 +277,7 @@ KFormDesignerPart::createBlankForm() && KFormDesigner::FormManager::self()->activeForm()->filename().isNull()) return; // active form is already a blank one - QString n = i18n("Form") + QString::number(++m_count); + TQString n = i18n("Form") + TQString::number(++m_count); Form *form = new Form(formsLibrary(), n.latin1(), false/*!designMode, we need to set it early enough*/); FormWidgetBase *w = new FormWidgetBase(this, m_workspace, n.latin1()); @@ -296,7 +296,7 @@ void KFormDesignerPart::open() { m_openingFile = true; - KURL url = KFileDialog::getOpenURL("::kformdesigner", i18n("*.ui|Qt Designer UI Files"), m_workspace->topLevelWidget()); + KURL url = KFileDialog::getOpenURL("::kformdesigner", i18n("*.ui|TQt Designer UI Files"), m_workspace->tqtopLevelWidget()); if(!url.isEmpty()) ReadWritePart::openURL(url); m_openingFile = false; @@ -331,8 +331,8 @@ KFormDesignerPart::saveFile() void KFormDesignerPart::saveAs() { - KURL url = KFileDialog::getSaveURL("::kformdesigner", i18n("*.ui|Qt Designer UI Files"), - m_workspace->topLevelWidget()); + KURL url = KFileDialog::getSaveURL("::kformdesigner", i18n("*.ui|TQt Designer UI Files"), + m_workspace->tqtopLevelWidget()); if(url.isEmpty()) return; else @@ -342,9 +342,9 @@ KFormDesignerPart::saveAs() bool KFormDesignerPart::closeForm(Form *form) { - int res = KMessageBox::questionYesNoCancel( m_workspace->topLevelWidget(), + int res = KMessageBox::questionYesNoCancel( m_workspace->tqtopLevelWidget(), i18n( "The form \"%1\" has been modified.\n" - "Do you want to save your changes or discard them?" ).arg( form->objectTree()->name() ), + "Do you want to save your changes or discard them?" ).tqarg( form->objectTree()->name() ), i18n( "Close Form" ), KStdGuiItem::save(), KStdGuiItem::discard() ); if(res == KMessageBox::Yes) @@ -356,8 +356,8 @@ KFormDesignerPart::closeForm(Form *form) bool KFormDesignerPart::closeForms() { - QWidgetList list = m_workspace->windowList(QWorkspace::CreationOrder); - for(QWidget *w = list.first(); w; w = list.next()) + TQWidgetList list = m_workspace->windowList(TQWorkspace::CreationOrder); + for(TQWidget *w = list.first(); w; w = list.next()) if(w->close() == false) return false; @@ -423,7 +423,7 @@ KFormDesignerPart::slotWidgetSelected(Form *form, bool multiple) ENABLE_ACTION("format_raise", true); ENABLE_ACTION("format_lower", true); - // If the widgets selected is a container, we enable layout actions + // If the widgets selected is a container, we enable tqlayout actions bool containerSelected = false; if(!multiple) { @@ -433,15 +433,15 @@ KFormDesignerPart::slotWidgetSelected(Form *form, bool multiple) } const bool twoSelected = form->selectedWidgets()->count()==2; // Layout actions - ENABLE_ACTION("layout_menu", multiple || containerSelected); - ENABLE_ACTION("layout_hbox", multiple || containerSelected); - ENABLE_ACTION("layout_vbox", multiple || containerSelected); - ENABLE_ACTION("layout_grid", multiple || containerSelected); - ENABLE_ACTION("layout_hsplitter", twoSelected); - ENABLE_ACTION("layout_vsplitter", twoSelected); + ENABLE_ACTION("tqlayout_menu", multiple || containerSelected); + ENABLE_ACTION("tqlayout_hbox", multiple || containerSelected); + ENABLE_ACTION("tqlayout_vbox", multiple || containerSelected); + ENABLE_ACTION("tqlayout_grid", multiple || containerSelected); + ENABLE_ACTION("tqlayout_hsplitter", twoSelected); + ENABLE_ACTION("tqlayout_vsplitter", twoSelected); KFormDesigner::Container *container = KFormDesigner::FormManager::self()->activeForm()->activeContainer(); - ENABLE_ACTION("break_layout", (container->layoutType() != KFormDesigner::Container::NoLayout)); + ENABLE_ACTION("break_layout", (container->tqlayoutType() != KFormDesigner::Container::NoLayout)); } void @@ -451,16 +451,16 @@ KFormDesignerPart::slotFormWidgetSelected(Form *form) enableFormActions(); const bool twoSelected = form->selectedWidgets()->count()==2; - const bool hasChildren = !form->objectTree()->children()->isEmpty(); + const bool hasChildren = !form->objectTree()->tqchildren()->isEmpty(); // Layout actions - ENABLE_ACTION("layout_menu", hasChildren); - ENABLE_ACTION("layout_hbox", hasChildren); - ENABLE_ACTION("layout_vbox", hasChildren); - ENABLE_ACTION("layout_grid", hasChildren); - ENABLE_ACTION("layout_hsplitter", twoSelected); - ENABLE_ACTION("layout_vsplitter", twoSelected); - ENABLE_ACTION("break_layout", (form->toplevelContainer()->layoutType() != KFormDesigner::Container::NoLayout)); + ENABLE_ACTION("tqlayout_menu", hasChildren); + ENABLE_ACTION("tqlayout_hbox", hasChildren); + ENABLE_ACTION("tqlayout_vbox", hasChildren); + ENABLE_ACTION("tqlayout_grid", hasChildren); + ENABLE_ACTION("tqlayout_hsplitter", twoSelected); + ENABLE_ACTION("tqlayout_vsplitter", twoSelected); + ENABLE_ACTION("break_layout", (form->toplevelContainer()->tqlayoutType() != KFormDesigner::Container::NoLayout)); } void @@ -523,18 +523,18 @@ KFormDesignerPart::disableWidgetActions() ENABLE_ACTION("format_raise", false); ENABLE_ACTION("format_lower", false); - ENABLE_ACTION("layout_menu", false); - ENABLE_ACTION("layout_hbox", false); - ENABLE_ACTION("layout_vbox", false); - ENABLE_ACTION("layout_grid", false); - ENABLE_ACTION("layout_hsplitter", false); - ENABLE_ACTION("layout_vsplitter", false); + ENABLE_ACTION("tqlayout_menu", false); + ENABLE_ACTION("tqlayout_hbox", false); + ENABLE_ACTION("tqlayout_vbox", false); + ENABLE_ACTION("tqlayout_grid", false); + ENABLE_ACTION("tqlayout_hsplitter", false); + ENABLE_ACTION("tqlayout_vsplitter", false); ENABLE_ACTION("break_layout", false); } #endif void -KFormDesignerPart::setUndoEnabled(bool enabled, const QString &text) +KFormDesignerPart::setUndoEnabled(bool enabled, const TQString &text) { KAction *undoAction = actionCollection()->action("edit_undo"); if(undoAction) @@ -545,7 +545,7 @@ KFormDesignerPart::setUndoEnabled(bool enabled, const QString &text) } void -KFormDesignerPart::setRedoEnabled(bool enabled, const QString &text) +KFormDesignerPart::setRedoEnabled(bool enabled, const TQString &text) { KAction *redoAction = actionCollection()->action("edit_redo"); if(redoAction) @@ -558,40 +558,40 @@ KFormDesignerPart::setRedoEnabled(bool enabled, const QString &text) ////// FormWidgetBase : helper widget to draw rects on top of widgets -//repaint all children widgets -static void repaintAll(QWidget *w) +//tqrepaint all tqchildren widgets +static void tqrepaintAll(TQWidget *w) { - w->repaint(); - QObjectList *list = w->queryList("QWidget"); - QObjectListIt it(*list); - for (QObject *obj; (obj=it.current()); ++it ) { - static_cast<QWidget*>(obj)->repaint(); + w->tqrepaint(); + TQObjectList *list = w->queryList(TQWIDGET_OBJECT_NAME_STRING); + TQObjectListIt it(*list); + for (TQObject *obj; (obj=it.current()); ++it ) { + static_cast<TQWidget*>(obj)->tqrepaint(); } delete list; } void -FormWidgetBase::drawRects(const QValueList<QRect> &list, int type) +FormWidgetBase::drawRects(const TQValueList<TQRect> &list, int type) { - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); if (prev_rect.isValid()) { //redraw prev. selection's rectangle - p.drawPixmap( QPoint(prev_rect.x()-2, prev_rect.y()-2), buffer, QRect(prev_rect.x()-2, prev_rect.y()-2, prev_rect.width()+4, prev_rect.height()+4)); + p.drawPixmap( TQPoint(prev_rect.x()-2, prev_rect.y()-2), buffer, TQRect(prev_rect.x()-2, prev_rect.y()-2, prev_rect.width()+4, prev_rect.height()+4)); } - p.setBrush(QBrush::NoBrush); + p.setBrush(TQBrush::NoBrush); if(type == 1) // selection rect - p.setPen(QPen(white, 1, Qt::DotLine)); + p.setPen(TQPen(white, 1, TQt::DotLine)); else if(type == 2) // insert rect - p.setPen(QPen(white, 2)); + p.setPen(TQPen(white, 2)); p.setRasterOp(XorROP); - prev_rect = QRect(); - QValueList<QRect>::ConstIterator endIt = list.constEnd(); - for(QValueList<QRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) { + prev_rect = TQRect(); + TQValueList<TQRect>::ConstIterator endIt = list.constEnd(); + for(TQValueList<TQRect>::ConstIterator it = list.constBegin(); it != endIt; ++it) { p.drawRect(*it); prev_rect = prev_rect.unite(*it); } @@ -602,9 +602,9 @@ FormWidgetBase::drawRects(const QValueList<QRect> &list, int type) } void -FormWidgetBase::drawRect(const QRect& r, int type) +FormWidgetBase::drawRect(const TQRect& r, int type) { - QValueList<QRect> l; + TQValueList<TQRect> l; l.append(r); drawRects(l, type); } @@ -612,58 +612,58 @@ FormWidgetBase::drawRect(const QRect& r, int type) void FormWidgetBase::initBuffer() { - repaintAll(this); + tqrepaintAll(this); buffer.resize( width(), height() ); - buffer = QPixmap::grabWindow( winId() ); - prev_rect = QRect(); + buffer = TQPixmap::grabWindow( winId() ); + prev_rect = TQRect(); } void FormWidgetBase::clearForm() { - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); //redraw entire form surface - p.drawPixmap( QPoint(0,0), buffer, QRect(0,0,buffer.width(), buffer.height()) ); + p.drawPixmap( TQPoint(0,0), buffer, TQRect(0,0,buffer.width(), buffer.height()) ); if (!unclipped) clearWFlags( WPaintUnclipped ); p.end(); - repaintAll(this); + tqrepaintAll(this); } void -FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &point) +FormWidgetBase::highlightWidgets(TQWidget *from, TQWidget *to)//, const TQPoint &point) { - QPoint fromPoint, toPoint; - if(from && from->parentWidget() && (from != this)) - fromPoint = from->parentWidget()->mapTo(this, from->pos()); - if(to && to->parentWidget() && (to != this)) - toPoint = to->parentWidget()->mapTo(this, to->pos()); + TQPoint fromPoint, toPoint; + if(from && from->tqparentWidget() && (from != this)) + fromPoint = from->tqparentWidget()->mapTo(this, from->pos()); + if(to && to->tqparentWidget() && (to != this)) + toPoint = to->tqparentWidget()->mapTo(this, to->pos()); - QPainter p; + TQPainter p; p.begin(this, true); bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); if (prev_rect.isValid()) { //redraw prev. selection's rectangle - p.drawPixmap( QPoint(prev_rect.x(), prev_rect.y()), buffer, QRect(prev_rect.x(), prev_rect.y(), prev_rect.width(), prev_rect.height())); + p.drawPixmap( TQPoint(prev_rect.x(), prev_rect.y()), buffer, TQRect(prev_rect.x(), prev_rect.y(), prev_rect.width(), prev_rect.height())); } - p.setPen( QPen(Qt::red, 2) ); + p.setPen( TQPen(TQt::red, 2) ); if(to) { - QPixmap pix1 = QPixmap::grabWidget(from); - QPixmap pix2 = QPixmap::grabWidget(to); + TQPixmap pix1 = TQPixmap::grabWidget(from); + TQPixmap pix2 = TQPixmap::grabWidget(to); if((from != this) && (to != this)) - p.drawLine( from->parentWidget()->mapTo(this, from->geometry().center()), to->parentWidget()->mapTo(this, to->geometry().center()) ); + p.drawLine( from->tqparentWidget()->mapTo(this, from->tqgeometry().center()), to->tqparentWidget()->mapTo(this, to->tqgeometry().center()) ); p.drawPixmap(fromPoint.x(), fromPoint.y(), pix1); p.drawPixmap(toPoint.x(), toPoint.y(), pix2); @@ -680,7 +680,7 @@ FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po p.drawRoundRect(fromPoint.x(), fromPoint.y(), from->width(), from->height(), 5, 5); if((to == this) || (from == this)) - prev_rect = QRect(0, 0, buffer.width(), buffer.height()); + prev_rect = TQRect(0, 0, buffer.width(), buffer.height()); else if(to) { prev_rect.setX( (fromPoint.x() < toPoint.x()) ? (fromPoint.x() - 5) : (toPoint.x() - 5) ); @@ -689,7 +689,7 @@ FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po prev_rect.setBottom( (fromPoint.y() < toPoint.y()) ? (toPoint.y() + to->height() + 10) : (fromPoint.y() + from->height() + 10) ) ; } else - prev_rect = QRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10); + prev_rect = TQRect(fromPoint.x()- 5, fromPoint.y() -5, from->width() + 10, from->height() + 10); if (!unclipped) clearWFlags( WPaintUnclipped ); @@ -697,7 +697,7 @@ FormWidgetBase::highlightWidgets(QWidget *from, QWidget *to)//, const QPoint &po } void -FormWidgetBase::closeEvent(QCloseEvent *ev) +FormWidgetBase::closeEvent(TQCloseEvent *ev) { Form *form = KFormDesigner::FormManager::self()->formForWidget(this); if(!form || !form->isModified() || !form->objectTree()) // == preview form @@ -713,7 +713,7 @@ FormWidgetBase::closeEvent(QCloseEvent *ev) } void KFormDesignerPart::slotPropertySetSwitched(KoProperty::Set *set, bool forceReload, - const QCString& propertyToSelect) + const TQCString& propertyToSelect) { if (m_editor) { if (propertyToSelect.isEmpty() && forceReload) diff --git a/kexi/formeditor/test/kfd_part.h b/kexi/formeditor/test/kfd_part.h index 77b809ca..7ffb8705 100644 --- a/kexi/formeditor/test/kfd_part.h +++ b/kexi/formeditor/test/kfd_part.h @@ -20,8 +20,8 @@ #ifndef KFORMDESIGNER_PART_H #define KFORMDESIGNER_PART_H -#include <qwidget.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqpixmap.h> #include <kparts/part.h> #include <kparts/factory.h> @@ -30,21 +30,22 @@ class KAboutData; class KInstance; -class QWorkspace; -class QCloseEvent; +class TQWorkspace; +class TQCloseEvent; using KFormDesigner::Form; class KFORMEDITOR_EXPORT KFDFactory : public KParts::Factory { Q_OBJECT + TQ_OBJECT public: KFDFactory(); virtual ~KFDFactory(); - virtual KParts::Part* createPartObject(QWidget *parentWidget=0, const char *widgetName=0, QObject *parent=0, const char *name=0, - const char *classname="KParts::Part", const QStringList &args=QStringList()); + virtual KParts::Part* createPartObject(TQWidget *tqparentWidget=0, const char *widgetName=0, TQObject *tqparent=0, const char *name=0, + const char *classname="KParts::Part", const TQStringList &args=TQStringList()); static KInstance *instance(); static KAboutData *aboutData(); @@ -56,9 +57,10 @@ class KFORMEDITOR_EXPORT KFDFactory : public KParts::Factory class KFORMEDITOR_EXPORT KFormDesignerPart: public KParts::ReadWritePart { Q_OBJECT + TQ_OBJECT public: - KFormDesignerPart(QWidget *parent, const char *name, bool readOnly=true, const QStringList &args=QStringList()); + KFormDesignerPart(TQWidget *tqparent, const char *name, bool readOnly=true, const TQStringList &args=TQStringList()); virtual ~KFormDesignerPart(); static KFormDesigner::WidgetLibrary* formsLibrary(); @@ -81,19 +83,19 @@ class KFORMEDITOR_EXPORT KFormDesignerPart: public KParts::ReadWritePart void slotPreviewForm(); void saveAs(); - //void slotCreateFormSlot(KFormDesigner::Form *form, const QString &widget, const QString &signal); + //void slotCreateFormSlot(KFormDesigner::Form *form, const TQString &widget, const TQString &signal); protected slots: void slotFormModified(KFormDesigner::Form *form, bool isDirty); //moved to manager void slotWidgetSelected(KFormDesigner::Form *form, bool multiple); //moved to manager void slotFormWidgetSelected(KFormDesigner::Form *form); //moved to manager void slotNoFormSelected(); - void setUndoEnabled(bool enabled, const QString &text); - void setRedoEnabled(bool enabled, const QString &text); + void setUndoEnabled(bool enabled, const TQString &text); + void setRedoEnabled(bool enabled, const TQString &text); /*! Shows a property set \a set in a Property Editor. */ void slotPropertySetSwitched(KoProperty::Set *set, bool forceReload = false, - const QCString& propertyToSelect = QCString()); + const TQCString& propertyToSelect = TQCString()); protected: virtual bool openFile(); @@ -105,8 +107,8 @@ class KFORMEDITOR_EXPORT KFormDesignerPart: public KParts::ReadWritePart private: static KFormDesigner::WidgetLibrary* static_formsLibrary; // KFormDesigner::FormManager *m_manager; - QWorkspace *m_workspace; - QGuardedPtr<KoProperty::Editor> m_editor; + TQWorkspace *m_workspace; + TQGuardedPtr<KoProperty::Editor> m_editor; int m_count; bool m_uniqueFormMode; bool m_openingFile; @@ -114,27 +116,28 @@ class KFORMEDITOR_EXPORT KFormDesignerPart: public KParts::ReadWritePart }; //! Helper: this widget is used to create form's surface -class KFORMEDITOR_EXPORT FormWidgetBase : public QWidget, public KFormDesigner::FormWidget +class KFORMEDITOR_EXPORT FormWidgetBase : public TQWidget, public KFormDesigner::FormWidget { Q_OBJECT + TQ_OBJECT public: - FormWidgetBase(KFormDesignerPart *part, QWidget *parent = 0, const char *name = 0, int WFlags = WDestructiveClose) - : QWidget(parent, name, WFlags), m_part(part) {} + FormWidgetBase(KFormDesignerPart *part, TQWidget *tqparent = 0, const char *name = 0, int WFlags = WDestructiveClose) + : TQWidget(tqparent, name, WFlags), m_part(part) {} ~FormWidgetBase() {;} - void drawRect(const QRect& r, int type); - void drawRects(const QValueList<QRect> &list, int type); + void drawRect(const TQRect& r, int type); + void drawRects(const TQValueList<TQRect> &list, int type); void initBuffer(); void clearForm(); - void highlightWidgets(QWidget *from, QWidget *to);//, const QPoint &p); + void highlightWidgets(TQWidget *from, TQWidget *to);//, const TQPoint &p); protected: - void closeEvent(QCloseEvent *ev); + void closeEvent(TQCloseEvent *ev); private: - QPixmap buffer; //!< stores grabbed entire form's area for redraw - QRect prev_rect; //!< previously selected rectangle + TQPixmap buffer; //!< stores grabbed entire form's area for redraw + TQRect prev_rect; //!< previously selected rectangle KFormDesignerPart *m_part; }; diff --git a/kexi/formeditor/utils.cpp b/kexi/formeditor/utils.cpp index 0c3acf59..f80c2c27 100644 --- a/kexi/formeditor/utils.cpp +++ b/kexi/formeditor/utils.cpp @@ -18,10 +18,10 @@ * Boston, MA 02110-1301, USA. */ -#include <qcursor.h> -#include <qobjectlist.h> -#include <qtabwidget.h> -#include <qtabbar.h> +#include <tqcursor.h> +#include <tqobjectlist.h> +#include <tqtabwidget.h> +#include <tqtabbar.h> #include <kdebug.h> #include <kexiutils/utils.h> @@ -36,11 +36,11 @@ void KFormDesigner::removeChildrenFromList(WidgetList &list) { for(WidgetListIterator it(list); it.current() != 0; ++it) { - QWidget *w = it.current(); + TQWidget *w = it.current(); // If any widget in the list is a child of this widget, we remove it from the list for(WidgetListIterator it2(list); it2.current() != 0; ++it2) { - QWidget *widg = it2.current(); + TQWidget *widg = it2.current(); if((w != widg) && (w->child(widg->name()))) { kdDebug() << "Removing the widget " << widg->name() << "which is a child of " << w->name() << endl; @@ -51,76 +51,77 @@ KFormDesigner::removeChildrenFromList(WidgetList &list) } void -KFormDesigner::installRecursiveEventFilter(QObject *object, QObject *container) +KFormDesigner::installRecursiveEventFilter(TQObject *object, TQObject *container) { if(!object || !container|| !object->isWidgetType()) return; kdDebug() << "Installing event filter on widget: " << object->name() << " directed to " << container->name() << endl; object->installEventFilter(container); - if(((QWidget*)object)->ownCursor()) - ((QWidget*)object)->setCursor(QCursor(Qt::ArrowCursor)); + if(((TQWidget*)object)->ownCursor()) + ((TQWidget*)object)->setCursor(TQCursor(TQt::ArrowCursor)); - if(!object->children()) + TQObjectList list = object->childrenListObject(); + + if(list.isEmpty()) return; - QObjectList list = *(object->children()); - for(QObject *obj = list.first(); obj; obj = list.next()) + for(TQObject *obj = list.first(); obj; obj = list.next()) installRecursiveEventFilter(obj, container); } void -KFormDesigner::removeRecursiveEventFilter(QObject *object, QObject *container) +KFormDesigner::removeRecursiveEventFilter(TQObject *object, TQObject *container) { object->removeEventFilter(container); if(!object->isWidgetType()) return; - if(!object->children()) + TQObjectList list = object->childrenListObject(); + if(list.isEmpty()) return; - QObjectList list = *(object->children()); - for(QObject *obj = list.first(); obj; obj = list.next()) + for(TQObject *obj = list.first(); obj; obj = list.next()) removeRecursiveEventFilter(obj, container); } void -KFormDesigner::setRecursiveCursor(QWidget *w, Form *form) +KFormDesigner::setRecursiveCursor(TQWidget *w, Form *form) { ObjectTreeItem *tree = form->objectTree()->lookup(w->name()); - if(tree && ((tree->modifiedProperties()->contains("cursor")) || !tree->children()->isEmpty()) - && !w->inherits("QLineEdit") && !w->inherits("QTextEdit") + if(tree && ((tree->modifiedProperties()->tqcontains("cursor")) || !tree->tqchildren()->isEmpty()) + && !w->inherits(TQLINEEDIT_OBJECT_NAME_STRING) && !w->inherits(TQTEXTEDIT_OBJECT_NAME_STRING) ) //fix weird behaviour return; // if the user has set a cursor for this widget or this is a container, don't change it if(w->ownCursor()) - w->setCursor(Qt::ArrowCursor); + w->setCursor(TQt::ArrowCursor); - QObjectList *l = w->queryList( "QWidget" ); - for(QObject *o = l->first(); o; o = l->next()) - ((QWidget*)o)->setCursor(Qt::ArrowCursor); + TQObjectList *l = w->queryList( TQWIDGET_OBJECT_NAME_STRING ); + for(TQObject *o = l->first(); o; o = l->next()) + ((TQWidget*)o)->setCursor(TQt::ArrowCursor); delete l; } -QSize -KFormDesigner::getSizeFromChildren(QWidget *w, const char *inheritClass) +TQSize +KFormDesigner::getSizeFromChildren(TQWidget *w, const char *inheritClass) { int tmpw = 0, tmph = 0; - QObjectList *list = w->queryList(inheritClass, 0, false, false); - for(QObject *o = list->first(); o; o = list->next()) { - QRect r = ((QWidget*)o)->geometry(); - tmpw = QMAX(tmpw, r.right()); - tmph = QMAX(tmph, r.bottom()); + TQObjectList *list = w->queryList(inheritClass, 0, false, false); + for(TQObject *o = list->first(); o; o = list->next()) { + TQRect r = ((TQWidget*)o)->tqgeometry(); + tmpw = TQMAX(tmpw, r.right()); + tmph = TQMAX(tmph, r.bottom()); } delete list; - return QSize(tmpw, tmph) + QSize(10, 10); + return TQSize(tmpw, tmph) + TQSize(10, 10); } // ----------------- -HorWidgetList::HorWidgetList(QWidget *topLevelWidget) +HorWidgetList::HorWidgetList(TQWidget *tqtopLevelWidget) : WidgetList() - , m_topLevelWidget(topLevelWidget) + , m_tqtopLevelWidget(tqtopLevelWidget) { } @@ -128,18 +129,18 @@ HorWidgetList::~HorWidgetList() { } -int HorWidgetList::compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2) +int HorWidgetList::compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2) { - QWidget *w1 = static_cast<QWidget*>(item1); - QWidget *w2 = static_cast<QWidget*>(item2); - return w1->mapTo(m_topLevelWidget, QPoint(0,0)).x() - w2->mapTo(m_topLevelWidget, QPoint(0,0)).x(); + TQWidget *w1 = TQT_TQWIDGET(item1); + TQWidget *w2 = TQT_TQWIDGET(item2); + return w1->mapTo(m_tqtopLevelWidget, TQPoint(0,0)).x() - w2->mapTo(m_tqtopLevelWidget, TQPoint(0,0)).x(); } // ----------------- -VerWidgetList::VerWidgetList(QWidget *topLevelWidget) +VerWidgetList::VerWidgetList(TQWidget *tqtopLevelWidget) : WidgetList() - , m_topLevelWidget(topLevelWidget) + , m_tqtopLevelWidget(tqtopLevelWidget) { } @@ -147,37 +148,37 @@ VerWidgetList::~VerWidgetList() { } -int VerWidgetList::compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2) +int VerWidgetList::compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2) { - QWidget *w1 = static_cast<QWidget*>(item1); - QWidget *w2 = static_cast<QWidget*>(item2); + TQWidget *w1 = TQT_TQWIDGET(item1); + TQWidget *w2 = TQT_TQWIDGET(item2); int y1, y2; - QObject *page1 = 0; + TQObject *page1 = 0; TabWidget *tw1 = KFormDesigner::findParent<KFormDesigner::TabWidget>(w1, "KFormDesigner::TabWidget", page1); if (tw1) // special case - y1 = w1->mapTo(m_topLevelWidget, QPoint(0,0)).y() + tw1->tabBarHeight() -2 -2; + y1 = w1->mapTo(m_tqtopLevelWidget, TQPoint(0,0)).y() + tw1->tabBarHeight() -2 -2; else - y1 = w1->mapTo(m_topLevelWidget, QPoint(0,0)).y(); + y1 = w1->mapTo(m_tqtopLevelWidget, TQPoint(0,0)).y(); - QObject *page2 = 0; + TQObject *page2 = 0; TabWidget *tw2 = KFormDesigner::findParent<KFormDesigner::TabWidget>(w2, "KFormDesigner::TabWidget", page2); if (tw1 && tw2 && tw1 == tw2 && page1 != page2) { // this sorts widgets by tabs there're put in - return tw1->indexOf(static_cast<QWidget*>(page1)) - tw2->indexOf(static_cast<QWidget*>(page2)); + return tw1->indexOf(TQT_TQWIDGET(page1)) - tw2->indexOf(TQT_TQWIDGET(page2)); } if (tw2) // special case - y2 = w2->mapTo(m_topLevelWidget, QPoint(0,0)).y() + tw2->tabBarHeight() -2 -2; + y2 = w2->mapTo(m_tqtopLevelWidget, TQPoint(0,0)).y() + tw2->tabBarHeight() -2 -2; else - y2 = w2->mapTo(m_topLevelWidget, QPoint(0,0)).y(); + y2 = w2->mapTo(m_tqtopLevelWidget, TQPoint(0,0)).y(); kdDebug() << w1->name() << ": " << y1 << " " << " | " << w2->name() << ": " << y2 << endl; - //kdDebug() << w1->name() << ": " << w1->mapTo(m_topLevelWidget, QPoint(0,0)) << " " << w1->y() - //<< " | " << w2->name() << ":" /*<< w2->mapFrom(m_topLevelWidget, QPoint(0,w2->y()))*/ << " " << w2->y() << endl; + //kdDebug() << w1->name() << ": " << w1->mapTo(m_tqtopLevelWidget, TQPoint(0,0)) << " " << w1->y() + //<< " | " << w2->name() << ":" /*<< w2->mapFrom(m_tqtopLevelWidget, TQPoint(0,w2->y()))*/ << " " << w2->y() << endl; return y1 - y2; } diff --git a/kexi/formeditor/utils.h b/kexi/formeditor/utils.h index d5384e45..30bbfdf3 100644 --- a/kexi/formeditor/utils.h +++ b/kexi/formeditor/utils.h @@ -21,30 +21,30 @@ #ifndef FORMEDITORUTILS_H #define FORMEDITORUTILS_H -#include <qptrlist.h> -#include <qtabbar.h> -#include <qtabwidget.h> +#include <tqptrlist.h> +#include <tqtabbar.h> +#include <tqtabwidget.h> -//! @todo replace QTabWidget by KTabWidget after the bug with & is fixed: -#define TabWidgetBase QTabWidget +//! @todo replace TQTabWidget by KTabWidget after the bug with & is fixed: +#define TabWidgetBase TQTabWidget //#define USE_KTabWidget //todo: uncomment namespace KFormDesigner { class Form; -/*! \return parent object of \a o that inherits \a className or NULL if no such parent - If the parent is found, \a prevPrev is set to a child of child of the parent, +/*! \return tqparent object of \a o that inherits \a className or NULL if no such tqparent + If the tqparent is found, \a prevPrev is set to a child of child of the tqparent, what for TabWidget means the page widget. */ template<class type> -type* findParent(QObject* o, const char* className, QObject* &prevPrev) +type* findParent(TQT_BASE_OBJECT_NAME* o, const char* className, TQObject* &prevPrev) { if (!o || !className || className[0]=='\0') return 0; - QObject *prev = o; - while ( ((o=o->parent())) && !o->inherits(className) ) { + TQObject *prev = TQT_TQOBJECT(o); + while ( ((o=TQT_TQOBJECT(o)->tqparent())) && !TQT_TQOBJECT(o)->inherits(className) ) { prevPrev = prev; - prev = o; + prev = TQT_TQOBJECT(o); } return static_cast<type*>(o); } @@ -53,39 +53,40 @@ type* findParent(QObject* o, const char* className, QObject* &prevPrev) class KFORMEDITOR_EXPORT TabWidget : public TabWidgetBase { Q_OBJECT + TQ_OBJECT public: - TabWidget(QWidget *parent, const char *name) - : TabWidgetBase(parent, name) {} + TabWidget(TQWidget *tqparent, const char *name) + : TabWidgetBase(tqparent, name) {} virtual ~TabWidget() {} int tabBarHeight() const { return tabBar()->height(); } }; //! @short A list of widget pointers. -typedef QPtrList<QWidget> WidgetList; +typedef TQPtrList<TQWidget> WidgetList; //! @short An iterator for WidgetList. -typedef QPtrListIterator<QWidget> WidgetListIterator; +typedef TQPtrListIterator<TQWidget> WidgetListIterator; //! @short A helper for sorting widgets horizontally class HorWidgetList : public WidgetList { public: - HorWidgetList(QWidget *topLevelWidget); + HorWidgetList(TQWidget *tqtopLevelWidget); virtual ~HorWidgetList(); protected: - virtual int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2); - QWidget *m_topLevelWidget; + virtual int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2); + TQWidget *m_tqtopLevelWidget; }; //! @short A helper for sorting widgets vertically class VerWidgetList : public WidgetList { public: - VerWidgetList(QWidget *topLevelWidget); + VerWidgetList(TQWidget *tqtopLevelWidget); virtual ~VerWidgetList(); protected: - virtual int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2); - QWidget *m_topLevelWidget; + virtual int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2); + TQWidget *m_tqtopLevelWidget; }; /*! This function is used to remove all the child widgets from a list, and @@ -93,19 +94,19 @@ class VerWidgetList : public WidgetList KFORMEDITOR_EXPORT void removeChildrenFromList(WidgetList &list); /*! This helper function install an event filter on \a object and all of its - children, directed to \a container. + tqchildren, directed to \a container. This is necessary to filter events for composed widgets. */ -KFORMEDITOR_EXPORT void installRecursiveEventFilter(QObject *object, QObject *container); +KFORMEDITOR_EXPORT void installRecursiveEventFilter(TQObject *object, TQObject *container); /*! This helper function removes an event filter installed before - on \a object and all of its children. + on \a object and all of its tqchildren. This is necessary to filter events for composed widgets. */ -KFORMEDITOR_EXPORT void removeRecursiveEventFilter(QObject *object, QObject *container); +KFORMEDITOR_EXPORT void removeRecursiveEventFilter(TQObject *object, TQObject *container); -KFORMEDITOR_EXPORT void setRecursiveCursor(QWidget *w, Form *form); +KFORMEDITOR_EXPORT void setRecursiveCursor(TQWidget *w, Form *form); -/*! \return the size of \a w children. This can be used eg to get widget's sizeHint. */ -KFORMEDITOR_EXPORT QSize getSizeFromChildren(QWidget *widget, const char *inheritClass="QWidget"); +/*! \return the size of \a w tqchildren. This can be used eg to get widget's tqsizeHint. */ +KFORMEDITOR_EXPORT TQSize getSizeFromChildren(TQWidget *widget, const char *inheritClass=TQWIDGET_OBJECT_NAME_STRING); } diff --git a/kexi/formeditor/widgetfactory.cpp b/kexi/formeditor/widgetfactory.cpp index 8122013c..12585b6c 100644 --- a/kexi/formeditor/widgetfactory.cpp +++ b/kexi/formeditor/widgetfactory.cpp @@ -21,10 +21,10 @@ #include "widgetfactory.h" -#include <qcursor.h> -#include <qobjectlist.h> -#include <qdict.h> -#include <qmetaobject.h> +#include <tqcursor.h> +#include <tqobjectlist.h> +#include <tqdict.h> +#include <tqmetaobject.h> #include <kdebug.h> #include <klocale.h> @@ -64,9 +64,9 @@ WidgetInfo::WidgetInfo(WidgetFactory *f) { } -WidgetInfo::WidgetInfo(WidgetFactory *f, const char* parentFactoryName, +WidgetInfo::WidgetInfo(WidgetFactory *f, const char* tqparentFactoryName, const char* inheritedClassName) - : m_parentFactoryName( QCString("kformdesigner_")+parentFactoryName ) + : m_parentFactoryName( TQCString("kformdesigner_")+tqparentFactoryName ) , m_inheritedClassName(inheritedClassName) , m_inheritedClass(0) , m_overriddenAlternateNames(0) @@ -84,12 +84,12 @@ WidgetInfo::~WidgetInfo() delete m_customTypesForProperty; } -void WidgetInfo::addAlternateClassName(const QCString& alternateName, bool override) +void WidgetInfo::addAlternateClassName(const TQCString& alternateName, bool override) { m_alternateNames += alternateName; if (override) { if (!m_overriddenAlternateNames) - m_overriddenAlternateNames = new QAsciiDict<char>(101); + m_overriddenAlternateNames = new TQAsciiDict<char>(101); m_overriddenAlternateNames->insert(alternateName, (char*)1); } else { @@ -98,9 +98,9 @@ void WidgetInfo::addAlternateClassName(const QCString& alternateName, bool overr } } -bool WidgetInfo::isOverriddenClassName(const QCString& alternateName) const +bool WidgetInfo::isOverriddenClassName(const TQCString& alternateName) const { - return m_overriddenAlternateNames && (m_overriddenAlternateNames->find(alternateName) != 0); + return m_overriddenAlternateNames && (m_overriddenAlternateNames->tqfind(alternateName) != 0); } void WidgetInfo::setAutoSyncForProperty(const char *propertyName, tristate flag) @@ -108,7 +108,7 @@ void WidgetInfo::setAutoSyncForProperty(const char *propertyName, tristate flag) if (!m_propertiesWithDisabledAutoSync) { if (~flag) return; - m_propertiesWithDisabledAutoSync = new QAsciiDict<char>(101); + m_propertiesWithDisabledAutoSync = new TQAsciiDict<char>(101); } if (~flag) { @@ -121,7 +121,7 @@ void WidgetInfo::setAutoSyncForProperty(const char *propertyName, tristate flag) tristate WidgetInfo::autoSyncForProperty(const char *propertyName) const { - char* flag = m_propertiesWithDisabledAutoSync ? m_propertiesWithDisabledAutoSync->find(propertyName) : 0; + char* flag = m_propertiesWithDisabledAutoSync ? m_propertiesWithDisabledAutoSync->tqfind(propertyName) : 0; if (!flag) return cancelled; return flag==(char*)1 ? true : false; @@ -132,14 +132,14 @@ void WidgetInfo::setCustomTypeForProperty(const char *propertyName, int type) if (!propertyName || type==KoProperty::Auto) return; if (!m_customTypesForProperty) { - m_customTypesForProperty = new QMap<QCString,int>(); + m_customTypesForProperty = new TQMap<TQCString,int>(); } - m_customTypesForProperty->replace(propertyName, type); + m_customTypesForProperty->tqreplace(propertyName, type); } int WidgetInfo::customTypeForProperty(const char *propertyName) const { - if (!m_customTypesForProperty || !m_customTypesForProperty->contains(propertyName)) + if (!m_customTypesForProperty || !m_customTypesForProperty->tqcontains(propertyName)) return KoProperty::Auto; return (*m_customTypesForProperty)[propertyName]; } @@ -147,8 +147,8 @@ int WidgetInfo::customTypeForProperty(const char *propertyName) const ///// Widget Factory ////////////////////////// -WidgetFactory::WidgetFactory(QObject *parent, const char *name) - : QObject(parent, (const char*)(QCString("kformdesigner_")+name)) +WidgetFactory::WidgetFactory(TQObject *tqparent, const char *name) + : TQObject(tqparent, (const char*)(TQCString("kformdesigner_")+name)) { m_showAdvancedProperties = true; m_classesByName.setAutoDelete(true); @@ -177,63 +177,63 @@ void WidgetFactory::addClass(WidgetInfo *w) void WidgetFactory::hideClass(const char *classname) { if (!m_hiddenClasses) - m_hiddenClasses = new QAsciiDict<char>(101, false); + m_hiddenClasses = new TQAsciiDict<char>(101, false); m_hiddenClasses->insert(classname, (char*)1); } void -WidgetFactory::createEditor(const QCString &classname, const QString &text, - QWidget *w, Container *container, QRect geometry, +WidgetFactory::createEditor(const TQCString &classname, const TQString &text, + TQWidget *w, Container *container, TQRect tqgeometry, int align, bool useFrame, bool multiLine, BackgroundMode background) { //#ifdef KEXI_KTEXTEDIT if (multiLine) { - KTextEdit *textedit = new KTextEdit(text, QString::null, w->parentWidget()); - textedit->setTextFormat(Qt::PlainText); - textedit->setAlignment(align); - if (dynamic_cast<QTextEdit*>(w)) { - textedit->setWordWrap(dynamic_cast<QTextEdit*>(w)->wordWrap()); - textedit->setWrapPolicy(dynamic_cast<QTextEdit*>(w)->wrapPolicy()); + KTextEdit *textedit = new KTextEdit(text, TQString(), w->tqparentWidget()); + textedit->setTextFormat(TQt::PlainText); + textedit->tqsetAlignment(align); + if (dynamic_cast<TQTextEdit*>(w)) { + textedit->setWordWrap(dynamic_cast<TQTextEdit*>(w)->wordWrap()); + textedit->setWrapPolicy(dynamic_cast<TQTextEdit*>(w)->wrapPolicy()); } textedit->setPalette(w->palette()); textedit->setFont(w->font()); - textedit->setResizePolicy(QScrollView::Manual); - textedit->setGeometry(geometry); - if(background == Qt::NoBackground) + textedit->setResizePolicy(TQScrollView::Manual); + textedit->setGeometry(tqgeometry); + if(background == TQt::NoBackground) textedit->setBackgroundMode(w->backgroundMode()); else textedit->setBackgroundMode(background); -// textedit->setPaletteBackgroundColor(textedit->colorGroup().color( QColorGroup::Base )); +// textedit->setPaletteBackgroundColor(textedit->tqcolorGroup().color( TQColorGroup::Base )); textedit->setPaletteBackgroundColor(w->paletteBackgroundColor()); for(int i =0; i <= textedit->paragraphs(); i++) textedit->setParagraphBackgroundColor(i, w->paletteBackgroundColor()); textedit->selectAll(true); textedit->setColor(w->paletteForegroundColor()); textedit->selectAll(false); - textedit->moveCursor(QTextEdit::MoveEnd, false); + textedit->moveCursor(TQTextEdit::MoveEnd, false); textedit->setParagraphBackgroundColor(0, w->paletteBackgroundColor()); - textedit->setVScrollBarMode(QScrollView::AlwaysOff); //ok? - textedit->setHScrollBarMode(QScrollView::AlwaysOff); //ok? + textedit->setVScrollBarMode(TQScrollView::AlwaysOff); //ok? + textedit->setHScrollBarMode(TQScrollView::AlwaysOff); //ok? textedit->installEventFilter(this); - textedit->setFrameShape(useFrame ? QFrame::LineEditPanel : QFrame::NoFrame); + textedit->setFrameShape(useFrame ? TQFrame::LineEditPanel : TQFrame::NoFrame); textedit->setMargin(2); //to move away from resize handle textedit->show(); textedit->setFocus(); textedit->selectAll(); setEditor(w, textedit); - connect(textedit, SIGNAL(textChanged()), this, SLOT(slotTextChanged())); - connect(w, SIGNAL(destroyed()), this, SLOT(widgetDestroyed())); - connect(textedit, SIGNAL(destroyed()), this, SLOT(editorDeleted())); + connect(textedit, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotTextChanged())); + connect(w, TQT_SIGNAL(destroyed()), this, TQT_SLOT(widgetDestroyed())); + connect(textedit, TQT_SIGNAL(destroyed()), this, TQT_SLOT(editorDeleted())); //#else } else { - KLineEdit *editor = new KLineEdit(text, w->parentWidget()); - editor->setAlignment(align); + KLineEdit *editor = new KLineEdit(text, w->tqparentWidget()); + editor->tqsetAlignment(align); editor->setPalette(w->palette()); editor->setFont(w->font()); - editor->setGeometry(geometry); - if(background == Qt::NoBackground) + editor->setGeometry(tqgeometry); + if(background == TQt::NoBackground) editor->setBackgroundMode(w->backgroundMode()); else editor->setBackgroundMode(background); @@ -243,17 +243,17 @@ WidgetFactory::createEditor(const QCString &classname, const QString &text, editor->show(); editor->setFocus(); editor->selectAll(); - connect(editor, SIGNAL(textChanged(const QString&)), this, SLOT(changeTextInternal(const QString&))); - connect(w, SIGNAL(destroyed()), this, SLOT(widgetDestroyed())); - connect(editor, SIGNAL(destroyed()), this, SLOT(editorDeleted())); + connect(editor, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(changeTextInternal(const TQString&))); + connect(w, TQT_SIGNAL(destroyed()), this, TQT_SLOT(widgetDestroyed())); + connect(editor, TQT_SIGNAL(destroyed()), this, TQT_SLOT(editorDeleted())); setEditor(w, editor); // m_editor = editor; } //copy properties if available WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(w); - QWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : w; - if (-1!=m_editor->metaObject()->findProperty("margin", true) && -1!=subwidget->metaObject()->findProperty("margin", true)) + TQWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : w; + if (-1!=m_editor->tqmetaObject()->tqfindProperty("margin", true) && -1!=subwidget->tqmetaObject()->tqfindProperty("margin", true)) m_editor->setProperty("margin", subwidget->property("margin")); //#endif //js m_handles = new ResizeHandleSet(w, container->form(), true); @@ -278,7 +278,7 @@ WidgetFactory::createEditor(const QCString &classname, const QString &text, } void -WidgetFactory::disableFilter(QWidget *w, Container *container) +WidgetFactory::disableFilter(TQWidget *w, Container *container) { ObjectTreeItem *tree = container->form()->objectTree()->lookup(w->name()); if(!tree) @@ -301,28 +301,28 @@ WidgetFactory::disableFilter(QWidget *w, Container *container) // widget is disabled, so we re-enable it while editing if(!tree->isEnabled()) { - QPalette p = w->palette(); - QColorGroup cg = p.active(); + TQPalette p = w->palette(); + TQColorGroup cg = p.active(); p.setActive(p.disabled()); p.setDisabled(cg); w->setPalette(p); } - connect(w, SIGNAL(destroyed()), this, SLOT(widgetDestroyed())); + connect(w, TQT_SIGNAL(destroyed()), this, TQT_SLOT(widgetDestroyed())); } bool -WidgetFactory::editList(QWidget *w, QStringList &list) +WidgetFactory::editList(TQWidget *w, TQStringList &list) { - KDialogBase dialog(w->topLevelWidget(), "stringlist_dialog", true, i18n("Edit List of Items"), + KDialogBase dialog(w->tqtopLevelWidget(), "stringlist_dialog", true, i18n("Edit List of Items"), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, false); - KEditListBox *edit = new KEditListBox(i18n("Contents of %1").arg(w->name()), &dialog, "editlist"); + KEditListBox *edit = new KEditListBox(i18n("Contents of %1").tqarg(w->name()), &dialog, "editlist"); dialog.setMainWidget(edit); edit->insertStringList(list); // edit->show(); - if(dialog.exec() == QDialog::Accepted) + if(dialog.exec() == TQDialog::Accepted) { list = edit->items(); return true; @@ -331,10 +331,10 @@ WidgetFactory::editList(QWidget *w, QStringList &list) } bool -WidgetFactory::editRichText(QWidget *w, QString &text) +WidgetFactory::editRichText(TQWidget *w, TQString &text) { RichTextDialog dlg(w, text); - if(dlg.exec()== QDialog::Accepted) + if(dlg.exec()== TQDialog::Accepted) { text = dlg.text(); return true; @@ -343,66 +343,66 @@ WidgetFactory::editRichText(QWidget *w, QString &text) } void -WidgetFactory::editListView(QListView *listview) +WidgetFactory::editListView(TQListView *listview) { - EditListViewDialog dlg(((QWidget*)listview)->topLevelWidget()); + EditListViewDialog dlg(((TQWidget*)listview)->tqtopLevelWidget()); //dlg.exec(listview); } bool -WidgetFactory::eventFilter(QObject *obj, QEvent *ev) +WidgetFactory::eventFilter(TQObject *obj, TQEvent *ev) { - if( ((ev->type() == QEvent::Resize) || (ev->type() == QEvent::Move) ) && (obj == m_widget) && editor(m_widget)) { + if( ((ev->type() == TQEvent::Resize) || (ev->type() == TQEvent::Move) ) && (obj == m_widget) && editor(m_widget)) { // resize widget using resize handles - QWidget *ed = editor(m_widget); + TQWidget *ed = editor(m_widget); resizeEditor(ed, m_widget, m_widget->className()); } - else if((ev->type() == QEvent::Paint) && (obj == m_widget) && editor(m_widget)) { + else if((ev->type() == TQEvent::Paint) && (obj == m_widget) && editor(m_widget)) { // paint event for container edited (eg button group) return m_container->eventFilter(obj, ev); } - else if((ev->type() == QEvent::MouseButtonPress) && (obj == m_widget) && editor(m_widget)) { + else if((ev->type() == TQEvent::MouseButtonPress) && (obj == m_widget) && editor(m_widget)) { // click outside editor --> cancel editing Container *cont = m_container; resetEditor(); return cont->eventFilter(obj, ev); } - if(ev->type() == QEvent::FocusOut) + if(ev->type() == TQEvent::FocusOut) { - QWidget *w = editor(m_widget); + TQWidget *w = editor(m_widget); if (!w) - w = (QWidget *)m_widget; - if(obj != (QObject *)w) + w = (TQWidget *)m_widget; + if(obj != (TQObject *)w) return false; - QWidget *focus = w->topLevelWidget()->focusWidget(); + TQWidget *focus = w->tqtopLevelWidget()->tqfocusWidget(); if(focus && w != focus && !w->child(focus->name(), focus->className())) resetEditor(); } - else if(ev->type() == QEvent::KeyPress) + else if(ev->type() == TQEvent::KeyPress) { - QWidget *w = editor(m_widget); + TQWidget *w = editor(m_widget); if (!w) - w = (QWidget *)m_widget; - if(obj != (QObject *)w) + w = (TQWidget *)m_widget; + if(obj != (TQObject *)w) return false; - QKeyEvent *e = static_cast<QKeyEvent*>(ev); - if(((e->key() == Qt::Key_Return) || (e->key() == Qt::Key_Enter)) && (e->state() != AltButton)) + TQKeyEvent *e = TQT_TQKEYEVENT(ev); + if(((e->key() == TQt::Key_Return) || (e->key() == TQt::Key_Enter)) && (e->state() != AltButton)) resetEditor(); - if(e->key() == Qt::Key_Escape) + if(e->key() == TQt::Key_Escape) { setEditorText(m_firstText); //changeText(m_firstText); resetEditor(); } } - else if(ev->type() == QEvent::ContextMenu) { - QWidget *w = editor(m_widget); + else if(ev->type() == TQEvent::ContextMenu) { + TQWidget *w = editor(m_widget); if (!w) - w = (QWidget *)m_widget; - if(obj != (QObject *)w) + w = (TQWidget *)m_widget; + if(obj != (TQObject *)w) return false; return true; @@ -419,7 +419,7 @@ WidgetFactory::resetEditor() if (m_container) m_container->stopInlineEditing(); - QWidget *ed = editor(m_widget); + TQWidget *ed = editor(m_widget); if(m_widget) { ObjectTreeItem *tree = m_container ? m_container->form()->objectTree()->lookup(m_widget->name()) : 0; @@ -431,16 +431,16 @@ WidgetFactory::resetEditor() tree->eventEater()->setContainer(m_container); if(m_widget) {// && !ed) setRecursiveCursor(m_widget, m_container->form()); - if (m_widget->inherits("QLineEdit") || m_widget->inherits("QTextEdit")) { //fix weird behaviour + if (m_widget->inherits(TQLINEEDIT_OBJECT_NAME_STRING) || m_widget->inherits(TQTEXTEDIT_OBJECT_NAME_STRING)) { //fix weird behaviour m_widget->unsetCursor(); - m_widget->setCursor(Qt::ArrowCursor); + m_widget->setCursor(TQt::ArrowCursor); } } // disable again the widget if(!ed && !tree->isEnabled()) { - QPalette p = m_widget->palette(); - QColorGroup cg = p.active(); + TQPalette p = m_widget->palette(); + TQColorGroup cg = p.active(); p.setActive(p.disabled()); p.setDisabled(cg); m_widget->setPalette(p); @@ -456,7 +456,7 @@ WidgetFactory::resetEditor() if(m_widget) { disconnect(m_widget, 0, this, 0); - m_widget->repaint(); + m_widget->tqrepaint(); } //js delete m_handles; @@ -505,8 +505,8 @@ WidgetFactory::editorDeleted() } void -WidgetFactory::changeProperty(const char *name, const QVariant &value, Form *form) -//WidgetFactory::changeProperty(const char *name, const QVariant &value, Container *container) +WidgetFactory::changeProperty(const char *name, const TQVariant &value, Form *form) +//WidgetFactory::changeProperty(const char *name, const TQVariant &value, Container *container) { // if (!form->manager()) // return; @@ -520,29 +520,29 @@ WidgetFactory::changeProperty(const char *name, const QVariant &value, Form *for else { WidgetPropertySet *set = KFormDesigner::FormManager::self()->propertySet(); - if(set->contains(name)) + if(set->tqcontains(name)) (*set)[name] = value; } } /* void -WidgetFactory::addPropertyDescription(Container *container, const char *prop, const QString &desc) +WidgetFactory::addPropertyDescription(Container *container, const char *prop, const TQString &desc) { WidgetPropertySet *buff = container->form()->manager()->buffer(); buff->addPropertyDescription(prop, desc); } void -WidgetFactory::addValueDescription(Container *container, const char *value, const QString &desc) +WidgetFactory::addValueDescription(Container *container, const char *value, const TQString &desc) { WidgetPropertySet *buff = container->form()->manager()->buffer(); buff->addValueDescription(value, desc); }*/ bool -WidgetFactory::isPropertyVisible(const QCString &classname, QWidget *w, - const QCString &property, bool multiple, bool isTopLevel) +WidgetFactory::isPropertyVisible(const TQCString &classname, TQWidget *w, + const TQCString &property, bool multiple, bool isTopLevel) { if (multiple) { @@ -560,8 +560,8 @@ WidgetFactory::isPropertyVisible(const QCString &classname, QWidget *w, } bool -WidgetFactory::isPropertyVisibleInternal(const QCString &, QWidget *w, - const QCString &property, bool isTopLevel) +WidgetFactory::isPropertyVisibleInternal(const TQCString &, TQWidget *w, + const TQCString &property, bool isTopLevel) { Q_UNUSED( w ); @@ -580,8 +580,8 @@ WidgetFactory::isPropertyVisibleInternal(const QCString &, QWidget *w, } bool -WidgetFactory::propertySetShouldBeReloadedAfterPropertyChange(const QCString& classname, QWidget *w, - const QCString& property) +WidgetFactory::propertySetShouldBeReloadedAfterPropertyChange(const TQCString& classname, TQWidget *w, + const TQCString& property) { Q_UNUSED(classname); Q_UNUSED(w); @@ -590,7 +590,7 @@ WidgetFactory::propertySetShouldBeReloadedAfterPropertyChange(const QCString& cl } void -WidgetFactory::resizeEditor(QWidget *, QWidget *, const QCString&) +WidgetFactory::resizeEditor(TQWidget *, TQWidget *, const TQCString&) { } @@ -601,13 +601,13 @@ WidgetFactory::slotTextChanged() } bool -WidgetFactory::clearWidgetContent(const QCString &, QWidget *) +WidgetFactory::clearWidgetContent(const TQCString &, TQWidget *) { return false; } void -WidgetFactory::changeTextInternal(const QString& text) +WidgetFactory::changeTextInternal(const TQString& text) { if (changeText( text )) return; @@ -622,68 +622,68 @@ WidgetFactory::changeTextInternal(const QString& text) } bool -WidgetFactory::changeText(const QString& text) +WidgetFactory::changeText(const TQString& text) { changeProperty( "text", text, m_container->form() ); return true; } bool -WidgetFactory::readSpecialProperty(const QCString &, QDomElement &, QWidget *, ObjectTreeItem *) +WidgetFactory::readSpecialProperty(const TQCString &, TQDomElement &, TQWidget *, ObjectTreeItem *) { return false; } bool -WidgetFactory::saveSpecialProperty(const QCString &, const QString &, const QVariant&, QWidget *, QDomElement &, QDomDocument &) +WidgetFactory::saveSpecialProperty(const TQCString &, const TQString &, const TQVariant&, TQWidget *, TQDomElement &, TQDomDocument &) { return false; } bool WidgetFactory::inheritsFactories() { - for (QAsciiDictIterator<WidgetInfo> it(m_classesByName); it.current(); ++it) { - if (!it.current()->parentFactoryName().isEmpty()) + for (TQAsciiDictIterator<WidgetInfo> it(m_classesByName); it.current(); ++it) { + if (!it.current()->tqparentFactoryName().isEmpty()) return true; } return false; } -QString WidgetFactory::editorText() const { - QWidget *ed = editor(m_widget); +TQString WidgetFactory::editorText() const { + TQWidget *ed = editor(m_widget); return dynamic_cast<KTextEdit*>(ed) ? dynamic_cast<KTextEdit*>(ed)->text() : dynamic_cast<KLineEdit*>(ed)->text(); } -void WidgetFactory::setEditorText(const QString& text) { - QWidget *ed = editor(m_widget); +void WidgetFactory::setEditorText(const TQString& text) { + TQWidget *ed = editor(m_widget); if (dynamic_cast<KTextEdit*>(ed)) dynamic_cast<KTextEdit*>(ed)->setText(text); else dynamic_cast<KLineEdit*>(ed)->setText(text); } -void WidgetFactory::setEditor(QWidget *widget, QWidget *editor) +void WidgetFactory::setEditor(TQWidget *widget, TQWidget *editor) { if (!widget) return; WidgetInfo *winfo = m_classesByName[widget->className()]; - if (!winfo || winfo->parentFactoryName().isEmpty()) { + if (!winfo || winfo->tqparentFactoryName().isEmpty()) { m_editor = editor; } else { - WidgetFactory *f = m_library->factory(winfo->parentFactoryName()); + WidgetFactory *f = m_library->factory(winfo->tqparentFactoryName()); if (f!=this) f->setEditor(widget, editor); m_editor = editor; //keep a copy } } -QWidget *WidgetFactory::editor(QWidget *widget) const +TQWidget *WidgetFactory::editor(TQWidget *widget) const { if (!widget) return 0; WidgetInfo *winfo = m_classesByName[widget->className()]; - if (!winfo || winfo->parentFactoryName().isEmpty()) { + if (!winfo || winfo->tqparentFactoryName().isEmpty()) { return m_editor; } else { @@ -694,11 +694,11 @@ QWidget *WidgetFactory::editor(QWidget *widget) const } } -void WidgetFactory::setWidget(QWidget *widget, Container* container) +void WidgetFactory::setWidget(TQWidget *widget, Container* container) { WidgetInfo *winfo = widget ? m_classesByName[widget->className()] : 0; - if (winfo && !winfo->parentFactoryName().isEmpty()) { - WidgetFactory *f = m_library->factory(winfo->parentFactoryName()); + if (winfo && !winfo->tqparentFactoryName().isEmpty()) { + WidgetFactory *f = m_library->factory(winfo->tqparentFactoryName()); if (f!=this) f->setWidget(widget, container); } @@ -706,18 +706,18 @@ void WidgetFactory::setWidget(QWidget *widget, Container* container) m_container = container; } -QWidget *WidgetFactory::widget() const +TQWidget *WidgetFactory::widget() const { return m_widget; } -void WidgetFactory::setInternalProperty(const QCString& classname, const QCString& property, - const QString& value) +void WidgetFactory::setInternalProperty(const TQCString& classname, const TQCString& property, + const TQString& value) { m_internalProp[classname+":"+property]=value; } -void WidgetFactory::setPropertyOptions( WidgetPropertySet& /*buf*/, const WidgetInfo& /*info*/, QWidget * /*w*/ ) +void WidgetFactory::setPropertyOptions( WidgetPropertySet& /*buf*/, const WidgetInfo& /*info*/, TQWidget * /*w*/ ) { //nothing } diff --git a/kexi/formeditor/widgetfactory.h b/kexi/formeditor/widgetfactory.h index 43736ebc..2cb74fc8 100644 --- a/kexi/formeditor/widgetfactory.h +++ b/kexi/formeditor/widgetfactory.h @@ -23,23 +23,23 @@ #define KFORMDESIGNERWIDGETFACTORY_H -#include <qobject.h> -#include <qguardedptr.h> -#include <qpixmap.h> -#include <qpopupmenu.h> -#include <qasciidict.h> +#include <tqobject.h> +#include <tqguardedptr.h> +#include <tqpixmap.h> +#include <tqpopupmenu.h> +#include <tqasciidict.h> #include <kexiutils/tristate.h> -// class QPixmap; -template<class type> class QValueVector; -template<class type> class QPtrList; -template<class type> class QDict; -class QWidget; -class QDomElement; -class QDomDocument; -class QVariant; -class QListView; +// class TQPixmap; +template<class type> class TQValueVector; +template<class type> class TQPtrList; +template<class type> class TQDict; +class TQWidget; +class TQDomElement; +class TQDomDocument; +class TQVariant; +class TQListView; class KActionCollection; class KTextEdit; class KLineEdit; @@ -65,49 +65,49 @@ class Form; class KFORMEDITOR_EXPORT WidgetInfo { public: - typedef QPtrList<WidgetInfo> List; - typedef QAsciiDict<WidgetInfo> Dict; + typedef TQPtrList<WidgetInfo> List; + typedef TQAsciiDict<WidgetInfo> Dict; WidgetInfo(WidgetFactory *f); - WidgetInfo(WidgetFactory *f, const char* parentFactoryName, const char* inheritedClassName = 0); + WidgetInfo(WidgetFactory *f, const char* tqparentFactoryName, const char* inheritedClassName = 0); virtual ~WidgetInfo(); //! \return a pixmap associated with the widget - QString pixmap() const { return m_pixmap; } + TQString pixmap() const { return m_pixmap; } - //! \return the class name of a widget e.g. 'QLineEdit' - QCString className() const { return m_class; } + //! \return the class name of a widget e.g. 'TQLineEdit' + TQCString className() const { return m_class; } /*! \return the name used to name widget, that will appear eg in scripts (must not contain spaces nor non-latin1 characters) */ - QString namePrefix() const { return m_prefixName; } + TQString namePrefix() const { return m_prefixName; } //! \return the real name e.g. 'Line Edit', showed eg in ObjectTreeView - QString name() const { return m_name; } + TQString name() const { return m_name; } - QString description() const { return m_desc; } - QString includeFileName() const { return m_include; } - QValueList<QCString> alternateClassNames() const { return m_alternateNames; } - QString savingName() const { return m_saveName; } + TQString description() const { return m_desc; } + TQString includeFileName() const { return m_include; } + TQValueList<TQCString> alternateClassNames() const { return m_alternateNames; } + TQString savingName() const { return m_saveName; } WidgetFactory *factory() const { return m_factory; } - void setPixmap(const QString &p) { m_pixmap = p; } - void setClassName(const QCString &s) { m_class = s; } - void setName(const QString &n) { m_name = n; } - void setNamePrefix(const QString &n) { m_prefixName = n; } - void setDescription(const QString &desc) { m_desc = desc;} + void setPixmap(const TQString &p) { m_pixmap = p; } + void setClassName(const TQCString &s) { m_class = s; } + void setName(const TQString &n) { m_name = n; } + void setNamePrefix(const TQString &n) { m_prefixName = n; } + void setDescription(const TQString &desc) { m_desc = desc;} /*! Sets the C++ include file corresponding to this class, - that uic will need to add when creating the file. You don't have to set this for Qt std widgets.*/ - void setIncludeFileName(const QString &name) { m_include = name;} + that uic will need to add when creating the file. You don't have to set this for TQt std widgets.*/ + void setIncludeFileName(const TQString &name) { m_include = name;} /*! Sets alternate names for this class. If this name is found when loading a .ui file, the className() will be used instead. - It allows to support both KDE and Qt versions of widget, without duplicating code. + It allows to support both KDE and TQt versions of widget, without duplicating code. As a rule, className() should always return a class name which is inherited from - alternate class. For example KListView class has alternate QListView class. + alternate class. For example KListView class has alternate TQListView class. \a override parameter overrides class name of a widget, even if it was implemented in other factory. @@ -119,21 +119,21 @@ class KFORMEDITOR_EXPORT WidgetInfo For example, in Kexi application, KLineEdit class contains additional "datasource" property for binding to database sources. */ - void addAlternateClassName(const QCString& alternateName, bool override = false); + void addAlternateClassName(const TQCString& alternateName, bool override = false); /*! \return true is a class \a alternateName is defined as alternate name with 'override' flag set to true, using addAlternateClassName(). If this flag is set to false (the default) or there's no such alternate class name defined. */ - bool isOverriddenClassName(const QCString& alternateName) const; + bool isOverriddenClassName(const TQCString& alternateName) const; /*! Sets the name that will be written in the .ui file when saving. This name must be one of alternate names (or loading will be impossible). On form data saving to XML .ui format, saveName is used instead, - so .ui format is not broken and still usable with other software as Qt Designer. + so .ui format is not broken and still usable with other software as TQt Designer. Custom properties are saved as well with 'stdset' attribute set to 0. */ - void setSavingName(const QString &saveName) { m_saveName = saveName; } + void setSavingName(const TQString &saveName) { m_saveName = saveName; } /*! Sets autoSync flag for property \a propertyName. This allows to override autoSync flag for certain widget's property, because @@ -146,7 +146,7 @@ class KFORMEDITOR_EXPORT WidgetInfo If cancelled value is returned, there is no overriding (the default). */ tristate autoSyncForProperty(const char *propertyName) const; - QCString parentFactoryName() const { return m_parentFactoryName; } + TQCString tqparentFactoryName() const { return m_parentFactoryName; } WidgetInfo* inheritedClass() const { return m_inheritedClass; } @@ -161,22 +161,22 @@ class KFORMEDITOR_EXPORT WidgetInfo int customTypeForProperty(const char *propertyName) const; protected: - QCString m_parentFactoryName, m_inheritedClassName; //!< Used for inheriting widgets between factories + TQCString m_parentFactoryName, m_inheritedClassName; //!< Used for inheriting widgets between factories WidgetInfo* m_inheritedClass; private: - QString m_pixmap; - QCString m_class; - QString m_name; - QString m_prefixName; - QString m_desc; - QString m_include; - QValueList<QCString> m_alternateNames; - QAsciiDict<char> *m_overriddenAlternateNames; - QString m_saveName; - QGuardedPtr<WidgetFactory> m_factory; - QAsciiDict<char> *m_propertiesWithDisabledAutoSync; - QMap<QCString,int> *m_customTypesForProperty; + TQString m_pixmap; + TQCString m_class; + TQString m_name; + TQString m_prefixName; + TQString m_desc; + TQString m_include; + TQValueList<TQCString> m_alternateNames; + TQAsciiDict<char> *m_overriddenAlternateNames; + TQString m_saveName; + TQGuardedPtr<WidgetFactory> m_factory; + TQAsciiDict<char> *m_propertiesWithDisabledAutoSync; + TQMap<TQCString,int> *m_customTypesForProperty; friend class WidgetLibrary; }; @@ -198,7 +198,7 @@ class KFORMEDITOR_EXPORT WidgetInfo You can also choose which properties to show in the Property Editor. By default, most all properties are shown (see implementation for details), but you can hide some reimplementing isPropertyVisibleInternal() (don't forget to call superclass' method) - To add new properties, just define new Q_PROPERTY in widget class definition.\n \n + To add new properties, just define new TQ_PROPERTY in widget class definition.\n \n <b>Inline editing</b>\n KFormDesigner allow you to edit the widget's contents inside Form, without using a dialog. @@ -218,12 +218,12 @@ class KFORMEDITOR_EXPORT WidgetInfo <b>Widget saving/loading</b>\n You can also control how your widget are saved/loaded. You can choose which properties to save (see autoSaveProperties()), and save/load custom properties, ie - properties that are not Q_PROPERTY but you want to save in the UI file. This is used eg to + properties that are not TQ_PROPERTY but you want to save in the UI file. This is used eg to save combo box or listview contents (see saveSpecialProperty() and readSpecialProperty()). \n \n <b>Special internal properties</b>\n - Use void setInternalProperty(const QCString& classname, const QCString& property, const QString& value); + Use void setInternalProperty(const TQCString& classname, const TQCString& property, const TQString& value); to set values of special internal properties. Currently these properties are used for customizing popup menu items used for orientation selection. Customization for class ClassName should look like: @@ -236,10 +236,10 @@ class KFORMEDITOR_EXPORT WidgetInfo * "orientationSelectionPopup:verticalIcon" - the same for "Vertical" item. Set this property only for classes supporting orientations. * "orientationSelectionPopup:horizontalText" - sets a i18n'd text for "Horizontal" item - for objects of class 'ClassName', e.g. i18n("Insert Horizontal Line"). + for objects of class 'ClassName', e.g. i18n("InsertQt::Horizontal Line"). Set this property only for classes supporting orientations. * "orientationSelectionPopup:verticalText" - the same for "Vertical" item, - e.g. i18n("Insert Vertical Line"). Set this property only for classes supporting orientations. + e.g. i18n("InsertQt::Vertical Line"). Set this property only for classes supporting orientations. * "dontStartEditingOnInserting" - if not empty, WidgetFactory::startEditing() will not be executed upon widget inseting by a user. * "forceShowAdvancedProperty:{propertyname}" - set it to "1" for "{propertyname}" advanced property @@ -254,9 +254,10 @@ class KFORMEDITOR_EXPORT WidgetInfo See the standard factories in formeditor/factories for an example of factories, and how to deal with complex widgets (eg tabwidget). */ -class KFORMEDITOR_EXPORT WidgetFactory : public QObject +class KFORMEDITOR_EXPORT WidgetFactory : public TQObject { Q_OBJECT + TQ_OBJECT public: //! Options used in createWidget() enum CreateWidgetOptions { @@ -267,7 +268,7 @@ class KFORMEDITOR_EXPORT WidgetFactory : public QObject DefaultOptions = AnyOrientation | DesignViewMode }; - WidgetFactory(QObject *parent=0, const char *name=0); + WidgetFactory(TQObject *tqparent=0, const char *name=0); virtual ~WidgetFactory(); /*! Adds a new class described by \a w. */ @@ -288,12 +289,12 @@ class KFORMEDITOR_EXPORT WidgetFactory : public QObject * Creates a widget (and if needed a KFormDesigner::Container) * \return the created widget * \param classname the classname of the widget, which should get created - * \param parent the parent for the created widget + * \param tqparent the tqparent for the created widget * \param name the name of the created widget * \param container the toplevel Container (if a container should get created) * \param options options for the created widget: orientation and view mode (see CreateWidgetOptions) */ - virtual QWidget* createWidget(const QCString &classname, QWidget *parent, const char *name, + virtual TQWidget* createWidget(const TQCString &classname, TQWidget *tqparent, const char *name, KFormDesigner::Container *container, int options = DefaultOptions) = 0; @@ -303,69 +304,69 @@ class KFORMEDITOR_EXPORT WidgetFactory : public QObject /*! This function can be used to add custom items in widget \a w context menu \a menu. */ - virtual bool createMenuActions(const QCString &classname, QWidget *w, QPopupMenu *menu, + virtual bool createMenuActions(const TQCString &classname, TQWidget *w, TQPopupMenu *menu, KFormDesigner::Container *container)=0; /*! Creates (if necessary) an editor to edit the contents of the widget directly in the Form (eg creates a line edit to change the text of a label). \a classname is the class the widget belongs to, \a w is the widget to edit - and \a container is the parent container of this widget (to access Form etc.). + and \a container is the tqparent container of this widget (to access Form etc.). */ - virtual bool startEditing(const QCString &classname, QWidget *w, Container *container)=0; + virtual bool startEditing(const TQCString &classname, TQWidget *w, Container *container)=0; /*! This function is called just before the Form is previewed. It allows widgets to make changes before switching (ie for a Spring, hiding the cross) */ - virtual bool previewWidget(const QCString &classname, QWidget *widget, Container *container)=0; + virtual bool previewWidget(const TQCString &classname, TQWidget *widget, Container *container)=0; - virtual bool clearWidgetContent(const QCString &classname, QWidget *w); + virtual bool clearWidgetContent(const TQCString &classname, TQWidget *w); /*! This function is called when FormIO finds a property, at save time, that it cannot handle (ie not a normal property). This way you can save special properties, for example the contents of a listbox. \sa readSpecialProperty() */ - virtual bool saveSpecialProperty(const QCString &classname, const QString &name, - const QVariant &value, QWidget *w, - QDomElement &parentNode, QDomDocument &parent); + virtual bool saveSpecialProperty(const TQCString &classname, const TQString &name, + const TQVariant &value, TQWidget *w, + TQDomElement &tqparentNode, TQDomDocument &tqparent); /*! This function is called when FormIO finds a property or an unknown element in a .ui file. You can this way load a special property, for example the contents of a listbox. \sa saveSpecialProperty() */ - virtual bool readSpecialProperty(const QCString &classname, QDomElement &node, - QWidget *w, ObjectTreeItem *item); + virtual bool readSpecialProperty(const TQCString &classname, TQDomElement &node, + TQWidget *w, ObjectTreeItem *item); /*! This function is used to know whether the \a property for the widget \a w should be shown or not in the PropertyEditor. If \a multiple is true, then multiple widgets of the same class are selected, and you should only show properties shared by widgets (eg font, color). By default, all properties are shown if multiple == true, and none if multiple == false. */ - bool isPropertyVisible(const QCString &classname, QWidget *w, - const QCString &property, bool multiple, bool isTopLevel); + bool isPropertyVisible(const TQCString &classname, TQWidget *w, + const TQCString &property, bool multiple, bool isTopLevel); /*! You need to return here a list of the properties that should automatically be saved for a widget belonging to \a classname, and your custom properties (eg "text" for label or button, "contents" for combobox...). */ - virtual QValueList<QCString> autoSaveProperties(const QCString &classname)=0; + virtual TQValueList<TQCString> autoSaveProperties(const TQCString &classname)=0; /*! \return The i18n'ed name of the property whose name is \a name, that will be displayed in PropertyEditor. */ - inline QString propertyDescForName(const QCString &name) { return m_propDesc[name]; }; + inline TQString propertyDescForName(const TQCString &name) { return m_propDesc[name]; }; /*! \return The i18n'ed name of the property's value whose name is \a name. */ - inline QString propertyDescForValue(const QCString &name) { return m_propValDesc[name]; }; + inline TQString propertyDescForValue(const TQCString &name) { return m_propValDesc[name]; }; /*! This method is called after WidgetPropertySet was filled with properties of a widget \a w, of class defined by \a info. Default implementation does nothing. Implement this if you need to set options for properties within the set \a buf. */ - virtual void setPropertyOptions( WidgetPropertySet& buf, const WidgetInfo& info, QWidget *w ); + virtual void setPropertyOptions( WidgetPropertySet& buf, const WidgetInfo& info, TQWidget *w ); /*! \return internal property \a property for a class \a classname. Internal properties are not stored within objects, but can be just provided to describe classes' details. */ - inline QString internalProperty(const QCString& classname, const QCString& property) const { + inline TQString internalProperty(const TQCString& classname, const TQCString& property) const { return m_internalProp[classname+":"+property]; } @@ -373,62 +374,62 @@ class KFORMEDITOR_EXPORT WidgetFactory : public QObject /*! This function is called when we want to know whether the property should be visible. Implement it in the factory; don't forget to call implementation in the superclass. Default implementation hides "caption", "icon", "sizeIncrement" and "iconText" properties. */ - virtual bool isPropertyVisibleInternal(const QCString &classname, QWidget *w, - const QCString &property, bool isTopLevel); + virtual bool isPropertyVisibleInternal(const TQCString &classname, TQWidget *w, + const TQCString &property, bool isTopLevel); /*! Sometimes property sets should be reloaded when a given property value changed. Implement it in the factory. Default implementation always returns false. */ - virtual bool propertySetShouldBeReloadedAfterPropertyChange(const QCString& classname, QWidget *w, - const QCString& property); + virtual bool propertySetShouldBeReloadedAfterPropertyChange(const TQCString& classname, TQWidget *w, + const TQCString& property); /*! This function creates a KLineEdit to input some text and edit a widget's contents. This can be used in startEditing(). \a text is the text to display by default - in the line edit, \a w is the edited widget, \a geometry is the geometry the new line - edit should have, and \a align is Qt::AlignmentFlags of the new line edit. */ - void createEditor(const QCString &classname, const QString &text, - QWidget *w, Container *container, QRect geometry, + in the line edit, \a w is the edited widget, \a tqgeometry is the tqgeometry the new line + edit should have, and \a align is TQt::AlignmentFlags of the new line edit. */ + void createEditor(const TQCString &classname, const TQString &text, + TQWidget *w, Container *container, TQRect tqgeometry, int align, bool useFrame=false, bool multiLine = false, - BackgroundMode background = Qt::NoBackground); + BackgroundMode background = TQt::NoBackground); /*! This function provides a simple editing mode : it justs disable event filtering for the widget, and it install it again when the widget loose focus or Enter is pressed. */ - void disableFilter(QWidget *w, Container *container); + void disableFilter(TQWidget *w, Container *container); /*! This function creates a little dialog (a KEditListBox) to modify the contents of a list (of strings). It can be used to modify the contents of a combo box for instance. The modified list is copied into \a list when the user presses "Ok".*/ - bool editList(QWidget *w, QStringList &list); + bool editList(TQWidget *w, TQStringList &list); - /*! This function creates a little editor to modify rich text. It supports alignment, + /*! This function creates a little editor to modify rich text. It supports tqalignment, subscript and superscript and all basic formatting properties. If the user presses "Ok", the edited text is put in \a text. If he presses "Cancel", nothing happens. */ - bool editRichText(QWidget *w, QString &text); + bool editRichText(TQWidget *w, TQString &text); /*! This function creates a dialog to modify the contents of a ListView. You can modify both columns and list items. The listview is automatically updated if the user presses "Ok".*/ - void editListView(QListView *listview); + void editListView(TQListView *listview); /*! This function destroys the editor when it loses focus or Enter is pressed. */ - virtual bool eventFilter(QObject *obj, QEvent *ev); + virtual bool eventFilter(TQObject *obj, TQEvent *ev); /*! This function is used to modify a property of a widget (eg after editing it). Please use it instead of w->setProperty() to allow sync inside PropertyEditor. */ - void changeProperty(const char *name, const QVariant &value, Form *form); + void changeProperty(const char *name, const TQVariant &value, Form *form); /*! This function is called when the widget is resized, and the \a editor size needs to be updated. */ - virtual void resizeEditor(QWidget *editor, QWidget *widget, const QCString &classname); + virtual void resizeEditor(TQWidget *editor, TQWidget *widget, const TQCString &classname); // /*! Adds the i18n'ed description of a property, which will be shown in PropertyEditor. */ -// void addPropertyDescription(Container *container, const char *prop, const QString &desc); +// void addPropertyDescription(Container *container, const char *prop, const TQString &desc); // /*! Adds the i18n'ed description of a property value, which will be shown in PropertyEditor. */ -// void addValueDescription(Container *container, const char *value, const QString &desc); +// void addValueDescription(Container *container, const char *value, const TQString &desc); /*! \return true if at least one class defined by this factory inherits a class from other factory. Used in WidgetLibrary::loadFactories() @@ -449,9 +450,9 @@ class KFORMEDITOR_EXPORT WidgetFactory : public QObject This slot is called when the line edit text changes, and you have to make it really change the good property of the widget using changeProperty() (text, or title, etc.). */ - virtual bool changeText(const QString &newText); + virtual bool changeText(const TQString &newText); - void changeTextInternal(const QString& text); + void changeTextInternal(const TQString& text); void slotTextChanged(); @@ -460,37 +461,37 @@ class KFORMEDITOR_EXPORT WidgetFactory : public QObject void widgetDestroyed(); protected: - QString editorText() const; - void setEditorText(const QString& text); - void setEditor(QWidget *widget, QWidget *editor); - QWidget *editor(QWidget *widget) const; - void setWidget(QWidget *widget, Container *container); - QWidget *widget() const; + TQString editorText() const; + void setEditorText(const TQString& text); + void setEditor(TQWidget *widget, TQWidget *editor); + TQWidget *editor(TQWidget *widget) const; + void setWidget(TQWidget *widget, Container *container); + TQWidget *widget() const; /*! Assigns \a value for internal property \a property for a class \a classname. Internal properties are not stored within objects, but can be provided to describe classes' details. */ - void setInternalProperty(const QCString& classname, const QCString& property, const QString& value); + void setInternalProperty(const TQCString& classname, const TQCString& property, const TQString& value); WidgetLibrary *m_library; - QCString m_editedWidgetClass; + TQCString m_editedWidgetClass; //#ifdef KEXI_KTEXTEDIT -// QGuardedPtr<KTextEdit> m_editor; +// TQGuardedPtr<KTextEdit> m_editor; //#else -// QGuardedPtr<KLineEdit> m_editor; +// TQGuardedPtr<KLineEdit> m_editor; //#endif - QString m_firstText; - QGuardedPtr<ResizeHandleSet> m_handles; - QGuardedPtr<Container> m_container; + TQString m_firstText; + TQGuardedPtr<ResizeHandleSet> m_handles; + TQGuardedPtr<Container> m_container; // WidgetInfo::List m_classes; WidgetInfo::Dict m_classesByName; - QAsciiDict<char>* m_hiddenClasses; + TQAsciiDict<char>* m_hiddenClasses; //! i18n stuff - QMap<QCString, QString> m_propDesc; - QMap<QCString, QString> m_propValDesc; + TQMap<TQCString, TQString> m_propDesc; + TQMap<TQCString, TQString> m_propValDesc; //! internal properties - QMap<QCString, QString> m_internalProp; + TQMap<TQCString, TQString> m_internalProp; /*! flag useful to decide whether to hide some properties. It's value is inherited from WidgetLibrary. */ @@ -500,12 +501,12 @@ class KFORMEDITOR_EXPORT WidgetFactory : public QObject (and menu items in the future?) for the factory. Can be empty, e.g. for the main factory which has XMLGUI defined in the shell window itself (e.g. kexiformpartinstui.rc for Kexi Forms). This name is set in WidgetLibrary::loadFactories() */ - QString m_xmlGUIFileName; + TQString m_xmlGUIFileName; KXMLGUIClient *m_guiClient; - QGuardedPtr<QWidget> m_widget; - QGuardedPtr<QWidget> m_editor; + TQGuardedPtr<TQWidget> m_widget; + TQGuardedPtr<TQWidget> m_editor; friend class WidgetLibrary; }; diff --git a/kexi/formeditor/widgetlibrary.cpp b/kexi/formeditor/widgetlibrary.cpp index 1a198195..265153e7 100644 --- a/kexi/formeditor/widgetlibrary.cpp +++ b/kexi/formeditor/widgetlibrary.cpp @@ -19,8 +19,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> -#include <qstrlist.h> +#include <tqdom.h> +#include <tqstrlist.h> #include <kdebug.h> #include <klocale.h> @@ -40,11 +40,11 @@ namespace KFormDesigner { //! @internal -class XMLGUIClient : public QObject, public KXMLGUIClient +class XMLGUIClient : public TQObject, public KXMLGUIClient { public: - XMLGUIClient(KXMLGUIClient* parent, const QString& xmlFileName) - : QObject(parent->actionCollection()), KXMLGUIClient(parent) + XMLGUIClient(KXMLGUIClient* tqparent, const TQString& xmlFileName) + : TQObject(tqparent->actionCollection()), KXMLGUIClient(tqparent) { setXMLFile( xmlFileName, true /*merge*/ ); } @@ -79,10 +79,10 @@ class WidgetLibraryPrivate /*! @todo: reenable */ advancedProperties.insert("palette", (char*)1); advancedProperties.insert("backgroundOrigin", (char*)1); advancedProperties.insert("backgroundMode", (char*)1);//this is rather useless - advancedProperties.insert("layout", (char*)1);// too large risk to break things + advancedProperties.insert("tqlayout", (char*)1);// too large risk to break things // by providing this in propeditor - advancedProperties.insert("minimumSize", (char*)1); - advancedProperties.insert("maximumSize", (char*)1); + advancedProperties.insert("tqminimumSize", (char*)1); + advancedProperties.insert("tqmaximumSize", (char*)1); #ifdef KEXI_NO_UNFINISHED /*! @todo reenable */ advancedProperties.insert("paletteBackgroundPixmap", (char*)1); @@ -93,11 +93,11 @@ class WidgetLibraryPrivate } // dict which associates a class name with a Widget class WidgetInfo::Dict widgets;//, alternateWidgets; - QAsciiDict<KService::Ptr> services; - QAsciiDict<char> supportedFactoryGroups; - QAsciiDict<WidgetFactory> factories; - QAsciiDict<char> advancedProperties; - QAsciiDict<char> hiddenClasses; + TQAsciiDict<KService::Ptr> services; + TQAsciiDict<char> supportedFactoryGroups; + TQAsciiDict<WidgetFactory> factories; + TQAsciiDict<char> advancedProperties; + TQAsciiDict<char> hiddenClasses; bool showAdvancedProperties : 1; bool factoriesLoaded : 1; }; @@ -107,11 +107,11 @@ using namespace KFormDesigner; //------------------------------------------- -WidgetLibrary::WidgetLibrary(QObject *parent, const QStringList& supportedFactoryGroups) - : QObject(parent) +WidgetLibrary::WidgetLibrary(TQObject *tqparent, const TQStringList& supportedFactoryGroups) + : TQObject(tqparent) , d(new WidgetLibraryPrivate()) { - for (QStringList::ConstIterator it = supportedFactoryGroups.constBegin(); + for (TQStringList::ConstIterator it = supportedFactoryGroups.constBegin(); it!=supportedFactoryGroups.constEnd(); ++it) { d->supportedFactoryGroups.insert( (*it).lower().latin1(), (char*)1); @@ -129,19 +129,19 @@ WidgetLibrary::loadFactoryWidgets(WidgetFactory *f) { const WidgetInfo::Dict widgets = f->classes(); WidgetInfo *w; - for(QAsciiDictIterator<WidgetInfo> it(widgets); (w = it.current()); ++it) + for(TQAsciiDictIterator<WidgetInfo> it(widgets); (w = it.current()); ++it) { if (0 != d->hiddenClasses[ w->className() ]) continue; //this class is hidden // check if we want to inherit a widget from a different factory if (!w->m_parentFactoryName.isEmpty() && !w->m_inheritedClassName.isEmpty()) { - WidgetFactory *parentFactory = d->factories[w->m_parentFactoryName]; - if (!parentFactory) { + WidgetFactory *tqparentFactory = d->factories[w->m_parentFactoryName]; + if (!tqparentFactory) { kdWarning() << "WidgetLibrary::loadFactoryWidgets(): class '" << w->className() - << "' - no such parent factory '" << w->m_parentFactoryName << "'" << endl; + << "' - no such tqparent factory '" << w->m_parentFactoryName << "'" << endl; continue; } - WidgetInfo* inheritedClass = parentFactory->m_classesByName[ w->m_inheritedClassName ]; + WidgetInfo* inheritedClass = tqparentFactory->m_classesByName[ w->m_inheritedClassName ]; if (!inheritedClass) { kdWarning() << "WidgetLibrary::loadFactoryWidgets(): class '" << w->m_inheritedClassName << "' - no such class to inherit in factory '" << w->m_parentFactoryName << "'" << endl; @@ -152,7 +152,7 @@ WidgetLibrary::loadFactoryWidgets(WidgetFactory *f) if (w->pixmap().isEmpty()) w->setPixmap( inheritedClass->pixmap() ); //ok? - foreach (QValueList<QCString>::ConstIterator, it_alt, inheritedClass->m_alternateNames) { + foreach (TQValueList<TQCString>::ConstIterator, it_alt, inheritedClass->m_alternateNames) { w->addAlternateClassName( *it_alt, inheritedClass->isOverriddenClassName( *it_alt ) ); } if (w->includeFileName().isEmpty()) @@ -166,27 +166,27 @@ WidgetLibrary::loadFactoryWidgets(WidgetFactory *f) } // kdDebug() << "WidgetLibrary::addFactory(): adding class " << w->className() << endl; - QValueList<QCString> l = w->alternateClassNames(); + TQValueList<TQCString> l = w->alternateClassNames(); l.prepend( w->className() ); //d->widgets.insert(w->className(), w); // if(!w->alternateClassName().isEmpty()) { -// QStringList l = QStringList::split("|", w->alternateClassName()); - QValueList<QCString>::ConstIterator endIt = l.constEnd(); - for(QValueList<QCString>::ConstIterator it = l.constBegin(); it != endIt; ++it) { - WidgetInfo *widgetForClass = d->widgets.find( *it ); +// TQStringList l = TQStringList::split("|", w->alternateClassName()); + TQValueList<TQCString>::ConstIterator endIt = l.constEnd(); + for(TQValueList<TQCString>::ConstIterator it = l.constBegin(); it != endIt; ++it) { + WidgetInfo *widgetForClass = d->widgets.tqfind( *it ); if (!widgetForClass || (widgetForClass && !widgetForClass->isOverriddenClassName(*it))) { //insert a widgetinfo, if: //1) this class has no alternate class assigned yet, or //2) this class has alternate class assigned but without 'override' flag - d->widgets.replace( *it, w); + d->widgets.tqreplace( *it, w); } -/* WidgetInfo *widgetForClass = d->alternateWidgets.find(*it); +/* WidgetInfo *widgetForClass = d->alternateWidgets.tqfind(*it); if (!widgetForClass || (widgetForClass && !widgetForClass->isOverriddenClassName(*it))) { //insert a widgetinfo, if: //1) this class has no alternate class assigned yet, or //2) this class has alternate class assigned but without 'override' flag - d->alternateWidgets.replace(*it, w); + d->alternateWidgets.tqreplace(*it, w); }*/ } } @@ -209,7 +209,7 @@ WidgetLibrary::lookupFactories() } kdDebug() << "WidgetLibrary::lookupFactories(): found factory: " << ptr->name() << endl; - QCString groupName = ptr->property("X-KFormDesigner-FactoryGroup").toCString(); + TQCString groupName = ptr->property("X-KFormDesigner-FactoryGroup").toCString(); if (!groupName.isEmpty() && !d->supportedFactoryGroups[groupName]) { kdDebug() << "WidgetLibrary::lookupFactories(): factory group '" << groupName << "' is unsupported by this application (library=" << ptr->library() << ")"<< endl; @@ -217,10 +217,10 @@ WidgetLibrary::lookupFactories() } const uint factoryVersion = ptr->property("X-KFormDesigner-WidgetFactoryVersion").toUInt(); if (KFormDesigner::version()!=factoryVersion) { - kdWarning() << QString("WidgetLibrary::lookupFactories(): factory '%1'" + kdWarning() << TQString("WidgetLibrary::lookupFactories(): factory '%1'" " has version '%2' but required Widget Factory version is '%3'\n" - " -- skipping this factory!").arg(ptr->library()).arg(factoryVersion) - .arg(KFormDesigner::version()) << endl; + " -- skipping this factory!").tqarg(ptr->library()).tqarg(factoryVersion) + .tqarg(KFormDesigner::version()) << endl; continue; } d->services.insert(ptr->library().latin1(), new KService::Ptr( ptr )); @@ -233,9 +233,9 @@ WidgetLibrary::loadFactories() if (d->factoriesLoaded) return; d->factoriesLoaded = true; - for (QAsciiDictIterator<KService::Ptr> it(d->services); it.current(); ++it) { + for (TQAsciiDictIterator<KService::Ptr> it(d->services); it.current(); ++it) { WidgetFactory *f = KParts::ComponentFactory::createInstanceFromService<WidgetFactory>( - *it.current(), this, (*it.current())->library().latin1(), QStringList()); + *it.current(), this, (*it.current())->library().latin1(), TQStringList()); if (!f) { kdWarning() << "WidgetLibrary::loadFactories(): creating factory failed! " << (*it.current())->library() << endl; @@ -248,15 +248,15 @@ WidgetLibrary::loadFactories() //collect information about classes to be hidden if (f->m_hiddenClasses) { - for (QAsciiDictIterator<char> it2(*f->m_hiddenClasses); it2.current(); ++it2) { - d->hiddenClasses.replace( it2.currentKey(), (char*)1 ); + for (TQAsciiDictIterator<char> it2(*f->m_hiddenClasses); it2.current(); ++it2) { + d->hiddenClasses.tqreplace( it2.currentKey(), (char*)1 ); } } } //now we have factories instantiated: load widgets - QPtrList<WidgetFactory> loadLater; - for (QAsciiDictIterator<WidgetFactory> it(d->factories); it.current(); ++it) { + TQPtrList<WidgetFactory> loadLater; + for (TQAsciiDictIterator<WidgetFactory> it(d->factories); it.current(); ++it) { //ONE LEVEL, FLAT INHERITANCE, but works! //if this factory inherits from something, load its witgets later //! @todo improve @@ -266,49 +266,49 @@ WidgetLibrary::loadFactories() loadFactoryWidgets(it.current()); } //load now the rest - for (QPtrListIterator<WidgetFactory> it(loadLater); it.current(); ++it) { + for (TQPtrListIterator<WidgetFactory> it(loadLater); it.current(); ++it) { loadFactoryWidgets(it.current()); } } /* old -QString +TQString WidgetLibrary::createXML() { loadFactories(); - QDomDocument doc("kpartgui"); - QDomElement root = doc.createElement("kpartgui"); + TQDomDocument doc("kpartgui"); + TQDomElement root = doc.createElement("kpartgui"); root.setAttribute("name", "kformdesigner"); root.setAttribute("version", "0.3"); doc.appendChild(root); - QDomElement toolbar = doc.createElement("ToolBar"); + TQDomElement toolbar = doc.createElement("ToolBar"); toolbar.setAttribute("name", "widgets"); root.appendChild(toolbar); - QDomElement texttb = doc.createElement("text"); + TQDomElement texttb = doc.createElement("text"); toolbar.appendChild(texttb); - QDomText ttext = doc.createTextNode("Widgets"); + TQDomText ttext = doc.createTextNode("Widgets"); texttb.appendChild(ttext); - QDomElement menubar = doc.createElement("MenuBar"); + TQDomElement menubar = doc.createElement("MenuBar"); toolbar.setAttribute("name", "widgets"); root.appendChild(menubar); - QDomElement Mtextb = doc.createElement("text"); + TQDomElement Mtextb = doc.createElement("text"); toolbar.appendChild(Mtextb); - QDomText Mtext = doc.createTextNode("Widgets"); + TQDomText Mtext = doc.createTextNode("Widgets"); Mtextb.appendChild(Mtext); - QDomElement menu = doc.createElement("Menu"); + TQDomElement menu = doc.createElement("Menu"); menu.setAttribute("name", "widgets"); - QAsciiDictIterator<WidgetInfo> it(d->widgets); + TQAsciiDictIterator<WidgetInfo> it(d->widgets); int i = 0; for(; it.current(); ++it) { - QDomElement action = doc.createElement("Action"); + TQDomElement action = doc.createElement("Action"); action.setAttribute("name", "library_widget" + it.current()->className()); toolbar.appendChild(action); @@ -319,13 +319,13 @@ WidgetLibrary::createXML() }*/ ActionList -WidgetLibrary::createWidgetActions(KXMLGUIClient* client, KActionCollection *parent, - QObject *receiver, const char *slot) +WidgetLibrary::createWidgetActions(KXMLGUIClient* client, KActionCollection *tqparent, + TQObject *receiver, const char *slot) { loadFactories(); // init XML gui clients (custom factories have their own .rc files) - for (QAsciiDictIterator<WidgetFactory> it(d->factories); it.current(); ++it) + for (TQAsciiDictIterator<WidgetFactory> it(d->factories); it.current(); ++it) { if (it.current()->m_xmlGUIFileName.isEmpty()) { // probably a built-in factory, with GUI file like kexiformpartinstui.rc it.current()->m_guiClient = 0; @@ -336,12 +336,12 @@ WidgetLibrary::createWidgetActions(KXMLGUIClient* client, KActionCollection *par } ActionList actions; - for (QAsciiDictIterator<WidgetInfo> it(d->widgets); it.current(); ++it) + for (TQAsciiDictIterator<WidgetInfo> it(d->widgets); it.current(); ++it) { LibActionWidget *a = new LibActionWidget(it.current(), it.current()->factory()->m_guiClient - ? it.current()->factory()->m_guiClient->actionCollection() : parent); - connect(a, SIGNAL(prepareInsert(const QCString &)), receiver, slot); + ? it.current()->factory()->m_guiClient->actionCollection() : tqparent); + connect(a, TQT_SIGNAL(prepareInsert(const TQCString &)), receiver, slot); actions.append(a); } return actions; @@ -350,7 +350,7 @@ WidgetLibrary::createWidgetActions(KXMLGUIClient* client, KActionCollection *par void WidgetLibrary::addCustomWidgetActions(KActionCollection *col) { - for (QAsciiDictIterator<WidgetFactory> it(d->factories); it.current(); ++it) + for (TQAsciiDictIterator<WidgetFactory> it(d->factories); it.current(); ++it) { it.current()->createCustomActions( it.current()->m_guiClient @@ -358,8 +358,8 @@ WidgetLibrary::addCustomWidgetActions(KActionCollection *col) } } -QWidget* -WidgetLibrary::createWidget(const QCString &classname, QWidget *parent, const char *name, Container *c, +TQWidget* +WidgetLibrary::createWidget(const TQCString &classname, TQWidget *tqparent, const char *name, Container *c, int options) { loadFactories(); @@ -367,12 +367,12 @@ WidgetLibrary::createWidget(const QCString &classname, QWidget *parent, const ch if(!wclass) return 0; - QWidget *widget = wclass->factory()->createWidget(wclass->className(), parent, name, c, options); + TQWidget *widget = wclass->factory()->createWidget(wclass->className(), tqparent, name, c, options); if (!widget) { //try to instantiate from inherited class if (wclass->inheritedClass()) widget = wclass->inheritedClass()->factory()->createWidget( - wclass->className(), parent, name, c, options); + wclass->className(), tqparent, name, c, options); if (!widget) return 0; } @@ -382,7 +382,7 @@ WidgetLibrary::createWidget(const QCString &classname, QWidget *parent, const ch } bool -WidgetLibrary::createMenuActions(const QCString &c, QWidget *w, QPopupMenu *menu, +WidgetLibrary::createMenuActions(const TQCString &c, TQWidget *w, TQPopupMenu *menu, KFormDesigner::Container *container) { loadFactories(); @@ -402,7 +402,7 @@ WidgetLibrary::createMenuActions(const QCString &c, QWidget *w, QPopupMenu *menu } bool -WidgetLibrary::startEditing(const QCString &classname, QWidget *w, Container *container) +WidgetLibrary::startEditing(const TQCString &classname, TQWidget *w, Container *container) { loadFactories(); WidgetInfo *wclass = d->widgets[classname]; @@ -418,7 +418,7 @@ WidgetLibrary::startEditing(const QCString &classname, QWidget *w, Container *co } bool -WidgetLibrary::previewWidget(const QCString &classname, QWidget *widget, Container *container) +WidgetLibrary::previewWidget(const TQCString &classname, TQWidget *widget, Container *container) { loadFactories(); WidgetInfo *wclass = d->widgets[classname]; @@ -434,7 +434,7 @@ WidgetLibrary::previewWidget(const QCString &classname, QWidget *widget, Contain } bool -WidgetLibrary::clearWidgetContent(const QCString &classname, QWidget *w) +WidgetLibrary::clearWidgetContent(const TQCString &classname, TQWidget *w) { loadFactories(); WidgetInfo *wclass = d->widgets[classname]; @@ -449,59 +449,59 @@ WidgetLibrary::clearWidgetContent(const QCString &classname, QWidget *w) return false; } -QString -WidgetLibrary::displayName(const QCString &classname) +TQString +WidgetLibrary::displayName(const TQCString &classname) { loadFactories(); - WidgetInfo *wi = d->widgets.find(classname); + WidgetInfo *wi = d->widgets.tqfind(classname); if(wi) return wi->name(); return classname; } -QString -WidgetLibrary::savingName(const QCString &classname) +TQString +WidgetLibrary::savingName(const TQCString &classname) { loadFactories(); - QString s; - WidgetInfo *wi = d->widgets.find(classname); + TQString s; + WidgetInfo *wi = d->widgets.tqfind(classname); if(wi && !wi->savingName().isEmpty()) return wi->savingName(); return classname; } -QString -WidgetLibrary::namePrefix(const QCString &classname) +TQString +WidgetLibrary::namePrefix(const TQCString &classname) { loadFactories(); - WidgetInfo *wi = d->widgets.find(classname); + WidgetInfo *wi = d->widgets.tqfind(classname); if(wi) return wi->namePrefix(); return classname; } -QString -WidgetLibrary::textForWidgetName(const QCString &name, const QCString &className) +TQString +WidgetLibrary::textForWidgetName(const TQCString &name, const TQCString &className) { loadFactories(); WidgetInfo *widget = d->widgets[className]; if(!widget) - return QString::null; + return TQString(); - QString newName = name; + TQString newName = name; newName.remove(widget->namePrefix()); newName = widget->name() + " " + newName; return newName; } -QCString -WidgetLibrary::classNameForAlternate(const QCString &classname) +TQCString +WidgetLibrary::classNameForAlternate(const TQCString &classname) { loadFactories(); - if(d->widgets.find(classname)) + if(d->widgets.tqfind(classname)) return classname; WidgetInfo *wi = d->widgets[classname]; @@ -513,49 +513,49 @@ WidgetLibrary::classNameForAlternate(const QCString &classname) return "CustomWidget"; } -QString -WidgetLibrary::includeFileName(const QCString &classname) +TQString +WidgetLibrary::includeFileName(const TQCString &classname) { loadFactories(); - WidgetInfo *wi = d->widgets.find(classname); + WidgetInfo *wi = d->widgets.tqfind(classname); if(wi) return wi->includeFileName(); - return QString::null; + return TQString(); } -QString -WidgetLibrary::iconName(const QCString &classname) +TQString +WidgetLibrary::iconName(const TQCString &classname) { loadFactories(); - WidgetInfo *wi = d->widgets.find(classname); + WidgetInfo *wi = d->widgets.tqfind(classname); if(wi) return wi->pixmap(); - return QString::fromLatin1("unknown_widget"); + return TQString::tqfromLatin1("unknown_widget"); } bool -WidgetLibrary::saveSpecialProperty(const QCString &classname, const QString &name, const QVariant &value, QWidget *w, QDomElement &parentNode, QDomDocument &parent) +WidgetLibrary::saveSpecialProperty(const TQCString &classname, const TQString &name, const TQVariant &value, TQWidget *w, TQDomElement &tqparentNode, TQDomDocument &tqparent) { loadFactories(); - WidgetInfo *wi = d->widgets.find(classname); + WidgetInfo *wi = d->widgets.tqfind(classname); if (!wi) return false; - if (wi->factory()->saveSpecialProperty(classname, name, value, w, parentNode, parent)) + if (wi->factory()->saveSpecialProperty(classname, name, value, w, tqparentNode, tqparent)) return true; //try from inherited class if (wi->inheritedClass()) - return wi->inheritedClass()->factory()->saveSpecialProperty(wi->className(), name, value, w, parentNode, parent); + return wi->inheritedClass()->factory()->saveSpecialProperty(wi->className(), name, value, w, tqparentNode, tqparent); return false; } bool -WidgetLibrary::readSpecialProperty(const QCString &classname, QDomElement &node, QWidget *w, ObjectTreeItem *item) +WidgetLibrary::readSpecialProperty(const TQCString &classname, TQDomElement &node, TQWidget *w, ObjectTreeItem *item) { loadFactories(); - WidgetInfo *wi = d->widgets.find(classname); + WidgetInfo *wi = d->widgets.tqfind(classname); if (!wi) return false; if (wi->factory()->readSpecialProperty(classname, node, w, item)) @@ -577,8 +577,8 @@ bool WidgetLibrary::advancedPropertiesVisible() const } bool -WidgetLibrary::isPropertyVisible(const QCString &classname, QWidget *w, - const QCString &property, bool multiple, bool isTopLevel) +WidgetLibrary::isPropertyVisible(const TQCString &classname, TQWidget *w, + const TQCString &property, bool multiple, bool isTopLevel) { if (isTopLevel) { // no focus policy for top-level form widget... @@ -587,7 +587,7 @@ WidgetLibrary::isPropertyVisible(const QCString &classname, QWidget *w, } loadFactories(); - WidgetInfo *wi = d->widgets.find(classname); + WidgetInfo *wi = d->widgets.tqfind(classname); if (!wi) return false; if (!d->showAdvancedProperties && d->advancedProperties[ property ]) { @@ -609,14 +609,14 @@ WidgetLibrary::isPropertyVisible(const QCString &classname, QWidget *w, return true; } -QValueList<QCString> -WidgetLibrary::autoSaveProperties(const QCString &classname) +TQValueList<TQCString> +WidgetLibrary::autoSaveProperties(const TQCString &classname) { loadFactories(); - WidgetInfo *wi = d->widgets.find(classname); + WidgetInfo *wi = d->widgets.tqfind(classname); if(!wi) - return QValueList<QCString>(); - QValueList<QCString> lst; + return TQValueList<TQCString>(); + TQValueList<TQCString> lst; //prepend from inherited class if (wi->inheritedClass()) lst = wi->inheritedClass()->factory()->autoSaveProperties(wi->className()); @@ -628,7 +628,7 @@ WidgetInfo* WidgetLibrary::widgetInfoForClassName(const char* classname) { loadFactories(); - return d->widgets.find(classname); + return d->widgets.tqfind(classname); } WidgetFactory* @@ -638,53 +638,53 @@ WidgetLibrary::factoryForClassName(const char* classname) return wi ? wi->factory() : 0; } -QString WidgetLibrary::propertyDescForName(WidgetInfo *winfo, const QCString& propertyName) +TQString WidgetLibrary::propertyDescForName(WidgetInfo *winfo, const TQCString& propertyName) { if (!winfo || !winfo->factory()) - return QString::null; - QString desc( winfo->factory()->propertyDescForName(propertyName) ); + return TQString(); + TQString desc( winfo->factory()->propertyDescForName(propertyName) ); if (!desc.isEmpty()) return desc; if (winfo->m_parentFactoryName.isEmpty()) - return QString::null; + return TQString(); - //try in parent factory, if exists - WidgetFactory *parentFactory = d->factories[winfo->m_parentFactoryName]; - if (!parentFactory) - return QString::null; + //try in tqparent factory, if exists + WidgetFactory *tqparentFactory = d->factories[winfo->m_parentFactoryName]; + if (!tqparentFactory) + return TQString(); - return parentFactory->propertyDescForName(propertyName); + return tqparentFactory->propertyDescForName(propertyName); } -QString WidgetLibrary::propertyDescForValue(WidgetInfo *winfo, const QCString& name) +TQString WidgetLibrary::propertyDescForValue(WidgetInfo *winfo, const TQCString& name) { if (!winfo->factory()) - return QString::null; - QString desc( winfo->factory()->propertyDescForValue(name) ); + return TQString(); + TQString desc( winfo->factory()->propertyDescForValue(name) ); if (!desc.isEmpty()) return desc; if (winfo->m_parentFactoryName.isEmpty()) - return QString::null; + return TQString(); - //try in parent factory, if exists - WidgetFactory *parentFactory = d->factories[winfo->m_parentFactoryName]; - if (!parentFactory) - return QString::null; + //try in tqparent factory, if exists + WidgetFactory *tqparentFactory = d->factories[winfo->m_parentFactoryName]; + if (!tqparentFactory) + return TQString(); - return parentFactory->propertyDescForValue(name); + return tqparentFactory->propertyDescForValue(name); } -void WidgetLibrary::setPropertyOptions( WidgetPropertySet& buf, const WidgetInfo& winfo, QWidget* w ) +void WidgetLibrary::setPropertyOptions( WidgetPropertySet& buf, const WidgetInfo& winfo, TQWidget* w ) { if (!winfo.factory()) return; winfo.factory()->setPropertyOptions(buf, winfo, w); if (winfo.m_parentFactoryName.isEmpty()) return; - WidgetFactory *parentFactory = d->factories[winfo.m_parentFactoryName]; - if (!parentFactory) + WidgetFactory *tqparentFactory = d->factories[winfo.m_parentFactoryName]; + if (!tqparentFactory) return; - parentFactory->setPropertyOptions(buf, winfo, w); + tqparentFactory->setPropertyOptions(buf, winfo, w); } WidgetFactory* WidgetLibrary::factory(const char* factoryName) const @@ -692,20 +692,20 @@ WidgetFactory* WidgetLibrary::factory(const char* factoryName) const return d->factories[factoryName]; } -QString WidgetLibrary::internalProperty(const QCString& classname, const QCString& property) +TQString WidgetLibrary::internalProperty(const TQCString& classname, const TQCString& property) { loadFactories(); WidgetInfo *wclass = d->widgets[classname]; if(!wclass) - return QString::null; - QString value( wclass->factory()->internalProperty(classname, property) ); + return TQString(); + TQString value( wclass->factory()->internalProperty(classname, property) ); if (value.isEmpty() && wclass->inheritedClass()) return wclass->inheritedClass()->factory()->internalProperty(classname, property); return value; } WidgetFactory::CreateWidgetOptions WidgetLibrary::showOrientationSelectionPopup( - const QCString &classname, QWidget* parent, const QPoint& pos) + const TQCString &classname, TQWidget* tqparent, const TQPoint& pos) { loadFactories(); WidgetInfo *wclass = d->widgets[classname]; @@ -713,8 +713,8 @@ WidgetFactory::CreateWidgetOptions WidgetLibrary::showOrientationSelectionPopup( return WidgetFactory::AnyOrientation; //get custom icons and strings - QPixmap iconHorizontal, iconVertical; - QString iconName( wclass->factory()->internalProperty(classname, "orientationSelectionPopup:horizontalIcon") ); + TQPixmap iconHorizontal, iconVertical; + TQString iconName( wclass->factory()->internalProperty(classname, "orientationSelectionPopup:horizontalIcon") ); if (iconName.isEmpty() && wclass->inheritedClass()) iconName = wclass->inheritedClass()->factory()->internalProperty(classname, "orientationSelectionPopup:horizontalIcon"); if (!iconName.isEmpty()) @@ -726,20 +726,20 @@ WidgetFactory::CreateWidgetOptions WidgetLibrary::showOrientationSelectionPopup( if (!iconName.isEmpty()) iconVertical = SmallIcon(iconName); - QString textHorizontal = wclass->factory()->internalProperty(classname, "orientationSelectionPopup:horizontalText"); + TQString textHorizontal = wclass->factory()->internalProperty(classname, "orientationSelectionPopup:horizontalText"); if (textHorizontal.isEmpty() && wclass->inheritedClass()) iconName = wclass->inheritedClass()->factory()->internalProperty(classname, "orientationSelectionPopup:horizontalText"); if (textHorizontal.isEmpty()) //default - textHorizontal = i18n("Insert Horizontal Widget", "Insert Horizontal"); + textHorizontal = i18n("InsertQt::Horizontal Widget", "InsertQt::Horizontal"); - QString textVertical = wclass->factory()->internalProperty(classname, "orientationSelectionPopup:verticalText"); + TQString textVertical = wclass->factory()->internalProperty(classname, "orientationSelectionPopup:verticalText"); if (textVertical.isEmpty() && wclass->inheritedClass()) iconName = wclass->inheritedClass()->factory()->internalProperty(classname, "orientationSelectionPopup:verticalText"); if (textVertical.isEmpty()) //default - textVertical = i18n("Insert Vertical Widget", "Insert Vertical"); + textVertical = i18n("InsertQt::Vertical Widget", "InsertQt::Vertical"); - KPopupMenu* popup = new KPopupMenu(parent, "orientationSelectionPopup"); - popup->insertTitle(SmallIcon(wclass->pixmap()), i18n("Insert Widget: %1").arg(wclass->name())); + KPopupMenu* popup = new KPopupMenu(tqparent, "orientationSelectionPopup"); + popup->insertTitle(SmallIcon(wclass->pixmap()), i18n("Insert Widget: %1").tqarg(wclass->name())); popup->insertItem(iconHorizontal, textHorizontal, 1); popup->insertItem(iconVertical, textVertical, 2); popup->insertSeparator(); @@ -758,7 +758,7 @@ WidgetFactory::CreateWidgetOptions WidgetLibrary::showOrientationSelectionPopup( } bool WidgetLibrary::propertySetShouldBeReloadedAfterPropertyChange( - const QCString& classname, QWidget *w, const QCString& property) + const TQCString& classname, TQWidget *w, const TQCString& property) { WidgetInfo *winfo = widgetInfoForClassName(classname); if (!winfo) diff --git a/kexi/formeditor/widgetlibrary.h b/kexi/formeditor/widgetlibrary.h index f4f8c1f3..d8a6529a 100644 --- a/kexi/formeditor/widgetlibrary.h +++ b/kexi/formeditor/widgetlibrary.h @@ -22,21 +22,21 @@ #ifndef KFORMDESIGNERWIDGETLIBRARY_H #define KFORMDESIGNERWIDGETLIBRARY_H -#include <qobject.h> -#include <qmap.h> -#include <qdict.h> +#include <tqobject.h> +#include <tqmap.h> +#include <tqdict.h> #include "widgetfactory.h" -template<class type> class QPtrList; -template<class type> class QValueVector; +template<class type> class TQPtrList; +template<class type> class TQValueVector; class KActionCollection; class KAction; -class QWidget; -class QPopupMenu; -class QVariant; -class QDomDocument; -class QDomElement; +class TQWidget; +class TQPopupMenu; +class TQVariant; +class TQDomDocument; +class TQDomElement; namespace KFormDesigner { @@ -45,7 +45,7 @@ class ObjectTreeItem; class WidgetLibraryPrivate; class WidgetPropertySet; -typedef QPtrList<KAction> ActionList; +typedef TQPtrList<KAction> ActionList; /** * This class searches for factories and provides KActions for widget creation. @@ -53,9 +53,10 @@ typedef QPtrList<KAction> ActionList; * You call WidgetLibrary functions instead of calling directly factories. * See WidgetFactory for a description of the functions. */ -class KFORMEDITOR_EXPORT WidgetLibrary : public QObject +class KFORMEDITOR_EXPORT WidgetLibrary : public TQObject { Q_OBJECT + TQ_OBJECT public: /*! Constructs WidgetLibrary object. @@ -65,69 +66,69 @@ class KFORMEDITOR_EXPORT WidgetLibrary : public QObject By default (when supportedFactoryGroups is empty) only factories having empty "X-KFormDesigner-FactoryGroup" field will be loaded. Factory group names are case-insensitive. */ - WidgetLibrary(QObject *parent=0, const QStringList& supportedFactoryGroups = QStringList()); + WidgetLibrary(TQObject *tqparent=0, const TQStringList& supportedFactoryGroups = TQStringList()); virtual ~WidgetLibrary(); /** * creates actions for widget creating */ - ActionList createWidgetActions(KXMLGUIClient* client, KActionCollection *parent, - QObject *receiver, const char *slot); + ActionList createWidgetActions(KXMLGUIClient* client, KActionCollection *tqparent, + TQObject *receiver, const char *slot); void addCustomWidgetActions(KActionCollection *col); //old /** //old * creates the XML for widget actions //old */ -//old QString createXML(); +//old TQString createXML(); /** * searches the right factory and creates a widget. * \return the widget or 0 if something falid */ - QWidget *createWidget(const QCString &classname, QWidget *parent, const char *name, Container *c, + TQWidget *createWidget(const TQCString &classname, TQWidget *tqparent, const char *name, Container *c, int options = WidgetFactory::DefaultOptions); - bool createMenuActions(const QCString &c, QWidget *w, QPopupMenu *menu, + bool createMenuActions(const TQCString &c, TQWidget *w, TQPopupMenu *menu, KFormDesigner::Container *container); /** * Shows orientation selection popup. * \return one of the following values: - * - WidgetFactory::AnyOrientation (means no selection has been made, i.e. it was cancelled) - * - WidgetFactory::HorizontalOrientation - * - WidgetFactory::VerticalOrientation + * - WidgetFactory::AnyQt::Orientation (means no selection has been made, i.e. it was cancelled) + * - WidgetFactory::HorizontalQt::Orientation + * - WidgetFactory::VerticalQt::Orientation */ WidgetFactory::CreateWidgetOptions showOrientationSelectionPopup( - const QCString &classname, QWidget* parent, const QPoint& pos); + const TQCString &classname, TQWidget* tqparent, const TQPoint& pos); - QString internalProperty(const QCString& classname, const QCString& property); + TQString internalProperty(const TQCString& classname, const TQCString& property); - QString displayName(const QCString &classname); - QString namePrefix(const QCString &classname); - QString textForWidgetName(const QCString &name, const QCString &className); + TQString displayName(const TQCString &classname); + TQString namePrefix(const TQCString &classname); + TQString textForWidgetName(const TQCString &name, const TQCString &className); /*! Checks if the \a classname is an alternate classname, and returns the good classname. If \a classname is not alternate, \a classname is returned. */ - QCString classNameForAlternate(const QCString &classname); - QString iconName(const QCString &classname); - QString includeFileName(const QCString &classname); - QString savingName(const QCString &classname); - - bool startEditing(const QCString &classname, QWidget *w, Container *container); - bool previewWidget(const QCString &classname, QWidget *widget, Container *container); - bool clearWidgetContent(const QCString &classname, QWidget *w); - - bool saveSpecialProperty(const QCString &classname, const QString &name, - const QVariant &value, QWidget *w, QDomElement &parentNode, QDomDocument &parent); - bool readSpecialProperty(const QCString &classname, QDomElement &node, QWidget *w, + TQCString classNameForAlternate(const TQCString &classname); + TQString iconName(const TQCString &classname); + TQString includeFileName(const TQCString &classname); + TQString savingName(const TQCString &classname); + + bool startEditing(const TQCString &classname, TQWidget *w, Container *container); + bool previewWidget(const TQCString &classname, TQWidget *widget, Container *container); + bool clearWidgetContent(const TQCString &classname, TQWidget *w); + + bool saveSpecialProperty(const TQCString &classname, const TQString &name, + const TQVariant &value, TQWidget *w, TQDomElement &tqparentNode, TQDomDocument &tqparent); + bool readSpecialProperty(const TQCString &classname, TQDomElement &node, TQWidget *w, ObjectTreeItem *item); - bool isPropertyVisible(const QCString &classname, QWidget *w, - const QCString &property, bool multiple = false, bool isTopLevel = false); + bool isPropertyVisible(const TQCString &classname, TQWidget *w, + const TQCString &property, bool multiple = false, bool isTopLevel = false); - QValueList<QCString> autoSaveProperties(const QCString &classname); + TQValueList<TQCString> autoSaveProperties(const TQCString &classname); WidgetInfo* widgetInfoForClassName(const char* classname); @@ -148,34 +149,34 @@ class KFORMEDITOR_EXPORT WidgetLibrary : public QObject for a class described by \a winfo. The name can be displayed in PropertyEditor. The name is retrieved from class' widget library. If this library doesn't define description for such property, - and there is a parent library for \a winfo defined, parent library + and there is a tqparent library for \a winfo defined, tqparent library is asked for returning description string. Eventually, if even this failed, empty string is returned. @see WidgetFactory::propertyDescForName() */ - QString propertyDescForName(WidgetInfo *winfo, const QCString& propertyName); + TQString propertyDescForName(WidgetInfo *winfo, const TQCString& propertyName); /*! \return The i18n'ed name of the property's value whose name is \a name. Works in the same way as propertyDescForName(): if actual library - does not define a description we are looking for, parent factory is asked + does not define a description we are looking for, tqparent factory is asked to return such description. Eventually, if even this failed, empty string is returned. @see WidgetFactory::propertyDescForValue() */ - QString propertyDescForValue(WidgetInfo *winfo, const QCString& name); + TQString propertyDescForValue(WidgetInfo *winfo, const TQCString& name); /*! Used by WidgetPropertySet::setWidget() after creating properties. */ - void setPropertyOptions( WidgetPropertySet &list, const WidgetInfo& winfo, QWidget* w ); + void setPropertyOptions( WidgetPropertySet &list, const WidgetInfo& winfo, TQWidget* w ); /*! \return true if property sets should be reloaded for \a property property, \a classname class and widget \a w when a given property value changed. */ - bool propertySetShouldBeReloadedAfterPropertyChange(const QCString& classname, QWidget *w, - const QCString& property); + bool propertySetShouldBeReloadedAfterPropertyChange(const TQCString& classname, TQWidget *w, + const TQCString& property); signals: - void prepareInsert(const QCString &c); + void prepareInsert(const TQCString &c); //! Received by KexiFormPart::slotWidgetCreatedByFormsLibrary() so we can add drag/drop //! connection for the new widget - void widgetCreated(QWidget *widget); + void widgetCreated(TQWidget *widget); protected: /** @@ -192,7 +193,7 @@ class KFORMEDITOR_EXPORT WidgetLibrary : public QObject * but don't want to confuse the user... are you confused now? * NB: not implemented yet */ - void setFilter(const QRegExp &expr); + void setFilter(const TQRegExp &expr); #endif /** diff --git a/kexi/formeditor/widgetpropertyset.cpp b/kexi/formeditor/widgetpropertyset.cpp index 497fb5e6..e1c3a1e9 100644 --- a/kexi/formeditor/widgetpropertyset.cpp +++ b/kexi/formeditor/widgetpropertyset.cpp @@ -19,14 +19,14 @@ */ #include "widgetpropertyset.h" -#include <qstringlist.h> -#include <qstrlist.h> -#include <qmetaobject.h> -#include <qvariant.h> -#include <qevent.h> -#include <qlayout.h> -#include <qapplication.h> -#include <qeventloop.h> +#include <tqstringlist.h> +#include <tqstrlist.h> +#include <tqmetaobject.h> +#include <tqvariant.h> +#include <tqevent.h> +#include <tqlayout.h> +#include <tqapplication.h> +#include <tqeventloop.h> #include <klocale.h> #include <kdebug.h> @@ -48,7 +48,7 @@ using namespace KFormDesigner; namespace KFormDesigner { //! @internal -typedef QValueList< QGuardedPtr<QWidget> > QGuardedWidgetList; +typedef TQValueList< TQGuardedPtr<TQWidget> > TQGuardedWidgetList; //! @internal class WidgetPropertySetPrivate @@ -67,9 +67,9 @@ class WidgetPropertySetPrivate KoProperty::Set set; // list of properties (not) to show in editor - QStringList properties; + TQStringList properties; // list of widgets - QGuardedWidgetList widgets; + TQGuardedWidgetList widgets; // FormManager *manager; // used to update command's value when undoing @@ -80,24 +80,24 @@ class WidgetPropertySetPrivate bool slotPropertyChanged_addCommandEnabled : 1; // helper to change color palette when switching 'enabled' property - QColorGroup* origActiveColors; + TQColorGroup* origActiveColors; // i18n stuff - QMap<QCString, QString> propCaption; - QMap<QCString, QString> propValCaption; + TQMap<TQCString, TQString> propCaption; + TQMap<TQCString, TQString> propValCaption; }; } -WidgetPropertySet::WidgetPropertySet(QObject *parent) - : QObject(parent, "kfd_widgetPropertySet") +WidgetPropertySet::WidgetPropertySet(TQObject *tqparent) + : TQObject(tqparent, "kfd_widgetPropertySet") { d = new WidgetPropertySetPrivate(); // d->manager = manager; - connect(&d->set, SIGNAL(propertyChanged(KoProperty::Set&, KoProperty::Property&)), - this, SLOT(slotPropertyChanged(KoProperty::Set&, KoProperty::Property&))); - connect(&d->set, SIGNAL(propertyReset(KoProperty::Set&, KoProperty::Property&)), - this, SLOT(slotPropertyReset(KoProperty::Set&, KoProperty::Property&))); + connect(&d->set, TQT_SIGNAL(propertyChanged(KoProperty::Set&, KoProperty::Property&)), + this, TQT_SLOT(slotPropertyChanged(KoProperty::Set&, KoProperty::Property&))); + connect(&d->set, TQT_SIGNAL(propertyReset(KoProperty::Set&, KoProperty::Property&)), + this, TQT_SLOT(slotPropertyReset(KoProperty::Set&, KoProperty::Property&))); initPropertiesDescription(); } @@ -114,21 +114,21 @@ WidgetPropertySet::manager() }*/ KoProperty::Property& -WidgetPropertySet::operator[](const QCString &name) +WidgetPropertySet::operator[](const TQCString &name) { return d->set[name]; } KoProperty::Property& -WidgetPropertySet::property(const QCString &name) +WidgetPropertySet::property(const TQCString &name) { return d->set[name]; } bool -WidgetPropertySet::contains(const QCString &property) +WidgetPropertySet::tqcontains(const TQCString &property) { - return d->set.contains(property); + return d->set.tqcontains(property); } KoProperty::Set* @@ -159,7 +159,7 @@ WidgetPropertySet::clearSet(bool dontSignalShowPropertySet) void WidgetPropertySet::saveModifiedProperties() { - QWidget * w = d->widgets.first(); + TQWidget * w = d->widgets.first(); if(!w || d->widgets.count() > 1 || !KFormDesigner::FormManager::self()->activeForm() || !KFormDesigner::FormManager::self()->activeForm()->objectTree()) return; ObjectTreeItem *tree = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup(w->name()); @@ -187,7 +187,7 @@ WidgetPropertySet::isUndoing() /////////////// Functions related to adding widgets ///////////////////////////////////// void -WidgetPropertySet::setSelectedWidget(QWidget *w, bool add, bool forceReload, bool moreWillBeSelected) +WidgetPropertySet::setSelectedWidget(TQWidget *w, bool add, bool forceReload, bool moreWillBeSelected) { if(!w) { clearSet(); @@ -195,7 +195,7 @@ WidgetPropertySet::setSelectedWidget(QWidget *w, bool add, bool forceReload, boo } // don't add a widget twice - if(!forceReload && d->widgets.contains(QGuardedPtr<QWidget>(w))) { + if(!forceReload && d->widgets.tqcontains(TQGuardedPtr<TQWidget>(w))) { kdWarning() << "WidgetPropertySet::setSelectedWidget() Widget is already selected" << endl; return; } @@ -203,7 +203,7 @@ WidgetPropertySet::setSelectedWidget(QWidget *w, bool add, bool forceReload, boo if(d->widgets.count() == 0) add = false; - QCString prevProperty; + TQCString prevProperty; if(add) addWidget(w); else { @@ -212,11 +212,11 @@ WidgetPropertySet::setSelectedWidget(QWidget *w, bool add, bool forceReload, boo prevProperty = d->set.prevSelection(); } clearSet(true); //clear but do not reload to avoid blinking - d->widgets.append(QGuardedPtr<QWidget>(w)); + d->widgets.append(TQGuardedPtr<TQWidget>(w)); createPropertiesForWidget(w); w->installEventFilter(this); - connect(w, SIGNAL(destroyed()), this, SLOT(slotWidgetDestroyed())); + connect(w, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotWidgetDestroyed())); } if (!moreWillBeSelected) @@ -224,16 +224,16 @@ WidgetPropertySet::setSelectedWidget(QWidget *w, bool add, bool forceReload, boo } void -WidgetPropertySet::addWidget(QWidget *w) +WidgetPropertySet::addWidget(TQWidget *w) { - d->widgets.append(QGuardedPtr<QWidget>(w)); + d->widgets.append(TQGuardedPtr<TQWidget>(w)); // Reset some stuff d->lastCommand = 0; d->lastGeoCommand = 0; d->properties.clear(); - QCString classname; + TQCString classname; if(d->widgets.first()->className() == w->className()) classname = d->widgets.first()->className(); @@ -241,7 +241,7 @@ WidgetPropertySet::addWidget(QWidget *w) bool isTopLevel = KFormDesigner::FormManager::self()->isTopLevel(w); //WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(w); -// QWidget *subwidget = isSubproperty ? subpropIface->subwidget() : w; +// TQWidget *subwidget = isSubproperty ? subpropIface->subwidget() : w; for(KoProperty::Set::Iterator it(d->set); it.current(); ++it) { kdDebug() << it.currentKey() << endl; @@ -253,7 +253,7 @@ WidgetPropertySet::addWidget(QWidget *w) //second widget, update metainfo d->set["this:className"].setValue("special:multiple"); d->set["this:classString"].setValue( - i18n("Multiple Widgets") + QString(" (%1)").arg(d->widgets.count()) ); + i18n("Multiple Widgets") + TQString(" (%1)").tqarg(d->widgets.count()) ); d->set["this:iconName"].setValue("multiple_obj"); //name doesn't make sense for now d->set["name"].setValue(""); @@ -261,7 +261,7 @@ WidgetPropertySet::addWidget(QWidget *w) } void -WidgetPropertySet::createPropertiesForWidget(QWidget *w) +WidgetPropertySet::createPropertiesForWidget(TQWidget *w) { Form *form; if (!KFormDesigner::FormManager::self() @@ -275,8 +275,8 @@ WidgetPropertySet::createPropertiesForWidget(QWidget *w) if(!tree) return; - const QVariantMap* modifiedProperties = tree->modifiedProperties(); - QVariantMapConstIterator modifiedPropertiesIt; + const TQVariantMap* modifiedProperties = tree->modifiedProperties(); + TQVariantMapConstIterator modifiedPropertiesIt; bool isTopLevel = KFormDesigner::FormManager::self()->isTopLevel(w); // int count = 0; KoProperty::Property *newProp = 0; @@ -287,16 +287,16 @@ WidgetPropertySet::createPropertiesForWidget(QWidget *w) return; } - QStrList pList = w->metaObject()->propertyNames(true); - QStrListIterator it(pList); + TQStrList pList = w->tqmetaObject()->propertyNames(true); + TQStrListIterator it(pList); // add subproperties if available WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(w); - QStrList tmpList; //used to allocate copy of names + TQStrList tmpList; //used to allocate copy of names if (subpropIface) { - QValueList<QCString> subproperies( + TQValueList<TQCString> subproperies( subpropIface->subproperies() ); - foreach(QValueListConstIterator<QCString>, it, subproperies ) { + foreach(TQValueListConstIterator<TQCString>, it, subproperies ) { tmpList.append( *it ); pList.append( tmpList.last() ); kdDebug() << "Added subproperty: " << *it << endl; @@ -306,34 +306,34 @@ WidgetPropertySet::createPropertiesForWidget(QWidget *w) // iterate over the property list, and create Property objects for(; it.current() != 0; ++it) { //kdDebug() << ">> " << it.current() << endl; - const QMetaProperty *subMeta = // special case - subproperty + const TQMetaProperty *subMeta = // special case - subproperty subpropIface ? subpropIface->findMetaSubproperty(it.current()) : 0; - const QMetaProperty *meta = subMeta ? subMeta - : w->metaObject()->property( w->metaObject()->findProperty(*it, true), true); + const TQMetaProperty *meta = subMeta ? subMeta + : w->tqmetaObject()->property( w->tqmetaObject()->tqfindProperty(*it, true), true); if (!meta) continue; const char* propertyName = meta->name(); - QWidget *subwidget = subMeta/*subpropIface*/ ? subpropIface->subwidget() : w; + TQWidget *subwidget = subMeta/*subpropIface*/ ? subpropIface->subwidget() : w; WidgetInfo *subwinfo = form->library()->widgetInfoForClassName(subwidget->className()); // kdDebug() << "$$$ " << subwidget->className() << endl; - if(subwinfo && meta->designable(subwidget) && !d->set.contains(propertyName)) { + if(subwinfo && meta->designable(subwidget) && !d->set.tqcontains(propertyName)) { //! \todo add another list for property description - QString desc( d->propCaption[meta->name()] ); + TQString desc( d->propCaption[meta->name()] ); //! \todo change i18n if (desc.isEmpty()) //try to get property description from factory desc = form->library()->propertyDescForName(subwinfo, propertyName); - modifiedPropertiesIt = modifiedProperties->find(propertyName); + modifiedPropertiesIt = modifiedProperties->tqfind(propertyName); const bool oldValueExists = modifiedPropertiesIt!=modifiedProperties->constEnd(); if(meta->isEnumType()) { - if(qstrcmp(propertyName, "alignment") == 0) { + if(qstrcmp(propertyName, "tqalignment") == 0) { createAlignProperty(meta, w, subwidget); continue; } - QStringList keys = QStringList::fromStrList( meta->enumKeys() ); + TQStringList keys = TQStringList::fromStrList( meta->enumKeys() ); newProp = new KoProperty::Property(propertyName, createValueList(subwinfo, keys), /* assign current or older value */ meta->valueToKey( @@ -347,7 +347,7 @@ WidgetPropertySet::createPropertiesForWidget(QWidget *w) else { newProp = new KoProperty::Property(propertyName, /* assign current or older value */ - oldValueExists ? modifiedPropertiesIt.data() : subwidget->property(propertyName), + oldValueExists ? TQVariant(modifiedPropertiesIt.data()) : TQVariant(subwidget->property(propertyName)), desc, desc, subwinfo->customTypeForProperty(propertyName)); //now set current value, so the old one is stored as old if (oldValueExists) { @@ -378,7 +378,7 @@ WidgetPropertySet::createPropertiesForWidget(QWidget *w) } (*this)["name"].setAutoSync(false); // name should be updated only when pressing Enter - (*this)["enabled"].setValue( QVariant(tree->isEnabled(), 3)); + (*this)["enabled"].setValue( TQVariant(tree->isEnabled(), 3)); if (winfo) { form->library()->setPropertyOptions(*this, *winfo, w); @@ -393,9 +393,9 @@ WidgetPropertySet::createPropertiesForWidget(QWidget *w) /*! let's forget it for now, until we have new complete events editor if (m_manager->lib()->advancedPropertiesVisible()) { // add the signals property - QStrList strlist = w->metaObject()->signalNames(true); - QStrListIterator strIt(strlist); - QStringList list; + TQStrList strlist = w->tqmetaObject()->signalNames(true); + TQStrListIterator strIt(strlist); + TQStringList list; for(; strIt.current() != 0; ++strIt) list.append(*strIt); Property *prop = new Property("signals", i18n("Events")"", @@ -403,20 +403,20 @@ WidgetPropertySet::createPropertiesForWidget(QWidget *w) )); }*/ - if(KFormDesigner::FormManager::self()->activeForm() && tree->container()) // we are a container -> layout property + if(KFormDesigner::FormManager::self()->activeForm() && tree->container()) // we are a container -> tqlayout property createLayoutProperty(tree); } void -WidgetPropertySet::updatePropertyValue(ObjectTreeItem *tree, const char *property, const QMetaProperty *meta) +WidgetPropertySet::updatePropertyValue(ObjectTreeItem *tree, const char *property, const TQMetaProperty *meta) { const char *propertyName = meta ? meta->name() : property; - if (!d->set.contains(propertyName)) + if (!d->set.tqcontains(propertyName)) return; KoProperty::Property p( d->set[propertyName] ); //! \todo what about set properties, and lists properties - QMap<QString, QVariant>::ConstIterator it( tree->modifiedProperties()->find(propertyName) ); + TQMap<TQString, TQVariant>::ConstIterator it( tree->modifiedProperties()->tqfind(propertyName) ); if (it != tree->modifiedProperties()->constEnd()) { blockSignals(true); if(meta && meta->isEnumType()) { @@ -431,7 +431,7 @@ WidgetPropertySet::updatePropertyValue(ObjectTreeItem *tree, const char *propert } bool -WidgetPropertySet::isPropertyVisible(const QCString &property, bool isTopLevel, const QCString &classname) +WidgetPropertySet::isPropertyVisible(const TQCString &property, bool isTopLevel, const TQCString &classname) { const bool multiple = d->widgets.count() >= 2; if(multiple && classname.isEmpty()) @@ -461,9 +461,9 @@ WidgetPropertySet::isPropertyVisible(const QCString &property, bool isTopLevel, */ // return KFormDesigner::FormManager::self()->lib()->isPropertyVisible(d->widgets.first()->className(), d->widgets.first(), - QWidget *w = d->widgets.first(); + TQWidget *w = d->widgets.first(); WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(w); - QWidget *subwidget; + TQWidget *subwidget; if (subpropIface && subpropIface->findMetaSubproperty(property)) // special case - subproperty subwidget = subpropIface->subwidget(); else @@ -484,11 +484,11 @@ WidgetPropertySet::slotPropertyChanged(KoProperty::Set& set, KoProperty::Propert || ! KFormDesigner::FormManager::self()->activeForm()->objectTree()) return; - QCString property = p.name(); - if (0==property.find("this:")) + TQCString property = p.name(); + if (0==property.tqfind("this:")) return; //starts with magical prefix: it's a "meta" prop. - QVariant value = p.value(); + TQVariant value = p.value(); // check if the name is valid (ie is correct identifier) and there is no name conflict if(property == "name") { @@ -507,7 +507,7 @@ WidgetPropertySet::slotPropertyChanged(KoProperty::Set& set, KoProperty::Propert saveAlignProperty(property); return; } - else if((property == "layout") || (property == "layoutMargin") || (property == "layoutSpacing")) { + else if((property == "tqlayout") || (property == "tqlayoutMargin") || (property == "tqlayoutSpacing")) { saveLayoutProperty(property, value); return; } @@ -554,9 +554,9 @@ WidgetPropertySet::slotPropertyChanged(KoProperty::Set& set, KoProperty::Propert else { if (d->slotPropertyChanged_addCommandEnabled && !KFormDesigner::FormManager::self()->isRedoing()) { // We store old values for each widget - QMap<QCString, QVariant> list; - // for(QWidget *w = d->widgets.first(); w; w = d->widgets.next()) - foreach(QGuardedWidgetList::ConstIterator, it, d->widgets) + TQMap<TQCString, TQVariant> list; + // for(TQWidget *w = d->widgets.first(); w; w = d->widgets.next()) + foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets) list.insert((*it)->name(), (*it)->property(property)); d->lastCommand = new PropertyCommand(this, list, value, property); @@ -564,8 +564,8 @@ WidgetPropertySet::slotPropertyChanged(KoProperty::Set& set, KoProperty::Propert } } -// for(QWidget *w = d->widgets.first(); w; w = d->widgets.next()) - foreach(QGuardedWidgetList::ConstIterator, it, d->widgets) { +// for(TQWidget *w = d->widgets.first(); w; w = d->widgets.next()) + foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets) { if (!alterLastCommand) { ObjectTreeItem *tree = KFormDesigner::FormManager::self()->activeForm()->objectTree() ->lookup((*it)->name()); @@ -578,23 +578,23 @@ WidgetPropertySet::slotPropertyChanged(KoProperty::Set& set, KoProperty::Propert } } -void WidgetPropertySet::emitWidgetPropertyChanged(QWidget *w, const QCString& property, const QVariant& value) +void WidgetPropertySet::emitWidgetPropertyChanged(TQWidget *w, const TQCString& property, const TQVariant& value) { emit widgetPropertyChanged(w, property, value); Form *form = KFormDesigner::FormManager::self()->activeForm(); if (form && form->library()->propertySetShouldBeReloadedAfterPropertyChange( w->className(), w, property)) { //setSelectedWidget(0, false); - qApp->eventLoop()->processEvents(QEventLoop::AllEvents); //be sure events related to editors are consumed + tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents); //be sure events related to editors are consumed setSelectedWidget(w, /*!add*/false, /*forceReload*/true); - qApp->eventLoop()->processEvents(QEventLoop::AllEvents); //be sure events related to editors are consumed + tqApp->eventLoop()->processEvents(TQEventLoop::AllEvents); //be sure events related to editors are consumed //KFormDesigner::FormManager::self()->showPropertySet(this, true/*forceReload*/); } } void -WidgetPropertySet::createPropertyCommandsInDesignMode(QWidget* widget, - const QMap<QCString, QVariant> &propValues, CommandGroup *group, bool addToActiveForm, +WidgetPropertySet::createPropertyCommandsInDesignMode(TQWidget* widget, + const TQMap<TQCString, TQVariant> &propValues, CommandGroup *group, bool addToActiveForm, bool execFlagForSubCommands) { if (!widget || propValues.isEmpty()) @@ -604,11 +604,11 @@ WidgetPropertySet::createPropertyCommandsInDesignMode(QWidget* widget, const bool widgetIsSelected = KFormDesigner::FormManager::self()->activeForm()->selectedWidget() == widget; d->slotPropertyChanged_addCommandEnabled = false; - QMap<QCString, QVariant>::ConstIterator endIt = propValues.constEnd(); + TQMap<TQCString, TQVariant>::ConstIterator endIt = propValues.constEnd(); // CommandGroup *group = new CommandGroup(commandName); - for(QMap<QCString, QVariant>::ConstIterator it = propValues.constBegin(); it != endIt; ++it) + for(TQMap<TQCString, TQVariant>::ConstIterator it = propValues.constBegin(); it != endIt; ++it) { - if (!d->set.contains(it.key())) { + if (!d->set.tqcontains(it.key())) { kdWarning() << "WidgetPropertySet::createPropertyCommandsInDesignMode(): \"" <<it.key()<<"\" property not found"<<endl; continue; } @@ -620,8 +620,8 @@ WidgetPropertySet::createPropertyCommandsInDesignMode(QWidget* widget, } else { WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(widget); - QWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : widget; - if (-1 != subwidget->metaObject()->findProperty(it.key(), true) && subwidget->property(it.key())!=it.data()) { + TQWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : widget; + if (-1 != subwidget->tqmetaObject()->tqfindProperty(it.key(), true) && subwidget->property(it.key())!=it.data()) { ObjectTreeItem *tree = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup(widget->name()); if (tree) tree->addModifiedProperty(it.key(), subwidget->property(it.key())); @@ -641,44 +641,44 @@ WidgetPropertySet::createPropertyCommandsInDesignMode(QWidget* widget, void WidgetPropertySet::saveEnabledProperty(bool value) { -// for(QWidget *w = d->widgets.first(); w; w = d->widgets.next()) { - foreach(QGuardedWidgetList::ConstIterator, it, d->widgets) { +// for(TQWidget *w = d->widgets.first(); w; w = d->widgets.next()) { + foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets) { ObjectTreeItem *tree = KFormDesigner::FormManager::self()->activeForm()->objectTree() ->lookup((*it)->name()); if(tree->isEnabled() == value) continue; - QPalette p( (*it)->palette() ); + TQPalette p( (*it)->palette() ); if (!d->origActiveColors) - d->origActiveColors = new QColorGroup( p.active() ); + d->origActiveColors = new TQColorGroup( p.active() ); if (value) { if (d->origActiveColors) p.setActive( *d->origActiveColors ); //revert } else { - QColorGroup cg = p.disabled(); + TQColorGroup cg = p.disabled(); //also make base color a bit disabled-like - cg.setColor(QColorGroup::Base, cg.color(QColorGroup::Background)); + cg.setColor(TQColorGroup::Base, cg.color(TQColorGroup::Background)); p.setActive(cg); } (*it)->setPalette(p); tree->setEnabled(value); - emit widgetPropertyChanged((*it), "enabled", QVariant(value, 3)); + emit widgetPropertyChanged((*it), "enabled", TQVariant(value, 3)); } } bool -WidgetPropertySet::isNameValid(const QString &name) +WidgetPropertySet::isNameValid(const TQString &name) { //! \todo add to undo buffer - QWidget *w = d->widgets.first(); - //also update widget's name in QObject member + TQWidget *w = d->widgets.first(); + //also update widget's name in TQObject member if (!KexiUtils::isIdentifier(name)) { KMessageBox::sorry(KFormDesigner::FormManager::self()->activeForm()->widget(), i18n("Could not rename widget \"%1\" to \"%2\" because " "\"%3\" is not a valid name (identifier) for a widget.\n") - .arg(w->name()).arg(name).arg(name)); + .tqarg(w->name()).tqarg(name).tqarg(name)); d->slotPropertyChangedEnabled = false; d->set["name"].resetValue(); d->slotPropertyChangedEnabled = true; @@ -689,7 +689,7 @@ WidgetPropertySet::isNameValid(const QString &name) KMessageBox::sorry( KFormDesigner::FormManager::self()->activeForm()->widget(), i18n("Could not rename widget \"%1\" to \"%2\" " "because a widget with the name \"%3\" already exists.\n") - .arg(w->name()).arg(name).arg(name)); + .tqarg(w->name()).tqarg(name).tqarg(name)); d->slotPropertyChangedEnabled = false; d->set["name"].resetValue(); d->slotPropertyChangedEnabled = true; @@ -708,21 +708,21 @@ WidgetPropertySet::slotPropertyReset(KoProperty::Set& set, KoProperty::Property& return; // We use the old value in modifProp for each widget -// for(QWidget *w = d->widgets.first(); w; w = d->widgets.next()) { - foreach(QGuardedWidgetList::ConstIterator, it, d->widgets) { +// for(TQWidget *w = d->widgets.first(); w; w = d->widgets.next()) { + foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets) { ObjectTreeItem *tree = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup((*it)->name()); - if(tree->modifiedProperties()->contains(property.name())) - (*it)->setProperty(property.name(), tree->modifiedProperties()->find(property.name()).data()); + if(tree->modifiedProperties()->tqcontains(property.name())) + (*it)->setProperty(property.name(), tree->modifiedProperties()->tqfind(property.name()).data()); } } void WidgetPropertySet::slotWidgetDestroyed() { -// if(d->widgets.contains(QGuardedPtr<const QWidget>( dynamic_cast<const QWidget*>(sender()) ))) { +// if(d->widgets.tqcontains(TQGuardedPtr<const TQWidget>( dynamic_cast<const TQWidget*>(sender()) ))) { //only clear this set if it contains the destroyed widget - foreach(QGuardedWidgetList::ConstIterator, it, d->widgets) { - if (dynamic_cast<const QWidget*>(sender()) == *it) { + foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets) { + if (dynamic_cast<const TQWidget*>(sender()) == *it) { clearSet(); break; } @@ -730,32 +730,32 @@ WidgetPropertySet::slotWidgetDestroyed() } bool -WidgetPropertySet::eventFilter(QObject *o, QEvent *ev) +WidgetPropertySet::eventFilter(TQObject *o, TQEvent *ev) { if(d->widgets.count() > 0 && o == d->widgets.first() && d->widgets.count() < 2) { - if((ev->type() == QEvent::Resize) || (ev->type() == QEvent::Move)) { - if(!d->set.contains("geometry")) + if((ev->type() == TQEvent::Resize) || (ev->type() == TQEvent::Move)) { + if(!d->set.tqcontains("geometry")) return false; if(d->set["geometry"].value() == o->property("geometry")) // to avoid infinite recursion return false; - d->set["geometry"] = static_cast<QWidget*>(o)->geometry(); + d->set["geometry"] = TQT_TQWIDGET(o)->tqgeometry(); } } - else if(d->widgets.count() > 1 && ev->type() == QEvent::Move) // the widget is being moved, we update the property + else if(d->widgets.count() > 1 && ev->type() == TQEvent::Move) // the widget is being moved, we update the property { if(d->isUndoing) return false; if(d->lastGeoCommand) - d->lastGeoCommand->setPos(static_cast<QMoveEvent*>(ev)->pos()); + d->lastGeoCommand->setPos(TQT_TQMOVEEVENT(ev)->pos()); else { - QStringList list; - foreach(QGuardedWidgetList::ConstIterator, it, d->widgets) + TQStringList list; + foreach(TQGuardedWidgetList::ConstIterator, it, d->widgets) list.append((*it)->name()); - d->lastGeoCommand = new GeometryPropertyCommand(this, list, static_cast<QMoveEvent*>(ev)->oldPos()); + d->lastGeoCommand = new GeometryPropertyCommand(this, list, TQT_TQMOVEEVENT(ev)->oldPos()); if (KFormDesigner::FormManager::self()->activeForm()) KFormDesigner::FormManager::self()->activeForm()->addCommand(d->lastGeoCommand, false); } @@ -767,33 +767,33 @@ WidgetPropertySet::eventFilter(QObject *o, QEvent *ev) // Alignment-related functions ///////////////////////////// void -WidgetPropertySet::createAlignProperty(const QMetaProperty *meta, QWidget *widget, QWidget *subwidget) +WidgetPropertySet::createAlignProperty(const TQMetaProperty *meta, TQWidget *widget, TQWidget *subwidget) { if (!KFormDesigner::FormManager::self()->activeForm() || !KFormDesigner::FormManager::self()->activeForm()->objectTree()) return; - QStringList list; - QString value; - const int alignment = subwidget->property("alignment").toInt(); - const QStringList keys( QStringList::fromStrList( meta->valueToKeys(alignment) ) ); + TQStringList list; + TQString value; + const int tqalignment = subwidget->property("tqalignment").toInt(); + const TQStringList keys( TQStringList::fromStrList( meta->valueToKeys(tqalignment) ) ); - QStrList *enumKeys = new QStrList(meta->enumKeys()); - const QStringList possibleValues( QStringList::fromStrList(*enumKeys) ); + TQStrList *enumKeys = new TQStrList(meta->enumKeys()); + const TQStringList possibleValues( TQStringList::fromStrList(*enumKeys) ); delete enumKeys; ObjectTreeItem *tree = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup(widget->name()); bool isTopLevel = KFormDesigner::FormManager::self()->isTopLevel(widget); - if(possibleValues.find("AlignHCenter")!=possibleValues.constEnd()) { - // Create the horizontal alignment property - if(keys.find("AlignHCenter")!=keys.constEnd() || keys.find("AlignCenter")!=keys.constEnd()) + if(possibleValues.tqfind("AlignHCenter")!=possibleValues.constEnd()) { + // Create the horizontal tqalignment property + if(keys.tqfind("AlignHCenter")!=keys.constEnd() || keys.tqfind("AlignCenter")!=keys.constEnd()) value = "AlignHCenter"; - else if(keys.find("AlignRight")!=keys.constEnd()) + else if(keys.tqfind("AlignRight")!=keys.constEnd()) value = "AlignRight"; - else if(keys.find("AlignLeft")!=keys.constEnd()) + else if(keys.tqfind("AlignLeft")!=keys.constEnd()) value = "AlignLeft"; - else if(keys.find("AlignJustify")!=keys.constEnd()) + else if(keys.tqfind("AlignJustify")!=keys.constEnd()) value = "AlignJustify"; else value = "AlignAuto"; @@ -810,12 +810,12 @@ WidgetPropertySet::createAlignProperty(const QMetaProperty *meta, QWidget *widge list.clear(); } - if(possibleValues.find("AlignTop")!=possibleValues.constEnd()) + if(possibleValues.tqfind("AlignTop")!=possibleValues.constEnd()) { - // Create the ver alignment property - if(keys.find("AlignTop")!=keys.constEnd()) + // Create the ver tqalignment property + if(keys.tqfind("AlignTop")!=keys.constEnd()) value = "AlignTop"; - else if(keys.find("AlignBottom")!=keys.constEnd()) + else if(keys.tqfind("AlignBottom")!=keys.constEnd()) value = "AlignBottom"; else value = "AlignVCenter"; @@ -831,13 +831,13 @@ WidgetPropertySet::createAlignProperty(const QMetaProperty *meta, QWidget *widge updatePropertyValue(tree, "vAlign"); } - if(possibleValues.find("WordBreak")!=possibleValues.constEnd() + if(possibleValues.tqfind("WordBreak")!=possibleValues.constEnd() // && isPropertyVisible("wordbreak", false, subwidget->className()) -// && !subWidget->inherits("QLineEdit") /* QLineEdit doesn't support 'word break' is this generic enough?*/ +// && !subWidget->inherits(TQLINEEDIT_OBJECT_NAME_STRING) /* TQLineEdit doesn't support 'word break' is this generic enough?*/ ) { // Create the wordbreak property KoProperty::Property *p = new KoProperty::Property("wordbreak", - QVariant(alignment & Qt::WordBreak, 3), i18n("Word Break"), i18n("Word Break") ); + TQVariant(tqalignment & TQt::WordBreak, 3), i18n("Word Break"), i18n("Word Break") ); d->set.addProperty(p); updatePropertyValue(tree, "wordbreak"); if (!KFormDesigner::FormManager::self()->activeForm()->library()->isPropertyVisible( @@ -849,25 +849,25 @@ WidgetPropertySet::createAlignProperty(const QMetaProperty *meta, QWidget *widge } void -WidgetPropertySet::saveAlignProperty(const QString &property) +WidgetPropertySet::saveAlignProperty(const TQString &property) { if (!KFormDesigner::FormManager::self()->activeForm()) return; - QStrList list; - if( d->set.contains("hAlign") ) + TQStrList list; + if( d->set.tqcontains("hAlign") ) list.append( d->set["hAlign"].value().toCString() ); - if( d->set.contains("vAlign") ) + if( d->set.tqcontains("vAlign") ) list.append( d->set["vAlign"].value().toCString() ); - if( d->set.contains("wordbreak") && d->set["wordbreak"].value().toBool() ) + if( d->set.tqcontains("wordbreak") && d->set["wordbreak"].value().toBool() ) list.append("WordBreak"); WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>( - (QWidget*)d->widgets.first() ); - QWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : (QWidget*)d->widgets.first(); - int count = subwidget->metaObject()->findProperty("alignment", true); - const QMetaProperty *meta = subwidget->metaObject()->property(count, true); - subwidget->setProperty("alignment", meta->keysToValue(list)); + (TQWidget*)d->widgets.first() ); + TQWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : (TQWidget*)d->widgets.first(); + int count = subwidget->tqmetaObject()->tqfindProperty("tqalignment", true); + const TQMetaProperty *meta = subwidget->tqmetaObject()->property(count, true); + subwidget->setProperty("tqalignment", meta->keysToValue(list)); ObjectTreeItem *tree = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup( d->widgets.first()->name() ); @@ -877,11 +877,11 @@ WidgetPropertySet::saveAlignProperty(const QString &property) if(d->isUndoing) return; - if(d->lastCommand && d->lastCommand->property() == "alignment") + if(d->lastCommand && d->lastCommand->property() == "tqalignment") d->lastCommand->setValue(meta->keysToValue(list)); else { d->lastCommand = new PropertyCommand(this, d->widgets.first()->name(), - subwidget->property("alignment"), meta->keysToValue(list), "alignment"); + subwidget->property("tqalignment"), meta->keysToValue(list), "tqalignment"); KFormDesigner::FormManager::self()->activeForm()->addCommand(d->lastCommand, false); } } @@ -895,40 +895,40 @@ WidgetPropertySet::createLayoutProperty(ObjectTreeItem *item) if (!container || !KFormDesigner::FormManager::self()->activeForm() || !KFormDesigner::FormManager::self()->activeForm()->objectTree() || !container->widget()) return; - // special containers have no 'layout' property, as it should not be changed - QCString className = container->widget()->className(); + // special containers have no 'tqlayout' property, as it should not be changed + TQCString className = container->widget()->className(); if((className == "HBox") || (className == "VBox") || (className == "Grid")) return; - QStringList list; - QString value = Container::layoutTypeToString(container->layoutType()); + TQStringList list; + TQString value = Container::tqlayoutTypeToString(container->tqlayoutType()); list << "NoLayout" << "HBox" << "VBox" << "Grid" << "HFlow" << "VFlow"; - KoProperty::Property *p = new KoProperty::Property("layout", createValueList(0, list), value, + KoProperty::Property *p = new KoProperty::Property("tqlayout", createValueList(0, list), value, i18n("Container's Layout"), i18n("Container's Layout")); p->setVisible( container->form()->library()->advancedPropertiesVisible() ); d->set.addProperty(p); - updatePropertyValue(item, "layout"); + updatePropertyValue(item, "tqlayout"); - p = new KoProperty::Property("layoutMargin", container->layoutMargin(), i18n("Layout Margin"), i18n("Layout Margin")); + p = new KoProperty::Property("tqlayoutMargin", container->tqlayoutMargin(), i18n("Layout Margin"), i18n("Layout Margin")); d->set.addProperty(p); - updatePropertyValue(item, "layoutMargin"); - if(container->layoutType() == Container::NoLayout) + updatePropertyValue(item, "tqlayoutMargin"); + if(container->tqlayoutType() == Container::NoLayout) p->setVisible(false); - p = new KoProperty::Property("layoutSpacing", container->layoutSpacing(), + p = new KoProperty::Property("tqlayoutSpacing", container->tqlayoutSpacing(), i18n("Layout Spacing"), i18n("Layout Spacing")); d->set.addProperty(p); - updatePropertyValue(item, "layoutSpacing"); - if(container->layoutType() == Container::NoLayout) + updatePropertyValue(item, "tqlayoutSpacing"); + if(container->tqlayoutType() == Container::NoLayout) p->setVisible(false); } void -WidgetPropertySet::saveLayoutProperty(const QString &prop, const QVariant &value) +WidgetPropertySet::saveLayoutProperty(const TQString &prop, const TQVariant &value) { Container *container=0; if(!KFormDesigner::FormManager::self()->activeForm() || !KFormDesigner::FormManager::self()->activeForm()->objectTree()) @@ -938,34 +938,34 @@ WidgetPropertySet::saveLayoutProperty(const QString &prop, const QVariant &value return; container = item->container(); - if(prop == "layout") { + if(prop == "tqlayout") { Container::LayoutType type = Container::stringToLayoutType(value.toString()); - if(d->lastCommand && d->lastCommand->property() == "layout" && !d->isUndoing) + if(d->lastCommand && d->lastCommand->property() == "tqlayout" && !d->isUndoing) d->lastCommand->setValue(value); else if(!d->isUndoing) { d->lastCommand = new LayoutPropertyCommand(this, d->widgets.first()->name(), - d->set["layout"].oldValue(), value); + d->set["tqlayout"].oldValue(), value); KFormDesigner::FormManager::self()->activeForm()->addCommand(d->lastCommand, false); } container->setLayout(type); bool show = (type != Container::NoLayout); - if(show != d->set["layoutMargin"].isVisible()) { - d->set["layoutMargin"].setVisible(show); - d->set["layoutSpacing"].setVisible(show); + if(show != d->set["tqlayoutMargin"].isVisible()) { + d->set["tqlayoutMargin"].setVisible(show); + d->set["tqlayoutSpacing"].setVisible(show); KFormDesigner::FormManager::self()->showPropertySet(this, true/*force*/); } return; } - if(prop == "layoutMargin" && container->layout()) { + if(prop == "tqlayoutMargin" && container->tqlayout()) { container->setLayoutMargin(value.toInt()); - container->layout()->setMargin(value.toInt()); + container->tqlayout()->setMargin(value.toInt()); } - else if(prop == "layoutSpacing" && container->layout()) { + else if(prop == "tqlayoutSpacing" && container->tqlayout()) { container->setLayoutSpacing(value.toInt()); - container->layout()->setSpacing(value.toInt()); + container->tqlayout()->setSpacing(value.toInt()); } ObjectTreeItem *tree = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup(d->widgets.first()->name()); @@ -975,7 +975,7 @@ WidgetPropertySet::saveLayoutProperty(const QString &prop, const QVariant &value if(d->isUndoing) return; - if(d->lastCommand && (QString(d->lastCommand->property()) == prop)) + if(d->lastCommand && (TQString(d->lastCommand->property()) == prop)) d->lastCommand->setValue(value); else { d->lastCommand = new PropertyCommand(this, d->widgets.first()->name(), @@ -992,7 +992,7 @@ void WidgetPropertySet::initPropertiesDescription() { //! \todo perhaps a few of them shouldn't be translated within KFD mode, -//! to be more Qt Designer friendly? +//! to be more TQt Designer friendly? d->propCaption["name"] = i18n("Name"); d->propCaption["caption"] = i18n("Caption"); d->propCaption["text"] = i18n("Text"); @@ -1000,8 +1000,8 @@ WidgetPropertySet::initPropertiesDescription() d->propCaption["enabled"] = i18n("Enabled"); d->propCaption["geometry"] = i18n("Geometry"); d->propCaption["sizePolicy"] = i18n("Size Policy"); - d->propCaption["minimumSize"] = i18n("Minimum Size"); - d->propCaption["maximumSize"] = i18n("Maximum Size"); + d->propCaption["tqminimumSize"] = i18n("Minimum Size"); + d->propCaption["tqmaximumSize"] = i18n("Maximum Size"); d->propCaption["font"] = i18n("Font"); d->propCaption["cursor"] = i18n("Cursor"); d->propCaption["paletteForegroundColor"] = i18n("Foreground Color"); @@ -1009,13 +1009,13 @@ WidgetPropertySet::initPropertiesDescription() d->propCaption["focusPolicy"] = i18n("Focus Policy"); d->propCaption["margin"] = i18n("Margin"); d->propCaption["readOnly"] = i18n("Read Only"); - //any QFrame + //any TQFrame d->propCaption["frame"] = i18n("Frame"); d->propCaption["lineWidth"] = i18n("Frame Width"); d->propCaption["midLineWidth"] = i18n("Mid Frame Width"); d->propCaption["frameShape"] = i18n("Frame Shape"); d->propCaption["frameShadow"] = i18n("Frame Shadow"); - //any QScrollbar + //any TQScrollbar d->propCaption["vScrollBarMode"] = i18n("Vertical ScrollBar"); d->propCaption["hScrollBarMode"] = i18n("Horizontal ScrollBar"); @@ -1066,27 +1066,27 @@ WidgetPropertySet::initPropertiesDescription() d->propValCaption["Vertical"] = i18n("Vertical"); } -QString -WidgetPropertySet::propertyCaption(const QCString &name) +TQString +WidgetPropertySet::propertyCaption(const TQCString &name) { return d->propCaption[name]; } -QString -WidgetPropertySet::valueCaption(const QCString &name) +TQString +WidgetPropertySet::valueCaption(const TQCString &name) { return d->propValCaption[name]; } KoProperty::Property::ListData* -WidgetPropertySet::createValueList(WidgetInfo *winfo, const QStringList &list) +WidgetPropertySet::createValueList(WidgetInfo *winfo, const TQStringList &list) { -// QMap <QString, QVariant> map; - QStringList names; - QStringList::ConstIterator endIt = list.end(); - for(QStringList::ConstIterator it = list.begin(); it != endIt; ++it) { - QString n( d->propValCaption[ (*it).latin1() ] ); - if (n.isEmpty()) { //try within factory and (maybe) parent factory +// TQMap <TQString, TQVariant> map; + TQStringList names; + TQStringList::ConstIterator endIt = list.end(); + for(TQStringList::ConstIterator it = list.begin(); it != endIt; ++it) { + TQString n( d->propValCaption[ (*it).latin1() ] ); + if (n.isEmpty()) { //try within factory and (maybe) tqparent factory if (winfo) n = KFormDesigner::FormManager::self()->activeForm()->library()->propertyDescForValue( winfo, (*it).latin1() ); if (n.isEmpty()) @@ -1104,16 +1104,16 @@ WidgetPropertySet::createValueList(WidgetInfo *winfo, const QStringList &list) } void -WidgetPropertySet::addPropertyCaption(const QCString &property, const QString &caption) +WidgetPropertySet::addPropertyCaption(const TQCString &property, const TQString &caption) { - if(!d->propCaption.contains(property)) + if(!d->propCaption.tqcontains(property)) d->propCaption[property] = caption; } void -WidgetPropertySet::addValueCaption(const QCString &value, const QString &caption) +WidgetPropertySet::addValueCaption(const TQCString &value, const TQString &caption) { - if(!d->propValCaption.contains(value)) + if(!d->propValCaption.tqcontains(value)) d->propValCaption[value] = caption; } diff --git a/kexi/formeditor/widgetpropertyset.h b/kexi/formeditor/widgetpropertyset.h index 71e7b225..d330e4ed 100644 --- a/kexi/formeditor/widgetpropertyset.h +++ b/kexi/formeditor/widgetpropertyset.h @@ -21,14 +21,14 @@ #ifndef KFD_WIDGETPROPERTYSET_H #define KFD_WIDGETPROPERTYSET_H -#include <qobject.h> -#include <qstrlist.h> +#include <tqobject.h> +#include <tqstrlist.h> #include <koproperty/set.h> #include <koproperty/property.h> -class QMetaObject; -class QWidget; +class TQMetaObject; +class TQWidget; namespace KFormDesigner { @@ -38,27 +38,28 @@ class WidgetPropertySetPrivate; class WidgetInfo; class CommandGroup; -class KFORMEDITOR_EXPORT WidgetPropertySet : public QObject +class KFORMEDITOR_EXPORT WidgetPropertySet : public TQObject { Q_OBJECT + TQ_OBJECT public: - WidgetPropertySet(QObject *parent); + WidgetPropertySet(TQObject *tqparent); ~WidgetPropertySet(); // FormManager* manager(); - KoProperty::Property& operator[](const QCString &name); + KoProperty::Property& operator[](const TQCString &name); - KoProperty::Property& property(const QCString &name); + KoProperty::Property& property(const TQCString &name); - bool contains(const QCString &property); + bool tqcontains(const TQCString &property); /*! i18n function used by factories to add new property caption. Should be called on Factory creation. */ - void addPropertyCaption(const QCString &property, const QString &caption); + void addPropertyCaption(const TQCString &property, const TQString &caption); - void addValueCaption(const QCString &value, const QString &caption); + void addValueCaption(const TQCString &value, const TQString &caption); public slots: /*! Sets the widget which properties are shown in the property editor. @@ -69,10 +70,10 @@ class KFORMEDITOR_EXPORT WidgetPropertySet : public QObject even if these were already displayed. If \a showPropertySet is true (the default), property editor will be updated for the current selection. This flag is set to false when we're selecting multiple widgets. */ - void setSelectedWidget(QWidget *w, bool add = false, bool forceReload = false, + void setSelectedWidget(TQWidget *w, bool add = false, bool forceReload = false, bool moreWillBeSelected = false); - void setSelectedWidgetWithoutReload(QWidget *w, bool add = false, bool moreWillBeSelected = false) { + void setSelectedWidgetWithoutReload(TQWidget *w, bool add = false, bool moreWillBeSelected = false) { setSelectedWidget(w, add, false, moreWillBeSelected); } @@ -86,37 +87,37 @@ class KFORMEDITOR_EXPORT WidgetPropertySet : public QObject /*! This slot is called when the watched widget is destroyed. Resets the buffer.*/ void slotWidgetDestroyed(); -// void setPropertyValueInDesignMode(QWidget* widget, const QMap<QCString, QVariant> &propValues, - void createPropertyCommandsInDesignMode(QWidget* widget, const QMap<QCString, - QVariant> &propValues, CommandGroup *group, bool addToActiveForm = true, +// void setPropertyValueInDesignMode(TQWidget* widget, const TQMap<TQCString, TQVariant> &propValues, + void createPropertyCommandsInDesignMode(TQWidget* widget, const TQMap<TQCString, + TQVariant> &propValues, CommandGroup *group, bool addToActiveForm = true, bool execFlagForSubCommands = false); signals: /*! This signal is emitted when a property was changed. \a widg is the widget concerned, \a property is the name of the modified property, and \a v is the new value of this property. */ - void widgetPropertyChanged(QWidget *w, const QCString &property, const QVariant &v); + void widgetPropertyChanged(TQWidget *w, const TQCString &property, const TQVariant &v); /*! This signal is emitted when the name of the widget is modified. \a oldname is the name of the widget before the change, \a newname is the name after renaming. */ - void widgetNameChanged(const QCString &oldname, const QCString &newname); + void widgetNameChanged(const TQCString &oldname, const TQCString &newname); protected: /*! Adds the widget in d->widgets, and updates property visibilty. */ - void addWidget(QWidget *w); + void addWidget(TQWidget *w); /*! Fills the list with properties related to the widget \a w. Also updates properties old value and changed state. */ - void createPropertiesForWidget(QWidget *w); + void createPropertiesForWidget(TQWidget *w); /*! Creates a map property description->prop. value from the list of keys \a list. */ - KoProperty::Property::ListData* createValueList(WidgetInfo *winfo, const QStringList &list); + KoProperty::Property::ListData* createValueList(WidgetInfo *winfo, const TQStringList &list); /*! Changes \a property old value and changed state, using the value stored in \a tree. Optional \a meta can be specified if you need to handle enum values. */ - void updatePropertyValue(ObjectTreeItem *tree, const char *property, const QMetaProperty *meta = 0); + void updatePropertyValue(ObjectTreeItem *tree, const char *property, const TQMetaProperty *meta = 0); /*! \return the property list hold by this object. Do not modify the list, just use this method to change Editor's list. */ @@ -131,7 +132,7 @@ class KFORMEDITOR_EXPORT WidgetPropertySet : public QObject /*! Checks if the name entered by user is valid, ie that it is a valid identifier, and that there is no name conflict. */ - bool isNameValid(const QString &name); + bool isNameValid(const TQString &name); /*! Saves 'enabled' property, and takes care of updating widget's palette. */ void saveEnabledProperty(bool value); @@ -139,7 +140,7 @@ class KFORMEDITOR_EXPORT WidgetPropertySet : public QObject /*! This function filters the event of the selected widget to automatically updates the "geometry" property when the widget is moved or resized in the Form. */ - bool eventFilter(QObject *o, QEvent *ev); + bool eventFilter(TQObject *o, TQEvent *ev); /*! Changes undoing state of the list. Used by Undo command to prevent recursion. */ @@ -150,29 +151,29 @@ class KFORMEDITOR_EXPORT WidgetPropertySet : public QObject /*! This function is used to filter the properties to be shown (ie not show "caption" if the widget isn't toplevel). \return true if the property should be shown. False otherwise.*/ - bool isPropertyVisible(const QCString &property, bool isTopLevel, - const QCString &classname=QCString()); + bool isPropertyVisible(const TQCString &property, bool isTopLevel, + const TQCString &classname=TQCString()); // Following functions are used to create special types of properties, different - // from Q_PROPERTY + // from TQ_PROPERTY - /*! Creates the properties related to alignment (ie hAlign, vAlign and WordBreak) for - the QWidget \a widget. \a subwidget is the same as \a widget if the widget itself handles + /*! Creates the properties related to tqalignment (ie hAlign, vAlign and WordBreak) for + the TQWidget \a widget. \a subwidget is the same as \a widget if the widget itself handles the property and it's a child widget if the child handles the property. For example, the second case is true for KexiDBAutoField. - \a meta is the QMetaProperty for "alignment" property" of subwidget. */ - void createAlignProperty(const QMetaProperty *meta, QWidget *widget, QWidget *subwidget); + \a meta is the TQMetaProperty for "tqalignment" property" of subwidget. */ + void createAlignProperty(const TQMetaProperty *meta, TQWidget *widget, TQWidget *subwidget); - /*! Saves the properties related to alignment (ie hAlign, vAlign and WordBreak) - and modifies the "alignment" property of the widget.*/ - void saveAlignProperty(const QString &property); + /*! Saves the properties related to tqalignment (ie hAlign, vAlign and WordBreak) + and modifies the "tqalignment" property of the widget.*/ + void saveAlignProperty(const TQString &property); - /*! Creates the "layout" property, for the Container representing \a item. */ + /*! Creates the "tqlayout" property, for the Container representing \a item. */ void createLayoutProperty(ObjectTreeItem *item); - /*! Saves the "layout" property and changes the Container 's layout ( + /*! Saves the "tqlayout" property and changes the Container 's tqlayout ( using Container::setLayout() ).*/ - void saveLayoutProperty(const QString &property, const QVariant &value); + void saveLayoutProperty(const TQString &property, const TQVariant &value); // Some i18n functions //! Adds translations for general properties, by adding items in d->propDesc @@ -180,17 +181,17 @@ class KFORMEDITOR_EXPORT WidgetPropertySet : public QObject /*! \return The i18n'ed name of the property whose name is \a name, that will be displayed in PropertyEditor. */ - QString propertyCaption(const QCString &name); + TQString propertyCaption(const TQCString &name); /*! \return The i18n'ed name of the property's value whose name is \a name. */ - QString valueCaption(const QCString &name); + TQString valueCaption(const TQCString &name); /*! \return The i18n'ed list of values, that will be shown by Property Editor (using descFromValue()).*/ - //QStringList captionForList(const QStringList &list); + //TQStringList captionForList(const TQStringList &list); //! Helper - void emitWidgetPropertyChanged(QWidget *w, const QCString& property, const QVariant& value); + void emitWidgetPropertyChanged(TQWidget *w, const TQCString& property, const TQVariant& value); private: WidgetPropertySetPrivate *d; diff --git a/kexi/formeditor/widgetwithsubpropertiesinterface.cpp b/kexi/formeditor/widgetwithsubpropertiesinterface.cpp index 812379e1..83904aa7 100644 --- a/kexi/formeditor/widgetwithsubpropertiesinterface.cpp +++ b/kexi/formeditor/widgetwithsubpropertiesinterface.cpp @@ -19,8 +19,8 @@ #include "widgetwithsubpropertiesinterface.h" -#include <qmetaobject.h> -#include <qasciidict.h> +#include <tqmetaobject.h> +#include <tqasciidict.h> #include <kdebug.h> @@ -34,19 +34,19 @@ WidgetWithSubpropertiesInterface::~WidgetWithSubpropertiesInterface() { } -void WidgetWithSubpropertiesInterface::setSubwidget(QWidget *widget) +void WidgetWithSubpropertiesInterface::setSubwidget(TQWidget *widget) { m_subwidget = widget; m_subproperies.clear(); - QAsciiDict<char> addedSubproperies(1024); + TQAsciiDict<char> addedSubproperies(1024); if (m_subwidget) { - //remember properties in the subwidget that are not present in the parent - for( QMetaObject *metaObject = m_subwidget->metaObject(); metaObject; metaObject = metaObject->superClass()) { - const int numProperties = metaObject->numProperties(); + //remember properties in the subwidget that are not present in the tqparent + for( TQMetaObject *tqmetaObject = m_subwidget->tqmetaObject(); tqmetaObject; tqmetaObject = tqmetaObject->tqsuperClass()) { + const int numProperties = tqmetaObject->numProperties(); for (int i = 0; i < numProperties; i++) { - const char *propertyName = metaObject->property( i )->name(); - if (dynamic_cast<QObject*>(this)->metaObject()->findProperty( propertyName, true )==-1 - && !addedSubproperies.find( propertyName ) ) + const char *propertyName = tqmetaObject->property( i )->name(); + if (dynamic_cast<TQObject*>(this)->tqmetaObject()->tqfindProperty( propertyName, true )==-1 + && !addedSubproperies.tqfind( propertyName ) ) { m_subproperies.append( propertyName ); addedSubproperies.insert( propertyName, (char*)1 ); @@ -58,40 +58,40 @@ void WidgetWithSubpropertiesInterface::setSubwidget(QWidget *widget) } } -QWidget* WidgetWithSubpropertiesInterface::subwidget() const +TQWidget* WidgetWithSubpropertiesInterface::subwidget() const { return m_subwidget; } -QValueList<QCString> WidgetWithSubpropertiesInterface::subproperies() const +TQValueList<TQCString> WidgetWithSubpropertiesInterface::subproperies() const { return m_subproperies; } -const QMetaProperty *WidgetWithSubpropertiesInterface::findMetaSubproperty(const char * name) const +const TQMetaProperty *WidgetWithSubpropertiesInterface::findMetaSubproperty(const char * name) const { - if (!m_subwidget || m_subproperies.find(name) == m_subproperies.constEnd()) { + if (!m_subwidget || m_subproperies.tqfind(name) == m_subproperies.constEnd()) { return 0; } - const int index = m_subwidget->metaObject()->findProperty( name, true ); + const int index = m_subwidget->tqmetaObject()->tqfindProperty( name, true ); if (index==-1) return 0; - return m_subwidget->metaObject()->property( index, true ); + return m_subwidget->tqmetaObject()->property( index, true ); } -QVariant WidgetWithSubpropertiesInterface::subproperty( const char * name, bool &ok ) const +TQVariant WidgetWithSubpropertiesInterface::subproperty( const char * name, bool &ok ) const { - if (!m_subwidget || m_subproperies.find(name) == m_subproperies.constEnd()) { + if (!m_subwidget || m_subproperies.tqfind(name) == m_subproperies.constEnd()) { ok = false; - return QVariant(); + return TQVariant(); } ok = true; return m_subwidget->property( name ); } -bool WidgetWithSubpropertiesInterface::setSubproperty( const char * name, const QVariant & value ) +bool WidgetWithSubpropertiesInterface::setSubproperty( const char * name, const TQVariant & value ) { - if (!m_subwidget || m_subproperies.find(name) == m_subproperies.end()) { + if (!m_subwidget || m_subproperies.tqfind(name) == m_subproperies.end()) { return false; } return m_subwidget->setProperty( name, value ); diff --git a/kexi/formeditor/widgetwithsubpropertiesinterface.h b/kexi/formeditor/widgetwithsubpropertiesinterface.h index 878fefca..b0d86710 100644 --- a/kexi/formeditor/widgetwithsubpropertiesinterface.h +++ b/kexi/formeditor/widgetwithsubpropertiesinterface.h @@ -20,11 +20,11 @@ #ifndef WIDGETWITHSUBPROPERTIESINTERFACE_H #define WIDGETWITHSUBPROPERTIESINTERFACE_H -#include <qcstring.h> -#include <qvaluelist.h> -#include <qwidget.h> -#include <qguardedptr.h> -#include <qvariant.h> +#include <tqcstring.h> +#include <tqvaluelist.h> +#include <tqwidget.h> +#include <tqguardedptr.h> +#include <tqvariant.h> namespace KFormDesigner { @@ -32,7 +32,7 @@ namespace KFormDesigner { /*! Currently used in KexiDBAutoField to allow editing specific properties of its internal editor. For example, if the autofield is of type Image Box, the Image Box widget has some specific properties like "lineWidth". - Such properties are provided by the parent KexiDBAutoField object as subproperties. */ + Such properties are provided by the tqparent KexiDBAutoField object as subproperties. */ class KFORMEDITOR_EXPORT WidgetWithSubpropertiesInterface { public: @@ -41,31 +41,31 @@ class KFORMEDITOR_EXPORT WidgetWithSubpropertiesInterface //! Sets \a widget subwidget handling subproperties. Setting 0 clears subwidget. //! @todo maybe someone wants to add more than one widget here? - void setSubwidget(QWidget *widget); + void setSubwidget(TQWidget *widget); //! \return the assigned subwidget. - QWidget* subwidget() const; + TQWidget* subwidget() const; //! \return a list of subproperties available for this widget. //! This is achieved by only listing those properties that are available in the - QValueList<QCString> subproperies() const; + TQValueList<TQCString> subproperies() const; //! \return a meta property for a widget's subproperty or 0 if there //! is no such subproperty. - const QMetaProperty *findMetaSubproperty(const char * name) const; + const TQMetaProperty *findMetaSubproperty(const char * name) const; //! \return a value of widget's subproperty. \a ok is set to true on success //! and to false on failure. - QVariant subproperty( const char * name, bool &ok ) const; + TQVariant subproperty( const char * name, bool &ok ) const; //! Sets a subproperty value \a value for a subproperty \a name //! \return true on successful setting and false when there - //! is no such a subproperty in the subwidget or QObject::setProperty() failed. - bool setSubproperty( const char * name, const QVariant & value ); + //! is no such a subproperty in the subwidget or TQObject::setProperty() failed. + bool setSubproperty( const char * name, const TQVariant & value ); protected: - QGuardedPtr<QWidget> m_subwidget; - QValueList<QCString> m_subproperies; + TQGuardedPtr<TQWidget> m_subwidget; + TQValueList<TQCString> m_subproperies; }; } |