diff options
Diffstat (limited to 'kommander/factory/kommanderfactory.cpp')
-rw-r--r-- | kommander/factory/kommanderfactory.cpp | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/kommander/factory/kommanderfactory.cpp b/kommander/factory/kommanderfactory.cpp index 5b1e12bc..0247a814 100644 --- a/kommander/factory/kommanderfactory.cpp +++ b/kommander/factory/kommanderfactory.cpp @@ -126,7 +126,7 @@ KommanderFactory::~KommanderFactory() qwf_currFileName = 0L; } -TQWidget *KommanderFactory::create( const TQString &uiFile, TQObject *connector, TQWidget *tqparent, const char *name ) +TQWidget *KommanderFactory::create( const TQString &uiFile, TQObject *connector, TQWidget *parent, const char *name ) { TQFile f( uiFile ); if ( !f.open( IO_ReadOnly ) ) @@ -135,14 +135,14 @@ TQWidget *KommanderFactory::create( const TQString &uiFile, TQObject *connector, if (!qwf_currFileName) qwf_currFileName = new TQString(); *qwf_currFileName = uiFile; - TQWidget *w = KommanderFactory::create( TQT_TQIODEVICE(&f), connector, tqparent, name ); + TQWidget *w = KommanderFactory::create( TQT_TQIODEVICE(&f), connector, parent, name ); if ( !qwf_forms ) qwf_forms = new TQMap<TQWidget*, TQString>; qwf_forms->insert( w, uiFile ); return w; } -TQWidget *KommanderFactory::create( TQIODevice *dev, TQObject *connector, TQWidget *tqparent, const char *name ) +TQWidget *KommanderFactory::create( TQIODevice *dev, TQObject *connector, TQWidget *parent, const char *name ) { TQDomDocument doc; TQString errMsg; @@ -217,7 +217,7 @@ TQWidget *KommanderFactory::create( TQIODevice *dev, TQObject *connector, TQWidg if ( !imageCollection.isNull() ) widgetFactory->loadImageCollection( imageCollection ); - widgetFactory->createWidgetInternal( widget, tqparent, 0, widget.attribute("class", TQWIDGET_OBJECT_NAME_STRING) ); + widgetFactory->createWidgetInternal( widget, parent, 0, widget.attribute("class", TQWIDGET_OBJECT_NAME_STRING) ); TQWidget *w = widgetFactory->toplevel; if ( !w ) { delete widgetFactory; @@ -310,110 +310,110 @@ void KommanderFactory::addPlugin( KommanderPlugin *plugin ) widgetPlugins.append( plugin ); } -TQWidget *KommanderFactory::createWidget( const TQString &literalClassName, TQWidget *tqparent, const char *name ) +TQWidget *KommanderFactory::createWidget( const TQString &literalClassName, TQWidget *parent, const char *name ) { TQString className = literalClassName; // create widgets we know if (className == TQPUSHBUTTON_OBJECT_NAME_STRING) - return new TQPushButton(tqparent, name); + return new TQPushButton(parent, name); else if (className == TQTOOLBUTTON_OBJECT_NAME_STRING) - return new TQToolButton(tqparent, name); + return new TQToolButton(parent, name); else if (className == TQCHECKBOX_OBJECT_NAME_STRING) - return new TQCheckBox(tqparent, name); + return new TQCheckBox(parent, name); else if (className == TQRADIOBUTTON_OBJECT_NAME_STRING) - return new TQRadioButton(tqparent, name); + return new TQRadioButton(parent, name); else if (className == TQGROUPBOX_OBJECT_NAME_STRING) - return new TQGroupBox(tqparent, name); + return new TQGroupBox(parent, name); else if (className == TQBUTTONGROUP_OBJECT_NAME_STRING) - return new TQButtonGroup(tqparent, name); + return new TQButtonGroup(parent, name); else if (className == TQICONVIEW_OBJECT_NAME_STRING) { #if !defined(TQT_NO_ICONVIEW) - return new TQIconView(tqparent, name); + return new TQIconView(parent, name); #endif } else if (className == TQTABLE_OBJECT_NAME_STRING) { #if !defined(TQT_NO_TABLE) - return new TQTable(tqparent, name); + return new TQTable(parent, name); #endif } else if (className == TQLISTBOX_OBJECT_NAME_STRING) - return new TQListBox(tqparent, name); + return new TQListBox(parent, name); else if (className == TQLISTVIEW_OBJECT_NAME_STRING) - return new TQListView(tqparent, name); + return new TQListView(parent, name); else if (className == TQLINEEDIT_OBJECT_NAME_STRING) - return new TQLineEdit(tqparent, name); + return new TQLineEdit(parent, name); else if (className == TQSPINBOX_OBJECT_NAME_STRING) - return new TQSpinBox(tqparent, name); + return new TQSpinBox(parent, name); else if (className == TQMULTILINEEDIT_OBJECT_NAME_STRING) - return new TQMultiLineEdit(tqparent, name); + return new TQMultiLineEdit(parent, name); else if (className == TQLABEL_OBJECT_NAME_STRING) - return new TQLabel(tqparent, name); + return new TQLabel(parent, name); else if (className == TQLAYOUTWIDGET_OBJECT_NAME_STRING) - return new TQWidget(tqparent, name); + return new TQWidget(parent, name); else if (className == TQTABWIDGET_OBJECT_NAME_STRING) - return new TQTabWidget(tqparent, name); + return new TQTabWidget(parent, name); else if (className == TQCOMBOBOX_OBJECT_NAME_STRING) - return new TQComboBox(false, tqparent, name); + return new TQComboBox(false, parent, name); else if (className == TQWIDGET_OBJECT_NAME_STRING) { if (!qwf_stays_on_top) - return new TQWidget(tqparent, name); - return new TQWidget(tqparent, name, TQt::WStyle_StaysOnTop); + return new TQWidget(parent, name); + return new TQWidget(parent, name, TQt::WStyle_StaysOnTop); } else if (className == TQDIALOG_OBJECT_NAME_STRING) { if (!qwf_stays_on_top) - return new TQDialog(tqparent, name); - return new TQDialog(tqparent, name, false, TQt::WStyle_StaysOnTop); + return new TQDialog(parent, name); + return new TQDialog(parent, name, false, TQt::WStyle_StaysOnTop); } else if (className == TQWIZARD_OBJECT_NAME_STRING) - return new TQWizard(tqparent, name); + return new TQWizard(parent, name); else if (className == TQLCDNUMBER_OBJECT_NAME_STRING) - return new TQLCDNumber(tqparent, name); + return new TQLCDNumber(parent, name); else if (className == TQPROGRESSBAR_OBJECT_NAME_STRING) - return new TQProgressBar(tqparent, name); + return new TQProgressBar(parent, name); else if (className == TQTEXTVIEW_OBJECT_NAME_STRING) - return new TQTextView(tqparent, name); + return new TQTextView(parent, name); else if (className == TQTEXTBROWSER_OBJECT_NAME_STRING) - return new TQTextBrowser(tqparent, name); + return new TQTextBrowser(parent, name); else if (className == TQDIAL_OBJECT_NAME_STRING) - return new TQDial(tqparent, name); + return new TQDial(parent, name); else if (className == TQSLIDER_OBJECT_NAME_STRING) - return new TQSlider(tqparent, name); + return new TQSlider(parent, name); else if (className == TQFRAME_OBJECT_NAME_STRING) - return new TQFrame(tqparent, name); + return new TQFrame(parent, name); else if (className == TQSPLITTER_OBJECT_NAME_STRING) - return new TQSplitter(tqparent, name); + return new TQSplitter(parent, name); else if (className == "Line") { - TQFrame *f = new TQFrame(tqparent, name); + TQFrame *f = new TQFrame(parent, name); f->setFrameStyle(TQFrame::HLine | TQFrame::Sunken); return f; } else if (className == TQTEXTEDIT_OBJECT_NAME_STRING) - return new TQTextEdit(tqparent, name); + return new TQTextEdit(parent, name); else if (className == TQDATEEDIT_OBJECT_NAME_STRING) - return new TQDateEdit(tqparent, name); + return new TQDateEdit(parent, name); else if (className == TQTIMEEDIT_OBJECT_NAME_STRING) - return new TQTimeEdit(tqparent, name); + return new TQTimeEdit(parent, name); else if (className == TQDATETIMEEDIT_OBJECT_NAME_STRING) - return new TQDateTimeEdit(tqparent, name); + return new TQDateTimeEdit(parent, name); else if (className == TQSCROLLBAR_OBJECT_NAME_STRING) - return new TQScrollBar(tqparent, name); + return new TQScrollBar(parent, name); else if (className == TQPOPUPMENU_OBJECT_NAME_STRING) - return new TQPopupMenu(tqparent, name); + return new TQPopupMenu(parent, name); else if (className == TQWIDGETSTACK_OBJECT_NAME_STRING) - return new TQWidgetStack(tqparent, name); + return new TQWidgetStack(parent, name); else if (className == TQMAINWINDOW_OBJECT_NAME_STRING) { TQMainWindow *mw = 0; if (!qwf_stays_on_top) - mw = new KmdrMainWindow(tqparent, name); + mw = new KmdrMainWindow(parent, name); else - mw = new KmdrMainWindow(tqparent, name, TQt::WType_TopLevel | TQt::WStyle_StaysOnTop); + mw = new KmdrMainWindow(parent, name, TQt::WType_TopLevel | TQt::WStyle_StaysOnTop); mw->setCentralWidget(new TQWidget(mw, "qt_central_widget")); mw->centralWidget()->show(); (void) mw->statusBar(); @@ -421,18 +421,18 @@ TQWidget *KommanderFactory::createWidget( const TQString &literalClassName, TQWi } #if !defined(TQT_NO_SQL) else if (className == TQDATATABLE_OBJECT_NAME_STRING) - return new TQDataTable(tqparent, name); + return new TQDataTable(parent, name); else if (className == TQDATABROWSER_OBJECT_NAME_STRING) - return new QDesignerDataBrowser2(tqparent, name); + return new QDesignerDataBrowser2(parent, name); else if (className == TQDATAVIEW_OBJECT_NAME_STRING) - return new QDesignerDataView2(tqparent, name); + return new QDesignerDataView2(parent, name); #endif // try to create it using the loaded kommander widget plugins //find the widget plugin which can create className for (KommanderPlugin * p = widgetPlugins.first(); p; p = widgetPlugins.next()) { - TQWidget *w = p->create(className, tqparent, name); + TQWidget *w = p->create(className, parent, name); if (w) return w; } @@ -497,7 +497,7 @@ FeatureList KommanderFactory::featureList() //iterate through widgetPlugins, appending KommanderPlugin::widgets() to features } -TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidget *tqparent, TQLayout* tqlayout, const TQString &classNameArg ) +TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidget *parent, TQLayout* tqlayout, const TQString &classNameArg ) { lastItem = 0; TQDomElement n = e.firstChild().toElement(); @@ -519,9 +519,9 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge className = TQWIDGET_OBJECT_NAME_STRING; if ( tqlayout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) { // hide tqlayout widgets - w = tqparent; + w = parent; } else { - obj = TQT_TQOBJECT(KommanderFactory::createWidget( className, tqparent, 0 )); + obj = TQT_TQOBJECT(KommanderFactory::createWidget( className, parent, 0 )); if ( !obj ) { return 0; @@ -599,16 +599,16 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge } else if ( n.tagName() == "attribute" && w ) { TQString attrib = n.attribute( "name" ); TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); - if ( tqparent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) { + if ( parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) { if ( attrib == "title" ) - ( (TQTabWidget*)tqparent )->insertTab( w, translate(v.toString()) ); + ( (TQTabWidget*)parent )->insertTab( w, translate(v.toString()) ); } else - if ( tqparent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) { + if ( parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) { if ( attrib == "label" ) - ( (TQToolBox*)tqparent )->addItem( w, translate(v.toString()) ); - }else if ( tqparent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) { + ( (TQToolBox*)parent )->addItem( w, translate(v.toString()) ); + }else if ( parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) { if ( attrib == "title" ) - ( (TQWizard*)tqparent )->addPage( w, translate(v.toString()) ); + ( (TQWizard*)parent )->addPage( w, translate(v.toString()) ); } } else if ( n.tagName() == "item" ) { createItem( n, w ); @@ -792,8 +792,8 @@ void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const T noDatabaseWidgets << obj->name(); } } else if ( prop == "buttonGroupId" ) { - if ( obj->inherits( TQBUTTON_OBJECT_NAME_STRING ) && obj->tqparent()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) - ( (TQButtonGroup*)obj->tqparent() )->insert( (TQButton*)obj, v.toInt() ); + if ( obj->inherits( TQBUTTON_OBJECT_NAME_STRING ) && obj->parent()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) + ( (TQButtonGroup*)obj->parent() )->insert( (TQButton*)obj, v.toInt() ); } return; @@ -1344,13 +1344,13 @@ void KommanderFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLi -void KommanderFactory::loadChildAction( TQObject *tqparent, const TQDomElement &e ) +void KommanderFactory::loadChildAction( TQObject *parent, const TQDomElement &e ) { TQDomElement n = e; TQAction *a = 0; EventFunction ef; if ( n.tagName() == "action" ) { - a = new TQAction( tqparent ); + a = new TQAction( parent ); TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "property" ) { @@ -1361,10 +1361,10 @@ void KommanderFactory::loadChildAction( TQObject *tqparent, const TQDomElement & } n2 = n2.nextSibling().toElement(); } - if ( !tqparent->inherits( TQACTION_OBJECT_NAME_STRING ) ) + if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) ) actionList.append( a ); } else if ( n.tagName() == "actiongroup" ) { - a = new TQActionGroup( tqparent ); + a = new TQActionGroup( parent ); TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "property" ) { @@ -1378,7 +1378,7 @@ void KommanderFactory::loadChildAction( TQObject *tqparent, const TQDomElement & } n2 = n2.nextSibling().toElement(); } - if ( !tqparent->inherits( TQACTION_OBJECT_NAME_STRING ) ) + if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) ) actionList.append( a ); } if ( a ) |