diff options
Diffstat (limited to 'kommander/factory/kommanderfactory.cpp')
-rw-r--r-- | kommander/factory/kommanderfactory.cpp | 888 |
1 files changed, 444 insertions, 444 deletions
diff --git a/kommander/factory/kommanderfactory.cpp b/kommander/factory/kommanderfactory.cpp index f3078830..3add83ae 100644 --- a/kommander/factory/kommanderfactory.cpp +++ b/kommander/factory/kommanderfactory.cpp @@ -26,71 +26,71 @@ #include <kommanderplugin.h> -#include <qfeatures.h> +#include <tqfeatures.h> #include "config.h" #ifndef QT_NO_SQL #include "database2.h" #endif -#include <qdom.h> -#include <qdir.h> -#include <qlayout.h> -#include <qmetaobject.h> +#include <tqdom.h> +#include <tqdir.h> +#include <tqlayout.h> +#include <tqmetaobject.h> #include "domtool.h" -#include <qapplication.h> -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qobjectlist.h> +#include <tqapplication.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqobjectlist.h> #include <private/qpluginmanager_p.h> -#include <qmime.h> -#include <qdragobject.h> +#include <tqmime.h> +#include <tqdragobject.h> #include <zlib.h> #ifndef QT_NO_SQL -#include <qsqlrecord.h> -#include <qsqldatabase.h> -#include <qdatatable.h> +#include <tqsqlrecord.h> +#include <tqsqldatabase.h> +#include <tqdatatable.h> #endif // include all Qt widgets we support -#include <qpushbutton.h> -#include <qtoolbutton.h> -#include <qcheckbox.h> -#include <qradiobutton.h> -#include <qgroupbox.h> -#include <qbuttongroup.h> -#include <qiconview.h> -#include <qheader.h> +#include <tqpushbutton.h> +#include <tqtoolbutton.h> +#include <tqcheckbox.h> +#include <tqradiobutton.h> +#include <tqgroupbox.h> +#include <tqbuttongroup.h> +#include <tqiconview.h> +#include <tqheader.h> #ifndef QT_NO_TABLE -#include <qtable.h> +#include <tqtable.h> #endif -#include <qlistbox.h> -#include <qlistview.h> -#include <qlineedit.h> -#include <qspinbox.h> -#include <qmultilineedit.h> -#include <qlabel.h> -#include <qwidget.h> -#include <qtabwidget.h> -#include <qcombobox.h> -#include <qdialog.h> -#include <qwizard.h> -#include <qlcdnumber.h> -#include <qprogressbar.h> -#include <qtextview.h> -#include <qtextbrowser.h> -#include <qdial.h> -#include <qslider.h> -#include <qframe.h> -#include <qwidgetstack.h> -#include <qtextedit.h> -#include <qscrollbar.h> -#include <qmainwindow.h> -#include <qsplitter.h> -#include <qaction.h> -#include <qpopupmenu.h> -#include <qmenubar.h> -#include <qdatetimeedit.h> -#include <qtoolbox.h> +#include <tqlistbox.h> +#include <tqlistview.h> +#include <tqlineedit.h> +#include <tqspinbox.h> +#include <tqmultilineedit.h> +#include <tqlabel.h> +#include <tqwidget.h> +#include <tqtabwidget.h> +#include <tqcombobox.h> +#include <tqdialog.h> +#include <tqwizard.h> +#include <tqlcdnumber.h> +#include <tqprogressbar.h> +#include <tqtextview.h> +#include <tqtextbrowser.h> +#include <tqdial.h> +#include <tqslider.h> +#include <tqframe.h> +#include <tqwidgetstack.h> +#include <tqtextedit.h> +#include <tqscrollbar.h> +#include <tqmainwindow.h> +#include <tqsplitter.h> +#include <tqaction.h> +#include <tqpopupmenu.h> +#include <tqmenubar.h> +#include <tqdatetimeedit.h> +#include <tqtoolbox.h> #include <stdlib.h> #include <kglobal.h> @@ -98,14 +98,14 @@ #include "kmdrmainwindow.h" -QPtrList<KommanderPlugin> widgetPlugins; +TQPtrList<KommanderPlugin> widgetPlugins; -QMap<QWidget*, QString> *qwf_functions = 0; -QMap<QWidget*, QString> *qwf_forms = 0; -QString *qwf_language = 0; +TQMap<TQWidget*, TQString> *qwf_functions = 0; +TQMap<TQWidget*, TQString> *qwf_forms = 0; +TQString *qwf_language = 0; bool qwf_execute_code = true; bool qwf_stays_on_top = false; -QString *qwf_currFileName = 0L; //is this really used? +TQString *qwf_currFileName = 0L; //is this really used? KommanderFactory::KommanderFactory() : dbControls( 0 ), usePixmapCollection( false ) @@ -114,7 +114,7 @@ KommanderFactory::KommanderFactory() defSpacing = 6; defMargin = 11; if (!qwf_currFileName) - qwf_currFileName = new QString(); + qwf_currFileName = new TQString(); } KommanderFactory::~KommanderFactory() @@ -123,33 +123,33 @@ KommanderFactory::~KommanderFactory() qwf_currFileName = 0L; } -QWidget *KommanderFactory::create( const QString &uiFile, QObject *connector, QWidget *parent, const char *name ) +TQWidget *KommanderFactory::create( const TQString &uiFile, TQObject *connector, TQWidget *parent, const char *name ) { - QFile f( uiFile ); + TQFile f( uiFile ); if ( !f.open( IO_ReadOnly ) ) return 0; if (!qwf_currFileName) - qwf_currFileName = new QString(); + qwf_currFileName = new TQString(); *qwf_currFileName = uiFile; - QWidget *w = KommanderFactory::create( &f, connector, parent, name ); + TQWidget *w = KommanderFactory::create( &f, connector, parent, name ); if ( !qwf_forms ) - qwf_forms = new QMap<QWidget*, QString>; + qwf_forms = new TQMap<TQWidget*, TQString>; qwf_forms->insert( w, uiFile ); return w; } -QWidget *KommanderFactory::create( QIODevice *dev, QObject *connector, QWidget *parent, const char *name ) +TQWidget *KommanderFactory::create( TQIODevice *dev, TQObject *connector, TQWidget *parent, const char *name ) { - QDomDocument doc; - QString errMsg; + TQDomDocument doc; + TQString errMsg; int errLine; - QTextStream stream(dev); - QString content = stream.read(); + TQTextStream stream(dev); + TQString content = stream.read(); if (content.startsWith("#!")) content = content.mid(content.find('\n')); if ( !doc.setContent( content ) ) { -// qDebug( QString("Parse error: ") + errMsg + QString(" in line %d"), errLine ); +// qDebug( TQString("Parse error: ") + errMsg + TQString(" in line %d"), errLine ); return 0; } @@ -158,45 +158,45 @@ QWidget *KommanderFactory::create( QIODevice *dev, QObject *connector, QWidget * KommanderFactory *widgetFactory = new KommanderFactory; widgetFactory->toplevel = 0; - QDomElement e = doc.firstChild().toElement().firstChild().toElement(); + TQDomElement e = doc.firstChild().toElement().firstChild().toElement(); - QDomElement variables = e; + TQDomElement variables = e; while ( variables.tagName() != "variables" && !variables.isNull() ) variables = variables.nextSibling().toElement(); - QDomElement eltSlots = e; + TQDomElement eltSlots = e; while ( eltSlots.tagName() != "slots" && !eltSlots.isNull() ) eltSlots = eltSlots.nextSibling().toElement(); - QDomElement connections = e; + TQDomElement connections = e; while ( connections.tagName() != "connections" && !connections.isNull() ) connections = connections.nextSibling().toElement(); - QDomElement imageCollection = e; + TQDomElement imageCollection = e; while ( imageCollection.tagName() != "images" && !imageCollection.isNull() ) imageCollection = imageCollection.nextSibling().toElement(); - QDomElement tabOrder = e; + TQDomElement tabOrder = e; while ( tabOrder.tagName() != "tabstops" && !tabOrder.isNull() ) tabOrder = tabOrder.nextSibling().toElement(); - QDomElement actions = e; + TQDomElement actions = e; while ( actions.tagName() != "actions" && !actions.isNull() ) actions = actions.nextSibling().toElement(); - QDomElement toolbars = e; + TQDomElement toolbars = e; while ( toolbars.tagName() != "toolbars" && !toolbars.isNull() ) toolbars = toolbars.nextSibling().toElement(); - QDomElement menubar = e; + TQDomElement menubar = e; while ( menubar.tagName() != "menubar" && !menubar.isNull() ) menubar = menubar.nextSibling().toElement(); - QDomElement functions = e; + TQDomElement functions = e; while ( functions.tagName() != "functions" && !functions.isNull() ) functions = functions.nextSibling().toElement(); - QDomElement widget; + TQDomElement widget; while ( !e.isNull() ) { if ( e.tagName() == "widget" ) { widget = e; @@ -205,8 +205,8 @@ QWidget *KommanderFactory::create( QIODevice *dev, QObject *connector, QWidget * } else if ( e.tagName() == "pixmapinproject" ) { widgetFactory->usePixmapCollection = true; } else if ( e.tagName() == "layoutdefaults" ) { - widgetFactory->defSpacing = e.attribute( "spacing", QString::number( widgetFactory->defSpacing ) ).toInt(); - widgetFactory->defMargin = e.attribute( "margin", QString::number( widgetFactory->defMargin ) ).toInt(); + widgetFactory->defSpacing = e.attribute( "spacing", TQString::number( widgetFactory->defSpacing ) ).toInt(); + widgetFactory->defMargin = e.attribute( "margin", TQString::number( widgetFactory->defMargin ) ).toInt(); } e = e.nextSibling().toElement(); } @@ -214,22 +214,22 @@ QWidget *KommanderFactory::create( QIODevice *dev, QObject *connector, QWidget * if ( !imageCollection.isNull() ) widgetFactory->loadImageCollection( imageCollection ); - widgetFactory->createWidgetInternal( widget, parent, 0, widget.attribute("class", "QWidget") ); - QWidget *w = widgetFactory->toplevel; + widgetFactory->createWidgetInternal( widget, parent, 0, widget.attribute("class", "TQWidget") ); + TQWidget *w = widgetFactory->toplevel; if ( !w ) { delete widgetFactory; return 0; } if ( !variables.isNull() ) { - for ( QDomElement n = variables.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) + for ( TQDomElement n = variables.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) if ( n.tagName() == "variable" ) widgetFactory->variables << n.firstChild().toText().data(); } if ( !eltSlots.isNull() ) { - for ( QDomElement n = eltSlots.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) + for ( TQDomElement n = eltSlots.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) if ( n.tagName() == "slot" ) { - QString s = n.firstChild().toText().data(); + TQString s = n.firstChild().toText().data(); widgetFactory->languageSlots.insert( s.left( s.find( "(" ) ) , n.attribute( "language", "C++" ) ); } } @@ -252,7 +252,7 @@ QWidget *KommanderFactory::create( QIODevice *dev, QObject *connector, QWidget * if ( widgetFactory->toplevel ) { #ifndef QT_NO_SQL - QMap<QWidget*, SqlWidgetConnection>::Iterator cit = widgetFactory->sqlWidgetConnections.begin(); + TQMap<TQWidget*, SqlWidgetConnection>::Iterator cit = widgetFactory->sqlWidgetConnections.begin(); for( ; cit != widgetFactory->sqlWidgetConnections.end(); ++cit ) { if ( widgetFactory->noDatabaseWidgets.find( cit.key()->name() ) != widgetFactory->noDatabaseWidgets.end() ) continue; @@ -262,42 +262,42 @@ QWidget *KommanderFactory::create( QIODevice *dev, QObject *connector, QWidget * ( (QDesignerDataView2*)cit.key() )->initPreview( (*cit).conn, (*cit).table, cit.key(), *(*cit).dbControls ); } - for ( QMap<QString, QStringList>::Iterator it = widgetFactory->dbTables.begin(); it != widgetFactory->dbTables.end(); ++it ) { - QDataTable *table = (QDataTable*)widgetFactory->toplevel->child( it.key(), "QDataTable" ); + for ( TQMap<TQString, TQStringList>::Iterator it = widgetFactory->dbTables.begin(); it != widgetFactory->dbTables.end(); ++it ) { + TQDataTable *table = (TQDataTable*)widgetFactory->toplevel->child( it.key(), "TQDataTable" ); if ( !table ) continue; if ( widgetFactory->noDatabaseWidgets.find( table->name() ) != widgetFactory->noDatabaseWidgets.end() ) continue; - QValueList<Field> fieldMap = *widgetFactory->fieldMaps.find( table ); - QString conn = (*it)[ 0 ]; - QSqlCursor* c = 0; - QSqlDatabase *db = 0; + TQValueList<Field> fieldMap = *widgetFactory->fieldMaps.find( table ); + TQString conn = (*it)[ 0 ]; + TQSqlCursor* c = 0; + TQSqlDatabase *db = 0; if ( conn.isEmpty() || conn == "(default)" ) { - db = QSqlDatabase::database(); - c = new QSqlCursor( (*it)[ 1 ] ); + db = TQSqlDatabase::database(); + c = new TQSqlCursor( (*it)[ 1 ] ); } else { - db = QSqlDatabase::database( conn ); - c = new QSqlCursor( (*it)[ 1 ], true, db ); + db = TQSqlDatabase::database( conn ); + c = new TQSqlCursor( (*it)[ 1 ], true, db ); } if ( db ) { table->setSqlCursor( c, fieldMap.isEmpty(), true ); - table->refresh( QDataTable::RefreshAll ); + table->refresh( TQDataTable::RefreshAll ); } } #endif } - for ( QMap<QString, QString>::Iterator it = widgetFactory->buddies.begin(); it != widgetFactory->buddies.end(); ++it ) { - QLabel *label = (QLabel*)widgetFactory->toplevel->child( it.key(), "QLabel" ); - QWidget *buddy = (QWidget*)widgetFactory->toplevel->child( *it, "QWidget" ); + for ( TQMap<TQString, TQString>::Iterator it = widgetFactory->buddies.begin(); it != widgetFactory->buddies.end(); ++it ) { + TQLabel *label = (TQLabel*)widgetFactory->toplevel->child( it.key(), "TQLabel" ); + TQWidget *buddy = (TQWidget*)widgetFactory->toplevel->child( *it, "TQWidget" ); if ( label && buddy ) label->setBuddy( buddy ); } delete widgetFactory; - QApplication::sendPostedEvents(); + TQApplication::sendPostedEvents(); return w; } @@ -307,121 +307,121 @@ void KommanderFactory::addPlugin( KommanderPlugin *plugin ) widgetPlugins.append( plugin ); } -QWidget *KommanderFactory::createWidget( const QString &literalClassName, QWidget *parent, const char *name ) +TQWidget *KommanderFactory::createWidget( const TQString &literalClassName, TQWidget *parent, const char *name ) { - QString className = literalClassName; + TQString className = literalClassName; // create widgets we know - if (className == "QPushButton") - return new QPushButton(parent, name); - else if (className == "QToolButton") - return new QToolButton(parent, name); - else if (className == "QCheckBox") - return new QCheckBox(parent, name); - else if (className == "QRadioButton") - return new QRadioButton(parent, name); - else if (className == "QGroupBox") - return new QGroupBox(parent, name); - else if (className == "QButtonGroup") - return new QButtonGroup(parent, name); - else if (className == "QIconView") + if (className == "TQPushButton") + return new TQPushButton(parent, name); + else if (className == "TQToolButton") + return new TQToolButton(parent, name); + else if (className == "TQCheckBox") + return new TQCheckBox(parent, name); + else if (className == "TQRadioButton") + return new TQRadioButton(parent, name); + else if (className == "TQGroupBox") + return new TQGroupBox(parent, name); + else if (className == "TQButtonGroup") + return new TQButtonGroup(parent, name); + else if (className == "TQIconView") { #if !defined(QT_NO_ICONVIEW) - return new QIconView(parent, name); + return new TQIconView(parent, name); #endif } - else if (className == "QTable") + else if (className == "TQTable") { #if !defined(QT_NO_TABLE) - return new QTable(parent, name); + return new TQTable(parent, name); #endif } - else if (className == "QListBox") - return new QListBox(parent, name); - else if (className == "QListView") - return new QListView(parent, name); - else if (className == "QLineEdit") - return new QLineEdit(parent, name); - else if (className == "QSpinBox") - return new QSpinBox(parent, name); - else if (className == "QMultiLineEdit") - return new QMultiLineEdit(parent, name); - else if (className == "QLabel") - return new QLabel(parent, name); + else if (className == "TQListBox") + return new TQListBox(parent, name); + else if (className == "TQListView") + return new TQListView(parent, name); + else if (className == "TQLineEdit") + return new TQLineEdit(parent, name); + else if (className == "TQSpinBox") + return new TQSpinBox(parent, name); + else if (className == "TQMultiLineEdit") + return new TQMultiLineEdit(parent, name); + else if (className == "TQLabel") + return new TQLabel(parent, name); else if (className == "QLayoutWidget") - return new QWidget(parent, name); - else if (className == "QTabWidget") - return new QTabWidget(parent, name); - else if (className == "QComboBox") - return new QComboBox(false, parent, name); - else if (className == "QWidget") + return new TQWidget(parent, name); + else if (className == "TQTabWidget") + return new TQTabWidget(parent, name); + else if (className == "TQComboBox") + return new TQComboBox(false, parent, name); + else if (className == "TQWidget") { if (!qwf_stays_on_top) - return new QWidget(parent, name); - return new QWidget(parent, name, Qt::WStyle_StaysOnTop); + return new TQWidget(parent, name); + return new TQWidget(parent, name, Qt::WStyle_StaysOnTop); } - else if (className == "QDialog") + else if (className == "TQDialog") { if (!qwf_stays_on_top) - return new QDialog(parent, name); - return new QDialog(parent, name, false, Qt::WStyle_StaysOnTop); + return new TQDialog(parent, name); + return new TQDialog(parent, name, false, Qt::WStyle_StaysOnTop); } - else if (className == "QWizard") - return new QWizard(parent, name); - else if (className == "QLCDNumber") - return new QLCDNumber(parent, name); - else if (className == "QProgressBar") - return new QProgressBar(parent, name); - else if (className == "QTextView") - return new QTextView(parent, name); - else if (className == "QTextBrowser") - return new QTextBrowser(parent, name); - else if (className == "QDial") - return new QDial(parent, name); - else if (className == "QSlider") - return new QSlider(parent, name); - else if (className == "QFrame") - return new QFrame(parent, name); - else if (className == "QSplitter") - return new QSplitter(parent, name); + else if (className == "TQWizard") + return new TQWizard(parent, name); + else if (className == "TQLCDNumber") + return new TQLCDNumber(parent, name); + else if (className == "TQProgressBar") + return new TQProgressBar(parent, name); + else if (className == "TQTextView") + return new TQTextView(parent, name); + else if (className == "TQTextBrowser") + return new TQTextBrowser(parent, name); + else if (className == "TQDial") + return new TQDial(parent, name); + else if (className == "TQSlider") + return new TQSlider(parent, name); + else if (className == "TQFrame") + return new TQFrame(parent, name); + else if (className == "TQSplitter") + return new TQSplitter(parent, name); else if (className == "Line") { - QFrame *f = new QFrame(parent, name); - f->setFrameStyle(QFrame::HLine | QFrame::Sunken); + TQFrame *f = new TQFrame(parent, name); + f->setFrameStyle(TQFrame::HLine | TQFrame::Sunken); return f; } - else if (className == "QTextEdit") - return new QTextEdit(parent, name); + else if (className == "TQTextEdit") + return new TQTextEdit(parent, name); else if (className == "QDateEdit") return new QDateEdit(parent, name); else if (className == "QTimeEdit") return new QTimeEdit(parent, name); else if (className == "QDateTimeEdit") return new QDateTimeEdit(parent, name); - else if (className == "QScrollBar") - return new QScrollBar(parent, name); - else if (className == "QPopupMenu") - return new QPopupMenu(parent, name); - else if (className == "QWidgetStack") - return new QWidgetStack(parent, name); - else if (className == "QMainWindow") + else if (className == "TQScrollBar") + return new TQScrollBar(parent, name); + else if (className == "TQPopupMenu") + return new TQPopupMenu(parent, name); + else if (className == "TQWidgetStack") + return new TQWidgetStack(parent, name); + else if (className == "TQMainWindow") { - QMainWindow *mw = 0; + TQMainWindow *mw = 0; if (!qwf_stays_on_top) mw = new KmdrMainWindow(parent, name); else mw = new KmdrMainWindow(parent, name, Qt::WType_TopLevel | Qt::WStyle_StaysOnTop); - mw->setCentralWidget(new QWidget(mw, "qt_central_widget")); + mw->setCentralWidget(new TQWidget(mw, "qt_central_widget")); mw->centralWidget()->show(); (void) mw->statusBar(); return mw; } #if !defined(QT_NO_SQL) - else if (className == "QDataTable") - return new QDataTable(parent, name); - else if (className == "QDataBrowser") + else if (className == "TQDataTable") + return new TQDataTable(parent, name); + else if (className == "TQDataBrowser") return new QDesignerDataBrowser2(parent, name); - else if (className == "QDataView") + else if (className == "TQDataView") return new QDesignerDataView2(parent, name); #endif @@ -429,7 +429,7 @@ QWidget *KommanderFactory::createWidget( const QString &literalClassName, QWidge //find the widget plugin which can create className for (KommanderPlugin * p = widgetPlugins.first(); p; p = widgetPlugins.next()) { - QWidget *w = p->create(className, parent, name); + TQWidget *w = p->create(className, parent, name); if (w) return w; } @@ -447,9 +447,9 @@ int KommanderFactory::loadPlugins(bool force) num_plugins_loaded = 0; KConfig cfg("kommanderrc", true); - QStringList plugins = "libkommanderwidgets"; + TQStringList plugins = "libkommanderwidgets"; plugins += cfg.readListEntry("plugins"); - QStringList::Iterator it; + TQStringList::Iterator it; KLibLoader *f = KLibLoader::self(); for (it = plugins.begin(); it != plugins.end(); ++it) { @@ -482,11 +482,11 @@ FeatureList KommanderFactory::featureList() FeatureList features; for ( KommanderPlugin *p = widgetPlugins.first(); p ; p = widgetPlugins.next() ) { - QStringList widgets = p->widgets(); - QStringList::Iterator it; + TQStringList widgets = p->widgets(); + TQStringList::Iterator it; for( it = widgets.begin() ; it != widgets.end() ; ++it ) { - QString wn = *it; + TQString wn = *it; features[wn] = KommanderWidgetInfo( p->group(wn), p->toolTip(wn),p->iconSet(wn), p->whatsThis(wn), p->isContainer(wn) ); } } @@ -494,14 +494,14 @@ FeatureList KommanderFactory::featureList() //iterate through widgetPlugins, appending KommanderPlugin::widgets() to features } -QWidget *KommanderFactory::createWidgetInternal( const QDomElement &e, QWidget *parent, QLayout* layout, const QString &classNameArg ) +TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidget *parent, TQLayout* layout, const TQString &classNameArg ) { lastItem = 0; - QDomElement n = e.firstChild().toElement(); - QWidget *w = 0; // the widget that got created - QObject *obj = 0; // gets the properties + TQDomElement n = e.firstChild().toElement(); + TQWidget *w = 0; // the widget that got created + TQObject *obj = 0; // gets the properties - QString className = classNameArg; + TQString className = classNameArg; int row = e.attribute( "row" ).toInt(); int col = e.attribute( "column" ).toInt(); @@ -513,7 +513,7 @@ QWidget *KommanderFactory::createWidgetInternal( const QDomElement &e, QWidget * colspan = 1; if ( !className.isEmpty() ) { if ( !layout && className == "QLayoutWidget" ) - className = "QWidget"; + className = "TQWidget"; if ( layout && className == "QLayoutWidget" ) { // hide layout widgets w = parent; @@ -523,21 +523,21 @@ QWidget *KommanderFactory::createWidgetInternal( const QDomElement &e, QWidget * { return 0; } - w = (QWidget*)obj; + w = (TQWidget*)obj; if ( !toplevel ) toplevel = w; - if ( w->inherits( "QMainWindow" ) ) - w = ( (QMainWindow*)w )->centralWidget(); + if ( w->inherits( "TQMainWindow" ) ) + w = ( (TQMainWindow*)w )->centralWidget(); if ( layout ) { switch( layoutType( layout ) ) { case HBox: - ( (QHBoxLayout*)layout )->addWidget( w ); + ( (TQHBoxLayout*)layout )->addWidget( w ); break; case VBox: - ( (QVBoxLayout*)layout )->addWidget( w ); + ( (TQVBoxLayout*)layout )->addWidget( w ); break; case Grid: - ( (QGridLayout*)layout )->addMultiCellWidget( w, row, row + rowspan - 1, + ( (TQGridLayout*)layout )->addMultiCellWidget( w, row, row + rowspan - 1, col, col + colspan - 1 ); break; default: @@ -555,57 +555,57 @@ QWidget *KommanderFactory::createWidgetInternal( const QDomElement &e, QWidget * if ( n.tagName() == "spacer" ) { createSpacer( n, layout ); } else if ( n.tagName() == "widget" ) { - QMap< QString, QString> *oldDbControls = dbControls; - createWidgetInternal( n, w, layout, n.attribute( "class", "QWidget" ) ); + TQMap< TQString, TQString> *oldDbControls = dbControls; + createWidgetInternal( n, w, layout, n.attribute( "class", "TQWidget" ) ); dbControls = oldDbControls; } else if ( n.tagName() == "hbox" ) { - QLayout *parentLayout = layout; - if ( layout && layout->inherits( "QGridLayout" ) ) + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( "TQGridLayout" ) ) layout = createLayout( 0, 0, KommanderFactory::HBox ); else layout = createLayout( w, layout, KommanderFactory::HBox ); obj = layout; n = n.firstChild().toElement(); - if ( parentLayout && parentLayout->inherits( "QGridLayout" ) ) - ( (QGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); + if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) ) + ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); continue; } else if ( n.tagName() == "grid" ) { - QLayout *parentLayout = layout; - if ( layout && layout->inherits( "QGridLayout" ) ) + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( "TQGridLayout" ) ) layout = createLayout( 0, 0, KommanderFactory::Grid ); else layout = createLayout( w, layout, KommanderFactory::Grid ); obj = layout; n = n.firstChild().toElement(); - if ( parentLayout && parentLayout->inherits( "QGridLayout" ) ) - ( (QGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); + if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) ) + ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); continue; } else if ( n.tagName() == "vbox" ) { - QLayout *parentLayout = layout; - if ( layout && layout->inherits( "QGridLayout" ) ) + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( "TQGridLayout" ) ) layout = createLayout( 0, 0, KommanderFactory::VBox ); else layout = createLayout( w, layout, KommanderFactory::VBox ); obj = layout; n = n.firstChild().toElement(); - if ( parentLayout && parentLayout->inherits( "QGridLayout" ) ) - ( (QGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); + if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) ) + ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); continue; } else if ( n.tagName() == "property" && obj ) { setProperty( obj, n.attribute( "name" ), n.firstChild().toElement() ); } else if ( n.tagName() == "attribute" && w ) { - QString attrib = n.attribute( "name" ); - QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); - if ( parent->inherits( "QTabWidget" ) ) { + TQString attrib = n.attribute( "name" ); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); + if ( parent->inherits( "TQTabWidget" ) ) { if ( attrib == "title" ) - ( (QTabWidget*)parent )->insertTab( w, translate(v.toString()) ); + ( (TQTabWidget*)parent )->insertTab( w, translate(v.toString()) ); } else - if ( parent->inherits( "QToolBox" ) ) { + if ( parent->inherits( "TQToolBox" ) ) { if ( attrib == "label" ) - ( (QToolBox*)parent )->addItem( w, translate(v.toString()) ); - }else if ( parent->inherits( "QWizard" ) ) { + ( (TQToolBox*)parent )->addItem( w, translate(v.toString()) ); + }else if ( parent->inherits( "TQWizard" ) ) { if ( attrib == "title" ) - ( (QWizard*)parent )->addPage( w, translate(v.toString()) ); + ( (TQWizard*)parent )->addPage( w, translate(v.toString()) ); } } else if ( n.tagName() == "item" ) { createItem( n, w ); @@ -619,39 +619,39 @@ QWidget *KommanderFactory::createWidgetInternal( const QDomElement &e, QWidget * return w; } -QLayout *KommanderFactory::createLayout( QWidget *widget, QLayout* layout, LayoutType type ) +TQLayout *KommanderFactory::createLayout( TQWidget *widget, TQLayout* layout, LayoutType type ) { int spacing = defSpacing; int margin = defMargin; - if ( !layout && widget && widget->inherits( "QTabWidget" ) ) - widget = ((QTabWidget*)widget)->currentPage(); - if ( !layout && widget && widget->inherits( "QToolBox" ) ) - widget = ((QToolBox*)widget)->currentItem(); + if ( !layout && widget && widget->inherits( "TQTabWidget" ) ) + widget = ((TQTabWidget*)widget)->currentPage(); + if ( !layout && widget && widget->inherits( "TQToolBox" ) ) + widget = ((TQToolBox*)widget)->currentItem(); - if ( !layout && widget && widget->inherits( "QWizard" ) ) - widget = ((QWizard*)widget)->currentPage(); + if ( !layout && widget && widget->inherits( "TQWizard" ) ) + widget = ((TQWizard*)widget)->currentPage(); - if ( !layout && widget && widget->inherits( "QWidgetStack" ) ) - widget = ((QWidgetStack*)widget)->visibleWidget(); + if ( !layout && widget && widget->inherits( "TQWidgetStack" ) ) + widget = ((TQWidgetStack*)widget)->visibleWidget(); - if ( !layout && widget && widget->inherits( "QGroupBox" ) ) { - QGroupBox *gb = (QGroupBox*)widget; + if ( !layout && widget && widget->inherits( "TQGroupBox" ) ) { + TQGroupBox *gb = (TQGroupBox*)widget; gb->setColumnLayout( 0, Qt::Vertical ); gb->layout()->setMargin( 0 ); gb->layout()->setSpacing( 0 ); - QLayout *l; + TQLayout *l; switch ( type ) { case HBox: - l = new QHBoxLayout( gb->layout() ); + l = new TQHBoxLayout( gb->layout() ); l->setAlignment( Qt::AlignTop ); return l; case VBox: - l = new QVBoxLayout( gb->layout(), spacing ); + l = new TQVBoxLayout( gb->layout(), spacing ); l->setAlignment( Qt::AlignTop ); return l; case Grid: - l = new QGridLayout( gb->layout() ); + l = new TQGridLayout( gb->layout() ); l->setAlignment( Qt::AlignTop ); return l; default: @@ -659,20 +659,20 @@ QLayout *KommanderFactory::createLayout( QWidget *widget, QLayout* layout, Layo } } else { if ( layout ) { - QLayout *l; + TQLayout *l; switch ( type ) { case HBox: - l = new QHBoxLayout( layout ); + l = new TQHBoxLayout( layout ); l->setSpacing( spacing ); l->setMargin( margin ); return l; case VBox: - l = new QVBoxLayout( layout ); + l = new TQVBoxLayout( layout ); l->setSpacing( spacing ); l->setMargin( margin ); return l; case Grid: { - l = new QGridLayout( layout ); + l = new TQGridLayout( layout ); l->setSpacing( spacing ); l->setMargin( margin ); return l; @@ -681,24 +681,24 @@ QLayout *KommanderFactory::createLayout( QWidget *widget, QLayout* layout, Layo return 0; } } else { - QLayout *l; + TQLayout *l; switch ( type ) { case HBox: - l = new QHBoxLayout( widget ); + l = new TQHBoxLayout( widget ); if ( !widget ) { l->setMargin( margin ); l->setSpacing( spacing ); } return l; case VBox: - l = new QVBoxLayout( widget ); + l = new TQVBoxLayout( widget ); if ( !widget ) { l->setMargin( margin ); l->setSpacing( spacing ); } return l; case Grid: { - l = new QGridLayout( widget ); + l = new TQGridLayout( widget ); if ( !widget ) { l->setMargin( margin ); l->setSpacing( spacing ); @@ -712,61 +712,61 @@ QLayout *KommanderFactory::createLayout( QWidget *widget, QLayout* layout, Layo } } -KommanderFactory::LayoutType KommanderFactory::layoutType( QLayout *layout ) const +KommanderFactory::LayoutType KommanderFactory::layoutType( TQLayout *layout ) const { - if ( layout->inherits( "QHBoxLayout" ) ) + if ( layout->inherits( "TQHBoxLayout" ) ) return HBox; - else if ( layout->inherits( "QVBoxLayout" ) ) + else if ( layout->inherits( "TQVBoxLayout" ) ) return VBox; - else if ( layout->inherits( "QGridLayout" ) ) + else if ( layout->inherits( "TQGridLayout" ) ) return Grid; return NoLayout; } -void KommanderFactory::setProperty( QObject* obj, const QString &prop, const QDomElement &e ) +void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const TQDomElement &e ) { - const QMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, true ), true ); + const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, true ), true ); - QVariant defVariant; + TQVariant defVariant; if ( e.tagName() == "font" ) { - QFont f( qApp->font() ); - if ( obj->isWidgetType() && ( (QWidget*)obj )->parentWidget() ) - f = ( (QWidget*)obj )->parentWidget()->font(); - defVariant = QVariant( f ); + TQFont f( qApp->font() ); + if ( obj->isWidgetType() && ( (TQWidget*)obj )->parentWidget() ) + f = ( (TQWidget*)obj )->parentWidget()->font(); + defVariant = TQVariant( f ); } - QString comment; - QVariant v( DomTool::elementToVariant( e, defVariant, comment ) ); + TQString comment; + TQVariant v( DomTool::elementToVariant( e, defVariant, comment ) ); if ( e.tagName() == "pixmap" ) { - QPixmap pix = loadPixmap( e ); + TQPixmap pix = loadPixmap( e ); if ( pix.isNull() ) return; - v = QVariant( pix ); + v = TQVariant( pix ); } else if ( e.tagName() == "iconset" ) { - QPixmap pix = loadPixmap( e ); + TQPixmap pix = loadPixmap( e ); if ( pix.isNull() ) return; - v = QVariant( QIconSet( pix ) ); + v = TQVariant( TQIconSet( pix ) ); } else if ( e.tagName() == "image" ) { - v = QVariant( loadFromCollection( v.toString() ) ); + v = TQVariant( loadFromCollection( v.toString() ) ); } else if ( e.tagName() == "string" ) { - v = QVariant( translate( v.asString(), comment ) ); + v = TQVariant( translate( v.asString(), comment ) ); } if ( !p ) { if ( obj->isWidgetType() ) { if ( prop == "toolTip" ) { if ( !v.toString().isEmpty() ) - QToolTip::add( (QWidget*)obj, translate(v.toString()) ); + TQToolTip::add( (TQWidget*)obj, translate(v.toString()) ); } else if ( prop == "whatsThis" ) { if ( !v.toString().isEmpty() ) - QWhatsThis::add( (QWidget*)obj, translate(v.toString()) ); + TQWhatsThis::add( (TQWidget*)obj, translate(v.toString()) ); } #ifndef QT_NO_SQL - if ( prop == "database" && !obj->inherits( "QDataView" ) - && !obj->inherits( "QDataBrowser" ) ) { - QStringList lst = DomTool::elementToVariant( e, QVariant( QStringList() ) ).toStringList(); + if ( prop == "database" && !obj->inherits( "TQDataView" ) + && !obj->inherits( "TQDataBrowser" ) ) { + TQStringList lst = DomTool::elementToVariant( e, TQVariant( TQStringList() ) ).toStringList(); if ( lst.count() > 2 ) { if ( dbControls ) dbControls->insert( obj->name(), lst[ 2 ] ); @@ -774,10 +774,10 @@ void KommanderFactory::setProperty( QObject* obj, const QString &prop, const QDo dbTables.insert( obj->name(), lst ); } } else if ( prop == "database" ) { - QStringList lst = DomTool::elementToVariant( e, QVariant( QStringList() ) ).toStringList(); - if ( lst.count() == 2 && obj->inherits( "QWidget" ) ) { + TQStringList lst = DomTool::elementToVariant( e, TQVariant( TQStringList() ) ).toStringList(); + if ( lst.count() == 2 && obj->inherits( "TQWidget" ) ) { SqlWidgetConnection conn( lst[ 0 ], lst[ 1 ] ); - sqlWidgetConnections.insert( (QWidget*)obj, conn ); + sqlWidgetConnections.insert( (TQWidget*)obj, conn ); dbControls = conn.dbControls; } } else @@ -785,12 +785,12 @@ void KommanderFactory::setProperty( QObject* obj, const QString &prop, const QDo if ( prop == "buddy" ) { buddies.insert( obj->name(), v.toCString() ); } else if ( prop == "frameworkCode" ) { - if ( !DomTool::elementToVariant( e, QVariant( true, 0 ) ).toBool() ) { + if ( !DomTool::elementToVariant( e, TQVariant( true, 0 ) ).toBool() ) { noDatabaseWidgets << obj->name(); } } else if ( prop == "buttonGroupId" ) { - if ( obj->inherits( "QButton" ) && obj->parent()->inherits( "QButtonGroup" ) ) - ( (QButtonGroup*)obj->parent() )->insert( (QButton*)obj, v.toInt() ); + if ( obj->inherits( "TQButton" ) && obj->parent()->inherits( "TQButtonGroup" ) ) + ( (TQButtonGroup*)obj->parent() )->insert( (TQButton*)obj, v.toInt() ); } return; @@ -798,10 +798,10 @@ void KommanderFactory::setProperty( QObject* obj, const QString &prop, const QDo } if ( e.tagName() == "palette" ) { - QDomElement n = e.firstChild().toElement(); - QPalette p; + TQDomElement n = e.firstChild().toElement(); + TQPalette p; while ( !n.isNull() ) { - QColorGroup cg; + TQColorGroup cg; if ( n.tagName() == "active" ) { cg = loadColorGroup( n ); p.setActive( cg ); @@ -814,17 +814,17 @@ void KommanderFactory::setProperty( QObject* obj, const QString &prop, const QDo } n = n.nextSibling().toElement(); } - v = QPalette( p ); + v = TQPalette( p ); } else if ( e.tagName() == "enum" && p && p->isEnumType() ) { - QString key( v.toString() ); - v = QVariant( p->keyToValue( key ) ); + TQString key( v.toString() ); + v = TQVariant( p->keyToValue( key ) ); } else if ( e.tagName() == "set" && p && p->isSetType() ) { - QString keys( v.toString() ); - QStringList lst = QStringList::split( '|', keys ); - QStrList l; - for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) + TQString keys( v.toString() ); + TQStringList lst = TQStringList::split( '|', keys ); + TQStrList l; + for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) l.append( *it ); - v = QVariant( p->keysToValue( l ) ); + v = TQVariant( p->keysToValue( l ) ); } if ( prop == "geometry" ) { @@ -837,9 +837,9 @@ void KommanderFactory::setProperty( QObject* obj, const QString &prop, const QDo obj->setProperty( prop, v ); } -void KommanderFactory::createSpacer( const QDomElement &e, QLayout *layout ) +void KommanderFactory::createSpacer( const TQDomElement &e, TQLayout *layout ) { - QDomElement n = e.firstChild().toElement(); + TQDomElement n = e.firstChild().toElement(); int row = e.attribute( "row" ).toInt(); int col = e.attribute( "column" ).toInt(); int rowspan = e.attribute( "rowspan" ).toInt(); @@ -847,10 +847,10 @@ void KommanderFactory::createSpacer( const QDomElement &e, QLayout *layout ) Qt::Orientation orient = Qt::Horizontal; int w = 0, h = 0; - QSizePolicy::SizeType sizeType = QSizePolicy::Preferred; + TQSizePolicy::SizeType sizeType = TQSizePolicy::Preferred; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QString prop = n.attribute( "name" ); + TQString prop = n.attribute( "name" ); if ( prop == "orientation" ) { if ( n.firstChild().firstChild().toText().data() == "Horizontal" ) orient = Qt::Horizontal; @@ -858,17 +858,17 @@ void KommanderFactory::createSpacer( const QDomElement &e, QLayout *layout ) orient = Qt::Vertical; } else if ( prop == "sizeType" ) { if ( n.firstChild().firstChild().toText().data() == "Fixed" ) - sizeType = QSizePolicy::Fixed; + sizeType = TQSizePolicy::Fixed; else if ( n.firstChild().firstChild().toText().data() == "Minimum" ) - sizeType = QSizePolicy::Minimum; + sizeType = TQSizePolicy::Minimum; else if ( n.firstChild().firstChild().toText().data() == "Maximum" ) - sizeType = QSizePolicy::Maximum; + sizeType = TQSizePolicy::Maximum; else if ( n.firstChild().firstChild().toText().data() == "Preferred" ) - sizeType = QSizePolicy::Preferred; + sizeType = TQSizePolicy::Preferred; else if ( n.firstChild().firstChild().toText().data() == "MinimumExpanding" ) - sizeType = QSizePolicy::MinimumExpanding; + sizeType = TQSizePolicy::MinimumExpanding; else if ( n.firstChild().firstChild().toText().data() == "Expanding" ) - sizeType = QSizePolicy::Expanding; + sizeType = TQSizePolicy::Expanding; } else if ( prop == "sizeHint" ) { w = n.firstChild().firstChild().firstChild().toText().data().toInt(); h = n.firstChild().firstChild().nextSibling().firstChild().toText().data().toInt(); @@ -881,21 +881,21 @@ void KommanderFactory::createSpacer( const QDomElement &e, QLayout *layout ) rowspan = 1; if ( colspan < 1 ) colspan = 1; - QSpacerItem *item = new QSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : QSizePolicy::Minimum, - orient == Qt::Vertical ? sizeType : QSizePolicy::Minimum ); + TQSpacerItem *item = new TQSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : TQSizePolicy::Minimum, + orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum ); if ( layout ) { - if ( layout->inherits( "QBoxLayout" ) ) - ( (QBoxLayout*)layout )->addItem( item ); + if ( layout->inherits( "TQBoxLayout" ) ) + ( (TQBoxLayout*)layout )->addItem( item ); else - ( (QGridLayout*)layout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1, + ( (TQGridLayout*)layout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1, orient == Qt::Horizontal ? Qt::AlignVCenter : Qt::AlignHCenter ); } } -static QImage loadImageData( QDomElement &n2 ) +static TQImage loadImageData( TQDomElement &n2 ) { - QImage img; - QString data = n2.firstChild().toText().data(); + TQImage img; + TQString data = n2.firstChild().toText().data(); char *ba = new char[ data.length() / 2 ]; for ( int i = 0; i < (int)data.length() / 2; ++i ) { char h = data[ 2 * i ].latin1(); @@ -912,12 +912,12 @@ static QImage loadImageData( QDomElement &n2 ) r += l - 'a' + 10; ba[ i ] = r; } - QString format = n2.attribute( "format", "PNG" ); + TQString format = n2.attribute( "format", "PNG" ); if ( format == "XPM.GZ" ) { ulong len = n2.attribute( "length" ).toULong(); if ( len < data.length() * 5 ) len = data.length() * 5; - QByteArray baunzip( len ); + TQByteArray baunzip( len ); ::uncompress( (uchar*) baunzip.data(), &len, (uchar*) ba, data.length()/2 ); img.loadFromData( (const uchar*)baunzip.data(), len, "XPM" ); } else { @@ -928,14 +928,14 @@ static QImage loadImageData( QDomElement &n2 ) return img; } -void KommanderFactory::loadImageCollection( const QDomElement &e ) +void KommanderFactory::loadImageCollection( const TQDomElement &e ) { - QDomElement n = e.firstChild().toElement(); + TQDomElement n = e.firstChild().toElement(); while ( !n.isNull() ) { if ( n.tagName() == "image" ) { Image img; img.name = n.attribute( "name" ); - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "data" ) img.img = loadImageData( n2 ); @@ -947,47 +947,47 @@ void KommanderFactory::loadImageCollection( const QDomElement &e ) } } -QImage KommanderFactory::loadFromCollection( const QString &name ) +TQImage KommanderFactory::loadFromCollection( const TQString &name ) { - QValueList<Image>::Iterator it = images.begin(); + TQValueList<Image>::Iterator it = images.begin(); for ( ; it != images.end(); ++it ) { if ( ( *it ).name == name ) return ( *it ).img; } - return QImage(); + return TQImage(); } -QPixmap KommanderFactory::loadPixmap( const QDomElement &e ) +TQPixmap KommanderFactory::loadPixmap( const TQDomElement &e ) { - QString arg = e.firstChild().toText().data(); + TQString arg = e.firstChild().toText().data(); if ( usePixmapCollection ) { - const QMimeSource *m = QMimeSourceFactory::defaultFactory()->data( arg ); + const TQMimeSource *m = TQMimeSourceFactory::defaultFactory()->data( arg ); if ( !m ) - return QPixmap(); - QPixmap pix; - QImageDrag::decode( m, pix ); + return TQPixmap(); + TQPixmap pix; + TQImageDrag::decode( m, pix ); return pix; } - QImage img = loadFromCollection( arg ); - QPixmap pix; + TQImage img = loadFromCollection( arg ); + TQPixmap pix; pix.convertFromImage( img ); return pix; } -QColorGroup KommanderFactory::loadColorGroup( const QDomElement &e ) +TQColorGroup KommanderFactory::loadColorGroup( const TQDomElement &e ) { - QColorGroup cg; + TQColorGroup cg; int r = -1; - QDomElement n = e.firstChild().toElement(); - QColor col; + TQDomElement n = e.firstChild().toElement(); + TQColor col; while ( !n.isNull() ) { if ( n.tagName() == "color" ) { r++; - cg.setColor( (QColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); + cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); } else if ( n.tagName() == "pixmap" ) { - QPixmap pix = loadPixmap( n ); - cg.setBrush( (QColorGroup::ColorRole)r, QBrush( col, pix ) ); + TQPixmap pix = loadPixmap( n ); + cg.setBrush( (TQColorGroup::ColorRole)r, TQBrush( col, pix ) ); } n = n.nextSibling().toElement(); } @@ -996,8 +996,8 @@ QColorGroup KommanderFactory::loadColorGroup( const QDomElement &e ) struct Connection { - QObject *sender, *receiver; - QCString signal, slot; + TQObject *sender, *receiver; + TQCString signal, slot; bool operator==( const Connection &c ) const { return sender == c.sender && receiver == c.receiver && signal == c.signal && slot == c.slot ; @@ -1007,27 +1007,27 @@ struct Connection class NormalizeObject : public QObject { public: - NormalizeObject() : QObject() {} - static QCString normalizeSignalSlot( const char *signalSlot ) { return QObject::normalizeSignalSlot( signalSlot ); } + NormalizeObject() : TQObject() {} + static TQCString normalizeSignalSlot( const char *signalSlot ) { return TQObject::normalizeSignalSlot( signalSlot ); } }; -void KommanderFactory::loadConnections( const QDomElement &e, QObject *connector ) +void KommanderFactory::loadConnections( const TQDomElement &e, TQObject *connector ) { - QDomElement n = e.firstChild().toElement(); + TQDomElement n = e.firstChild().toElement(); while ( !n.isNull() ) { if ( n.tagName() == "connection" ) { - QString lang = n.attribute( "language", "C++" ); - QDomElement n2 = n.firstChild().toElement(); + TQString lang = n.attribute( "language", "C++" ); + TQDomElement n2 = n.firstChild().toElement(); Connection conn; while ( !n2.isNull() ) { if ( n2.tagName() == "sender" ) { - QString name = n2.firstChild().toText().data(); + TQString name = n2.firstChild().toText().data(); if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) { conn.sender = toplevel; } else { if ( name == "this" ) name = toplevel->name(); - QObjectList *l = toplevel->queryList( 0, name, false ); + TQObjectList *l = toplevel->queryList( 0, name, false ); if ( l ) { if ( l->first() ) conn.sender = l->first(); @@ -1039,11 +1039,11 @@ void KommanderFactory::loadConnections( const QDomElement &e, QObject *connector } else if ( n2.tagName() == "signal" ) { conn.signal = n2.firstChild().toText().data(); } else if ( n2.tagName() == "receiver" ) { - QString name = n2.firstChild().toText().data(); + TQString name = n2.firstChild().toText().data(); if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) { conn.receiver = toplevel; } else { - QObjectList *l = toplevel->queryList( 0, name, false ); + TQObjectList *l = toplevel->queryList( 0, name, false ); if ( l ) { if ( l->first() ) conn.receiver = l->first(); @@ -1059,8 +1059,8 @@ void KommanderFactory::loadConnections( const QDomElement &e, QObject *connector conn.signal = NormalizeObject::normalizeSignalSlot( conn.signal ); conn.slot = NormalizeObject::normalizeSignalSlot( conn.slot ); - QObject *sender = 0, *receiver = 0; - QObjectList *l = toplevel->queryList( 0, conn.sender->name(), false ); + TQObject *sender = 0, *receiver = 0; + TQObjectList *l = toplevel->queryList( 0, conn.sender->name(), false ); if ( qstrcmp( conn.sender->name(), toplevel->name() ) == 0 ) { sender = toplevel; } else { @@ -1089,13 +1089,13 @@ void KommanderFactory::loadConnections( const QDomElement &e, QObject *connector } if ( lang == "C++" ) { - QString s = "2""%1"; + TQString s = "2""%1"; s = s.arg( conn.signal ); - QString s2 = "1""%1"; + TQString s2 = "1""%1"; s2 = s2.arg( conn.slot ); - QStrList signalList = sender->metaObject()->signalNames( true ); - QStrList slotList = receiver->metaObject()->slotNames( true ); + TQStrList signalList = sender->metaObject()->signalNames( true ); + TQStrList slotList = receiver->metaObject()->slotNames( true ); // if this is a connection to a custom slot and we have a connector, try this as receiver if ( slotList.find( conn.slot ) == -1 && receiver == toplevel && connector ) { @@ -1109,32 +1109,32 @@ void KommanderFactory::loadConnections( const QDomElement &e, QObject *connector n = n.nextSibling().toElement(); continue; } - QObject::connect( sender, s, receiver, s2 ); + TQObject::connect( sender, s, receiver, s2 ); } else { EventFunction ef = eventMap[ conn.sender ]; ef.events.append( conn.signal ); - ef.functions.append( QStringList::split( ',', conn.slot ) ); + ef.functions.append( TQStringList::split( ',', conn.slot ) ); eventMap.replace( conn.sender, ef ); } } else if ( n.tagName() == "slot" ) { - QString s = n.firstChild().toText().data(); + TQString s = n.firstChild().toText().data(); languageSlots.insert( s.left( s.find( "(" ) ) , n.attribute( "language" ) ); } n = n.nextSibling().toElement(); } } -void KommanderFactory::loadTabOrder( const QDomElement &e ) +void KommanderFactory::loadTabOrder( const TQDomElement &e ) { - QWidget *last = 0; - QDomElement n = e.firstChild().toElement(); + TQWidget *last = 0; + TQDomElement n = e.firstChild().toElement(); while ( !n.isNull() ) { if ( n.tagName() == "tabstop" ) { - QString name = n.firstChild().toText().data(); - QObjectList *l = toplevel->queryList( 0, name, false ); + TQString name = n.firstChild().toText().data(); + TQObjectList *l = toplevel->queryList( 0, name, false ); if ( l ) { if ( l->first() ) { - QWidget *w = (QWidget*)l->first(); + TQWidget *w = (TQWidget*)l->first(); if ( last ) toplevel->setTabOrder( last, w ); last = w; @@ -1146,19 +1146,19 @@ void KommanderFactory::loadTabOrder( const QDomElement &e ) } } -void KommanderFactory::createColumn( const QDomElement &e, QWidget *widget ) +void KommanderFactory::createColumn( const TQDomElement &e, TQWidget *widget ) { - if ( widget->inherits( "QListView" ) && e.tagName() == "column" ) { - QListView *lv = (QListView*)widget; - QDomElement n = e.firstChild().toElement(); - QPixmap pix; + if ( widget->inherits( "TQListView" ) && e.tagName() == "column" ) { + TQListView *lv = (TQListView*)widget; + TQDomElement n = e.firstChild().toElement(); + TQPixmap pix; bool hasPixmap = false; - QString txt; + TQString txt; bool clickable = true, resizeable = true; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QString attrib = n.attribute( "name" ); - QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + TQString attrib = n.attribute( "name" ); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) txt = translate(v.toString()); else if ( attrib == "pixmap" ) { @@ -1182,10 +1182,10 @@ void KommanderFactory::createColumn( const QDomElement &e, QWidget *widget ) lv->header()->setResizeEnabled( resizeable, i ); } #ifndef QT_NO_TABLE - else if ( widget->inherits( "QTable" ) ) { - QTable *table = (QTable*)widget; + else if ( widget->inherits( "TQTable" ) ) { + TQTable *table = (TQTable*)widget; #ifndef QT_NO_SQL - bool isSql = (widget->inherits( "QDataTable" )); + bool isSql = (widget->inherits( "TQDataTable" )); #endif bool isRow; if ( ( isRow = e.tagName() == "row" ) ) @@ -1197,20 +1197,20 @@ void KommanderFactory::createColumn( const QDomElement &e, QWidget *widget ) table->setNumCols( table->numCols() + 1 ); } - QDomElement n = e.firstChild().toElement(); - QPixmap pix; + TQDomElement n = e.firstChild().toElement(); + TQPixmap pix; bool hasPixmap = false; - QString txt; - QString field; - QValueList<Field> fieldMap; + TQString txt; + TQString field; + TQValueList<Field> fieldMap; if ( fieldMaps.find( table ) != fieldMaps.end() ) { fieldMap = *fieldMaps.find( table ); fieldMaps.remove( table ); } while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QString attrib = n.attribute( "name" ); - QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + TQString attrib = n.attribute( "name" ); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) txt = translate(v.toString()); else if ( attrib == "pixmap" ) { @@ -1224,39 +1224,39 @@ void KommanderFactory::createColumn( const QDomElement &e, QWidget *widget ) } int i = isRow ? table->numRows() - 1 : table->numCols() - 1; - QHeader *h = !isRow ? table->horizontalHeader() : table->verticalHeader(); + TQHeader *h = !isRow ? table->horizontalHeader() : table->verticalHeader(); if ( hasPixmap ) { #ifndef QT_NO_SQL if ( isSql ) - ((QDataTable*)table)->addColumn( field, txt, -1, pix ); + ((TQDataTable*)table)->addColumn( field, txt, -1, pix ); else #endif h->setLabel( i, pix, txt ); } else { #ifndef QT_NO_SQL if ( isSql ) { - ((QDataTable*)table)->addColumn( field, txt ); + ((TQDataTable*)table)->addColumn( field, txt ); } else #endif h->setLabel( i, txt ); } if ( !isRow && !field.isEmpty() ) { - fieldMap.append( Field( txt, (hasPixmap ? pix : QPixmap()), field ) ); + fieldMap.append( Field( txt, (hasPixmap ? pix : TQPixmap()), field ) ); fieldMaps.insert( table, fieldMap ); } } #endif } -void KommanderFactory::loadItem( const QDomElement &e, QPixmap &pix, QString &txt, bool &hasPixmap ) +void KommanderFactory::loadItem( const TQDomElement &e, TQPixmap &pix, TQString &txt, bool &hasPixmap ) { - QDomElement n = e; + TQDomElement n = e; hasPixmap = false; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QString attrib = n.attribute( "name" ); - QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + TQString attrib = n.attribute( "name" ); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) txt = translate(v.toString()); else if ( attrib == "pixmap" ) { @@ -1268,56 +1268,56 @@ void KommanderFactory::loadItem( const QDomElement &e, QPixmap &pix, QString &tx } } -void KommanderFactory::createItem( const QDomElement &e, QWidget *widget, QListViewItem *i ) +void KommanderFactory::createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i ) { - if ( widget->inherits( "QListBox" ) || widget->inherits( "QComboBox" ) ) { - QDomElement n = e.firstChild().toElement(); - QPixmap pix; + if ( widget->inherits( "TQListBox" ) || widget->inherits( "TQComboBox" ) ) { + TQDomElement n = e.firstChild().toElement(); + TQPixmap pix; bool hasPixmap = false; - QString txt; + TQString txt; loadItem( n, pix, txt, hasPixmap ); - QListBox *lb = 0; - if ( widget->inherits( "QListBox" ) ) - lb = (QListBox*)widget; + TQListBox *lb = 0; + if ( widget->inherits( "TQListBox" ) ) + lb = (TQListBox*)widget; else - lb = ( (QComboBox*)widget)->listBox(); + lb = ( (TQComboBox*)widget)->listBox(); if ( hasPixmap ) { - new QListBoxPixmap( lb, pix, txt ); + new TQListBoxPixmap( lb, pix, txt ); } else { - new QListBoxText( lb, txt ); + new TQListBoxText( lb, txt ); } #ifndef QT_NO_ICONVIEW - } else if ( widget->inherits( "QIconView" ) ) { - QDomElement n = e.firstChild().toElement(); - QPixmap pix; + } else if ( widget->inherits( "TQIconView" ) ) { + TQDomElement n = e.firstChild().toElement(); + TQPixmap pix; bool hasPixmap = false; - QString txt; + TQString txt; loadItem( n, pix, txt, hasPixmap ); - QIconView *iv = (QIconView*)widget; - new QIconViewItem( iv, txt, pix ); + TQIconView *iv = (TQIconView*)widget; + new TQIconViewItem( iv, txt, pix ); #endif - } else if ( widget->inherits( "QListView" ) ) { - QDomElement n = e.firstChild().toElement(); - QPixmap pix; - QValueList<QPixmap> pixmaps; - QStringList textes; - QListViewItem *item = 0; - QListView *lv = (QListView*)widget; + } else if ( widget->inherits( "TQListView" ) ) { + TQDomElement n = e.firstChild().toElement(); + TQPixmap pix; + TQValueList<TQPixmap> pixmaps; + TQStringList textes; + TQListViewItem *item = 0; + TQListView *lv = (TQListView*)widget; if ( i ) - item = new QListViewItem( i, lastItem ); + item = new TQListViewItem( i, lastItem ); else - item = new QListViewItem( lv, lastItem ); + item = new TQListViewItem( lv, lastItem ); while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - QString attrib = n.attribute( "name" ); - QVariant v = DomTool::elementToVariant( n.firstChild().toElement(), QVariant() ); + TQString attrib = n.attribute( "name" ); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) textes << translate(v.toString()); else if ( attrib == "pixmap" ) { - QString s = v.toString(); + TQString s = v.toString(); if ( s.isEmpty() ) { - pixmaps << QPixmap(); + pixmaps << TQPixmap(); } else { pix = loadPixmap( n.firstChild().toElement() ); pixmaps << pix; @@ -1341,28 +1341,28 @@ void KommanderFactory::createItem( const QDomElement &e, QWidget *widget, QListV -void KommanderFactory::loadChildAction( QObject *parent, const QDomElement &e ) +void KommanderFactory::loadChildAction( TQObject *parent, const TQDomElement &e ) { - QDomElement n = e; - QAction *a = 0; + TQDomElement n = e; + TQAction *a = 0; EventFunction ef; if ( n.tagName() == "action" ) { - a = new QAction( parent ); - QDomElement n2 = n.firstChild().toElement(); + a = new TQAction( parent ); + TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "property" ) { setProperty( a, n2.attribute( "name" ), n2.firstChild().toElement() ); } else if ( n2.tagName() == "event" ) { ef.events.append( n2.attribute( "name" ) ); - ef.functions.append( QStringList::split( ',', n2.attribute( "functions" ) ) ); + ef.functions.append( TQStringList::split( ',', n2.attribute( "functions" ) ) ); } n2 = n2.nextSibling().toElement(); } - if ( !parent->inherits( "QAction" ) ) + if ( !parent->inherits( "TQAction" ) ) actionList.append( a ); } else if ( n.tagName() == "actiongroup" ) { - a = new QActionGroup( parent ); - QDomElement n2 = n.firstChild().toElement(); + a = new TQActionGroup( parent ); + TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "property" ) { setProperty( a, n2.attribute( "name" ), n2.firstChild().toElement() ); @@ -1371,20 +1371,20 @@ void KommanderFactory::loadChildAction( QObject *parent, const QDomElement &e ) loadChildAction( a, n2 ); } else if ( n2.tagName() == "event" ) { ef.events.append( n2.attribute( "name" ) ); - ef.functions.append( QStringList::split( ',', n2.attribute( "functions" ) ) ); + ef.functions.append( TQStringList::split( ',', n2.attribute( "functions" ) ) ); } n2 = n2.nextSibling().toElement(); } - if ( !parent->inherits( "QAction" ) ) + if ( !parent->inherits( "TQAction" ) ) actionList.append( a ); } if ( a ) eventMap.insert( a, ef ); } -void KommanderFactory::loadActions( const QDomElement &e ) +void KommanderFactory::loadActions( const TQDomElement &e ) { - QDomElement n = e.firstChild().toElement(); + TQDomElement n = e.firstChild().toElement(); while ( !n.isNull() ) { if ( n.tagName() == "action" ) { loadChildAction( toplevel, n ); @@ -1395,27 +1395,27 @@ void KommanderFactory::loadActions( const QDomElement &e ) } } -void KommanderFactory::loadToolBars( const QDomElement &e ) +void KommanderFactory::loadToolBars( const TQDomElement &e ) { - QDomElement n = e.firstChild().toElement(); - QMainWindow *mw = ( (QMainWindow*)toplevel ); - QToolBar *tb = 0; + TQDomElement n = e.firstChild().toElement(); + TQMainWindow *mw = ( (TQMainWindow*)toplevel ); + TQToolBar *tb = 0; while ( !n.isNull() ) { if ( n.tagName() == "toolbar" ) { Qt::Dock dock = (Qt::Dock)n.attribute( "dock" ).toInt(); - tb = new QToolBar( QString::null, mw, dock ); + tb = new TQToolBar( TQString::null, mw, dock ); tb->setLabel( n.attribute( "label" ) ); tb->setName( n.attribute( "name" ) ); - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "action" ) { - QAction *a = findAction( n2.attribute( "name" ) ); + TQAction *a = findAction( n2.attribute( "name" ) ); if ( a ) a->addTo( tb ); } else if ( n2.tagName() == "separator" ) { tb->addSeparator(); } else if ( n2.tagName() == "widget" ) { - (void)createWidgetInternal( n2, tb, 0, n2.attribute( "class", "QWidget" ) ); + (void)createWidgetInternal( n2, tb, 0, n2.attribute( "class", "TQWidget" ) ); } else if ( n2.tagName() == "property" ) { setProperty( tb, n2.attribute( "name" ), n2.firstChild().toElement() ); } @@ -1426,19 +1426,19 @@ void KommanderFactory::loadToolBars( const QDomElement &e ) } } -void KommanderFactory::loadMenuBar( const QDomElement &e ) +void KommanderFactory::loadMenuBar( const TQDomElement &e ) { - QDomElement n = e.firstChild().toElement(); - QMainWindow *mw = ( (QMainWindow*)toplevel ); - QMenuBar *mb = mw->menuBar(); + TQDomElement n = e.firstChild().toElement(); + TQMainWindow *mw = ( (TQMainWindow*)toplevel ); + TQMenuBar *mb = mw->menuBar(); while ( !n.isNull() ) { if ( n.tagName() == "item" ) { - QPopupMenu *popup = new QPopupMenu( mw ); + TQPopupMenu *popup = new TQPopupMenu( mw ); popup->setName( n.attribute( "name" ) ); - QDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "action" ) { - QAction *a = findAction( n2.attribute( "name" ) ); + TQAction *a = findAction( n2.attribute( "name" ) ); if ( a ) a->addTo( popup ); } else if ( n2.tagName() == "separator" ) { @@ -1455,27 +1455,27 @@ void KommanderFactory::loadMenuBar( const QDomElement &e ) } -QAction *KommanderFactory::findAction( const QString &name ) +TQAction *KommanderFactory::findAction( const TQString &name ) { - for ( QAction *a = actionList.first(); a; a = actionList.next() ) { - if ( QString( a->name() ) == name ) + for ( TQAction *a = actionList.first(); a; a = actionList.next() ) { + if ( TQString( a->name() ) == name ) return a; - QAction *ac = (QAction*)a->child( name.latin1(), "QAction" ); + TQAction *ac = (TQAction*)a->child( name.latin1(), "TQAction" ); if ( ac ) return ac; } return 0; } -void KommanderFactory::loadImages( const QString &dir ) +void KommanderFactory::loadImages( const TQString &dir ) { - QDir d(dir); - QStringList l = d.entryList(QDir::Files); - for (QStringList::Iterator it = l.begin(); it != l.end(); ++it) - QMimeSourceFactory::defaultFactory()->setPixmap(*it, QPixmap(d.path() + "/" + *it, "PNG")); + TQDir d(dir); + TQStringList l = d.entryList(TQDir::Files); + for (TQStringList::Iterator it = l.begin(); it != l.end(); ++it) + TQMimeSourceFactory::defaultFactory()->setPixmap(*it, TQPixmap(d.path() + "/" + *it, "PNG")); } -QString KommanderFactory::translate( const QString& sourceText, const QString& comment ) +TQString KommanderFactory::translate( const TQString& sourceText, const TQString& comment ) { if (!sourceText.isEmpty() && !comment.isEmpty()) return KGlobal::locale()->translate(comment.utf8(), sourceText.utf8()); |