diff options
Diffstat (limited to 'kexi/formeditor')
34 files changed, 396 insertions, 396 deletions
diff --git a/kexi/formeditor/commands.cpp b/kexi/formeditor/commands.cpp index c9bad809..9f6f4cfd 100644 --- a/kexi/formeditor/commands.cpp +++ b/kexi/formeditor/commands.cpp @@ -19,7 +19,7 @@ */ #include <tqdom.h> #include <tqwidget.h> -#include <tqlayout.h> +#include <layout.h> #include <tqlabel.h> #include <tqsplitter.h> #include <tqmetaobject.h> @@ -127,7 +127,7 @@ PropertyCommand::unexecute() WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(widg); TQWidget *subWidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : widg; - if (-1!=subWidget->tqmetaObject()->findProperty( m_property, true )) + if (-1!=subWidget->metaObject()->findProperty( m_property, true )) subWidget->setProperty(m_property, it.data()); } @@ -139,9 +139,9 @@ TQString PropertyCommand::name() const { if(m_oldvalues.count() >= 2) - return i18n("Change \"%1\" property for multiple widgets" ).tqarg(TQString(m_property)); + return i18n("Change \"%1\" property for multiple widgets" ).arg(TQString(m_property)); else - return i18n("Change \"%1\" property for widget \"%2\"" ).tqarg(TQString(m_property)).tqarg(TQString(m_oldvalues.begin().key())); + return i18n("Change \"%1\" property for widget \"%2\"" ).arg(TQString(m_property)).arg(TQString(m_oldvalues.begin().key())); } void @@ -435,10 +435,10 @@ AdjustSizeCommand::execute() { for(TQWidget *w = list.first(); w; w = list.next()) { ObjectTreeItem *item = m_form->objectTree()->lookup(w->name()); - if(item && !item->tqchildren()->isEmpty()) { // container + if(item && !item->children()->isEmpty()) { // container TQSize s; - if(item->container() && item->container()->tqlayout()) - s = w->tqsizeHint(); + if(item->container() && item->container()->layout()) + s = w->sizeHint(); else s = getSizeFromChildren(item); // minimum size for containers @@ -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 { - TQSize tqsizeHint(w->tqsizeHint()); - if (tqsizeHint.isValid()) - w->resize(tqsizeHint); + TQSize sizeHint(w->sizeHint()); + if (sizeHint.isValid()) + w->resize(sizeHint); } } break; @@ -545,17 +545,17 @@ AdjustSizeCommand::getSizeFromChildren(ObjectTreeItem *item) { TQSize s; // get size for each container, and keep the biggest one - for(ObjectTreeItem *tree = item->tqchildren()->first(); tree; tree = item->tqchildren()->next()) + for(ObjectTreeItem *tree = item->children()->first(); tree; tree = item->children()->next()) s = s.expandedTo(getSizeFromChildren(tree)); return s; } int tmpw = 0, tmph = 0; - for(ObjectTreeItem *tree = item->tqchildren()->first(); tree; tree = item->tqchildren()->next()) { + for(ObjectTreeItem *tree = item->children()->first(); tree; tree = item->children()->next()) { if(!tree->widget()) continue; - tmpw = TQMAX(tmpw, tree->widget()->tqgeometry().right()); - tmph = TQMAX(tmph, tree->widget()->tqgeometry().bottom()); + tmpw = TQMAX(tmpw, tree->widget()->geometry().right()); + tmph = TQMAX(tmph, tree->widget()->geometry().bottom()); } return TQSize(tmpw, tmph) + TQSize(10, 10); @@ -614,16 +614,16 @@ AdjustSizeCommand::debug() LayoutPropertyCommand::LayoutPropertyCommand(WidgetPropertySet *buf, const TQCString &wname, const TQVariant &oldValue, const TQVariant &value) - : PropertyCommand(buf, wname, oldValue, value, "tqlayout") + : PropertyCommand(buf, wname, oldValue, value, "layout") { 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 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()); + // 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()); } void @@ -655,7 +655,7 @@ LayoutPropertyCommand::unexecute() TQString LayoutPropertyCommand::name() const { - return i18n("Change tqlayout of widget \"%1\"").tqarg(TQString(m_oldvalues.begin().key())); + return i18n("Change layout of widget \"%1\"").arg(TQString(m_oldvalues.begin().key())); } void @@ -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.") - .tqarg(winfo ? winfo->name() : TQString())); + .arg(winfo ? winfo->name() : TQString())); kdWarning() << "InsertWidgetCommand::execute() ERROR: widget creation failed" << endl; return; } @@ -755,7 +755,7 @@ 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))) { - TQSize s = w->tqsizeHint(); + TQSize s = w->sizeHint(); if(s.isEmpty()) s = TQSize(20, 20); // Minimum size to avoid creating a (0,0) widget @@ -802,7 +802,7 @@ InsertWidgetCommand::execute() for(TQValueList<TQCString>::ConstIterator it = list.constBegin(); it != endIt; ++it) item->addModifiedProperty(*it, w->property(*it)); - m_container->reloadLayout(); // reload the tqlayout to take the new wigdet into account + m_container->reloadLayout(); // reload the layout to take the new wigdet into account m_container->setSelectedWidget(w, false); if (m_container->form()->library()->internalProperty(w->className(), @@ -830,7 +830,7 @@ TQString InsertWidgetCommand::name() const { if(!m_name.isEmpty()) - return i18n("Insert widget \"%1\"").tqarg(TQString(m_name)); + return i18n("Insert widget \"%1\"").arg(TQString(m_name)); else return i18n("Insert widget"); } @@ -864,10 +864,10 @@ CreateLayoutCommand::CreateLayoutCommand(int layoutType, WidgetList &list, Form } for(TQWidget *w = list.first(); w; w = list.next()) m_list->append(w); - m_list->sort(); // we sort them now, before creating the tqlayout + m_list->sort(); // we sort them now, before creating the layout for(TQWidget *w = m_list->first(); w; w = m_list->next()) - m_pos.insert(w->name(), w->tqgeometry()); + m_pos.insert(w->name(), w->geometry()); ObjectTreeItem *item = form->objectTree()->lookup(m_list->first()->name()); if(item && item->parent()->container()) m_containername = item->parent()->name(); @@ -911,8 +911,8 @@ CreateLayoutCommand::execute() return; container->setSelectedWidget(0, false); - 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 + 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 if(m_type == Container::HFlow) w->resize( TQSize(700, 20) ); else if(m_type == Container::VFlow) @@ -938,7 +938,7 @@ CreateLayoutCommand::execute() ((TQSplitter*)w)->setOrientation(Qt::Vertical); else if(tree->container()) { tree->container()->setLayout((Container::LayoutType)m_type); - w->resize(tree->container()->tqlayout()->tqsizeHint()); // the tqlayout doesn't have its own size + w->resize(tree->container()->layout()->sizeHint()); // the layout doesn't have its own size } container->setSelectedWidget(w, false); @@ -952,7 +952,7 @@ CreateLayoutCommand::unexecute() if(!parent) parent = m_form->objectTree(); - // We reparent every widget to the Container and take them out of the tqlayout + // We reparent every widget to the Container and take them out of the layout TQMap<TQCString,TQRect>::ConstIterator endIt = m_pos.constEnd(); for(TQMap<TQCString,TQRect>::ConstIterator it = m_pos.constBegin(); it != endIt; ++it) { @@ -973,7 +973,7 @@ CreateLayoutCommand::unexecute() if (!titem) return; //better this than a crash TQWidget *w = titem->widget(); - parent->container()->deleteWidget(w); // delete the tqlayout widget + parent->container()->deleteWidget(w); // delete the layout widget FormManager::self()->windowChanged(m_form->widget()); // to reload ObjectTreeView } @@ -1019,7 +1019,7 @@ BreakLayoutCommand::BreakLayoutCommand(Container *container) m_form = container->form(); m_type = container->layoutType(); - for(ObjectTreeItem *tree = container->objectTree()->tqchildren()->first(); tree; tree = container->objectTree()->tqchildren()->next()) + for(ObjectTreeItem *tree = container->objectTree()->children()->first(); tree; tree = container->objectTree()->children()->next()) { TQRect r(container->widget()->mapTo(container->widget()->parentWidget(), tree->widget()->pos()), tree->widget()->size()); m_pos.insert(tree->widget()->name(), r); @@ -1041,7 +1041,7 @@ BreakLayoutCommand::unexecute() TQString BreakLayoutCommand::name() const { - return i18n("Break Layout: \"%1\"").tqarg(m_name); + return i18n("Break Layout: \"%1\"").arg(m_name); } void @@ -1208,7 +1208,7 @@ PasteWidgetCommand::changePos(TQDomElement &el, const TQPoint &newpos) { //TQDomElement el = widg.cloneNode(true).toElement(); TQDomElement rect; - // Find the widget tqgeometry if there is one + // Find the widget geometry if there is one for(TQDomNode n = el.firstChild(); !n.isNull(); n = n.nextSibling()) { if((n.toElement().tagName() == "property") && (n.toElement().attribute("name") == "geometry")) @@ -1249,13 +1249,13 @@ PasteWidgetCommand::fixPos(TQDomElement &el, Container *container) int rh = h.text().toInt(); TQRect r(rx, ry, rw, rh); - TQWidget *w = m_form->widget()->tqchildAt(r.x() + 6, r.y() + 6, false); + TQWidget *w = m_form->widget()->childAt(r.x() + 6, r.y() + 6, false); if(!w) return; - while((w->tqgeometry() == r) && (w != 0))// there is already a widget there, with the same size + while((w->geometry() == r) && (w != 0))// there is already a widget there, with the same size { - w = m_form->widget()->tqchildAt(w->x() + 16, w->y() + 16, false); + w = m_form->widget()->childAt(w->x() + 16, w->y() + 16, false); r.moveBy(10,10); } @@ -1300,11 +1300,11 @@ PasteWidgetCommand::moveWidgetBy(TQDomElement &el, Container *container, const T TQRect r(rx + p.x(), ry + p.y(), rw, rh); kdDebug() << "Moving widget by " << p << " from " << rx << " " << ry << " to " << r.topLeft() << endl; - TQWidget *w = m_form->widget()->tqchildAt(r.x() + 6, r.y() + 6, false); + TQWidget *w = m_form->widget()->childAt(r.x() + 6, r.y() + 6, false); - while(w && (w->tqgeometry() == r))// there is already a widget there, with the same size + while(w && (w->geometry() == r))// there is already a widget there, with the same size { - w = m_form->widget()->tqchildAt(w->x() + 16, w->y() + 16, false); + w = m_form->widget()->childAt(w->x() + 16, w->y() + 16, false); r.moveBy(10,10); } diff --git a/kexi/formeditor/commands.h b/kexi/formeditor/commands.h index 64e5a253..41da4b60 100644 --- a/kexi/formeditor/commands.h +++ b/kexi/formeditor/commands.h @@ -105,7 +105,7 @@ class KFORMEDITOR_EXPORT GeometryPropertyCommand : public Command /*! 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 tqalignment (see the enum for possible values). */ + type of alignment (see the enum for possible values). */ class KFORMEDITOR_EXPORT AlignWidgetsCommand : public Command { public: @@ -150,7 +150,7 @@ class KFORMEDITOR_EXPORT AdjustSizeCommand : public Command TQMap<TQCString, TQSize> m_sizes; }; -/*! This command is used when switching the tqlayout of a Container. It remembers the old pos +/*! This command is used when switching the layout of a Container. It remembers the old pos of every widget inside the Container. */ class KFORMEDITOR_EXPORT LayoutPropertyCommand : public PropertyCommand { @@ -203,7 +203,7 @@ class KFORMEDITOR_EXPORT InsertWidgetCommand : public Command TQRect m_insertRect; }; -/*! This command is used when creating a tqlayout from some widgets using "Lay out in..." menu item. +/*! This command is used when creating a layout 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 diff --git a/kexi/formeditor/connectiondialog.cpp b/kexi/formeditor/connectiondialog.cpp index f683ce74..3fe0ac61 100644 --- a/kexi/formeditor/connectiondialog.cpp +++ b/kexi/formeditor/connectiondialog.cpp @@ -18,7 +18,7 @@ * Boston, MA 02110-1301, USA. */ -#include <tqlayout.h> +#include <layout.h> #include <tqhbox.h> #include <tqlabel.h> #include <tqregexp.h> @@ -51,7 +51,7 @@ ConnectionDialog::ConnectionDialog(TQWidget *parent) , m_buffer(0) { TQFrame *frame = makeMainWidget(); - TQHBoxLayout *tqlayout = new TQHBoxLayout(frame, 0, 6); + TQHBoxLayout *layout = new TQHBoxLayout(frame, 0, 6); // Setup the details widget ///////// TQHBox *details = new TQHBox(frame); @@ -60,10 +60,10 @@ ConnectionDialog::ConnectionDialog(TQWidget *parent) m_pixmapLabel = new TQLabel(details); m_pixmapLabel->setFixedWidth( int(IconSize(KIcon::Desktop) * 1.5) ); - m_pixmapLabel->tqsetAlignment(AlignHCenter | AlignTop); + m_pixmapLabel->setAlignment(AlignHCenter | AlignTop); m_textLabel = new TQLabel(details); - m_textLabel->tqsetAlignment(AlignLeft | AlignTop); + m_textLabel->setAlignment(AlignLeft | AlignTop); //setStatusOk(); // And the KexiTableView //////// @@ -74,21 +74,21 @@ ConnectionDialog::ConnectionDialog(TQWidget *parent) initTable(); m_table->setData(m_data, false); m_table->adjustColumnWidthToContents(0); - tqlayout->addWidget(m_table); + layout->addWidget(m_table); //// Setup the icon toolbar ///////////////// - TQVBoxLayout *vtqlayout = new TQVBoxLayout(tqlayout, 3); + TQVBoxLayout *vlayout = new TQVBoxLayout(layout, 3); KPushButton *newItem = new KPushButton(SmallIconSet("filenew"), i18n("&New Connection"), frame); - vtqlayout->addWidget(newItem); + vlayout->addWidget(newItem); m_buttons.insert(BAdd, newItem); connect(newItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(newItem())); KPushButton *delItem = new KPushButton(SmallIconSet("editdelete"), i18n("&Remove Connection"), frame); - vtqlayout->addWidget(delItem); + vlayout->addWidget(delItem); m_buttons.insert(BRemove, delItem); connect(delItem, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeItem())); - vtqlayout->addStretch(); + vlayout->addStretch(); setInitialSize(TQSize(600, 300)); //setWFlags(WDestructiveClose); @@ -289,7 +289,7 @@ ConnectionDialog::updateSlotList(KexiTableItem *item) TQString signalArg(signal); signalArg = signalArg.remove( TQRegExp(".*[(]|[)]") ); - TQStrList slotList = tree->widget()->tqmetaObject()->slotNames(true); + TQStrList slotList = tree->widget()->metaObject()->slotNames(true); TQStrListIterator it(slotList); for(; it.current() != 0; ++it) { @@ -297,7 +297,7 @@ ConnectionDialog::updateSlotList(KexiTableItem *item) TQString slotArg(*it); slotArg = slotArg.remove( TQRegExp(".*[(]|[)]") ); - if(!signalArg.tqstartsWith(slotArg, true) && (!signal.isEmpty())) // args not compatible + if(!signalArg.startsWith(slotArg, true) && (!signal.isEmpty())) // args not compatible continue; KexiTableItem *item = m_slotsColumnData->createItem(); //new KexiTableItem(2); @@ -315,7 +315,7 @@ ConnectionDialog::updateSignalList(KexiTableItem *item) return; m_signalsColumnData->deleteAllRows(); - TQStrList signalList = tree->widget()->tqmetaObject()->signalNames(true); + TQStrList signalList = tree->widget()->metaObject()->signalNames(true); TQStrListIterator it(signalList); for(; it.current() != 0; ++it) { @@ -334,7 +334,7 @@ ConnectionDialog::checkConnection(KexiTableItem *item) { if( !item || (*item)[i].toString().isEmpty()) { - setStatusError( i18n("<qt>You have not selected item: <b>%1</b>.</qt>").tqarg(m_data->column(i)->captionAliasOrName()), + setStatusError( i18n("<qt>You have not selected item: <b>%1</b>.</qt>").arg(m_data->column(i)->captionAliasOrName()), item); return; } @@ -346,7 +346,7 @@ ConnectionDialog::checkConnection(KexiTableItem *item) TQString slot = (*item)[4].toString(); slot = slot.remove( TQRegExp(".*[(]|[)]") ); - if(!signal.tqstartsWith(slot, true)) + if(!signal.startsWith(slot, true)) { setStatusError( i18n("The signal/slot arguments are not compatible."), item); return; diff --git a/kexi/formeditor/container.cpp b/kexi/formeditor/container.cpp index d1275adc..366f6a6d 100644 --- a/kexi/formeditor/container.cpp +++ b/kexi/formeditor/container.cpp @@ -23,7 +23,7 @@ #include <tqrect.h> #include <tqevent.h> #include <tqvaluevector.h> -#include <tqlayout.h> +#include <layout.h> #include <tqcursor.h> #include <kdebug.h> @@ -73,7 +73,7 @@ EventEater::eventFilter(TQObject *, TQEvent *ev) } } // else if(ev->type() == TQEvent::ChildInserted) { - // widget's tqchildren have changed, we need to reinstall filter + // widget's children have changed, we need to reinstall filter // installRecursiveEventFilter(m_widget, this); // } @@ -180,7 +180,7 @@ Container::eventFilter(TQObject *s, TQEvent *e) unSelectWidget(m_moving); else // the widget is the only selected, so it means we want to copy it { - //m_copyRect = m_moving->tqgeometry(); + //m_copyRect = m_moving->geometry(); m_state = CopyingWidget; if(m_form->formWidget()) m_form->formWidget()->initBuffer(); @@ -333,7 +333,7 @@ Container::eventFilter(TQObject *s, TQEvent *e) return false; } - case TQEvent::Resize: // we are resizing a widget, so we set m_move to true -> the tqlayout will be reloaded when releasing mouse + case TQEvent::Resize: // we are resizing a widget, so we set m_move to true -> the layout will be reloaded when releasing mouse { if(m_form->interactiveMode()) m_state = MovingWidget; @@ -408,7 +408,7 @@ Container::eventFilter(TQObject *s, TQEvent *e) ObjectTreeItem *item = form()->objectTree()->lookup(form()->selectedWidgets()->first()->name()); if(!item || !item->parent()) return true; - ObjectTreeList *list = item->parent()->tqchildren(); + ObjectTreeList *list = item->parent()->children(); if(list->count() == 1) return true; int index = list->findRef(item); @@ -525,7 +525,7 @@ Container::handleMouseReleaseEvent(TQObject *s, TQMouseEvent *mev) //m_initialPos = TQPoint(); } - else if(m_state == MovingWidget) // one widget has been moved, so we need to update the tqlayout + else if(m_state == MovingWidget) // one widget has been moved, so we need to update the layout reloadLayout(); // cancel copying as user released Ctrl before releasing mouse button @@ -639,7 +639,7 @@ Container::setLayout(LayoutType type) return; } } - m_container->setGeometry(m_container->tqgeometry()); // just update tqlayout + m_container->setGeometry(m_container->geometry()); // just update layout m_layout->activate(); } @@ -654,14 +654,14 @@ Container::reloadLayout() void Container::createBoxLayout(WidgetList *list) { - TQBoxLayout *tqlayout = static_cast<TQBoxLayout*>(m_layout); + TQBoxLayout *layout = static_cast<TQBoxLayout*>(m_layout); - for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) + for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) list->append( tree->widget()); list->sort(); for(TQWidget *obj = list->first(); obj; obj = list->next()) - tqlayout->addWidget(obj); + layout->addWidget(obj); delete list; } @@ -669,7 +669,7 @@ void Container::createFlowLayout() { KexiFlowLayout *flow = dynamic_cast<KexiFlowLayout*>(m_layout); - if(!flow || m_tree->tqchildren()->isEmpty()) + if(!flow || m_tree->children()->isEmpty()) return; const int offset = 15; @@ -684,7 +684,7 @@ Container::createFlowLayout() } // fill the list - for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) + for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) list->append( tree->widget()); list->sort(); @@ -741,11 +741,11 @@ Container::createGridLayout(bool testOnly) int end=-1000; bool same = false; - for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) + for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) vlist->append( tree->widget()); vlist->sort(); - for(ObjectTreeItem *tree = m_tree->tqchildren()->first(); tree; tree = m_tree->tqchildren()->next()) + for(ObjectTreeItem *tree = m_tree->children()->first(); tree; tree = m_tree->children()->next()) hlist->append( tree->widget()); hlist->sort(); @@ -759,30 +759,30 @@ Container::createGridLayout(bool testOnly) for(; it2.current() != 0; ++it2) { TQWidget *nextw = it2.current(); - if((w->y() >= nextw->y()) || (nextw->y() >= w->tqgeometry().bottom())) + if((w->y() >= nextw->y()) || (nextw->y() >= w->geometry().bottom())) break; - if(!w->tqgeometry().intersects(nextw->tqgeometry())) + if(!w->geometry().intersects(nextw->geometry())) 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->tqgeometry().bottom()+1); + nextw->move(nextw->x(), w->geometry().bottom()+1); else if(nextw->x() >= w->x()) - nextw->move(w->tqgeometry().right()+1, nextw->y()); + nextw->move(w->geometry().right()+1, nextw->y()); else - w->move(nextw->tqgeometry().right()+1, nextw->y()); + w->move(nextw->geometry().right()+1, nextw->y()); } } } - // Then we count the number of rows in the tqlayout, and set their beginnings + // Then we count the number of rows in the layout, and set their beginnings for(WidgetListIterator it(*vlist); it.current() != 0; ++it) { TQWidget *w = it.current(); WidgetListIterator it2 = it; if(!same) { // this widget will make a new row - end = w->tqgeometry().bottom(); + end = w->geometry().bottom(); rows.append(w->y()); } @@ -796,9 +796,9 @@ Container::createGridLayout(bool testOnly) if(nextw->y() >= end) same = false; else { - same = !(same && (nextw->y() >= w->tqgeometry().bottom())); + same = !(same && (nextw->y() >= w->geometry().bottom())); if(!same) - end = w->tqgeometry().bottom(); + end = w->geometry().bottom(); } } kdDebug() << "the new grid will have n rows: n == " << rows.size() << endl; @@ -811,7 +811,7 @@ Container::createGridLayout(bool testOnly) TQWidget *w = it.current(); WidgetListIterator it2 = it; if(!same) { - end = w->tqgeometry().right(); + end = w->geometry().right(); cols.append(w->x()); } @@ -823,25 +823,25 @@ Container::createGridLayout(bool testOnly) if(nextw->x() >= end) same = false; else { - same = !(same && (nextw->x() >= w->tqgeometry().right())); + same = !(same && (nextw->x() >= w->geometry().right())); if(!same) - end = w->tqgeometry().right(); + end = w->geometry().right(); } } kdDebug() << "the new grid will have n columns: n == " << cols.size() << endl; - // We create the tqlayout .. - TQGridLayout *tqlayout=0; + // We create the layout .. + TQGridLayout *layout=0; if(!testOnly) { - tqlayout = new TQGridLayout(m_container, rows.size(), cols.size(), m_margin, m_spacing, "grid"); - m_layout = (TQLayout*)tqlayout; + layout = new TQGridLayout(m_container, rows.size(), cols.size(), m_margin, m_spacing, "grid"); + m_layout = (TQLayout*)layout; } // .. and we fill it with widgets for(WidgetListIterator it(*vlist); it.current() != 0; ++it) { TQWidget *w = it.current(); - TQRect r = w->tqgeometry(); + TQRect r = w->geometry(); uint wcol=0, wrow=0, endrow=0, endcol=0; uint i = 0; @@ -901,14 +901,14 @@ Container::createGridLayout(bool testOnly) ObjectTreeItem *item = m_form->objectTree()->lookup(w->name()); if(!endrow && !endcol) { if(!testOnly) - tqlayout->addWidget(w, wrow, wcol); + layout->addWidget(w, wrow, wcol); item->setGridPos(wrow, wcol, 0, 0); } else { if(!endcol) endcol = wcol; if(!endrow) endrow = wrow; if(!testOnly) - tqlayout->addMultiCellWidget(w, wrow, endrow, wcol, endcol); + layout->addMultiCellWidget(w, wrow, endrow, wcol, endcol); item->setGridPos(wrow, wcol, endrow-wrow+1, endcol-wcol+1); } } @@ -971,7 +971,7 @@ Container::drawConnection(TQMouseEvent *mev) { FormManager::self()->createdConnection()->setReceiver(m_moving->name()); FormManager::self()->createSlotMenu(m_moving); - m_container->tqrepaint(); + m_container->repaint(); return; } // the user clicked outside the menu, we cancel the connection @@ -997,12 +997,12 @@ Container::drawSelectionRect(TQMouseEvent *mev) setSelectedWidget(m_container, false); TQWidget *widgetToSelect = 0; // We check which widgets are in the rect and select them - for(ObjectTreeItem *item = m_tree->tqchildren()->first(); item; item = m_tree->tqchildren()->next()) + for(ObjectTreeItem *item = m_tree->children()->first(); item; item = m_tree->children()->next()) { TQWidget *w = item->widget(); if(!w) continue; - if(w->tqgeometry().intersects(r) && w != m_container) { + if(w->geometry().intersects(r) && w != m_container) { if (widgetToSelect) setSelectedWidget(widgetToSelect, true/*add*/, false/*raise*/, true/*moreWillBeSelected*/); widgetToSelect = w; //select later @@ -1013,7 +1013,7 @@ Container::drawSelectionRect(TQMouseEvent *mev) m_insertRect = TQRect(); m_state = DoingNothing; - m_container->tqrepaint(); + m_container->repaint(); } void @@ -1070,7 +1070,7 @@ Container::drawCopiedWidgetRect(TQMouseEvent *mev) //FormManager::self()->undo(); // undo last moving //m_moving->move(m_initialPos); if(m_form->formWidget()) { - m_container->tqrepaint(); + m_container->repaint(); m_form->formWidget()->initBuffer(); } m_state = CopyingWidget; @@ -1081,7 +1081,7 @@ Container::drawCopiedWidgetRect(TQMouseEvent *mev) if(m_form->formWidget()) { TQValueList<TQRect> rectList; for(TQWidget *w = m_form->selectedWidgets()->first(); w; w = m_form->selectedWidgets()->next()) { - TQRect drawRect = w->tqgeometry(); + TQRect drawRect = w->geometry(); TQPoint p = mev->pos() - m_grab; drawRect.moveBy(p.x(), p.y()); p = m_container->mapTo(m_form->widget(), TQPoint(0, 0)); diff --git a/kexi/formeditor/container.h b/kexi/formeditor/container.h index 36f35e82..bd46c7a1 100644 --- a/kexi/formeditor/container.h +++ b/kexi/formeditor/container.h @@ -104,9 +104,9 @@ class KFORMEDITOR_EXPORT Container : public TQObject void setObjectTree(ObjectTreeItem *t) { m_tree = t; } //! \return a pointer to the TQLayout of this Container, or 0 if there is not. - TQLayout* tqlayout() const { return m_layout; } + TQLayout* layout() const { return m_layout; } - //! \return the type of the tqlayout associated to this Container's widget (see LayoutType enum). + //! \return the type of the layout associated to this Container's widget (see LayoutType enum). LayoutType layoutType() const { return m_layType; } //! \return the margin of this Container. @@ -115,8 +115,8 @@ class KFORMEDITOR_EXPORT Container : public TQObject //! \return the spacing of this Container. int layoutSpacing() { return m_spacing; } - /*! Sets this Container to use \a type of tqlayout. The widget are inserted - automatically in the tqlayout following their positions. + /*! Sets this Container to use \a type of layout. The widget are inserted + automatically in the layout following their positions. \sa createBoxLayout(), createGridLayout() */ void setLayout(LayoutType type); @@ -129,7 +129,7 @@ class KFORMEDITOR_EXPORT Container : public TQObject //! \return the string representing the layoutType \a type. static TQString layoutTypeToString(int type); - //! \return the LayoutType (an int) for a given tqlayout name. + //! \return the LayoutType (an int) for a given layout name. static LayoutType stringToLayoutType(const TQString &name); /*! Stops the inline editing of the current widget (as when you click @@ -161,8 +161,8 @@ class KFORMEDITOR_EXPORT Container : public TQObject to Container's widget. */ void deleteWidget(TQWidget *w); - /*! Recreates the Container tqlayout. Calls this when a widget has been moved - or added to update the tqlayout. */ + /*! Recreates the Container layout. Calls this when a widget has been moved + or added to update the layout. */ void reloadLayout(); protected slots: @@ -178,7 +178,7 @@ class KFORMEDITOR_EXPORT Container : public TQObject /*! Internal function to create a KexiFlowLayout. */ void createFlowLayout(); - /*! Internal function to create a GridLayout. if \a testOnly is true, the tqlayout + /*! Internal function to create a GridLayout. if \a testOnly is true, the layout is simulated, and only the widget's grid info aris filled. */ void createGridLayout(bool testOnly=false); diff --git a/kexi/formeditor/editlistviewdialog.cpp b/kexi/formeditor/editlistviewdialog.cpp index d073b43d..5bfdfbfe 100644 --- a/kexi/formeditor/editlistviewdialog.cpp +++ b/kexi/formeditor/editlistviewdialog.cpp @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ #include <tqheader.h> -#include <tqlayout.h> +#include <layout.h> #include <klistview.h> #include <ktabwidget.h> @@ -46,45 +46,45 @@ EditListViewDialog::EditListViewDialog(TQWidget *parent) m_contents = addPage(i18n("Contents")); ///////// Setup the "Contents" page ///////////////////////////// - TQHBoxLayout *tqlayout = new TQHBoxLayout(m_contents, 0, 6); + TQHBoxLayout *layout = new TQHBoxLayout(m_contents, 0, 6); //// Setup the icon toolbar ///////////////// - TQVBoxLayout *vtqlayout = new TQVBoxLayout(tqlayout, 3); + TQVBoxLayout *vlayout = new TQVBoxLayout(layout, 3); TQToolButton *newRow = new TQToolButton(m_contents); newRow->setIconSet(BarIconSet("edit_add")); newRow->setTextLabel(i18n("&Add Item"), true); - vtqlayout->addWidget(newRow); + vlayout->addWidget(newRow); m_buttons.insert(BNewRow, newRow); connect(newRow, TQT_SIGNAL(clicked()), this, TQT_SLOT(newRow())); TQToolButton *newChild = new TQToolButton(m_contents); newChild->setIconSet(BarIconSet("1rightarrow")); newChild->setTextLabel(i18n("New &Subitem"), true); - vtqlayout->addWidget(newChild); + vlayout->addWidget(newChild); m_buttons.insert(BNewChild, newChild); connect(newChild, TQT_SIGNAL(clicked()), this, TQT_SLOT(newChildRow())); TQToolButton *delRow = new TQToolButton(m_contents); delRow->setIconSet(BarIconSet("edit_remove")); delRow->setTextLabel(i18n("&Remove Item"), true); - vtqlayout->addWidget(delRow); + vlayout->addWidget(delRow); m_buttons.insert(BRemRow, delRow); connect(delRow, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeRow())); TQToolButton *rowUp = new TQToolButton(m_contents); rowUp->setIconSet(BarIconSet("1uparrow")); rowUp->setTextLabel(i18n("Move Item &Up"), true); - vtqlayout->addWidget(rowUp); + vlayout->addWidget(rowUp); m_buttons.insert(BRowUp, rowUp); connect(rowUp, TQT_SIGNAL(clicked()), this, TQT_SLOT(MoveRowUp())); TQToolButton *rowDown = new TQToolButton(m_contents); rowDown->setIconSet(BarIconSet("1downarrow")); rowDown->setTextLabel(i18n("Move Item &Down"), true); - vtqlayout->addWidget(rowDown); + vlayout->addWidget(rowDown); m_buttons.insert(BRowDown, rowDown); connect(rowDown, TQT_SIGNAL(clicked()), this, TQT_SLOT(MoveRowDown())); - vtqlayout->addStretch(); + vlayout->addStretch(); //// The listview /////////// m_listview = new KListView(m_contents, "editlistview_listview"); @@ -96,7 +96,7 @@ EditListViewDialog::EditListViewDialog(TQWidget *parent) m_listview->setDropVisualizer(true); m_listview->setAcceptDrops(true); m_listview->setSorting(-1); - tqlayout->addWidget(m_listview); + layout->addWidget(m_listview); m_listview->setFocus(); 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*))); diff --git a/kexi/formeditor/factories/containerfactory.cpp b/kexi/formeditor/factories/containerfactory.cpp index acc72c24..c1056b3b 100644 --- a/kexi/formeditor/factories/containerfactory.cpp +++ b/kexi/formeditor/factories/containerfactory.cpp @@ -36,7 +36,7 @@ #include <tqscrollview.h> #include <tqtabbar.h> #include <tqsplitter.h> -#include <tqlayout.h> +#include <layout.h> #include <kiconloader.h> #include <kgenericfactory.h> @@ -73,7 +73,7 @@ ContainerWidget::~ContainerWidget() { } -TQSize ContainerWidget::tqsizeHint() const +TQSize ContainerWidget::sizeHint() const { return TQSize(30,30); //default } @@ -125,7 +125,7 @@ KFDTabWidget::~KFDTabWidget() } TQSize -KFDTabWidget::tqsizeHint() const +KFDTabWidget::sizeHint() const { TQSize s(30,30); // default min size for(int i=0; i < count(); i++) @@ -150,7 +150,7 @@ void KFDTabWidget::dropEvent( TQDropEvent *e ) emit handleDropEvent(e); } -/// Various tqlayout widgets /////////////////: +/// Various layout widgets /////////////////: HBox::HBox(TQWidget *parent, const char *name) : TQFrame(parent, name), m_preview(false) @@ -218,10 +218,10 @@ VFlow::paintEvent(TQPaintEvent *) } TQSize -VFlow::tqsizeHint() const +VFlow::sizeHint() const { - if(tqlayout()) - return tqlayout()->tqsizeHint(); + if(layout()) + return layout()->sizeHint(); else return TQSize(700, 50); // default } @@ -256,7 +256,7 @@ InsertPageCommand::execute() if(classname == "KFDTabWidget") { TabWidgetBase *tab = dynamic_cast<TabWidgetBase*>(parent); - TQString n = i18n("Page %1").tqarg(tab->count() + 1); + TQString n = i18n("Page %1").arg(tab->count() + 1); tab->addTab(page, n); tab->showPage(page); @@ -318,7 +318,7 @@ SubForm::SubForm(TQWidget *parent, const char *name) : TQScrollView(parent, name), m_form(0), m_widget(0) { setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken); - viewport()->setPaletteBackgroundColor(tqcolorGroup().mid()); + viewport()->setPaletteBackgroundColor(colorGroup().mid()); } void @@ -455,7 +455,7 @@ ContainerFactory::ContainerFactory(TQObject *parent, const char *, const TQStrin 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 tqchildren")); + wSplitter->setDescription(i18n("A container that enables user to resize its children")); addClass(wSplitter); KFormDesigner::WidgetInfo *wHFlow = new KFormDesigner::WidgetInfo(this); @@ -682,7 +682,7 @@ ContainerFactory::createMenuActions(const TQCString &classname, TQWidget *w, TQP int id = menu->insertItem(SmallIconSet("tab_new"), i18n("Add Page"), this, TQT_SLOT(addStackPage()) ); 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( ((TQWidgetStack*)m_widget)->children()->count() == 4) // == the stack has only one page if(stack->childrenListObject().count() == 4) // == the stack has only one page menu->setItemEnabled(id, false); @@ -860,7 +860,7 @@ void ContainerFactory::renameTabPage() #if TDE_VERSION < KDE_MAKE_VERSION(3,1,9) TQLineEdit::Normal, #endif - tab->tabLabel(w), &ok, w->tqtopLevelWidget()); + tab->tabLabel(w), &ok, w->topLevelWidget()); if(ok) tab->changeTab(w, name); } @@ -872,8 +872,8 @@ void ContainerFactory::reorderTabs(int oldpos, int newpos) if(!tab) return; - KFormDesigner::ObjectTreeItem *item = tab->tqchildren()->take(oldpos); - tab->tqchildren()->insert(newpos, item); + KFormDesigner::ObjectTreeItem *item = tab->children()->take(oldpos); + tab->children()->insert(newpos, item); } void ContainerFactory::addStackPage() diff --git a/kexi/formeditor/factories/containerfactory.h b/kexi/formeditor/factories/containerfactory.h index b88b437f..6f013e9c 100644 --- a/kexi/formeditor/factories/containerfactory.h +++ b/kexi/formeditor/factories/containerfactory.h @@ -126,7 +126,7 @@ class KFORMEDITOR_EXPORT VFlow : public TQFrame virtual ~VFlow(){;} void setPreviewMode() {m_preview = true;} virtual void paintEvent(TQPaintEvent *ev); - virtual TQSize tqsizeHint() const; + virtual TQSize sizeHint() const; protected: bool m_preview; @@ -144,7 +144,7 @@ class KFORMEDITOR_EXPORT ContainerWidget : public TQWidget ContainerWidget(TQWidget *parent, const char *name); virtual ~ContainerWidget(); - virtual TQSize tqsizeHint() const; + virtual TQSize sizeHint() const; //! Used to emit handleDragMoveEvent() signal needed to control dragging over the container's surface virtual void dragMoveEvent( TQDragMoveEvent *e ); @@ -170,7 +170,7 @@ class KFORMEDITOR_EXPORT KFDTabWidget : public KFormDesigner::TabWidget KFDTabWidget(TQWidget *parent, const char *name); virtual ~KFDTabWidget(); - virtual TQSize tqsizeHint() const; + virtual TQSize sizeHint() const; //! Used to emit handleDragMoveEvent() signal needed to control dragging over the container's surface virtual void dragMoveEvent( TQDragMoveEvent *e ); diff --git a/kexi/formeditor/factories/stdwidgetfactory.cpp b/kexi/formeditor/factories/stdwidgetfactory.cpp index 24827e13..2607fcca 100644 --- a/kexi/formeditor/factories/stdwidgetfactory.cpp +++ b/kexi/formeditor/factories/stdwidgetfactory.cpp @@ -431,13 +431,13 @@ StdWidgetFactory::createWidget(const TQCString &c, TQWidget *p, const char *n, w = new KProgress(p, n); else if(c == "KDateWidget") - w = new KDateWidget(TQDate::tqcurrentDate(), p, n); + w = new KDateWidget(TQDate::currentDate(), p, n); else if(c == "KTimeWidget") w = new KTimeWidget(TQTime::currentTime(), p, n); else if(c == "KDateTimeWidget") - w = new KDateTimeWidget(TQDateTime::tqcurrentDateTime(), p, n); + w = new KDateTimeWidget(TQDateTime::currentDateTime(), p, n); else if(c == "Line") w = new Line(options & WidgetFactory::VerticalOrientation ? Qt::Vertical : Qt::Horizontal, p, n); @@ -492,7 +492,7 @@ StdWidgetFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDes if(classname == "KLineEdit") { KLineEdit *lineedit = static_cast<KLineEdit*>(w); - createEditor(classname, lineedit->text(), lineedit, container, lineedit->tqgeometry(), lineedit->tqalignment(), true); + createEditor(classname, lineedit->text(), lineedit, container, lineedit->geometry(), lineedit->alignment(), true); return true; } else if(classname == TQLABEL_OBJECT_NAME_STRING) @@ -505,7 +505,7 @@ StdWidgetFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDes editText(); } else - createEditor(classname, label->text(), label, container, label->tqgeometry(), label->tqalignment()); + createEditor(classname, label->text(), label, container, label->geometry(), label->alignment()); return true; } else if(classname == "KPushButton") @@ -531,7 +531,7 @@ StdWidgetFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDes else if(classname == TQCHECKBOX_OBJECT_NAME_STRING) { TQCheckBox *check = static_cast<TQCheckBox*>(w); - //TQRect r(check->tqgeometry()); + //TQRect r(check->geometry()); //r.setX(r.x() + 20); TQRect r = w->tqstyle().subRect(TQStyle::SR_CheckBoxContents, w); TQRect editorRect = TQRect(check->x() + r.x(), check->y() + r.y(), r.width(), r.height()); @@ -605,13 +605,13 @@ StdWidgetFactory::changeText(const TQString &text) else changeProperty("text", text, m_container->form()); - /* By-hand method not needed as tqsizeHint() can do that for us + /* By-hand method not needed as sizeHint() can do that for us TQFontMetrics fm = w->fontMetrics(); TQSize s(fm.width( text ), fm.height()); int width; if(n == TQLABEL_OBJECT_NAME_STRING) // labels are resized to fit the text { - w->resize(w->tqsizeHint()); + w->resize(w->sizeHint()); WidgetFactory::m_editor->resize(w->size()); return; } @@ -624,7 +624,7 @@ StdWidgetFactory::changeText(const TQString &text) width = w->style().sizeFromContents( TQStyle::CT_RadioButton, w, s).width(); else return; - int width = w->tqsizeHint().width();*/ + int width = w->sizeHint().width();*/ #if 0 //not needed here, size hint is used on creation in InsertWidgetCommand::execute() if(w->width() < width) @@ -860,7 +860,7 @@ StdWidgetFactory::isPropertyVisibleInternal(const TQCString &classname, } else if(classname == "KexiPictureLabel") { - if((property == "text") || (property == "indent") || (property == "textFormat") || (property == "font") || (property == "tqalignment")) + if((property == "text") || (property == "indent") || (property == "textFormat") || (property == "font") || (property == "alignment")) return false; } else if(classname == TQLABEL_OBJECT_NAME_STRING) @@ -956,7 +956,7 @@ StdWidgetFactory::editText() } if(classname == TQLABEL_OBJECT_NAME_STRING) - widget()->resize(widget()->tqsizeHint()); + widget()->resize(widget()->sizeHint()); } void diff --git a/kexi/formeditor/form.cpp b/kexi/formeditor/form.cpp index b5b20936..52d44966 100644 --- a/kexi/formeditor/form.cpp +++ b/kexi/formeditor/form.cpp @@ -364,10 +364,10 @@ Form::changeName(const TQCString &oldname, const TQCString &newname) return; if(!d->topTree->rename(oldname, newname)) // rename failed { - KMessageBox::sorry(widget()->tqtopLevelWidget(), - i18n("Renaming widget \"%1\" to \"%2\" failed.").tqarg(TQString(oldname)).tqarg(TQString(newname))); + KMessageBox::sorry(widget()->topLevelWidget(), + i18n("Renaming widget \"%1\" to \"%2\" failed.").arg(TQString(oldname)).arg(TQString(newname))); //moved to WidgetPropertySet::slotChangeProperty() -// KMessageBox::sorry(widget()->tqtopLevelWidget(), +// KMessageBox::sorry(widget()->topLevelWidget(), // 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; @@ -499,7 +499,7 @@ void collectContainers(ObjectTreeItem* item, TQPtrDict<char>& containers) << " " << item->container()->objectTree()->name() << endl; containers.insert( item->container(), (const char *)1 ); } - for (ObjectTreeListIterator it(*item->tqchildren()); it.current(); ++it) + for (ObjectTreeListIterator it(*item->children()); it.current(); ++it) collectContainers(it.current(), containers); } @@ -528,7 +528,7 @@ Form::autoAssignTabStops() d->tabstops.clear(); /// We automatically sort widget from the top-left to bottom-right corner - //! \todo Handle RTL tqlayout (ie from top-right to bottom-left) + //! \todo Handle RTL layout (ie from top-right to bottom-left) foreach_list(WidgetListIterator, it, list) { TQWidget *w = it.current(); hlist.append(w); diff --git a/kexi/formeditor/form.h b/kexi/formeditor/form.h index 7df731c6..a8bd6dc0 100644 --- a/kexi/formeditor/form.h +++ b/kexi/formeditor/form.h @@ -67,7 +67,7 @@ class KFORMEDITOR_EXPORT FormWidget /*! 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 tqrepaint the Form. */ + /*! Clears the form, ie pastes the whole buffer to repaint the Form. */ virtual void clearForm() = 0; /*! This function highlights two widgets (to is optional), which are @@ -109,7 +109,7 @@ class FormPrivate PixmapCollection *pixcollection; - //! This map is used to store cursor tqshapes before inserting (so we can restore them later) + //! This map is used to store cursor shapes 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) @@ -231,10 +231,10 @@ class KFORMEDITOR_EXPORT Form : public TQObject //! @todo make gridSize configurable at global level int gridSize() { return 10; } - //! \return the default margin for all the tqlayout inside this Form. + //! \return the default margin for all the layout inside this Form. int defaultMargin() { return 11;} - //! \return the default spacing for all the tqlayout inside this Form. + //! \return the default spacing for all the layout inside this Form. int defaultSpacing() { return 6;} /*! This function is used by ObjectTree to emit childAdded() signal (as it is not a TQObject). */ @@ -285,7 +285,7 @@ class KFORMEDITOR_EXPORT Form : public TQObject (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 tqlayout has changed + /*! Tells the Form to reassign the tab stops because the widget layout 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, diff --git a/kexi/formeditor/formIO.cpp b/kexi/formeditor/formIO.cpp index 2759fe98..23c67fb4 100644 --- a/kexi/formeditor/formIO.cpp +++ b/kexi/formeditor/formIO.cpp @@ -23,11 +23,11 @@ #include <tqmetaobject.h> #include <tqdom.h> #include <tqfile.h> -#include <tqtextstream.h> +#include <textstream.h> #include <tqcursor.h> #include <tqbuffer.h> #include <tqimage.h> -#include <tqlayout.h> +#include <layout.h> #include <tqobjectlist.h> #include <tqdatetime.h> #include <tqlabel.h> @@ -66,7 +66,7 @@ void CustomWidget::paintEvent(TQPaintEvent *) { TQPainter p(this); - p.setPen(tqpalette().active().text()); + p.setPen(palette().active().text()); TQRect r(rect()); r.setX(r.x()+2); p.drawText(r, TQt::AlignTop, m_className); @@ -406,10 +406,10 @@ FormIO::savePropertyValue(TQDomElement &parentNode, TQDomDocument &parent, const WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(w); TQWidget *subwidget = w; bool addSubwidgetFlag = false; - int propertyId = w->tqmetaObject()->findProperty(name, true); + int propertyId = w->metaObject()->findProperty(name, true); if (propertyId == -1 && subpropIface && subpropIface->subwidget()) { // try property from subwidget subwidget = subpropIface->subwidget(); - propertyId = subpropIface->subwidget()->tqmetaObject()->findProperty(name, true); + propertyId = subpropIface->subwidget()->metaObject()->findProperty(name, true); addSubwidgetFlag = true; } if(propertyId == -1) @@ -420,7 +420,7 @@ FormIO::savePropertyValue(TQDomElement &parentNode, TQDomDocument &parent, const return; } - const TQMetaProperty *meta = subwidget->tqmetaObject()->property(propertyId, true); + const TQMetaProperty *meta = subwidget->metaObject()->property(propertyId, true); if (!meta->stored( subwidget )) //not storable return; TQDomElement propertyE = parent.createElement("property"); @@ -621,7 +621,7 @@ FormIO::writeVariant(TQDomDocument &parent, TQDomElement &parentNode, TQVariant case TQVariant::Cursor: { type = parent.createElement("cursor"); - valueE = parent.createTextNode(TQString::number(value.toCursor().tqshape())); + valueE = parent.createTextNode(TQString::number(value.toCursor().shape())); type.appendChild(valueE); break; } @@ -880,8 +880,8 @@ FormIO::readPropertyValue(TQDomNode node, TQObject *obj, const TQString &name) { WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(obj); TQObject *subobject = (subpropIface && subpropIface->subwidget()) ? TQT_TQOBJECT(subpropIface->subwidget()) : obj; - const int count = subobject->tqmetaObject()->findProperty(name.latin1(), true); - const TQMetaProperty *meta = count!=-1 ? subobject->tqmetaObject()->property(count, true) : 0; + const int count = subobject->metaObject()->findProperty(name.latin1(), true); + const TQMetaProperty *meta = count!=-1 ? subobject->metaObject()->property(count, true) : 0; if (meta) { if (meta->isSetType()) { @@ -964,14 +964,14 @@ FormIO::saveWidget(ObjectTreeItem *item, TQDomElement &parent, TQDomDocument &do savePropertyValue(tclass, domDoc, "name", item->widget()->property("name"), item->widget()); - // Important: save dataSource property FIRST before properties like "tqalignment" + // Important: save dataSource property FIRST before properties like "alignment" // - 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()->tqmetaObject()->findProperty("dataSource")) +// if (-1 != item->widget()->metaObject()->findProperty("dataSource")) // savePropertyValue(tclass, domDoc, "dataSource", item->widget()->property("dataSource"), item->widget()); - // We don't want to save the tqgeometry if the widget is inside a tqlayout (so parent.tagName() == "grid" for example) + // 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()) { // save form widget size, but not its position savePropertyValue(tclass, domDoc, "geometry", @@ -992,14 +992,14 @@ FormIO::saveWidget(ObjectTreeItem *item, TQDomElement &parent, TQDomDocument &do for(TQMap<TQString,TQVariant>::ConstIterator it = map->constBegin(); it != endIt; ++it) { const TQCString name( it.key().latin1() ); - if(name == "hAlign" || name == "vAlign" || name == "wordbreak" || name == "tqalignment") { + if(name == "hAlign" || name == "vAlign" || name == "wordbreak" || name == "alignment") { if(!savedAlignment) // not to save it twice { - savePropertyValue(tclass, domDoc, "tqalignment", item->widget()->property("tqalignment"), item->widget()); + savePropertyValue(tclass, domDoc, "alignment", item->widget()->property("alignment"), item->widget()); savedAlignment = true; } } - else if(name == "name" || name == "geometry" || name == "tqlayout") { + else if(name == "name" || name == "geometry" || name == "layout") { // these have already been saved } else { @@ -1017,80 +1017,80 @@ FormIO::saveWidget(ObjectTreeItem *item, TQDomElement &parent, TQDomDocument &do } } - // Saving container 's tqlayout if there is one - TQDomElement tqlayout; + // Saving container 's layout if there is one + TQDomElement layout; if(item->container() && item->container()->layoutType() != Container::NoLayout) { - if(item->container()->tqlayout()) // there is a tqlayout + if(item->container()->layout()) // there is a layout { - tqlayout = domDoc.createElement("temp"); - savePropertyValue(tqlayout, domDoc, "name", "unnamed", item->widget()); + layout = domDoc.createElement("temp"); + savePropertyValue(layout, domDoc, "name", "unnamed", item->widget()); if(item->modifiedProperties()->contains("layoutMargin")) - savePropertyElement(tqlayout, domDoc, "property", "margin", item->container()->layoutMargin()); + savePropertyElement(layout, domDoc, "property", "margin", item->container()->layoutMargin()); if(item->modifiedProperties()->contains("layoutSpacing")) - savePropertyElement(tqlayout, domDoc, "property", "spacing", item->container()->layoutSpacing()); - tclass.appendChild(tqlayout); + savePropertyElement(layout, domDoc, "property", "spacing", item->container()->layoutSpacing()); + tclass.appendChild(layout); } } int layoutType = item->container() ? item->container()->layoutType() : Container::NoLayout; switch(layoutType) { - case Container::Grid: // grid tqlayout + case Container::Grid: // grid layout { - tqlayout.setTagName("grid"); - for(ObjectTreeItem *objIt = item->tqchildren()->first(); objIt; objIt = item->tqchildren()->next()) - saveWidget(objIt, tqlayout, domDoc, true); + layout.setTagName("grid"); + for(ObjectTreeItem *objIt = item->children()->first(); objIt; objIt = item->children()->next()) + saveWidget(objIt, layout, domDoc, true); break; } case Container::HBox: case Container::VBox: { - // as we don't save tqgeometry, we need to sort widgets in the right order, not creation order + // as we don't save geometry, we need to sort widgets in the right order, not creation order WidgetList *list; - if(tqlayout.tagName() == "hbox") { + if(layout.tagName() == "hbox") { list = new HorWidgetList(item->container()->form()->toplevelContainer()->widget()); - tqlayout.setTagName("hbox"); + layout.setTagName("hbox"); } else { list = new VerWidgetList(item->container()->form()->toplevelContainer()->widget()); - tqlayout.setTagName("vbox"); + layout.setTagName("vbox"); } - for(ObjectTreeItem *objTree = item->tqchildren()->first(); objTree; objTree = item->tqchildren()->next()) + for(ObjectTreeItem *objTree = item->children()->first(); objTree; objTree = item->children()->next()) list->append(objTree->widget()); list->sort(); for(TQWidget *obj = list->first(); obj; obj = list->next()) { ObjectTreeItem *titem = item->container()->form()->objectTree()->lookup(obj->name()); if(item) - saveWidget(titem, tqlayout, domDoc); + saveWidget(titem, layout, domDoc); } delete list; break; } case Container::HFlow: case Container::VFlow: { - tqlayout.setTagName("grid"); - KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->tqlayout()); + layout.setTagName("grid"); + KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->layout()); if(!flow) break; WidgetList *list = (WidgetList*)flow->widgetList(); // save some special properties - savePropertyElement(tqlayout, domDoc, "property", "customLayout", Container::layoutTypeToString(item->container()->layoutType()) ); - savePropertyElement(tqlayout, domDoc, "property", "justify", TQVariant(static_cast<KexiFlowLayout*>(item->container()->tqlayout())->isJustified(), 3) ); + savePropertyElement(layout, domDoc, "property", "customLayout", Container::layoutTypeToString(item->container()->layoutType()) ); + savePropertyElement(layout, domDoc, "property", "justify", TQVariant(static_cast<KexiFlowLayout*>(item->container()->layout())->isJustified(), 3) ); - // fill the widget's grid info, ie just simulate grid tqlayout + // fill the widget's grid info, ie just simulate grid layout item->container()->createGridLayout(true); for(TQWidget *obj = list->first(); obj; obj = list->next()) { ObjectTreeItem *titem = item->container()->form()->objectTree()->lookup(obj->name()); if(item) - saveWidget(titem, tqlayout, domDoc, true); // save grid info for compatibility with TQtDesigner + saveWidget(titem, layout, domDoc, true); // save grid info for compatibility with TQtDesigner } delete list; break; } default: { - for(ObjectTreeItem *objIt = item->tqchildren()->first(); objIt; objIt = item->tqchildren()->next()) + for(ObjectTreeItem *objIt = item->children()->first(); objIt; objIt = item->children()->next()) saveWidget(objIt, tclass, domDoc); } } @@ -1153,7 +1153,7 @@ FormIO::loadWidget(Container *container, const TQDomElement &el, TQWidget *paren else if(tagName == "vbox") classname = "VBox"; else if(tagName == "grid") { - // first, see if it is flow tqlayout + // first, see if it is flow layout for(TQDomNode child = n.firstChild(); !child.isNull(); child = child.nextSibling()) { if((child.toElement().tagName() == "property") && (child.toElement().attribute("name") == "customLayout")) @@ -1232,27 +1232,27 @@ FormIO::loadWidget(Container *container, const TQDomElement &el, TQWidget *paren m_currentItem = item; // if we are inside a Grid, we need to insert the widget in the good cell if(container->layoutType() == Container::Grid) { - TQGridLayout *tqlayout = (TQGridLayout*)container->tqlayout(); + TQGridLayout *layout = (TQGridLayout*)container->layout(); if(el.hasAttribute("rowspan")) { // widget spans multiple cells - if(tqlayout) - tqlayout->addMultiCellWidget(w, el.attribute("row").toInt(), el.attribute("row").toInt() + el.attribute("rowspan").toInt()-1, + if(layout) + layout->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(tqlayout) - tqlayout->addWidget(w, el.attribute("row").toInt(), el.attribute("column").toInt()); + if(layout) + layout->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->tqlayout()) - container->tqlayout()->add(w); + else if(container->layout()) + container->layout()->add(w); readChildNodes(item, container, el, w); - if(item->container() && item->container()->tqlayout()) - item->container()->tqlayout()->activate(); + if(item->container() && item->container()->layout()) + item->container()->layout()->activate(); // We add the autoSaveProperties in the modifProp list of the ObjectTreeItem, so that they are saved later TQValueList<TQCString> list(container->form()->library()->autoSaveProperties(w->className())); @@ -1261,7 +1261,7 @@ FormIO::loadWidget(Container *container, const TQDomElement &el, TQWidget *paren = dynamic_cast<KFormDesigner::WidgetWithSubpropertiesInterface*>(w); TQWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : w; for(TQValueList<TQCString>::ConstIterator it = list.constBegin(); it != endIt; ++it) { - if(subwidget->tqmetaObject()->findProperty(*it, true) != -1) + if(subwidget->metaObject()->findProperty(*it, true) != -1) item->addModifiedProperty(*it, subwidget->property(*it)); } @@ -1337,7 +1337,7 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const TQDomEl //if(name == "geometry") // hasGeometryProp = true; if( ((eltag == "grid") || (eltag == "hbox") || (eltag == "vbox")) && - (name == "name")) // we don't care about tqlayout names + (name == "name")) // we don't care about layout names continue; if (node.attribute("subwidget")=="true") { @@ -1355,30 +1355,30 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const TQDomEl if(name == "buddy") 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()->tqlayout()) { + item->container() && item->container()->layout()) { // We load the margin of a Layout if(name == "margin") { int margin = readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toInt(); item->container()->setLayoutMargin(margin); - item->container()->tqlayout()->setMargin(margin); + item->container()->layout()->setMargin(margin); } // We load the spacing of a Layout else if(name == "spacing") { int spacing = readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toInt(); item->container()->setLayoutSpacing(spacing); - item->container()->tqlayout()->setSpacing(spacing); + item->container()->layout()->setSpacing(spacing); } else if((name == "justify")){ bool justify = readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name).toBool(); - KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->tqlayout()); + KexiFlowLayout *flow = static_cast<KexiFlowLayout*>(item->container()->layout()); 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->tqmetaObject()->findProperty(name.latin1(), true) == -1) + else if(subwidget->metaObject()->findProperty(name.latin1(), true) == -1) { - if(w->className() == TQString::tqfromLatin1("CustomWidget")) + if(w->className() == TQString::fromLatin1("CustomWidget")) item->storeUnknownProperty(node); else { bool read = container->form()->library()->readSpecialProperty( @@ -1391,7 +1391,7 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const TQDomEl { TQVariant val( readPropertyValue(node.firstChild(), TQT_TQOBJECT(w), name) ); if(name == "geometry" && dynamic_cast<FormWidget*>(w)) { - //fix tqgeometry if needed - this is top level form widget + //fix geometry if needed - this is top level form widget TQRect r( val.toRect() ); if (r.left()<0) //negative X! r.moveLeft(0); @@ -1400,8 +1400,8 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const TQDomEl val = r; } subwidget->setProperty(name.latin1(), val); -// int count = w->tqmetaObject()->findProperty(name, true); -// const TQMetaProperty *meta = w->tqmetaObject()->property(count, true); +// int count = w->metaObject()->findProperty(name, true); +// const TQMetaProperty *meta = w->metaObject()->property(count, true); // if(meta && meta->isEnumType()) { // val = w->property(name.latin1()); //update: we want a numeric value of enum // } @@ -1419,7 +1419,7 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const TQDomEl loadWidget(container, node, w); } else if(tag == "grid") { - // first, see if it is flow tqlayout + // first, see if it is flow layout TQString layoutName; for(TQDomNode child = node.firstChild(); !child.isNull(); child = child.nextSibling()) { if((child.toElement().tagName() == "property") && (child.toElement().attribute("name") == "customLayout")) { @@ -1430,37 +1430,37 @@ FormIO::readChildNodes(ObjectTreeItem *item, Container *container, const TQDomEl if(layoutName == "HFlow") { item->container()->m_layType = Container::HFlow; - KexiFlowLayout *tqlayout = new KexiFlowLayout(item->widget()); - tqlayout->setOrientation(Qt::Horizontal); - item->container()->m_layout = (TQLayout*)tqlayout; + KexiFlowLayout *layout = new KexiFlowLayout(item->widget()); + layout->setOrientation(Qt::Horizontal); + item->container()->m_layout = (TQLayout*)layout; } else if(layoutName == "VFlow") { item->container()->m_layType = Container::VFlow; - KexiFlowLayout *tqlayout = new KexiFlowLayout(item->widget()); - tqlayout->setOrientation(Qt::Vertical); - item->container()->m_layout = (TQLayout*)tqlayout; + KexiFlowLayout *layout = new KexiFlowLayout(item->widget()); + layout->setOrientation(Qt::Vertical); + item->container()->m_layout = (TQLayout*)layout; } - else { // grid tqlayout + else { // grid layout item->container()->m_layType = Container::Grid; - TQGridLayout *tqlayout = new TQGridLayout(item->widget(), 1, 1); - item->container()->m_layout = (TQLayout*)tqlayout; + TQGridLayout *layout = new TQGridLayout(item->widget(), 1, 1); + item->container()->m_layout = (TQLayout*)layout; } readChildNodes(item, container, node, w); } else if(tag == "vbox") { item->container()->m_layType = Container::VBox; - TQVBoxLayout *tqlayout = new TQVBoxLayout(item->widget()); - item->container()->m_layout = (TQLayout*)tqlayout; + TQVBoxLayout *layout = new TQVBoxLayout(item->widget()); + item->container()->m_layout = (TQLayout*)layout; readChildNodes(item, container, node, w); } else if(tag == "hbox") { item->container()->m_layType = Container::HBox; - TQHBoxLayout *tqlayout = new TQHBoxLayout(item->widget()); - item->container()->m_layout = (TQLayout*)tqlayout; + TQHBoxLayout *layout = new TQHBoxLayout(item->widget()); + item->container()->m_layout = (TQLayout*)layout; readChildNodes(item, container, node, w); } else {// unknown tag, we let the Factory handle it - if(w->className() == TQString::tqfromLatin1("CustomWidget")) + if(w->className() == TQString::fromLatin1("CustomWidget")) item->storeUnknownProperty(node); else { bool read = container->form()->library()->readSpecialProperty( diff --git a/kexi/formeditor/formmanager.cpp b/kexi/formeditor/formmanager.cpp index a2ed0dac..75846dd3 100644 --- a/kexi/formeditor/formmanager.cpp +++ b/kexi/formeditor/formmanager.cpp @@ -227,7 +227,7 @@ FormManager::createActions(WidgetLibrary *lib, KActionCollection* collection, KX m_style->setEditable(false); KGlobal::config()->setGroup("General"); - TQString currentStyle = TQString::tqfromLatin1(kapp->tqstyle().name()).lower(); + TQString currentStyle = TQString::fromLatin1(kapp->tqstyle().name()).lower(); const TQStringList styles = TQStyleFactory::keys(); m_style->setItems(styles); m_style->setCurrentItem(0); @@ -413,7 +413,7 @@ FormManager::resetCreatedConnection() m_active->formWidget()->clearForm(); } if (m_active && m_active->widget()) - m_active->widget()->tqrepaint(); + m_active->widget()->repaint(); } void @@ -790,7 +790,7 @@ FormManager::createSignalMenu(TQWidget *w) m_sigSlotMenu = new KPopupMenu(); m_sigSlotMenu->insertTitle(SmallIcon("connection"), i18n("Signals")); - TQStrList list = w->tqmetaObject()->signalNames(true); + TQStrList list = w->metaObject()->signalNames(true); TQStrListIterator it(list); for(; it.current() != 0; ++it) m_sigSlotMenu->insertItem(*it); @@ -813,14 +813,14 @@ FormManager::createSlotMenu(TQWidget *w) TQString signalArg( m_connection->signal().remove( TQRegExp(".*[(]|[)]") ) ); - TQStrList list = w->tqmetaObject()->slotNames(true); + TQStrList list = w->metaObject()->slotNames(true); TQStrListIterator it(list); for(; it.current() != 0; ++it) { // we add the slot only if it is compatible with the signal TQString slotArg(*it); slotArg = slotArg.remove( TQRegExp(".*[(]|[)]") ); - if(!signalArg.tqstartsWith(slotArg, true)) // args not compatible + if(!signalArg.startsWith(slotArg, true)) // args not compatible continue; m_sigSlotMenu->insertItem(*it); @@ -845,7 +845,7 @@ FormManager::createContextMenu(TQWidget *w, Container *container, bool popupAtCu const uint widgetsCount = container->form()->selectedWidgets()->count(); const bool multiple = widgetsCount > 1; //const bool enableRemove = w != m_active->widget(); - // We only enabletqlayout creation if more than one widget with the same parent are selected + // We only enablelayout creation if more than one widget with the same parent are selected const bool enableLayout = multiple || w == container->widget(); m_menuWidget = w; @@ -863,14 +863,14 @@ FormManager::createContextMenu(TQWidget *w, Container *container, bool popupAtCu if(!multiple) { if(w == container->form()->widget()) - m_popup->insertTitle(SmallIcon("form"), i18n("%1 : Form").tqarg(w->name()) ); + m_popup->insertTitle(SmallIcon("form"), i18n("%1 : Form").arg(w->name()) ); else m_popup->insertTitle( SmallIcon( container->form()->library()->iconName(w->className())), TQString(w->name()) + " : " + n ); } else m_popup->insertTitle(SmallIcon("multiple_obj"), i18n("Multiple Widgets") - + TQString(" (%1)").tqarg(widgetsCount)); + + TQString(" (%1)").arg(widgetsCount)); KAction *a; #define PLUG_ACTION(_name, forceVisible) \ @@ -937,7 +937,7 @@ FormManager::createContextMenu(TQWidget *w, Container *container, bool popupAtCu // We create the signals menu KPopupMenu *sigMenu = new KPopupMenu(); - TQStrList list = w->tqmetaObject()->signalNames(true); + TQStrList list = w->metaObject()->signalNames(true); TQStrListIterator it(list); for(; it.current() != 0; ++it) sigMenu->insertItem(*it); @@ -1095,7 +1095,7 @@ void FormManager::createLayout(int layoutType) { WidgetList *list = m_active->selectedWidgets(); - // if only one widget is selected (a container), we modify its tqlayout + // if only one widget is selected (a container), we modify its layout if (list->isEmpty()) {//sanity check kdWarning() << "FormManager::createLayout(): list is empty!" << endl; return; @@ -1103,9 +1103,9 @@ FormManager::createLayout(int layoutType) if(list->count() == 1) { ObjectTreeItem *item = m_active->objectTree()->lookup(list->first()->name()); - if(!item || !item->container() || !m_propSet->contains("tqlayout")) + if(!item || !item->container() || !m_propSet->contains("layout")) return; - (*m_propSet)["tqlayout"] = Container::layoutTypeToString(layoutType); + (*m_propSet)["layout"] = Container::layoutTypeToString(layoutType); return; } @@ -1115,7 +1115,7 @@ FormManager::createLayout(int layoutType) kdDebug() << "comparing widget " << w->name() << " whose parent is " << w->parentWidget()->name() << " insteaed of " << parent->name() << endl; if(w->parentWidget() != parent) { - KMessageBox::sorry(m_active->widget()->tqtopLevelWidget(), i18n("<b>Cannot create the tqlayout.</b>\n" + 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; return; @@ -1143,7 +1143,7 @@ FormManager::breakLayout() else // normal container { if(activeForm()->selectedWidgets()->count() == 1) - (*m_propSet)["tqlayout"] = "NoLayout"; + (*m_propSet)["layout"] = "NoLayout"; else container->setLayout(Container::NoLayout); } @@ -1188,7 +1188,7 @@ FormManager::editTabOrder() { if(!activeForm() || !activeForm()->objectTree()) return; - TQWidget *topLevel = m_active->widget()->tqtopLevelWidget(); + TQWidget *topLevel = m_active->widget()->topLevelWidget(); TabStopDialog dlg(topLevel); //const bool oldAutoTabStops = m_active->autoTabStops(); if (dlg.exec(m_active) == TQDialog::Accepted) { @@ -1222,7 +1222,7 @@ FormManager::editFormPixmapCollection() if(!activeForm() || !activeForm()->objectTree()) return; - PixmapCollectionEditor dialog(activeForm()->pixmapCollection(), activeForm()->widget()->tqtopLevelWidget()); + PixmapCollectionEditor dialog(activeForm()->pixmapCollection(), activeForm()->widget()->topLevelWidget()); dialog.exec(); } @@ -1234,7 +1234,7 @@ FormManager::editConnections() if(!activeForm() || !activeForm()->objectTree()) return; - ConnectionDialog dialog(activeForm()->widget()->tqtopLevelWidget()); + ConnectionDialog dialog(activeForm()->widget()->topLevelWidget()); dialog.exec(activeForm()); } @@ -1380,9 +1380,9 @@ FormManager::selectAll() return; activeForm()->selectFormWidget(); - uint count = activeForm()->objectTree()->tqchildren()->count(); - for(ObjectTreeItem *it = activeForm()->objectTree()->tqchildren()->first(); it; - it = activeForm()->objectTree()->tqchildren()->next(), count--) + uint count = activeForm()->objectTree()->children()->count(); + for(ObjectTreeItem *it = activeForm()->objectTree()->children()->first(); it; + it = activeForm()->objectTree()->children()->next(), count--) { activeForm()->setSelectedWidget(it->widget(), /*add*/true, /*raise*/false, /*moreWillBeSelected*/count>1); } @@ -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()->tqmetaObject()->findProperty("font", true)) { + if (-1 != it.current()->metaObject()->findProperty("font", true)) { fontEnabled = true; break; } } enableAction("format_font", fontEnabled); - // If the widgets selected is a container, we enable tqlayout actions + // If the widgets selected is a container, we enable layout actions bool containerSelected = false; if(!multiple) { @@ -1550,7 +1550,7 @@ FormManager::emitFormWidgetSelected( KFormDesigner::Form* form ) enableFormActions(); const bool twoSelected = form->selectedWidgets()->count()==2; - const bool hasChildren = !form->objectTree()->tqchildren()->isEmpty(); + const bool hasChildren = !form->objectTree()->children()->isEmpty(); // Layout actions enableAction("layout_menu", hasChildren); diff --git a/kexi/formeditor/formmanager.h b/kexi/formeditor/formmanager.h index a43100ff..677a3e7b 100644 --- a/kexi/formeditor/formmanager.h +++ b/kexi/formeditor/formmanager.h @@ -221,13 +221,13 @@ class KFORMEDITOR_EXPORT FormManager : public TQObject bool isRedoing() const { return m_isRedoing; } public slots: - /*! Deletes the selected widget in active Form and all of its tqchildren. */ + /*! Deletes the selected widget in active Form and all of its children. */ void deleteWidget(); - /*! Copies the slected widget and all its tqchildren of the active Form using an XML representation. */ + /*! Copies the slected widget and all its children of the active Form using an XML representation. */ void copyWidget(); - /*! Cuts (ie Copies and deletes) the selected widget and all its tqchildren of + /*! Cuts (ie Copies and deletes) the selected widget and all its children of the active Form using an XML representation. */ void cutWidget(); @@ -258,22 +258,22 @@ class KFORMEDITOR_EXPORT FormManager : public TQObject /*! Creates a dialog to edit the Connection of \ref activeForm(). */ void editConnections(); - //! Lay out selected widgets using HBox tqlayout (calls \ref CreateLayoutCommand). + //! Lay out selected widgets using HBox layout (calls \ref CreateLayoutCommand). void layoutHBox(); - //! Lay out selected widgets using VBox tqlayout. + //! Lay out selected widgets using VBox layout. void layoutVBox(); - //! Lay out selected widgets using Grid tqlayout. + //! Lay out selected widgets using Grid layout. void layoutGrid(); //! Lay out selected widgets in an horizontal splitter void layoutHSplitter(); //! Lay out selected widgets in a verticak splitter void layoutVSplitter(); - //! Lay out selected widgets using HFlow tqlayout + //! Lay out selected widgets using HFlow layout void layoutHFlow(); - //! Lay out selected widgets using VFlow tqlayout. + //! Lay out selected widgets using VFlow layout. void layoutVFlow(); - //! Breaks selected tqlayout(calls \ref BreakLayoutCommand). + //! Breaks selected layout(calls \ref BreakLayoutCommand). void breakLayout(); void alignWidgetsToLeft(); @@ -418,7 +418,7 @@ class KFORMEDITOR_EXPORT FormManager : public TQObject Change this if you need to handle, eg. custom UI XML tags, as in Kexi's Form Designer. */ virtual bool saveFormToStringInternal(Form *form, TQString &dest, int indent = 0); #endif - /*! Function called by the "Lay out in..." menu items. It creates a tqlayout from the + /*! Function called by the "Lay out in..." menu items. It creates a layout from the currently selected widgets (that must have the same parent). Calls \ref CreateLayoutCommand. */ void createLayout(int layoutType); diff --git a/kexi/formeditor/kfdpixmapedit.cpp b/kexi/formeditor/kfdpixmapedit.cpp index db9a726e..64e65f1e 100644 --- a/kexi/formeditor/kfdpixmapedit.cpp +++ b/kexi/formeditor/kfdpixmapedit.cpp @@ -48,7 +48,7 @@ KFDPixmapEdit::selectPixmap() ObjectTreeItem *item = m_manager->activeForm()->objectTree()->lookup(m_manager->activeForm()->selectedWidget()->name()); TQString name = item ? item->pixmapName(property()->name()) : ""; - PixmapCollectionChooser dialog( m_manager->activeForm()->pixmapCollection(), name, tqtopLevelWidget() ); + PixmapCollectionChooser dialog( m_manager->activeForm()->pixmapCollection(), name, topLevelWidget() ); if(dialog.exec() == TQDialog::Accepted) { setValue(dialog.pixmap(), true); item->setPixmapName(property()->name(), dialog.pixmapName()); diff --git a/kexi/formeditor/objecttree.cpp b/kexi/formeditor/objecttree.cpp index e2ada714..a9b507f7 100644 --- a/kexi/formeditor/objecttree.cpp +++ b/kexi/formeditor/objecttree.cpp @@ -22,7 +22,7 @@ #include <tqwidget.h> #include <tqvariant.h> #include <tqdom.h> -#include <tqtextstream.h> +#include <textstream.h> #include "form.h" #include "container.h" @@ -64,14 +64,14 @@ ObjectTreeItem::rename(const TQString &name) void ObjectTreeItem::addChild(ObjectTreeItem *c) { - m_tqchildren.append(c); + m_children.append(c); c->setParent(this); } void ObjectTreeItem::removeChild(ObjectTreeItem *c) { - m_tqchildren.remove(c); + m_children.remove(c); } void @@ -141,10 +141,10 @@ ObjectTree::ObjectTree(const TQString &classn, const TQString &name, TQWidget *w ObjectTree::~ObjectTree() { -// for(ObjectTreeItem *it = tqchildren()->first(); it; it = tqchildren()->next()) +// for(ObjectTreeItem *it = children()->first(); it; it = children()->next()) // removeItem(it->name()); - while (tqchildren()->first()) { - removeItem(tqchildren()->first()); + while (children()->first()) { + removeItem(children()->first()); } } @@ -216,7 +216,7 @@ ObjectTree::removeItem(ObjectTreeItem *c) if (m_container && m_container->form()) m_container->form()->emitChildRemoved(c); - for(ObjectTreeItem *it = c->tqchildren()->first(); it; it = c->tqchildren()->next()) + for(ObjectTreeItem *it = c->children()->first(); it; it = c->children()->next()) removeItem(it->name()); m_treeDict.remove(c->name()); diff --git a/kexi/formeditor/objecttree.h b/kexi/formeditor/objecttree.h index b37d7caa..eaa95a0c 100644 --- a/kexi/formeditor/objecttree.h +++ b/kexi/formeditor/objecttree.h @@ -58,7 +58,7 @@ typedef TQMapConstIterator<TQString, TQVariant> TQVariantMapConstIterator; /*! @short An item representing a widget - Holds the properties of a widget (classname, name, parent, tqchildren ..). + Holds the properties of a widget (classname, name, parent, children ..). @author Lucijan Busch <lucijan@kde.org> */ class KFORMEDITOR_EXPORT ObjectTreeItem @@ -72,7 +72,7 @@ class KFORMEDITOR_EXPORT ObjectTreeItem TQWidget* widget() const { return m_widget; } EventEater* eventEater() const { return m_eater; } ObjectTreeItem* parent() const { return m_parent; } - ObjectTreeList* tqchildren() { return &m_tqchildren; } + ObjectTreeList* children() { return &m_children; } /*! \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. */ @@ -121,7 +121,7 @@ class KFORMEDITOR_EXPORT ObjectTreeItem protected: TQString m_className; TQString m_name; - ObjectTreeList m_tqchildren; + ObjectTreeList m_children; TQGuardedPtr<Container> m_container; TQMap<TQString, TQVariant> m_props; TQMap<TQString, TQVariant> *m_subprops; diff --git a/kexi/formeditor/objecttreeview.cpp b/kexi/formeditor/objecttreeview.cpp index 049df3a5..82cb67bb 100644 --- a/kexi/formeditor/objecttreeview.cpp +++ b/kexi/formeditor/objecttreeview.cpp @@ -191,10 +191,10 @@ ObjectTreeView::~ObjectTreeView() } TQSize -ObjectTreeView::tqsizeHint() const +ObjectTreeView::sizeHint() const { return TQSize( TQFontMetrics(font()).width(columnText(0)+columnText(1)+" "), - KListView::tqsizeHint().height()); + KListView::sizeHint().height()); } TQString @@ -367,7 +367,7 @@ ObjectTreeView::loadTree(ObjectTreeItem *item, ObjectTreeViewItem *parent) last = last->nextSibling(); treeItem->moveItem(last); - ObjectTreeList *list = item->tqchildren(); + ObjectTreeList *list = item->children(); 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 b625c0ad..2ddf867c 100644 --- a/kexi/formeditor/objecttreeview.h +++ b/kexi/formeditor/objecttreeview.h @@ -73,7 +73,7 @@ class KFORMEDITOR_EXPORT ObjectTreeView : public KListView ObjectTreeView(TQWidget *parent=0, const char *name=0, bool tabStop = false); virtual ~ObjectTreeView(); - virtual TQSize tqsizeHint() const; + virtual TQSize sizeHint() 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. diff --git a/kexi/formeditor/richtextdialog.cpp b/kexi/formeditor/richtextdialog.cpp index 168102b0..9c4a4112 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 <tqlayout.h> +#include <layout.h> #include <ktoolbar.h> #include <kfontcombo.h> @@ -146,10 +146,10 @@ RichTextDialog::buttonToggled(int id) if(!isOn) break; switch(id) { - 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; + case TBLeft: m_edit->setAlignment(TQt::AlignLeft); break; + case TBCenter: m_edit->setAlignment(TQt::AlignCenter); break; + case TBRight: m_edit->setAlignment(TQt::AlignRight); break; + case TBJustify: m_edit->setAlignment(TQt::AlignJustify); break; default: break; } } @@ -168,7 +168,7 @@ RichTextDialog::cursorPositionChanged(int, int) m_toolbar->setButton(TBUnder, m_edit->underline()); int id = 0; - switch(m_edit->tqalignment()) + switch(m_edit->alignment()) { case TQt::AlignLeft: id = TBLeft; break; case TQt::AlignCenter: id = TBCenter; break; diff --git a/kexi/formeditor/richtextdialog.h b/kexi/formeditor/richtextdialog.h index 25150873..f5ae41ea 100644 --- a/kexi/formeditor/richtextdialog.h +++ b/kexi/formeditor/richtextdialog.h @@ -30,7 +30,7 @@ class KColorCombo; namespace KFormDesigner { //! A simple dialog to edit rich text -/*! It allows to change font name, style and color, tqalignment. */ +/*! It allows to change font name, style and color, alignment. */ class KFORMEDITOR_EXPORT RichTextDialog : public KDialogBase { Q_OBJECT diff --git a/kexi/formeditor/scripting/formscript.cpp b/kexi/formeditor/scripting/formscript.cpp index 1123e093..aa32bc02 100644 --- a/kexi/formeditor/scripting/formscript.cpp +++ b/kexi/formeditor/scripting/formscript.cpp @@ -71,7 +71,7 @@ FormScript::execute(const TQString &functionName) m_script->callFunction(functionName); } catch(Kross::Api::Exception& e) { - kdDebug() << TQString("EXCEPTION type='%1' description='%2'").tqarg(e.type()).tqarg(e.description()) << endl; + kdDebug() << TQString("EXCEPTION type='%1' description='%2'").arg(e.type()).arg(e.description()) << endl; return false; } return true; diff --git a/kexi/formeditor/spring.cpp b/kexi/formeditor/spring.cpp index 1ec9a2b4..3e0651b1 100644 --- a/kexi/formeditor/spring.cpp +++ b/kexi/formeditor/spring.cpp @@ -47,25 +47,25 @@ Spring::setOrientation(Qt::Orientation orient) SizeType type = sizeType(); m_orient = orient; setSizeType(type); - tqrepaint(); + repaint(); } Spring::SizeType Spring::sizeType() const { if(m_orient ==Qt::Vertical) - return (SizeType)tqsizePolicy().verData(); + return (SizeType)sizePolicy().verData(); else - return (SizeType)tqsizePolicy().horData(); + return (SizeType)sizePolicy().horData(); } void Spring::setSizeType(SizeType size) { if(m_orient ==Qt::Vertical) - tqsetSizePolicy(TQSizePolicy::Minimum, (TQSizePolicy::SizeType)size); + setSizePolicy(TQSizePolicy::Minimum, (TQSizePolicy::SizeType)size); else - tqsetSizePolicy( (TQSizePolicy::SizeType)size, TQSizePolicy::Minimum); + setSizePolicy( (TQSizePolicy::SizeType)size, TQSizePolicy::Minimum); } void @@ -144,10 +144,10 @@ Spring::saveSpring(KFormDesigner::ObjectTreeItem *item, TQDomElement &parentNode if(parentNode.tagName() == "widget") KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "geometry", item->widget()->property("geometry"), item->widget()); - if(!item->widget()->tqsizeHint().isValid()) - KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "tqsizeHint", item->widget()->property("size"), item->widget()); + if(!item->widget()->sizeHint().isValid()) + KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "sizeHint", item->widget()->property("size"), item->widget()); else - KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "tqsizeHint", item->widget()->property("tqsizeHint"), item->widget()); + KFormDesigner::FormIO::savePropertyValue(tclass, domDoc, "sizeHint", item->widget()->property("sizeHint"), 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/tabstopdialog.cpp b/kexi/formeditor/tabstopdialog.cpp index f28c8e2a..20d81b9e 100644 --- a/kexi/formeditor/tabstopdialog.cpp +++ b/kexi/formeditor/tabstopdialog.cpp @@ -17,7 +17,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include <tqlayout.h> +#include <layout.h> #include <tqcheckbox.h> #include <tqtooltip.h> diff --git a/kexi/formeditor/tdevelop_plugin/kfd_kdev_part.cpp b/kexi/formeditor/tdevelop_plugin/kfd_kdev_part.cpp index 0cfe0483..79f1b05f 100644 --- a/kexi/formeditor/tdevelop_plugin/kfd_kdev_part.cpp +++ b/kexi/formeditor/tdevelop_plugin/kfd_kdev_part.cpp @@ -276,7 +276,7 @@ void KFormDesignerKDevPart::open() { m_openingFile = true; - KURL url = KFileDialog::getOpenURL("::kformdesigner", i18n("*.ui|TQt Designer UI Files"), m_workspace->tqtopLevelWidget()); + KURL url = KFileDialog::getOpenURL("::kformdesigner", i18n("*.ui|TQt Designer UI Files"), m_workspace->topLevelWidget()); if(!url.isEmpty()) ReadWritePart::openURL(url); m_openingFile = false; @@ -321,9 +321,9 @@ KFormDesignerKDevPart::saveAs() bool KFormDesignerKDevPart::closeForm(Form *form) { - int res = KMessageBox::warningYesNoCancel( m_workspace->tqtopLevelWidget(), + int res = KMessageBox::warningYesNoCancel( m_workspace->topLevelWidget(), i18n( "The form \"%1\" has been modified.\n" - "Do you want to save your changes or discard them?" ).tqarg( form->objectTree()->name() ), + "Do you want to save your changes or discard them?" ).arg( form->objectTree()->name() ), i18n( "Close Form" ), KStdGuiItem::save(), KStdGuiItem::discard() ); if(res == KMessageBox::Yes) @@ -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 tqlayout actions + // If the widgets selected is a container, we enable layout actions if(!multiple) { KFormDesigner::ObjectTreeItem *item = form->objectTree()->lookup( form->selectedWidgets()->first()->name() ); @@ -535,13 +535,13 @@ KFormDesignerKDevPart::~KFormDesignerKDevPart() ////// FormWidgetBase : helper widget to draw rects on top of widgets -//tqrepaint all tqchildren widgets +//repaint all children widgets static void repaintAll(TQWidget *w) { TQObjectList *list = w->queryList(TQWIDGET_OBJECT_NAME_STRING); TQObjectListIt it(*list); for (TQObject *obj; (obj=it.current()); ++it ) { - static_cast<TQWidget*>(obj)->tqrepaint(); + static_cast<TQWidget*>(obj)->repaint(); } delete list; } @@ -639,7 +639,7 @@ FormWidgetBase::highlightWidgets(TQWidget *from, TQWidget *to)//, const TQPoint TQPixmap pix2 = TQPixmap::grabWidget(to); if((from != this) && (to != this)) - p.drawLine( from->parentWidget()->mapTo(this, from->tqgeometry().center()), to->parentWidget()->mapTo(this, to->tqgeometry().center()) ); + p.drawLine( from->parentWidget()->mapTo(this, from->geometry().center()), to->parentWidget()->mapTo(this, to->geometry().center()) ); p.drawPixmap(fromPoint.x(), fromPoint.y(), pix1); p.drawPixmap(toPoint.x(), toPoint.y(), pix2); diff --git a/kexi/formeditor/test/kfd_part.cpp b/kexi/formeditor/test/kfd_part.cpp index cd51817a..02996580 100644 --- a/kexi/formeditor/test/kfd_part.cpp +++ b/kexi/formeditor/test/kfd_part.cpp @@ -296,7 +296,7 @@ void KFormDesignerPart::open() { m_openingFile = true; - KURL url = KFileDialog::getOpenURL("::kformdesigner", i18n("*.ui|TQt Designer UI Files"), m_workspace->tqtopLevelWidget()); + KURL url = KFileDialog::getOpenURL("::kformdesigner", i18n("*.ui|TQt Designer UI Files"), m_workspace->topLevelWidget()); if(!url.isEmpty()) ReadWritePart::openURL(url); m_openingFile = false; @@ -332,7 +332,7 @@ void KFormDesignerPart::saveAs() { KURL url = KFileDialog::getSaveURL("::kformdesigner", i18n("*.ui|TQt Designer UI Files"), - m_workspace->tqtopLevelWidget()); + m_workspace->topLevelWidget()); if(url.isEmpty()) return; else @@ -342,9 +342,9 @@ KFormDesignerPart::saveAs() bool KFormDesignerPart::closeForm(Form *form) { - int res = KMessageBox::questionYesNoCancel( m_workspace->tqtopLevelWidget(), + int res = KMessageBox::questionYesNoCancel( m_workspace->topLevelWidget(), i18n( "The form \"%1\" has been modified.\n" - "Do you want to save your changes or discard them?" ).tqarg( form->objectTree()->name() ), + "Do you want to save your changes or discard them?" ).arg( form->objectTree()->name() ), i18n( "Close Form" ), KStdGuiItem::save(), KStdGuiItem::discard() ); if(res == KMessageBox::Yes) @@ -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 tqlayout actions + // If the widgets selected is a container, we enable layout actions bool containerSelected = false; if(!multiple) { @@ -451,7 +451,7 @@ KFormDesignerPart::slotFormWidgetSelected(Form *form) enableFormActions(); const bool twoSelected = form->selectedWidgets()->count()==2; - const bool hasChildren = !form->objectTree()->tqchildren()->isEmpty(); + const bool hasChildren = !form->objectTree()->children()->isEmpty(); // Layout actions ENABLE_ACTION("layout_menu", hasChildren); @@ -558,14 +558,14 @@ KFormDesignerPart::setRedoEnabled(bool enabled, const TQString &text) ////// FormWidgetBase : helper widget to draw rects on top of widgets -//tqrepaint all tqchildren widgets +//repaint all children widgets static void repaintAll(TQWidget *w) { - w->tqrepaint(); + w->repaint(); TQObjectList *list = w->queryList(TQWIDGET_OBJECT_NAME_STRING); TQObjectListIt it(*list); for (TQObject *obj; (obj=it.current()); ++it ) { - static_cast<TQWidget*>(obj)->tqrepaint(); + static_cast<TQWidget*>(obj)->repaint(); } delete list; } @@ -663,7 +663,7 @@ FormWidgetBase::highlightWidgets(TQWidget *from, TQWidget *to)//, const TQPoint TQPixmap pix2 = TQPixmap::grabWidget(to); if((from != this) && (to != this)) - p.drawLine( from->parentWidget()->mapTo(this, from->tqgeometry().center()), to->parentWidget()->mapTo(this, to->tqgeometry().center()) ); + p.drawLine( from->parentWidget()->mapTo(this, from->geometry().center()), to->parentWidget()->mapTo(this, to->geometry().center()) ); p.drawPixmap(fromPoint.x(), fromPoint.y(), pix1); p.drawPixmap(toPoint.x(), toPoint.y(), pix2); diff --git a/kexi/formeditor/utils.cpp b/kexi/formeditor/utils.cpp index 6ce4bcae..53a9a15b 100644 --- a/kexi/formeditor/utils.cpp +++ b/kexi/formeditor/utils.cpp @@ -88,7 +88,7 @@ void KFormDesigner::setRecursiveCursor(TQWidget *w, Form *form) { ObjectTreeItem *tree = form->objectTree()->lookup(w->name()); - if(tree && ((tree->modifiedProperties()->contains("cursor")) || !tree->tqchildren()->isEmpty()) + if(tree && ((tree->modifiedProperties()->contains("cursor")) || !tree->children()->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 @@ -108,7 +108,7 @@ KFormDesigner::getSizeFromChildren(TQWidget *w, const char *inheritClass) int tmpw = 0, tmph = 0; TQObjectList *list = w->queryList(inheritClass, 0, false, false); for(TQObject *o = list->first(); o; o = list->next()) { - TQRect r = ((TQWidget*)o)->tqgeometry(); + TQRect r = ((TQWidget*)o)->geometry(); tmpw = TQMAX(tmpw, r.right()); tmph = TQMAX(tmph, r.bottom()); } @@ -119,9 +119,9 @@ KFormDesigner::getSizeFromChildren(TQWidget *w, const char *inheritClass) // ----------------- -HorWidgetList::HorWidgetList(TQWidget *tqtopLevelWidget) +HorWidgetList::HorWidgetList(TQWidget *topLevelWidget) : WidgetList() - , m_tqtopLevelWidget(tqtopLevelWidget) + , m_topLevelWidget(topLevelWidget) { } @@ -133,14 +133,14 @@ int HorWidgetList::compareItems(TQPtrCollection::Item item1, TQPtrCollection::It { 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(); + return w1->mapTo(m_topLevelWidget, TQPoint(0,0)).x() - w2->mapTo(m_topLevelWidget, TQPoint(0,0)).x(); } // ----------------- -VerWidgetList::VerWidgetList(TQWidget *tqtopLevelWidget) +VerWidgetList::VerWidgetList(TQWidget *topLevelWidget) : WidgetList() - , m_tqtopLevelWidget(tqtopLevelWidget) + , m_topLevelWidget(topLevelWidget) { } @@ -157,9 +157,9 @@ int VerWidgetList::compareItems(TQPtrCollection::Item item1, TQPtrCollection::It TQObject *page1 = 0; TabWidget *tw1 = KFormDesigner::findParent<KFormDesigner::TabWidget>(w1, "KFormDesigner::TabWidget", page1); if (tw1) // special case - y1 = w1->mapTo(m_tqtopLevelWidget, TQPoint(0,0)).y() + tw1->tabBarHeight() -2 -2; + y1 = w1->mapTo(m_topLevelWidget, TQPoint(0,0)).y() + tw1->tabBarHeight() -2 -2; else - y1 = w1->mapTo(m_tqtopLevelWidget, TQPoint(0,0)).y(); + y1 = w1->mapTo(m_topLevelWidget, TQPoint(0,0)).y(); TQObject *page2 = 0; TabWidget *tw2 = KFormDesigner::findParent<KFormDesigner::TabWidget>(w2, "KFormDesigner::TabWidget", page2); @@ -169,16 +169,16 @@ int VerWidgetList::compareItems(TQPtrCollection::Item item1, TQPtrCollection::It } if (tw2) // special case - y2 = w2->mapTo(m_tqtopLevelWidget, TQPoint(0,0)).y() + tw2->tabBarHeight() -2 -2; + y2 = w2->mapTo(m_topLevelWidget, TQPoint(0,0)).y() + tw2->tabBarHeight() -2 -2; else - y2 = w2->mapTo(m_tqtopLevelWidget, TQPoint(0,0)).y(); + y2 = w2->mapTo(m_topLevelWidget, TQPoint(0,0)).y(); kdDebug() << w1->name() << ": " << y1 << " " << " | " << w2->name() << ": " << y2 << 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; + //kdDebug() << w1->name() << ": " << w1->mapTo(m_topLevelWidget, TQPoint(0,0)) << " " << w1->y() + //<< " | " << w2->name() << ":" /*<< w2->mapFrom(m_topLevelWidget, TQPoint(0,w2->y()))*/ << " " << w2->y() << endl; return y1 - y2; } diff --git a/kexi/formeditor/utils.h b/kexi/formeditor/utils.h index 3d078401..d6d56acb 100644 --- a/kexi/formeditor/utils.h +++ b/kexi/formeditor/utils.h @@ -71,22 +71,22 @@ typedef TQPtrListIterator<TQWidget> WidgetListIterator; class HorWidgetList : public WidgetList { public: - HorWidgetList(TQWidget *tqtopLevelWidget); + HorWidgetList(TQWidget *topLevelWidget); virtual ~HorWidgetList(); protected: virtual int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2); - TQWidget *m_tqtopLevelWidget; + TQWidget *m_topLevelWidget; }; //! @short A helper for sorting widgets vertically class VerWidgetList : public WidgetList { public: - VerWidgetList(TQWidget *tqtopLevelWidget); + VerWidgetList(TQWidget *topLevelWidget); virtual ~VerWidgetList(); protected: virtual int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2); - TQWidget *m_tqtopLevelWidget; + TQWidget *m_topLevelWidget; }; /*! This function is used to remove all the child widgets from a list, and @@ -94,18 +94,18 @@ class VerWidgetList : public WidgetList KFORMEDITOR_EXPORT void removeChildrenFromList(WidgetList &list); /*! This helper function install an event filter on \a object and all of its - tqchildren, directed to \a container. + children, directed to \a container. This is necessary to filter events for composed widgets. */ KFORMEDITOR_EXPORT void installRecursiveEventFilter(TQObject *object, TQObject *container); /*! This helper function removes an event filter installed before - on \a object and all of its tqchildren. + on \a object and all of its children. This is necessary to filter events for composed widgets. */ KFORMEDITOR_EXPORT void removeRecursiveEventFilter(TQObject *object, TQObject *container); KFORMEDITOR_EXPORT void setRecursiveCursor(TQWidget *w, Form *form); -/*! \return the size of \a w tqchildren. This can be used eg to get widget's tqsizeHint. */ +/*! \return the size of \a w children. This can be used eg to get widget's sizeHint. */ 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 178e2b74..9bec64ba 100644 --- a/kexi/formeditor/widgetfactory.cpp +++ b/kexi/formeditor/widgetfactory.cpp @@ -183,14 +183,14 @@ void WidgetFactory::hideClass(const char *classname) void WidgetFactory::createEditor(const TQCString &classname, const TQString &text, - TQWidget *w, Container *container, TQRect tqgeometry, + TQWidget *w, Container *container, TQRect geometry, int align, bool useFrame, bool multiLine, BackgroundMode background) { //#ifdef KEXI_KTEXTEDIT if (multiLine) { KTextEdit *textedit = new KTextEdit(text, TQString(), w->parentWidget()); textedit->setTextFormat(TQt::PlainText); - textedit->tqsetAlignment(align); + textedit->setAlignment(align); if (dynamic_cast<TQTextEdit*>(w)) { textedit->setWordWrap(dynamic_cast<TQTextEdit*>(w)->wordWrap()); textedit->setWrapPolicy(dynamic_cast<TQTextEdit*>(w)->wrapPolicy()); @@ -198,12 +198,12 @@ WidgetFactory::createEditor(const TQCString &classname, const TQString &text, textedit->setPalette(w->palette()); textedit->setFont(w->font()); textedit->setResizePolicy(TQScrollView::Manual); - textedit->setGeometry(tqgeometry); + textedit->setGeometry(geometry); if(background == TQt::NoBackground) textedit->setBackgroundMode(w->backgroundMode()); else textedit->setBackgroundMode(background); -// textedit->setPaletteBackgroundColor(textedit->tqcolorGroup().color( TQColorGroup::Base )); +// textedit->setPaletteBackgroundColor(textedit->colorGroup().color( TQColorGroup::Base )); textedit->setPaletteBackgroundColor(w->paletteBackgroundColor()); for(int i =0; i <= textedit->paragraphs(); i++) textedit->setParagraphBackgroundColor(i, w->paletteBackgroundColor()); @@ -229,10 +229,10 @@ WidgetFactory::createEditor(const TQCString &classname, const TQString &text, } else { KLineEdit *editor = new KLineEdit(text, w->parentWidget()); - editor->tqsetAlignment(align); + editor->setAlignment(align); editor->setPalette(w->palette()); editor->setFont(w->font()); - editor->setGeometry(tqgeometry); + editor->setGeometry(geometry); if(background == TQt::NoBackground) editor->setBackgroundMode(w->backgroundMode()); else @@ -253,7 +253,7 @@ WidgetFactory::createEditor(const TQCString &classname, const TQString &text, //copy properties if available WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(w); TQWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : w; - if (-1!=m_editor->tqmetaObject()->findProperty("margin", true) && -1!=subwidget->tqmetaObject()->findProperty("margin", true)) + if (-1!=m_editor->metaObject()->findProperty("margin", true) && -1!=subwidget->metaObject()->findProperty("margin", true)) m_editor->setProperty("margin", subwidget->property("margin")); //#endif //js m_handles = new ResizeHandleSet(w, container->form(), true); @@ -314,10 +314,10 @@ WidgetFactory::disableFilter(TQWidget *w, Container *container) bool WidgetFactory::editList(TQWidget *w, TQStringList &list) { - KDialogBase dialog(w->tqtopLevelWidget(), "stringlist_dialog", true, i18n("Edit List of Items"), + KDialogBase dialog(w->topLevelWidget(), "stringlist_dialog", true, i18n("Edit List of Items"), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, false); - KEditListBox *edit = new KEditListBox(i18n("Contents of %1").tqarg(w->name()), &dialog, "editlist"); + KEditListBox *edit = new KEditListBox(i18n("Contents of %1").arg(w->name()), &dialog, "editlist"); dialog.setMainWidget(edit); edit->insertStringList(list); // edit->show(); @@ -345,7 +345,7 @@ WidgetFactory::editRichText(TQWidget *w, TQString &text) void WidgetFactory::editListView(TQListView *listview) { - EditListViewDialog dlg(((TQWidget*)listview)->tqtopLevelWidget()); + EditListViewDialog dlg(((TQWidget*)listview)->topLevelWidget()); //dlg.exec(listview); } @@ -376,7 +376,7 @@ WidgetFactory::eventFilter(TQObject *obj, TQEvent *ev) if(obj != (TQObject *)w) return false; - TQWidget *focus = w->tqtopLevelWidget()->tqfocusWidget(); + TQWidget *focus = w->topLevelWidget()->focusWidget(); if(focus && w != focus && !w->child(focus->name(), focus->className())) resetEditor(); } @@ -456,7 +456,7 @@ WidgetFactory::resetEditor() if(m_widget) { disconnect(m_widget, 0, this, 0); - m_widget->tqrepaint(); + m_widget->repaint(); } //js delete m_handles; diff --git a/kexi/formeditor/widgetfactory.h b/kexi/formeditor/widgetfactory.h index 9e585625..7c9c5ceb 100644 --- a/kexi/formeditor/widgetfactory.h +++ b/kexi/formeditor/widgetfactory.h @@ -384,10 +384,10 @@ class KFORMEDITOR_EXPORT WidgetFactory : public TQObject /*! 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 tqgeometry is the tqgeometry the new line + 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 TQt::AlignmentFlags of the new line edit. */ void createEditor(const TQCString &classname, const TQString &text, - TQWidget *w, Container *container, TQRect tqgeometry, + TQWidget *w, Container *container, TQRect geometry, int align, bool useFrame=false, bool multiLine = false, BackgroundMode background = TQt::NoBackground); @@ -403,7 +403,7 @@ class KFORMEDITOR_EXPORT WidgetFactory : public TQObject into \a list when the user presses "Ok".*/ bool editList(TQWidget *w, TQStringList &list); - /*! This function creates a little editor to modify rich text. It supports tqalignment, + /*! This function creates a little editor to modify rich text. It supports alignment, 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. */ diff --git a/kexi/formeditor/widgetlibrary.cpp b/kexi/formeditor/widgetlibrary.cpp index c9f9bd9b..55f8cde6 100644 --- a/kexi/formeditor/widgetlibrary.cpp +++ b/kexi/formeditor/widgetlibrary.cpp @@ -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("tqlayout", (char*)1);// too large risk to break things + advancedProperties.insert("layout", (char*)1);// too large risk to break things // by providing this in propeditor - advancedProperties.insert("tqminimumSize", (char*)1); - advancedProperties.insert("tqmaximumSize", (char*)1); + advancedProperties.insert("minimumSize", (char*)1); + advancedProperties.insert("maximumSize", (char*)1); #ifdef KEXI_NO_UNFINISHED /*! @todo reenable */ advancedProperties.insert("paletteBackgroundPixmap", (char*)1); @@ -219,8 +219,8 @@ WidgetLibrary::lookupFactories() if (KFormDesigner::version()!=factoryVersion) { kdWarning() << TQString("WidgetLibrary::lookupFactories(): factory '%1'" " has version '%2' but required Widget Factory version is '%3'\n" - " -- skipping this factory!").tqarg(ptr->library()).tqarg(factoryVersion) - .tqarg(KFormDesigner::version()) << endl; + " -- skipping this factory!").arg(ptr->library()).arg(factoryVersion) + .arg(KFormDesigner::version()) << endl; continue; } d->services.insert(ptr->library().latin1(), new KService::Ptr( ptr )); @@ -532,7 +532,7 @@ WidgetLibrary::iconName(const TQCString &classname) if(wi) return wi->pixmap(); - return TQString::tqfromLatin1("unknown_widget"); + return TQString::fromLatin1("unknown_widget"); } bool @@ -739,7 +739,7 @@ WidgetFactory::CreateWidgetOptions WidgetLibrary::showOrientationSelectionPopup( textVertical = i18n("InsertQt::Vertical Widget", "InsertQt::Vertical"); KPopupMenu* popup = new KPopupMenu(parent, "orientationSelectionPopup"); - popup->insertTitle(SmallIcon(wclass->pixmap()), i18n("Insert Widget: %1").tqarg(wclass->name())); + popup->insertTitle(SmallIcon(wclass->pixmap()), i18n("Insert Widget: %1").arg(wclass->name())); popup->insertItem(iconHorizontal, textHorizontal, 1); popup->insertItem(iconVertical, textVertical, 2); popup->insertSeparator(); diff --git a/kexi/formeditor/widgetpropertyset.cpp b/kexi/formeditor/widgetpropertyset.cpp index d06a5c2e..b76d326a 100644 --- a/kexi/formeditor/widgetpropertyset.cpp +++ b/kexi/formeditor/widgetpropertyset.cpp @@ -24,7 +24,7 @@ #include <tqmetaobject.h> #include <tqvariant.h> #include <tqevent.h> -#include <tqlayout.h> +#include <layout.h> #include <tqapplication.h> #include <tqeventloop.h> @@ -253,7 +253,7 @@ WidgetPropertySet::addWidget(TQWidget *w) //second widget, update metainfo d->set["this:className"].setValue("special:multiple"); d->set["this:classString"].setValue( - i18n("Multiple Widgets") + TQString(" (%1)").tqarg(d->widgets.count()) ); + i18n("Multiple Widgets") + TQString(" (%1)").arg(d->widgets.count()) ); d->set["this:iconName"].setValue("multiple_obj"); //name doesn't make sense for now d->set["name"].setValue(""); @@ -287,7 +287,7 @@ WidgetPropertySet::createPropertiesForWidget(TQWidget *w) return; } - TQStrList pList = w->tqmetaObject()->propertyNames(true); + TQStrList pList = w->metaObject()->propertyNames(true); TQStrListIterator it(pList); // add subproperties if available @@ -309,7 +309,7 @@ WidgetPropertySet::createPropertiesForWidget(TQWidget *w) const TQMetaProperty *subMeta = // special case - subproperty subpropIface ? subpropIface->findMetaSubproperty(it.current()) : 0; const TQMetaProperty *meta = subMeta ? subMeta - : w->tqmetaObject()->property( w->tqmetaObject()->findProperty(*it, true), true); + : w->metaObject()->property( w->metaObject()->findProperty(*it, true), true); if (!meta) continue; const char* propertyName = meta->name(); @@ -328,7 +328,7 @@ WidgetPropertySet::createPropertiesForWidget(TQWidget *w) const bool oldValueExists = modifiedPropertiesIt!=modifiedProperties->constEnd(); if(meta->isEnumType()) { - if(qstrcmp(propertyName, "tqalignment") == 0) { + if(qstrcmp(propertyName, "alignment") == 0) { createAlignProperty(meta, w, subwidget); continue; } @@ -393,7 +393,7 @@ WidgetPropertySet::createPropertiesForWidget(TQWidget *w) /*! let's forget it for now, until we have new complete events editor if (m_manager->lib()->advancedPropertiesVisible()) { // add the signals property - TQStrList strlist = w->tqmetaObject()->signalNames(true); + TQStrList strlist = w->metaObject()->signalNames(true); TQStrListIterator strIt(strlist); TQStringList list; for(; strIt.current() != 0; ++strIt) @@ -403,7 +403,7 @@ WidgetPropertySet::createPropertiesForWidget(TQWidget *w) )); }*/ - if(KFormDesigner::FormManager::self()->activeForm() && tree->container()) // we are a container -> tqlayout property + if(KFormDesigner::FormManager::self()->activeForm() && tree->container()) // we are a container -> layout property createLayoutProperty(tree); } @@ -507,7 +507,7 @@ WidgetPropertySet::slotPropertyChanged(KoProperty::Set& set, KoProperty::Propert saveAlignProperty(property); return; } - else if((property == "tqlayout") || (property == "layoutMargin") || (property == "layoutSpacing")) { + else if((property == "layout") || (property == "layoutMargin") || (property == "layoutSpacing")) { saveLayoutProperty(property, value); return; } @@ -621,7 +621,7 @@ WidgetPropertySet::createPropertyCommandsInDesignMode(TQWidget* widget, else { WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>(widget); TQWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : widget; - if (-1 != subwidget->tqmetaObject()->findProperty(it.key(), true) && subwidget->property(it.key())!=it.data()) { + if (-1 != subwidget->metaObject()->findProperty(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())); @@ -678,7 +678,7 @@ WidgetPropertySet::isNameValid(const TQString &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") - .tqarg(w->name()).tqarg(name).tqarg(name)); + .arg(w->name()).arg(name).arg(name)); d->slotPropertyChangedEnabled = false; d->set["name"].resetValue(); d->slotPropertyChangedEnabled = true; @@ -689,7 +689,7 @@ WidgetPropertySet::isNameValid(const TQString &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") - .tqarg(w->name()).tqarg(name).tqarg(name)); + .arg(w->name()).arg(name).arg(name)); d->slotPropertyChangedEnabled = false; d->set["name"].resetValue(); d->slotPropertyChangedEnabled = true; @@ -740,7 +740,7 @@ WidgetPropertySet::eventFilter(TQObject *o, TQEvent *ev) if(d->set["geometry"].value() == o->property("geometry")) // to avoid infinite recursion return false; - d->set["geometry"] = TQT_TQWIDGET(o)->tqgeometry(); + d->set["geometry"] = TQT_TQWIDGET(o)->geometry(); } } else if(d->widgets.count() > 1 && ev->type() == TQEvent::Move) // the widget is being moved, we update the property @@ -775,8 +775,8 @@ WidgetPropertySet::createAlignProperty(const TQMetaProperty *meta, TQWidget *wid TQStringList list; TQString value; - const int tqalignment = subwidget->property("tqalignment").toInt(); - const TQStringList keys( TQStringList::fromStrList( meta->valueToKeys(tqalignment) ) ); + const int alignment = subwidget->property("alignment").toInt(); + const TQStringList keys( TQStringList::fromStrList( meta->valueToKeys(alignment) ) ); TQStrList *enumKeys = new TQStrList(meta->enumKeys()); const TQStringList possibleValues( TQStringList::fromStrList(*enumKeys) ); @@ -786,7 +786,7 @@ WidgetPropertySet::createAlignProperty(const TQMetaProperty *meta, TQWidget *wid bool isTopLevel = KFormDesigner::FormManager::self()->isTopLevel(widget); if(possibleValues.find("AlignHCenter")!=possibleValues.constEnd()) { - // Create the horizontal tqalignment property + // Create the horizontal alignment property if(keys.find("AlignHCenter")!=keys.constEnd() || keys.find("AlignCenter")!=keys.constEnd()) value = "AlignHCenter"; else if(keys.find("AlignRight")!=keys.constEnd()) @@ -812,7 +812,7 @@ WidgetPropertySet::createAlignProperty(const TQMetaProperty *meta, TQWidget *wid if(possibleValues.find("AlignTop")!=possibleValues.constEnd()) { - // Create the ver tqalignment property + // Create the ver alignment property if(keys.find("AlignTop")!=keys.constEnd()) value = "AlignTop"; else if(keys.find("AlignBottom")!=keys.constEnd()) @@ -837,7 +837,7 @@ WidgetPropertySet::createAlignProperty(const TQMetaProperty *meta, TQWidget *wid ) { // Create the wordbreak property KoProperty::Property *p = new KoProperty::Property("wordbreak", - TQVariant(tqalignment & TQt::WordBreak, 3), i18n("Word Break"), i18n("Word Break") ); + TQVariant(alignment & TQt::WordBreak, 3), i18n("Word Break"), i18n("Word Break") ); d->set.addProperty(p); updatePropertyValue(tree, "wordbreak"); if (!KFormDesigner::FormManager::self()->activeForm()->library()->isPropertyVisible( @@ -865,9 +865,9 @@ WidgetPropertySet::saveAlignProperty(const TQString &property) WidgetWithSubpropertiesInterface* subpropIface = dynamic_cast<WidgetWithSubpropertiesInterface*>( (TQWidget*)d->widgets.first() ); TQWidget *subwidget = (subpropIface && subpropIface->subwidget()) ? subpropIface->subwidget() : (TQWidget*)d->widgets.first(); - int count = subwidget->tqmetaObject()->findProperty("tqalignment", true); - const TQMetaProperty *meta = subwidget->tqmetaObject()->property(count, true); - subwidget->setProperty("tqalignment", meta->keysToValue(list)); + int count = subwidget->metaObject()->findProperty("alignment", true); + const TQMetaProperty *meta = subwidget->metaObject()->property(count, true); + subwidget->setProperty("alignment", meta->keysToValue(list)); ObjectTreeItem *tree = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup( d->widgets.first()->name() ); @@ -877,11 +877,11 @@ WidgetPropertySet::saveAlignProperty(const TQString &property) if(d->isUndoing) return; - if(d->lastCommand && d->lastCommand->property() == "tqalignment") + if(d->lastCommand && d->lastCommand->property() == "alignment") d->lastCommand->setValue(meta->keysToValue(list)); else { d->lastCommand = new PropertyCommand(this, d->widgets.first()->name(), - subwidget->property("tqalignment"), meta->keysToValue(list), "tqalignment"); + subwidget->property("alignment"), meta->keysToValue(list), "alignment"); KFormDesigner::FormManager::self()->activeForm()->addCommand(d->lastCommand, false); } } @@ -895,7 +895,7 @@ WidgetPropertySet::createLayoutProperty(ObjectTreeItem *item) if (!container || !KFormDesigner::FormManager::self()->activeForm() || !KFormDesigner::FormManager::self()->activeForm()->objectTree() || !container->widget()) return; - // special containers have no 'tqlayout' property, as it should not be changed + // special containers have no 'layout' property, as it should not be changed TQCString className = container->widget()->className(); if((className == "HBox") || (className == "VBox") || (className == "Grid")) return; @@ -905,12 +905,12 @@ WidgetPropertySet::createLayoutProperty(ObjectTreeItem *item) list << "NoLayout" << "HBox" << "VBox" << "Grid" << "HFlow" << "VFlow"; - KoProperty::Property *p = new KoProperty::Property("tqlayout", createValueList(0, list), value, + KoProperty::Property *p = new KoProperty::Property("layout", createValueList(0, list), value, i18n("Container's Layout"), i18n("Container's Layout")); p->setVisible( container->form()->library()->advancedPropertiesVisible() ); d->set.addProperty(p); - updatePropertyValue(item, "tqlayout"); + updatePropertyValue(item, "layout"); p = new KoProperty::Property("layoutMargin", container->layoutMargin(), i18n("Layout Margin"), i18n("Layout Margin")); d->set.addProperty(p); @@ -938,14 +938,14 @@ WidgetPropertySet::saveLayoutProperty(const TQString &prop, const TQVariant &val return; container = item->container(); - if(prop == "tqlayout") { + if(prop == "layout") { Container::LayoutType type = Container::stringToLayoutType(value.toString()); - if(d->lastCommand && d->lastCommand->property() == "tqlayout" && !d->isUndoing) + if(d->lastCommand && d->lastCommand->property() == "layout" && !d->isUndoing) d->lastCommand->setValue(value); else if(!d->isUndoing) { d->lastCommand = new LayoutPropertyCommand(this, d->widgets.first()->name(), - d->set["tqlayout"].oldValue(), value); + d->set["layout"].oldValue(), value); KFormDesigner::FormManager::self()->activeForm()->addCommand(d->lastCommand, false); } @@ -959,13 +959,13 @@ WidgetPropertySet::saveLayoutProperty(const TQString &prop, const TQVariant &val return; } - if(prop == "layoutMargin" && container->tqlayout()) { + if(prop == "layoutMargin" && container->layout()) { container->setLayoutMargin(value.toInt()); - container->tqlayout()->setMargin(value.toInt()); + container->layout()->setMargin(value.toInt()); } - else if(prop == "layoutSpacing" && container->tqlayout()) { + else if(prop == "layoutSpacing" && container->layout()) { container->setLayoutSpacing(value.toInt()); - container->tqlayout()->setSpacing(value.toInt()); + container->layout()->setSpacing(value.toInt()); } ObjectTreeItem *tree = KFormDesigner::FormManager::self()->activeForm()->objectTree()->lookup(d->widgets.first()->name()); @@ -1000,8 +1000,8 @@ WidgetPropertySet::initPropertiesDescription() d->propCaption["enabled"] = i18n("Enabled"); d->propCaption["geometry"] = i18n("Geometry"); d->propCaption["sizePolicy"] = i18n("Size Policy"); - d->propCaption["tqminimumSize"] = i18n("Minimum Size"); - d->propCaption["tqmaximumSize"] = i18n("Maximum Size"); + d->propCaption["minimumSize"] = i18n("Minimum Size"); + d->propCaption["maximumSize"] = i18n("Maximum Size"); d->propCaption["font"] = i18n("Font"); d->propCaption["cursor"] = i18n("Cursor"); d->propCaption["paletteForegroundColor"] = i18n("Foreground Color"); diff --git a/kexi/formeditor/widgetpropertyset.h b/kexi/formeditor/widgetpropertyset.h index afb303d1..896d309c 100644 --- a/kexi/formeditor/widgetpropertyset.h +++ b/kexi/formeditor/widgetpropertyset.h @@ -157,21 +157,21 @@ class KFORMEDITOR_EXPORT WidgetPropertySet : public TQObject // Following functions are used to create special types of properties, different // from TQ_PROPERTY - /*! Creates the properties related to tqalignment (ie hAlign, vAlign and WordBreak) for + /*! Creates the properties related to alignment (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 TQMetaProperty for "tqalignment" property" of subwidget. */ + \a meta is the TQMetaProperty for "alignment" property" of subwidget. */ void createAlignProperty(const TQMetaProperty *meta, TQWidget *widget, TQWidget *subwidget); - /*! Saves the properties related to tqalignment (ie hAlign, vAlign and WordBreak) - and modifies the "tqalignment" property of the widget.*/ + /*! Saves the properties related to alignment (ie hAlign, vAlign and WordBreak) + and modifies the "alignment" property of the widget.*/ void saveAlignProperty(const TQString &property); - /*! Creates the "tqlayout" property, for the Container representing \a item. */ + /*! Creates the "layout" property, for the Container representing \a item. */ void createLayoutProperty(ObjectTreeItem *item); - /*! Saves the "tqlayout" property and changes the Container 's tqlayout ( + /*! Saves the "layout" property and changes the Container 's layout ( using Container::setLayout() ).*/ void saveLayoutProperty(const TQString &property, const TQVariant &value); diff --git a/kexi/formeditor/widgetwithsubpropertiesinterface.cpp b/kexi/formeditor/widgetwithsubpropertiesinterface.cpp index aa84f831..362214a1 100644 --- a/kexi/formeditor/widgetwithsubpropertiesinterface.cpp +++ b/kexi/formeditor/widgetwithsubpropertiesinterface.cpp @@ -41,11 +41,11 @@ void WidgetWithSubpropertiesInterface::setSubwidget(TQWidget *widget) TQAsciiDict<char> addedSubproperies(1024); if (m_subwidget) { //remember properties in the subwidget that are not present in the parent - for( TQMetaObject *tqmetaObject = m_subwidget->tqmetaObject(); tqmetaObject; tqmetaObject = tqmetaObject->tqsuperClass()) { - const int numProperties = tqmetaObject->numProperties(); + for( TQMetaObject *metaObject = m_subwidget->metaObject(); metaObject; metaObject = metaObject->superClass()) { + const int numProperties = metaObject->numProperties(); for (int i = 0; i < numProperties; i++) { - const char *propertyName = tqmetaObject->property( i )->name(); - if (dynamic_cast<TQObject*>(this)->tqmetaObject()->findProperty( propertyName, true )==-1 + const char *propertyName = metaObject->property( i )->name(); + if (dynamic_cast<TQObject*>(this)->metaObject()->findProperty( propertyName, true )==-1 && !addedSubproperies.find( propertyName ) ) { m_subproperies.append( propertyName ); @@ -73,10 +73,10 @@ const TQMetaProperty *WidgetWithSubpropertiesInterface::findMetaSubproperty(cons if (!m_subwidget || m_subproperies.find(name) == m_subproperies.constEnd()) { return 0; } - const int index = m_subwidget->tqmetaObject()->findProperty( name, true ); + const int index = m_subwidget->metaObject()->findProperty( name, true ); if (index==-1) return 0; - return m_subwidget->tqmetaObject()->property( index, true ); + return m_subwidget->metaObject()->property( index, true ); } TQVariant WidgetWithSubpropertiesInterface::subproperty( const char * name, bool &ok ) const |