diff options
Diffstat (limited to 'kexi/formeditor/formmanager.cpp')
-rw-r--r-- | kexi/formeditor/formmanager.cpp | 428 |
1 files changed, 214 insertions, 214 deletions
diff --git a/kexi/formeditor/formmanager.cpp b/kexi/formeditor/formmanager.cpp index 20b40cf9..85001f5e 100644 --- a/kexi/formeditor/formmanager.cpp +++ b/kexi/formeditor/formmanager.cpp @@ -20,16 +20,16 @@ #include <kdebug.h> -#include <qworkspace.h> -#include <qcursor.h> -#include <qstring.h> -#include <qlabel.h> -#include <qobjectlist.h> -#include <qstylefactory.h> -#include <qmetaobject.h> -#include <qregexp.h> -#include <qvaluevector.h> -#include <qvbox.h> +#include <tqworkspace.h> +#include <tqcursor.h> +#include <tqstring.h> +#include <tqlabel.h> +#include <tqobjectlist.h> +#include <tqstylefactory.h> +#include <tqmetaobject.h> +#include <tqregexp.h> +#include <tqvaluevector.h> +#include <tqvbox.h> #include <klocale.h> #include <kiconloader.h> @@ -51,7 +51,7 @@ #include <kfontdialog.h> #include <kdeversion.h> -#if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) && !defined(Q_WS_WIN) +#if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) && !defined(TQ_WS_WIN) # include <kactioncollection.h> #endif @@ -83,8 +83,8 @@ namespace KFormDesigner { class PropertyFactory : public KoProperty::CustomPropertyFactory { public: - PropertyFactory(QObject *parent) - : KoProperty::CustomPropertyFactory(parent) + PropertyFactory(TQObject *tqparent) + : KoProperty::CustomPropertyFactory(tqparent) // m_manager(manager) { } @@ -105,8 +105,8 @@ using namespace KFormDesigner; static KStaticDeleter<FormManager> m_managerDeleter; FormManager* FormManager::_self = 0L; -FormManager::FormManager(QObject *parent, int options, const char *name) - : QObject(parent, name) +FormManager::FormManager(TQObject *tqparent, int options, const char *name) + : TQObject(tqparent, name) #ifdef KEXI_DEBUG_GUI , m_uiCodeDialog(0) , m_options(options) @@ -121,7 +121,7 @@ FormManager::FormManager(QObject *parent, int options, const char *name) KGlobal::locale()->insertCatalogue("kformdesigner"); #endif - connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) ); + connect( kapp, TQT_SIGNAL( settingsChanged(int) ), TQT_SLOT( slotSettingsChanged(int) ) ); slotSettingsChanged(KApplication::SETTINGS_SHORTCUTS); //moved to createWidgetLibrary() m_lib = new WidgetLibrary(this, supportedFactoryGroups); @@ -139,9 +139,9 @@ FormManager::FormManager(QObject *parent, int options, const char *name) m_domDoc.appendChild(m_domDoc.createElement("UI")); m_deleteWidgetLater_list.setAutoDelete(true); - connect( &m_deleteWidgetLater_timer, SIGNAL(timeout()), this, SLOT(deleteWidgetLaterTimeout())); - connect( this, SIGNAL(connectionCreated(KFormDesigner::Form*, KFormDesigner::Connection&)), - this, SLOT(slotConnectionCreated(KFormDesigner::Form*, KFormDesigner::Connection&))); + connect( &m_deleteWidgetLater_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(deleteWidgetLaterTimeout())); + connect( this, TQT_SIGNAL(connectionCreated(KFormDesigner::Form*, KFormDesigner::Connection&)), + this, TQT_SLOT(slotConnectionCreated(KFormDesigner::Form*, KFormDesigner::Connection&))); // register kfd custom editors KoProperty::FactoryManager::self()->registerFactoryForEditor(KoProperty::Pixmap, @@ -166,7 +166,7 @@ FormManager* FormManager::self() } WidgetLibrary* -FormManager::createWidgetLibrary(FormManager* m, const QStringList& supportedFactoryGroups) +FormManager::createWidgetLibrary(FormManager* m, const TQStringList& supportedFactoryGroups) { if(!_self) m_managerDeleter.setObject( _self, m ); @@ -187,8 +187,8 @@ FormManager::setObjectTreeView(ObjectTreeView *treeview) { m_treeview = treeview; if (m_treeview) - connect(m_propSet, SIGNAL(widgetNameChanged(const QCString&, const QCString&)), - m_treeview, SLOT(renameItem(const QCString&, const QCString&))); + connect(m_propSet, TQT_SIGNAL(widgetNameChanged(const TQCString&, const TQCString&)), + m_treeview, TQT_SLOT(renameItem(const TQCString&, const TQCString&))); } ActionList @@ -196,13 +196,13 @@ FormManager::createActions(WidgetLibrary *lib, KActionCollection* collection, KX { m_collection = collection; - ActionList actions = lib->createWidgetActions(client, m_collection, this, SLOT(insertWidget(const QCString &))); + ActionList actions = lib->createWidgetActions(client, m_collection, this, TQT_SLOT(insertWidget(const TQCString &))); if (m_options & HideSignalSlotConnections) m_dragConnection = 0; else { m_dragConnection = new KToggleAction(i18n("Connect Signals/Slots"), - "signalslot", KShortcut(0), this, SLOT(startCreatingConnection()), m_collection, + "signalslot", KShortcut(0), this, TQT_SLOT(startCreatingConnection()), m_collection, "drag_connection"); //to be exclusive with any 'widget' action m_dragConnection->setExclusiveGroup("LibActionWidgets"); @@ -211,30 +211,30 @@ FormManager::createActions(WidgetLibrary *lib, KActionCollection* collection, KX } m_pointer = new KToggleAction(i18n("Pointer"), "mouse_pointer", KShortcut(0), - this, SLOT(slotPointerClicked()), m_collection, "pointer"); + this, TQT_SLOT(slotPointerClicked()), m_collection, "pointer"); m_pointer->setExclusiveGroup("LibActionWidgets"); //to be exclusive with any 'widget' action m_pointer->setChecked(true); actions.append(m_pointer); - m_snapToGrid = new KToggleAction(i18n("Snap to Grid"), QString::null, KShortcut(0), + m_snapToGrid = new KToggleAction(i18n("Snap to Grid"), TQString(), KShortcut(0), 0, 0, m_collection, "snap_to_grid"); m_snapToGrid->setChecked(true); actions.append(m_snapToGrid); // Create the Style selection action (with a combo box in toolbar and submenu items) KSelectAction *m_style = new KSelectAction( i18n("Style"), KShortcut(0), - this, SLOT(slotStyle()), m_collection, "change_style"); + this, TQT_SLOT(slotStyle()), m_collection, "change_style"); m_style->setEditable(false); KGlobal::config()->setGroup("General"); - QString currentStyle = QString::fromLatin1(kapp->style().name()).lower(); - const QStringList styles = QStyleFactory::keys(); + TQString currentStyle = TQString::tqfromLatin1(kapp->tqstyle().name()).lower(); + const TQStringList styles = TQStyleFactory::keys(); m_style->setItems(styles); m_style->setCurrentItem(0); - QStringList::ConstIterator endIt = styles.constEnd(); + TQStringList::ConstIterator endIt = styles.constEnd(); int idx = 0; - for (QStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) + for (TQStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) { if ((*it).lower() == currentStyle) { m_style->setCurrentItem(idx); @@ -278,7 +278,7 @@ FormManager::redo() } void -FormManager::insertWidget(const QCString &classname) +FormManager::insertWidget(const TQCString &classname) { if(m_drawingSlot) stopCreatingConnection(); @@ -288,17 +288,17 @@ FormManager::insertWidget(const QCString &classname) Form *form; for(form = m_forms.first(); form; form = m_forms.next()) { -// form->d->cursors = new QMap<QString, QCursor>(); +// form->d->cursors = new TQMap<TQString, TQCursor>(); if (form->toplevelContainer()) - form->widget()->setCursor(QCursor(CrossCursor)); - QObjectList *l = form->widget()->queryList( "QWidget" ); - for(QObject *o = l->first(); o; o = l->next()) + form->widget()->setCursor(TQCursor(CrossCursor)); + TQObjectList *l = form->widget()->queryList( TQWIDGET_OBJECT_NAME_STRING ); + for(TQObject *o = l->first(); o; o = l->next()) { - if( ((QWidget*)o)->ownCursor() ) + if( ((TQWidget*)o)->ownCursor() ) { -// form->d->cursors->insert(o->name(), ((QWidget*)o)->cursor()); - form->d->cursors.insert(o, static_cast<QWidget*>(o)->cursor()); - static_cast<QWidget*>(o)->setCursor(QCursor(Qt::CrossCursor)); +// form->d->cursors->insert(o->name(), ((TQWidget*)o)->cursor()); + form->d->cursors.insert(o, TQT_TQWIDGET(o)->cursor()); + TQT_TQWIDGET(o)->setCursor(TQCursor(TQt::CrossCursor)); } } @@ -322,16 +322,16 @@ FormManager::stopInsert() for(form = m_forms.first(); form; form = m_forms.next()) { form->widget()->unsetCursor(); - QObjectList *l = form->widget()->queryList( "QWidget" ); - for(QObject *o = l->first(); o; o = l->next()) + TQObjectList *l = form->widget()->queryList( TQWIDGET_OBJECT_NAME_STRING ); + for(TQObject *o = l->first(); o; o = l->next()) { - static_cast<QWidget*>(o)->unsetCursor(); + TQT_TQWIDGET(o)->unsetCursor(); #if 0 - if( ((QWidget*)o)->ownCursor()) { - QMap<QObject*,QCursor>::ConstIterator curIt( form->d->cursors.find(o) ); + if( ((TQWidget*)o)->ownCursor()) { + TQMap<TQObject*,TQCursor>::ConstIterator curIt( form->d->cursors.tqfind(o) ); if (curIt!=form->d->cursors.constEnd()) - static_cast<QWidget*>(o)->setCursor( *curIt ); -// ((QWidget*)o)->setCursor( (*(form->d->cursors))[o->name()] ) ; + TQT_TQWIDGET(o)->setCursor( *curIt ); +// ((TQWidget*)o)->setCursor( (*(form->d->cursors))[o->name()] ) ; } #endif } @@ -366,22 +366,22 @@ FormManager::startCreatingConnection() Form *form; for(form = m_forms.first(); form; form = m_forms.next()) { -// form->d->cursors = new QMap<QString, QCursor>(); - form->d->mouseTrackers = new QStringList(); +// form->d->cursors = new TQMap<TQString, TQCursor>(); + form->d->mouseTrackers = new TQStringList(); if (form->toplevelContainer()) { - form->widget()->setCursor(QCursor(PointingHandCursor)); + form->widget()->setCursor(TQCursor(PointingHandCursor)); form->widget()->setMouseTracking(true); } - QObjectList *l = form->widget()->queryList( "QWidget" ); - for(QObject *o = l->first(); o; o = l->next()) + TQObjectList *l = form->widget()->queryList( TQWIDGET_OBJECT_NAME_STRING ); + for(TQObject *o = l->first(); o; o = l->next()) { - QWidget *w = static_cast<QWidget*>(o); + TQWidget *w = TQT_TQWIDGET(o); if( w->ownCursor() ) { - form->d->cursors.insert(w, w->cursor()); -// form->d->cursors->insert(w->name(), w->cursor()); - w->setCursor(QCursor(PointingHandCursor )); + form->d->cursors.insert(TQT_TQOBJECT(w), w->cursor()); +// form->d->cursors->insert(TQT_TQOBJECT(w)->name(), w->cursor()); + w->setCursor(TQCursor(PointingHandCursor )); } if(w->hasMouseTracking()) form->d->mouseTrackers->append(w->name()); @@ -413,7 +413,7 @@ FormManager::resetCreatedConnection() m_active->formWidget()->clearForm(); } if (m_active && m_active->widget()) - m_active->widget()->repaint(); + m_active->widget()->tqrepaint(); } void @@ -432,14 +432,14 @@ FormManager::stopCreatingConnection() { form->widget()->unsetCursor(); form->widget()->setMouseTracking(false); - QObjectList *l = form->widget()->queryList( "QWidget" ); - for(QObject *o = l->first(); o; o = l->next()) + TQObjectList *l = form->widget()->queryList( TQWIDGET_OBJECT_NAME_STRING ); + for(TQObject *o = l->first(); o; o = l->next()) { - QWidget *w = (QWidget*)o; + TQWidget *w = (TQWidget*)o; if( w->ownCursor()) { - QMap<QObject*,QCursor>::ConstIterator curIt( form->d->cursors.find(o) ); + TQMap<TQObject*,TQCursor>::ConstIterator curIt( form->d->cursors.tqfind(o) ); if (curIt!=form->d->cursors.constEnd()) - static_cast<QWidget*>(o)->setCursor( *curIt ); + TQT_TQWIDGET(o)->setCursor( *curIt ); } // w->setCursor( (*(form->d->cursors))[o->name()] ) ; w->setMouseTracking( !form->d->mouseTrackers->grep(w->name()).isEmpty() ); @@ -466,10 +466,10 @@ FormManager::snapWidgetsToGrid() } void -FormManager::windowChanged(QWidget *w) +FormManager::windowChanged(TQWidget *w) { kdDebug() << "FormManager::windowChanged(" - << (w ? (QString(w->className())+" "+w->name()) : QString("0")) << ")" << endl; + << (w ? (TQString(w->className())+" "+w->name()) : TQString("0")) << ")" << endl; if(!w) { @@ -502,12 +502,12 @@ FormManager::windowChanged(QWidget *w) #ifndef KFD_NO_STYLES // update the 'style' action KSelectAction *m_style = (KSelectAction*)m_collection->action("change_style", "KSelectAction"); - const QString currentStyle = form->widget()->style().name(); - const QStringList styles = m_style->items(); + const TQString currentStyle = form->widget()->style().name(); + const TQStringList styles = m_style->items(); int idx = 0; - QStringList::ConstIterator endIt = styles.constEnd(); - for (QStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) + TQStringList::ConstIterator endIt = styles.constEnd(); + for (TQStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) { if ((*it).lower() == currentStyle) { kdDebug() << "Updating the style to " << currentStyle << endl; @@ -545,12 +545,12 @@ FormManager::windowChanged(QWidget *w) #ifndef KFD_NO_STYLES // update the 'style' action KSelectAction *m_style = (KSelectAction*)m_collection->action("change_style", "KSelectAction"); - const QString currentStyle = form->widget()->style().name(); - const QStringList styles = m_style->items(); + const TQString currentStyle = form->widget()->style().name(); + const TQStringList styles = m_style->items(); int idx = 0; - QStringList::ConstIterator endIt = styles.constEnd(); - for (QStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) + TQStringList::ConstIterator endIt = styles.constEnd(); + for (TQStringList::ConstIterator it = styles.constBegin(); it != endIt; ++it, ++idx) { if ((*it).lower() == currentStyle) { kdDebug() << "Updating the style to " << currentStyle << endl; @@ -580,7 +580,7 @@ FormManager::activeForm() const } Form* -FormManager::formForWidget(QWidget *w) +FormManager::formForWidget(TQWidget *w) { for(Form *form = m_forms.first(); form; form = m_forms.next()) { if(form->toplevelContainer() && form->widget() == w) @@ -595,7 +595,7 @@ FormManager::deleteForm(Form *form) { if (!form) return; - if(m_forms.find(form) == -1) + if(m_forms.tqfind(form) == -1) m_preview.remove(form); else m_forms.remove(form); @@ -628,28 +628,28 @@ FormManager::initForm(Form *form) m_active = form; - connect(form, SIGNAL(selectionChanged(QWidget*, bool, bool)), - m_propSet, SLOT(setSelectedWidgetWithoutReload(QWidget*, bool, bool))); + connect(form, TQT_SIGNAL(selectionChanged(TQWidget*, bool, bool)), + m_propSet, TQT_SLOT(setSelectedWidgetWithoutReload(TQWidget*, bool, bool))); if(m_treeview) { - connect(form, SIGNAL(selectionChanged(QWidget*, bool, bool)), - m_treeview, SLOT(setSelectedWidget(QWidget*, bool))); - connect(form, SIGNAL(childAdded(ObjectTreeItem* )), m_treeview, SLOT(addItem(ObjectTreeItem*))); - connect(form, SIGNAL(childRemoved(ObjectTreeItem* )), m_treeview, SLOT(removeItem(ObjectTreeItem*))); + connect(form, TQT_SIGNAL(selectionChanged(TQWidget*, bool, bool)), + m_treeview, TQT_SLOT(setSelectedWidget(TQWidget*, bool))); + connect(form, TQT_SIGNAL(childAdded(ObjectTreeItem* )), m_treeview, TQT_SLOT(addItem(ObjectTreeItem*))); + connect(form, TQT_SIGNAL(childRemoved(ObjectTreeItem* )), m_treeview, TQT_SLOT(removeItem(ObjectTreeItem*))); } - connect(m_propSet, SIGNAL(widgetNameChanged(const QCString&, const QCString&)), - form, SLOT(changeName(const QCString&, const QCString&))); + connect(m_propSet, TQT_SIGNAL(widgetNameChanged(const TQCString&, const TQCString&)), + form, TQT_SLOT(changeName(const TQCString&, const TQCString&))); form->setSelectedWidget(form->widget()); windowChanged(form->widget()); } void -FormManager::previewForm(Form *form, QWidget *container, Form *toForm) +FormManager::previewForm(Form *form, TQWidget *container, Form *toForm) { if(!form || !container || !form->objectTree()) return; - QDomDocument domDoc; + TQDomDocument domDoc; if (!FormIO::saveFormToDom(form, domDoc)) return; @@ -660,7 +660,7 @@ FormManager::previewForm(Form *form, QWidget *container, Form *toForm) else myform = toForm; myform->createToplevel(container); - container->setStyle( &(form->widget()->style()) ); + container->setStyle( &(form->widget()->tqstyle()) ); if (!FormIO::loadFormFromDom(myform, container, domDoc)) { delete myform; @@ -674,19 +674,19 @@ FormManager::previewForm(Form *form, QWidget *container, Form *toForm) /* bool -FormManager::loadFormFromDomInternal(Form *form, QWidget *container, QDomDocument &inBuf) +FormManager::loadFormFromDomInternal(Form *form, TQWidget *container, TQDomDocument &inBuf) { return FormIO::loadFormFromDom(myform, container, domDoc); } bool -FormManager::saveFormToStringInternal(Form *form, QString &dest, int indent) +FormManager::saveFormToStringInternal(Form *form, TQString &dest, int indent) { return KFormDesigner::FormIO::saveFormToString(form, dest, indent); }*/ bool -FormManager::isTopLevel(QWidget *w) +FormManager::isTopLevel(TQWidget *w) { if(!activeForm() || !activeForm()->objectTree()) return false; @@ -698,7 +698,7 @@ FormManager::isTopLevel(QWidget *w) if(!item) return true; - return (!item->parent()); + return (!item->tqparent()); } void @@ -707,7 +707,7 @@ FormManager::deleteWidget() if(!activeForm() || !activeForm()->objectTree()) return; - QPtrList<QWidget> *list = activeForm()->selectedWidgets(); + TQPtrList<TQWidget> *list = activeForm()->selectedWidgets(); if(list->isEmpty()) return; @@ -726,28 +726,28 @@ FormManager::copyWidget() if (!activeForm() || !activeForm()->objectTree()) return; - QPtrList<QWidget> *list = activeForm()->selectedWidgets(); + TQPtrList<TQWidget> *list = activeForm()->selectedWidgets(); if(list->isEmpty()) return; removeChildrenFromList(*list); // We clear the current clipboard - m_domDoc.setContent(QString(), true); - QDomElement parent = m_domDoc.createElement("UI"); - m_domDoc.appendChild(parent); + m_domDoc.setContent(TQString(), true); + TQDomElement tqparent = m_domDoc.createElement("UI"); + m_domDoc.appendChild(tqparent); - QWidget *w; + TQWidget *w; for(w = list->first(); w; w = list->next()) { ObjectTreeItem *it = activeForm()->objectTree()->lookup(w->name()); if (!it) continue; - FormIO::saveWidget(it, parent, m_domDoc); + FormIO::saveWidget(it, tqparent, m_domDoc); } - FormIO::cleanClipboard(parent); + FormIO::cleanClipboard(tqparent); activeForm()->emitActionSignals(); // to update 'Paste' item state } @@ -758,7 +758,7 @@ FormManager::cutWidget() if(!activeForm() || !activeForm()->objectTree()) return; - QPtrList<QWidget> *list = activeForm()->selectedWidgets(); + TQPtrList<TQWidget> *list = activeForm()->selectedWidgets(); if(list->isEmpty()) return; @@ -779,23 +779,23 @@ FormManager::pasteWidget() } void -FormManager::setInsertPoint(const QPoint &p) +FormManager::setInsertPoint(const TQPoint &p) { m_insertPoint = p; } void -FormManager::createSignalMenu(QWidget *w) +FormManager::createSignalMenu(TQWidget *w) { m_sigSlotMenu = new KPopupMenu(); m_sigSlotMenu->insertTitle(SmallIcon("connection"), i18n("Signals")); - QStrList list = w->metaObject()->signalNames(true); - QStrListIterator it(list); + TQStrList list = w->tqmetaObject()->signalNames(true); + TQStrListIterator it(list); for(; it.current() != 0; ++it) m_sigSlotMenu->insertItem(*it); - int result = m_sigSlotMenu->exec(QCursor::pos()); + int result = m_sigSlotMenu->exec(TQCursor::pos()); if(result == -1) resetCreatedConnection(); else @@ -806,27 +806,27 @@ FormManager::createSignalMenu(QWidget *w) } void -FormManager::createSlotMenu(QWidget *w) +FormManager::createSlotMenu(TQWidget *w) { m_sigSlotMenu = new KPopupMenu(); m_sigSlotMenu->insertTitle(SmallIcon("connection"), i18n("Slots")); - QString signalArg( m_connection->signal().remove( QRegExp(".*[(]|[)]") ) ); + TQString signalArg( m_connection->signal().remove( TQRegExp(".*[(]|[)]") ) ); - QStrList list = w->metaObject()->slotNames(true); - QStrListIterator it(list); + TQStrList list = w->tqmetaObject()->slotNames(true); + TQStrListIterator it(list); for(; it.current() != 0; ++it) { // we add the slot only if it is compatible with the signal - QString slotArg(*it); - slotArg = slotArg.remove( QRegExp(".*[(]|[)]") ); - if(!signalArg.startsWith(slotArg, true)) // args not compatible + TQString slotArg(*it); + slotArg = slotArg.remove( TQRegExp(".*[(]|[)]") ); + if(!signalArg.tqstartsWith(slotArg, true)) // args not compatible continue; m_sigSlotMenu->insertItem(*it); } - int result = m_sigSlotMenu->exec(QCursor::pos()); + int result = m_sigSlotMenu->exec(TQCursor::pos()); if(result == -1) resetCreatedConnection(); else @@ -837,7 +837,7 @@ FormManager::createSlotMenu(QWidget *w) } void -FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCursor) +FormManager::createContextMenu(TQWidget *w, Container *container, bool popupAtCursor) { if(!activeForm() || !activeForm()->widget()) return; @@ -845,12 +845,12 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur const uint widgetsCount = container->form()->selectedWidgets()->count(); const bool multiple = widgetsCount > 1; //const bool enableRemove = w != m_active->widget(); - // We only enablelayout creation if more than one widget with the same parent are selected + // We only enabletqlayout creation if more than one widget with the same tqparent are selected const bool enableLayout = multiple || w == container->widget(); m_menuWidget = w; - QString n = container->form()->library()->displayName(w->className()); -// QValueVector<int> menuIds(); + TQString n = container->form()->library()->displayName(w->className()); +// TQValueVector<int> menuIds(); if (!m_popup) { m_popup = new KPopupMenu(); @@ -863,14 +863,14 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur if(!multiple) { if(w == container->form()->widget()) - m_popup->insertTitle(SmallIcon("form"), i18n("%1 : Form").arg(w->name()) ); + m_popup->insertTitle(SmallIcon("form"), i18n("%1 : Form").tqarg(w->name()) ); else m_popup->insertTitle( SmallIcon( - container->form()->library()->iconName(w->className())), QString(w->name()) + " : " + n ); + container->form()->library()->iconName(w->className())), TQString(w->name()) + " : " + n ); } else m_popup->insertTitle(SmallIcon("multiple_obj"), i18n("Multiple Widgets") - + QString(" (%1)").arg(widgetsCount)); + + TQString(" (%1)").tqarg(widgetsCount)); KAction *a; #define PLUG_ACTION(_name, forceVisible) \ @@ -890,7 +890,7 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur PLUG_ACTION("edit_paste", true); PLUG_ACTION("edit_delete", !toplevelWidgetSelected); separatorNeeded = true; - PLUG_ACTION("layout_menu", enableLayout); + PLUG_ACTION("tqlayout_menu", enableLayout); PLUG_ACTION("break_layout", enableLayout); separatorNeeded = true; PLUG_ACTION("align_menu", !toplevelWidgetSelected); @@ -898,13 +898,13 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur separatorNeeded = true; // We create the buddy menu - if(!multiple && w->inherits("QLabel") && ((QLabel*)w)->text().contains("&") && (((QLabel*)w)->textFormat() != RichText)) + if(!multiple && w->inherits(TQLABEL_OBJECT_NAME_STRING) && ((TQLabel*)w)->text().tqcontains("&") && (((TQLabel*)w)->textFormat() != RichText)) { if (separatorNeeded) m_popup->insertSeparator(); KPopupMenu *sub = new KPopupMenu(w); - QWidget *buddy = ((QLabel*)w)->buddy(); + TQWidget *buddy = ((TQLabel*)w)->buddy(); sub->insertItem(i18n("No Buddy"), MenuNoBuddy); if(!buddy) @@ -923,7 +923,7 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur /*int id =*/ m_popup->insertItem(i18n("Choose Buddy..."), sub); // menuIds->append(id); - connect(sub, SIGNAL(activated(int)), this, SLOT(buddyChosen(int))); + connect(sub, TQT_SIGNAL(activated(int)), this, TQT_SLOT(buddyChosen(int))); separatorNeeded = true; } @@ -937,8 +937,8 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur // We create the signals menu KPopupMenu *sigMenu = new KPopupMenu(); - QStrList list = w->metaObject()->signalNames(true); - QStrListIterator it(list); + TQStrList list = w->tqmetaObject()->signalNames(true); + TQStrListIterator it(list); for(; it.current() != 0; ++it) sigMenu->insertItem(*it); @@ -946,7 +946,7 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur // menuIds->append(id); if(list.isEmpty()) m_popup->setItemEnabled(id, false); - connect(sigMenu, SIGNAL(activated(int)), this, SLOT(menuSignalChosen(int))); + connect(sigMenu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(menuSignalChosen(int))); separatorNeeded = true; } #endif @@ -975,20 +975,20 @@ FormManager::createContextMenu(QWidget *w, Container *container, bool popupAtCur } //show the popup at the selected widget - QPoint popupPos; + TQPoint popupPos; if (popupAtCursor) { - popupPos = QCursor::pos(); + popupPos = TQCursor::pos(); } else { WidgetList *lst = container->form()->selectedWidgets(); - QWidget * sel_w = lst ? lst->first() : container->form()->selectedWidget(); - popupPos = sel_w ? sel_w->mapToGlobal(QPoint(sel_w->width()/2, sel_w->height()/2)) : QCursor::pos(); + TQWidget * sel_w = lst ? lst->first() : container->form()->selectedWidget(); + popupPos = sel_w ? sel_w->mapToGlobal(TQPoint(sel_w->width()/2, sel_w->height()/2)) : TQCursor::pos(); } m_insertPoint = container->widget()->mapFromGlobal(popupPos); - m_popup->exec(popupPos);//QCursor::pos()); - m_insertPoint = QPoint(); + m_popup->exec(popupPos);//TQCursor::pos()); + m_insertPoint = TQPoint(); -// QValueVector<int>::iterator it; +// TQValueVector<int>::iterator it; // for(it = menuIds->begin(); it != menuIds->end(); ++it) // m_popup->removeItem(*it); } @@ -998,7 +998,7 @@ FormManager::buddyChosen(int id) { if(!m_menuWidget) return; - QLabel *label = static_cast<QLabel*>((QWidget*)m_menuWidget); + TQLabel *label = static_cast<TQLabel*>((TQWidget*)m_menuWidget); if(id == MenuNoBuddy) { @@ -1050,52 +1050,52 @@ FormManager::slotConnectionCreated(Form *form, Connection &connection) } void -FormManager::layoutHBox() +FormManager::tqlayoutHBox() { createLayout(Container::HBox); } void -FormManager::layoutVBox() +FormManager::tqlayoutVBox() { createLayout(Container::VBox); } void -FormManager::layoutGrid() +FormManager::tqlayoutGrid() { createLayout(Container::Grid); } void -FormManager::layoutHSplitter() +FormManager::tqlayoutHSplitter() { createLayout(Container::HSplitter); } void -FormManager::layoutVSplitter() +FormManager::tqlayoutVSplitter() { createLayout(Container::VSplitter); } void -FormManager::layoutHFlow() +FormManager::tqlayoutHFlow() { createLayout(Container::HFlow); } void -FormManager::layoutVFlow() +FormManager::tqlayoutVFlow() { createLayout(Container::VFlow); } void -FormManager::createLayout(int layoutType) +FormManager::createLayout(int tqlayoutType) { WidgetList *list = m_active->selectedWidgets(); - // if only one widget is selected (a container), we modify its layout + // if only one widget is selected (a container), we modify its tqlayout if (list->isEmpty()) {//sanity check kdWarning() << "FormManager::createLayout(): list is empty!" << endl; return; @@ -1103,26 +1103,26 @@ FormManager::createLayout(int layoutType) if(list->count() == 1) { ObjectTreeItem *item = m_active->objectTree()->lookup(list->first()->name()); - if(!item || !item->container() || !m_propSet->contains("layout")) + if(!item || !item->container() || !m_propSet->tqcontains("tqlayout")) return; - (*m_propSet)["layout"] = Container::layoutTypeToString(layoutType); + (*m_propSet)["tqlayout"] = Container::tqlayoutTypeToString(tqlayoutType); return; } - QWidget *parent = list->first()->parentWidget(); - for(QWidget *w = list->first(); w; w = list->next()) + TQWidget *tqparent = list->first()->tqparentWidget(); + for(TQWidget *w = list->first(); w; w = list->next()) { - kdDebug() << "comparing widget " << w->name() << " whose parent is " << w->parentWidget()->name() << " insteaed of " << parent->name() << endl; - if(w->parentWidget() != parent) + kdDebug() << "comparing widget " << w->name() << " whose tqparent is " << w->tqparentWidget()->name() << " insteaed of " << tqparent->name() << endl; + if(w->tqparentWidget() != tqparent) { - KMessageBox::sorry(m_active->widget()->topLevelWidget(), i18n("<b>Cannot create the layout.</b>\n" - "All selected widgets must have the same parent.")); - kdDebug() << "FormManager::createLayout() widgets don't have the same parent widget" << endl; + KMessageBox::sorry(m_active->widget()->tqtopLevelWidget(), i18n("<b>Cannot create the tqlayout.</b>\n" + "All selected widgets must have the same tqparent.")); + kdDebug() << "FormManager::createLayout() widgets don't have the same tqparent widget" << endl; return; } } - KCommand *com = new CreateLayoutCommand(layoutType, *list, m_active); + KCommand *com = new CreateLayoutCommand(tqlayoutType, *list, m_active); m_active->addCommand(com, true); } @@ -1133,7 +1133,7 @@ FormManager::breakLayout() return; Container *container = activeForm()->activeContainer(); - QCString c( container->widget()->className() ); + TQCString c( container->widget()->className() ); if((c == "Grid") || (c == "VBox") || (c == "HBox") || (c == "HFlow") || (c == "VFlow")) { @@ -1143,14 +1143,14 @@ FormManager::breakLayout() else // normal container { if(activeForm()->selectedWidgets()->count() == 1) - (*m_propSet)["layout"] = "NoLayout"; + (*m_propSet)["tqlayout"] = "NoLayout"; else container->setLayout(Container::NoLayout); } } void -FormManager::showPropertySet(WidgetPropertySet *set, bool forceReload, const QCString& propertyToSelect) +FormManager::showPropertySet(WidgetPropertySet *set, bool forceReload, const TQCString& propertyToSelect) { if (m_objectBlockingPropertyEditorUpdating) return; @@ -1188,10 +1188,10 @@ FormManager::editTabOrder() { if(!activeForm() || !activeForm()->objectTree()) return; - QWidget *topLevel = m_active->widget()->topLevelWidget(); + TQWidget *topLevel = m_active->widget()->tqtopLevelWidget(); TabStopDialog dlg(topLevel); //const bool oldAutoTabStops = m_active->autoTabStops(); - if (dlg.exec(m_active) == QDialog::Accepted) { + if (dlg.exec(m_active) == TQDialog::Accepted) { //inform about changing "autoTabStop" property // -- this will be received eg. by Kexi, so custom "autoTabStop" property can be updated emit autoTabStopsSet(m_active, dlg.autoTabStops()); @@ -1207,12 +1207,12 @@ FormManager::slotStyle() return; KSelectAction *m_style = (KSelectAction*)m_collection->action("change_style", "KSelectAction"); - QString style = m_style->currentText(); - activeForm()->widget()->setStyle( style); + TQString style = m_style->currentText(); + activeForm()->widget()->setStyle( style ); - QObjectList *l = activeForm()->widget()->queryList( "QWidget" ); - for(QObject *o = l->first(); o; o = l->next()) - (static_cast<QWidget*>(o))->setStyle( style ); + TQObjectList *l = activeForm()->widget()->queryList( TQWIDGET_OBJECT_NAME_STRING ); + for(TQObject *o = l->first(); o; o = l->next()) + (TQT_TQWIDGET(o))->setStyle( style ); delete l; } @@ -1222,7 +1222,7 @@ FormManager::editFormPixmapCollection() if(!activeForm() || !activeForm()->objectTree()) return; - PixmapCollectionEditor dialog(activeForm()->pixmapCollection(), activeForm()->widget()->topLevelWidget()); + PixmapCollectionEditor dialog(activeForm()->pixmapCollection(), activeForm()->widget()->tqtopLevelWidget()); dialog.exec(); } @@ -1234,7 +1234,7 @@ FormManager::editConnections() if(!activeForm() || !activeForm()->objectTree()) return; - ConnectionDialog dialog(activeForm()->widget()->topLevelWidget()); + ConnectionDialog dialog(activeForm()->widget()->tqtopLevelWidget()); dialog.exec(activeForm()); } @@ -1244,13 +1244,13 @@ FormManager::alignWidgets(int type) if(!activeForm() || !activeForm()->objectTree() || (activeForm()->selectedWidgets()->count() < 2)) return; - QWidget *parentWidget = activeForm()->selectedWidgets()->first()->parentWidget(); + TQWidget *tqparentWidget = activeForm()->selectedWidgets()->first()->tqparentWidget(); - for(QWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) + for(TQWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) { - if(w->parentWidget() != parentWidget) + if(w->tqparentWidget() != tqparentWidget) { - kdDebug() << "FormManager::alignWidgets() type ==" << type << " widgets don't have the same parent widget" << endl; + kdDebug() << "FormManager::alignWidgets() type ==" << type << " widgets don't have the same tqparent widget" << endl; return; } } @@ -1359,7 +1359,7 @@ FormManager::bringWidgetToFront() if(!activeForm() || !activeForm()->objectTree()) return; - for(QWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) + for(TQWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) w->raise(); } @@ -1369,7 +1369,7 @@ FormManager::sendWidgetToBack() if(!activeForm() || !activeForm()->objectTree()) return; - for(QWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) + for(TQWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) w->lower(); } @@ -1380,9 +1380,9 @@ FormManager::selectAll() return; activeForm()->selectFormWidget(); - uint count = activeForm()->objectTree()->children()->count(); - for(ObjectTreeItem *it = activeForm()->objectTree()->children()->first(); it; - it = activeForm()->objectTree()->children()->next(), count--) + uint count = activeForm()->objectTree()->tqchildren()->count(); + for(ObjectTreeItem *it = activeForm()->objectTree()->tqchildren()->first(); it; + it = activeForm()->objectTree()->tqchildren()->next(), count--) { activeForm()->setSelectedWidget(it->widget(), /*add*/true, /*raise*/false, /*moreWillBeSelected*/count>1); } @@ -1394,15 +1394,15 @@ FormManager::clearWidgetContent() if(!activeForm() || !activeForm()->objectTree()) return; - for(QWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) + for(TQWidget *w = activeForm()->selectedWidgets()->first(); w; w = activeForm()->selectedWidgets()->next()) activeForm()->library()->clearWidgetContent(w->className(), w); } void -FormManager::deleteWidgetLater( QWidget *w ) +FormManager::deleteWidgetLater( TQWidget *w ) { w->hide(); - w->reparent(0, WType_TopLevel, QPoint(0,0)); + w->reparent(0, WType_TopLevel, TQPoint(0,0)); m_deleteWidgetLater_list.append( w ); m_deleteWidgetLater_timer.start( 100, true ); } @@ -1420,7 +1420,7 @@ FormManager::showFormUICode() if(!activeForm()) return; - QString uiCode; + TQString uiCode; if (!FormIO::saveFormToString(activeForm(), uiCode, 3)) { //! @todo show err? return; @@ -1430,26 +1430,26 @@ FormManager::showFormUICode() m_uiCodeDialog = new KDialogBase(0, "uiwindow", true, i18n("Form's UI Code"), KDialogBase::Close, KDialogBase::Close); m_uiCodeDialog->resize(700, 600); - QVBox *box = m_uiCodeDialog->makeVBoxMainWidget(); + TQVBox *box = m_uiCodeDialog->makeVBoxMainWidget(); KTabWidget* tab = new KTabWidget(box); - m_currentUICodeDialogEditor = new KTextEdit(QString::null, QString::null, tab); + m_currentUICodeDialogEditor = new KTextEdit(TQString(), TQString(), tab); tab->addTab( m_currentUICodeDialogEditor, i18n("Current")); m_currentUICodeDialogEditor->setReadOnly(true); - QFont f( m_currentUICodeDialogEditor->font() ); + TQFont f( m_currentUICodeDialogEditor->font() ); f.setFamily("courier"); m_currentUICodeDialogEditor->setFont(f); - m_currentUICodeDialogEditor->setTextFormat(Qt::PlainText); + m_currentUICodeDialogEditor->setTextFormat(TQt::PlainText); - m_originalUICodeDialogEditor = new KTextEdit(QString::null, QString::null, tab); + m_originalUICodeDialogEditor = new KTextEdit(TQString(), TQString(), tab); tab->addTab( m_originalUICodeDialogEditor, i18n("Original")); m_originalUICodeDialogEditor->setReadOnly(true); m_originalUICodeDialogEditor->setFont(f); - m_originalUICodeDialogEditor->setTextFormat(Qt::PlainText); + m_originalUICodeDialogEditor->setTextFormat(TQt::PlainText); } m_currentUICodeDialogEditor->setText( uiCode ); //indent and set our original doc as well: - QDomDocument doc; + TQDomDocument doc; doc.setContent( activeForm()->m_recentlyLoadedUICode ); m_originalUICodeDialogEditor->setText( doc.toString( 3 ) ); m_uiCodeDialog->show(); @@ -1493,14 +1493,14 @@ FormManager::emitWidgetSelected( KFormDesigner::Form* form, bool multiple ) WidgetList *wlist = form->selectedWidgets(); bool fontEnabled = false; for (WidgetListIterator it(*wlist); it.current(); ++it) { - if (-1 != it.current()->metaObject()->findProperty("font", true)) { + if (-1 != it.current()->tqmetaObject()->tqfindProperty("font", true)) { fontEnabled = true; break; } } enableAction("format_font", fontEnabled); - // If the widgets selected is a container, we enable layout actions + // If the widgets selected is a container, we enable tqlayout actions bool containerSelected = false; if(!multiple) { @@ -1512,16 +1512,16 @@ FormManager::emitWidgetSelected( KFormDesigner::Form* form, bool multiple ) } const bool twoSelected = form->selectedWidgets()->count()==2; // Layout actions - enableAction("layout_menu", multiple || containerSelected); - enableAction("layout_hbox", multiple || containerSelected); - enableAction("layout_vbox", multiple || containerSelected); - enableAction("layout_grid", multiple || containerSelected); - enableAction("layout_hsplitter", twoSelected); - enableAction("layout_vsplitter", twoSelected); + enableAction("tqlayout_menu", multiple || containerSelected); + enableAction("tqlayout_hbox", multiple || containerSelected); + enableAction("tqlayout_vbox", multiple || containerSelected); + enableAction("tqlayout_grid", multiple || containerSelected); + enableAction("tqlayout_hsplitter", twoSelected); + enableAction("tqlayout_vsplitter", twoSelected); KFormDesigner::Container *container = activeForm() ? activeForm()->activeContainer() : 0; if (container) - enableAction("break_layout", (container->layoutType() != KFormDesigner::Container::NoLayout)); + enableAction("break_layout", (container->tqlayoutType() != KFormDesigner::Container::NoLayout)); emit widgetSelected(form, true); } @@ -1550,16 +1550,16 @@ FormManager::emitFormWidgetSelected( KFormDesigner::Form* form ) enableFormActions(); const bool twoSelected = form->selectedWidgets()->count()==2; - const bool hasChildren = !form->objectTree()->children()->isEmpty(); + const bool hasChildren = !form->objectTree()->tqchildren()->isEmpty(); // Layout actions - enableAction("layout_menu", hasChildren); - enableAction("layout_hbox", hasChildren); - enableAction("layout_vbox", hasChildren); - enableAction("layout_grid", hasChildren); - enableAction("layout_hsplitter", twoSelected); - enableAction("layout_vsplitter", twoSelected); - enableAction("break_layout", (form->toplevelContainer()->layoutType() != KFormDesigner::Container::NoLayout)); + enableAction("tqlayout_menu", hasChildren); + enableAction("tqlayout_hbox", hasChildren); + enableAction("tqlayout_vbox", hasChildren); + enableAction("tqlayout_grid", hasChildren); + enableAction("tqlayout_hsplitter", twoSelected); + enableAction("tqlayout_vsplitter", twoSelected); + enableAction("break_layout", (form->toplevelContainer()->tqlayoutType() != KFormDesigner::Container::NoLayout)); emit formWidgetSelected( form ); } @@ -1631,24 +1631,24 @@ FormManager::disableWidgetActions() enableAction("format_raise", false); enableAction("format_lower", false); - enableAction("layout_menu", false); - enableAction("layout_hbox", false); - enableAction("layout_vbox", false); - enableAction("layout_grid", false); - enableAction("layout_hsplitter", false); - enableAction("layout_vsplitter", false); + enableAction("tqlayout_menu", false); + enableAction("tqlayout_hbox", false); + enableAction("tqlayout_vbox", false); + enableAction("tqlayout_grid", false); + enableAction("tqlayout_hsplitter", false); + enableAction("tqlayout_vsplitter", false); enableAction("break_layout", false); } void -FormManager::emitUndoEnabled(bool enabled, const QString &text) +FormManager::emitUndoEnabled(bool enabled, const TQString &text) { enableAction("edit_undo", enabled); emit undoEnabled(enabled, text); } void -FormManager::emitRedoEnabled(bool enabled, const QString &text) +FormManager::emitRedoEnabled(bool enabled, const TQString &text) { enableAction("edit_redo", enabled); emit redoEnabled(enabled, text); @@ -1661,8 +1661,8 @@ FormManager::changeFont() return; WidgetList *wlist = m_active->selectedWidgets(); WidgetList widgetsWithFontProperty; - QWidget *widget; - QFont font; + TQWidget *widget; + TQFont font; bool oneFontSelected = true; for (WidgetListIterator it(*wlist); (widget = it.current()); ++it) { if (m_active->library()->isPropertyVisible(widget->className(), widget, "font")) { @@ -1684,19 +1684,19 @@ FormManager::changeFont() //single widget's settings widget = widgetsWithFontProperty.first(); KoProperty::Property &fontProp = m_propSet->property("font"); - if (QDialog::Accepted != KFontDialog::getFont(font, false, m_active->widget())) + if (TQDialog::Accepted != KFontDialog::getFont(font, false, m_active->widget())) return; fontProp = font; return; } //multiple widgets int diffFlags=0; - if (QDialog::Accepted != KFontDialog::getFontDiff(font, diffFlags, false, m_active->widget()) + if (TQDialog::Accepted != KFontDialog::getFontDiff(font, diffFlags, false, m_active->widget()) || 0==diffFlags) return; //update font for (WidgetListIterator it(widgetsWithFontProperty); (widget = it.current()); ++it) { - QFont prevFont( widget->font() ); + TQFont prevFont( widget->font() ); if (diffFlags & KFontChooser::FontDiffFamily) prevFont.setFamily( font.family() ); if (diffFlags & KFontChooser::FontDiffStyle) { |