diff options
Diffstat (limited to 'kdevdesigner/designer/widgetfactory.cpp')
-rw-r--r-- | kdevdesigner/designer/widgetfactory.cpp | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/kdevdesigner/designer/widgetfactory.cpp b/kdevdesigner/designer/widgetfactory.cpp index 162e20ce..9fd07ffc 100644 --- a/kdevdesigner/designer/widgetfactory.cpp +++ b/kdevdesigner/designer/widgetfactory.cpp @@ -686,7 +686,7 @@ void WidgetFactory::deleteLayout( TQWidget *widget ) TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *parent, const char *name, bool init, const TQRect *r, Qt::Orientation orient ) { - if ( className == TQPUSHBUTTON_OBJECT_NAME_STRING ) { + if ( className == "TQPushButton" ) { TQPushButton *b = 0; if ( init ) { b = new QDesignerPushButton( parent, name ); @@ -697,7 +697,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare TQWidget *w = find_formwindow( b ); b->setAutoDefault( w && ::tqqt_cast<TQDialog*>(((FormWindow*)w)->mainContainer()) ); return b; - } else if ( className == TQTOOLBUTTON_OBJECT_NAME_STRING ) { + } else if ( className == "TQToolButton" ) { if ( init ) { QDesignerToolButton *tb = new QDesignerToolButton( parent, name ); if ( ::tqqt_cast<TQToolBox*>(widgetOfContainer(parent))) { @@ -711,29 +711,29 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare return tb; } return new QDesignerToolButton( parent, name ); - } else if ( className == TQCHECKBOX_OBJECT_NAME_STRING ) { + } else if ( className == "TQCheckBox" ) { if ( init ) { QDesignerCheckBox *cb = new QDesignerCheckBox( parent, name ); cb->setText( TQString::fromLatin1( name ) ); return cb; } return new QDesignerCheckBox( parent, name ); - } else if ( className == TQRADIOBUTTON_OBJECT_NAME_STRING ) { + } else if ( className == "TQRadioButton" ) { if ( init ) { QDesignerRadioButton *rb = new QDesignerRadioButton( parent, name ); rb->setText( TQString::fromLatin1( name ) ); return rb; } return new QDesignerRadioButton( parent, name ); - } else if ( className == TQGROUPBOX_OBJECT_NAME_STRING ) { + } else if ( className == "TQGroupBox" ) { if ( init ) return new TQGroupBox( TQString::fromLatin1( name ), parent, name ); return new TQGroupBox( parent, name ); - } else if ( className == TQBUTTONGROUP_OBJECT_NAME_STRING ) { + } else if ( className == "TQButtonGroup" ) { if ( init ) return new TQButtonGroup( TQString::fromLatin1( name ), parent, name ); return new TQButtonGroup( parent, name ); - } else if ( className == TQICONVIEW_OBJECT_NAME_STRING ) { + } else if ( className == "TQIconView" ) { #if !defined(TQT_NO_ICONVIEW) TQIconView* iv = new TQIconView( parent, name ); if ( init ) @@ -742,7 +742,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare #else return 0; #endif - } else if ( className == TQTABLE_OBJECT_NAME_STRING ) { + } else if ( className == "TQTable" ) { #if !defined(TQT_NO_TABLE) if ( init ) return new TQTable( 3, 3, parent, name ); @@ -751,24 +751,24 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare return 0; #endif #ifndef TQT_NO_SQL - } else if ( className == TQDATATABLE_OBJECT_NAME_STRING ) { + } else if ( className == "TQDataTable" ) { return new TQDataTable( parent, name ); #endif //TQT_NO_SQL - } else if ( className == TQDATEEDIT_OBJECT_NAME_STRING ) { + } else if ( className == "TQDateEdit" ) { return new TQDateEdit( parent, name ); - } else if ( className == TQTIMEEDIT_OBJECT_NAME_STRING ) { + } else if ( className == "TQTimeEdit" ) { return new TQTimeEdit( parent, name ); - } else if ( className == TQDATETIMEEDIT_OBJECT_NAME_STRING ) { + } else if ( className == "TQDateTimeEdit" ) { return new TQDateTimeEdit( parent, name ); } - else if ( className == TQLISTBOX_OBJECT_NAME_STRING ) { + else if ( className == "TQListBox" ) { TQListBox* lb = new TQListBox( parent, name ); if ( init ) { lb->insertItem( i18n( "New Item" ) ); lb->setCurrentItem( 0 ); } return lb; - } else if ( className == TQLISTVIEW_OBJECT_NAME_STRING ) { + } else if ( className == "TQListView" ) { TQListView *lv = new TQListView( parent, name ); lv->setSorting( -1 ); if ( init ) { @@ -776,17 +776,17 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare lv->setCurrentItem( new TQListViewItem( lv, i18n( "New Item" ) ) ); } return lv; - } else if ( className == TQLINEEDIT_OBJECT_NAME_STRING ) + } else if ( className == "TQLineEdit" ) return new TQLineEdit( parent, name ); - else if ( className == TQSPINBOX_OBJECT_NAME_STRING ) + else if ( className == "TQSpinBox" ) return new TQSpinBox( parent, name ); - else if ( className == TQSPLITTER_OBJECT_NAME_STRING ) + else if ( className == "TQSplitter" ) return new TQSplitter( parent, name ); - else if ( className == TQMULTILINEEDIT_OBJECT_NAME_STRING ) + else if ( className == "TQMultiLineEdit" ) return new TQMultiLineEdit( parent, name ); - else if ( className == TQTEXTEDIT_OBJECT_NAME_STRING ) + else if ( className == "TQTextEdit" ) return new TQTextEdit( parent, name ); - else if ( className == TQLABEL_OBJECT_NAME_STRING || className == "TextLabel" ) { + else if ( className == "TQLabel" || className == "TextLabel" ) { QDesignerLabel *l = new QDesignerLabel( parent, name ); if ( init ) { l->setText( TQString::fromLatin1( name ) ); @@ -804,9 +804,9 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare MetaDataBase::setPropertyChanged( TQT_TQOBJECT(l), "scaledContents", TRUE ); } return l; - } else if ( className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) + } else if ( className == "TQLayoutWidget" ) return new TQLayoutWidget( parent, name ); - else if ( className == TQTABWIDGET_OBJECT_NAME_STRING ) { + else if ( className == "TQTabWidget" ) { TQTabWidget *tw = new QDesignerTabWidget( parent, name ); if ( init ) { FormWindow *fw = find_formwindow( parent ); @@ -819,7 +819,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare MetaDataBase::addEntry( TQT_TQOBJECT(w) ); } return tw; - } else if ( className == TQWIDGETSTACK_OBJECT_NAME_STRING ) { + } else if ( className == "TQWidgetStack" ) { QDesignerWidgetStack *ws = new QDesignerWidgetStack( parent, name ); if ( init ) { FormWindow *fw = find_formwindow( parent ); @@ -829,9 +829,9 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare MetaDataBase::addEntry( TQT_TQOBJECT(ws) ); } return ws; - } else if ( className == TQCOMBOBOX_OBJECT_NAME_STRING ) { + } else if ( className == "TQComboBox" ) { return new TQComboBox( FALSE, parent, name ); - } else if ( className == TQWIDGET_OBJECT_NAME_STRING ) { + } else if ( className == "TQWidget" ) { if ( parent && ( ::tqqt_cast<FormWindow*>(parent) || ::tqqt_cast<TQWizard*>(parent) || @@ -847,7 +847,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare } } return new TQWidget( parent, name ); - } else if ( className == TQDIALOG_OBJECT_NAME_STRING ) { + } else if ( className == "TQDialog" ) { TQDialog *dia = 0; if ( ::tqqt_cast<FormWindow*>(parent) ) dia = new QDesignerDialog( (FormWindow*)parent, parent, name ); @@ -856,7 +856,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare if ( parent ) dia->reparent( parent, TQPoint( 0, 0 ), TRUE ); return dia; - } else if ( className == TQWIZARD_OBJECT_NAME_STRING ) { + } else if ( className == "TQWizard" ) { TQWizard *wiz = new QDesignerWizard( parent, name ); if ( parent ) wiz->reparent( parent, TQPoint( 0, 0 ), TRUE ); @@ -881,17 +881,17 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare else s->setOrientation( Qt::Horizontal ); return s; - } else if ( className == TQLCDNUMBER_OBJECT_NAME_STRING ) + } else if ( className == "TQLCDNumber" ) return new TQLCDNumber( parent, name ); - else if ( className == TQPROGRESSBAR_OBJECT_NAME_STRING ) + else if ( className == "TQProgressBar" ) return new TQProgressBar( parent, name ); - else if ( className == TQTEXTVIEW_OBJECT_NAME_STRING ) + else if ( className == "TQTextView" ) return new TQTextView( parent, name ); - else if ( className == TQTEXTBROWSER_OBJECT_NAME_STRING ) + else if ( className == "TQTextBrowser" ) return new TQTextBrowser( parent, name ); - else if ( className == TQDIAL_OBJECT_NAME_STRING ) + else if ( className == "TQDial" ) return new TQDial( parent, name ); - else if ( className == TQSLIDER_OBJECT_NAME_STRING ) { + else if ( className == "TQSlider" ) { TQSlider *s = new TQSlider( parent, name ); if ( !r ) return s; @@ -902,7 +902,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare MetaDataBase::addEntry( TQT_TQOBJECT(s) ); MetaDataBase::setPropertyChanged( TQT_TQOBJECT(s), "orientation", TRUE ); return s; - } else if ( className == TQSCROLLBAR_OBJECT_NAME_STRING ) { + } else if ( className == "TQScrollBar" ) { TQScrollBar *s = new TQScrollBar( parent, name ); if ( !r ) return s; @@ -913,7 +913,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare MetaDataBase::addEntry( TQT_TQOBJECT(s) ); MetaDataBase::setPropertyChanged( TQT_TQOBJECT(s), "orientation", TRUE ); return s; - } else if ( className == TQFRAME_OBJECT_NAME_STRING ) { + } else if ( className == "TQFrame" ) { if ( !init ) return new TQFrame( parent, name ); TQFrame *f = new TQFrame( parent, name ); @@ -932,7 +932,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare else if ( r->width() < r->height() ) l->setOrientation( Qt::Vertical ); return l; - } else if ( className == TQMAINWINDOW_OBJECT_NAME_STRING ) { + } else if ( className == "TQMainWindow" ) { TQMainWindow *mw = new TQMainWindow( parent, name, 0 ); mw->setDockEnabled( TQt::DockMinimized, FALSE ); QDesignerWidget *dw = new QDesignerWidget( (FormWindow*)parent, mw, "central widget" ); @@ -942,7 +942,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare (void)mw->statusBar(); dw->show(); return mw; - } else if ( className == TQTOOLBOX_OBJECT_NAME_STRING ) { + } else if ( className == "TQToolBox" ) { if ( !init ) return new QDesignerToolBox( parent, name ); TQToolBox *tb = new QDesignerToolBox( parent, name ); @@ -958,12 +958,12 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare return tb; } #ifndef TQT_NO_SQL - else if ( className == TQDATABROWSER_OBJECT_NAME_STRING ) { + else if ( className == "TQDataBrowser" ) { TQWidget *w = new QDesignerDataBrowser( parent, name ); if ( parent ) w->reparent( parent, TQPoint( 0, 0 ), TRUE ); return w; - } else if ( className == TQDATAVIEW_OBJECT_NAME_STRING ) { + } else if ( className == "TQDataView" ) { TQWidget *w = new QDesignerDataView( parent, name ); if ( parent ) w->reparent( parent, TQPoint( 0, 0 ), TRUE ); @@ -1021,7 +1021,7 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay TQLayout *lay = w->layout(); if ( ::tqqt_cast<TQGroupBox*>(w) ) { - TQObjectList *l = TQT_TQOBJECT(lay)->queryList( TQLAYOUT_OBJECT_NAME_STRING ); + TQObjectList *l = TQT_TQOBJECT(lay)->queryList( "TQLayout" ); if ( l && l->first() ) lay = (TQLayout*)l->first(); delete l; @@ -1169,10 +1169,10 @@ bool WidgetFactory::isPassiveInteractor( TQObject* o ) else if ( ::tqqt_cast<TQMenuBar*>(o) && ::tqqt_cast<TQMainWindow*>(o->parent()) ) return ( lastWasAPassiveInteractor = TRUE ); // else if ( ::tqqt_cast<TQDockWindowHandle*>(o) ) - else if ( o->inherits( TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING ) ) + else if ( o->inherits( "TQDockWindowHandle" ) ) return ( lastWasAPassiveInteractor = TRUE ); // else if ( ::tqqt_cast<TQHideDock*>(o) ) - else if ( o->inherits( TQHIDEDOCK_OBJECT_NAME_STRING ) ) + else if ( o->inherits( "TQHideDock" ) ) return ( lastWasAPassiveInteractor = TRUE ); else if ( qstrcmp( o->name(), "designer_wizardstack_button" ) == 0 ) return ( lastWasAPassiveInteractor = TRUE ); @@ -1215,46 +1215,46 @@ const char* WidgetFactory::classNameOf( TQObject* o ) if (WidgetDatabase::isCustomPluginWidget(WidgetDatabase::idFromClassName(o->className()))) return o->className(); else if ( ::tqqt_cast<QDesignerTabWidget*>(o) ) - return TQTABWIDGET_OBJECT_NAME_STRING; + return "TQTabWidget"; else if ( ::tqqt_cast<QDesignerWidgetStack*>(o) ) - return TQWIDGETSTACK_OBJECT_NAME_STRING; + return "TQWidgetStack"; else if ( ::tqqt_cast<TQWidgetStack*>(o) ) return "TQWeDoNotWantToBreakTabWidget"; else if ( ::tqqt_cast<QDesignerDialog*>(o) ) - return TQDIALOG_OBJECT_NAME_STRING; + return "TQDialog"; else if ( ::tqqt_cast<QDesignerWidget*>(o) ) - return TQWIDGET_OBJECT_NAME_STRING; + return "TQWidget"; else if ( o->inherits( "CustomWidget" ) ) return ( (CustomWidget*)o )->realClassName().latin1(); else if ( ::tqqt_cast<QDesignerLabel*>(o) ) - return TQLABEL_OBJECT_NAME_STRING; + return "TQLabel"; else if ( ::tqqt_cast<QDesignerWizard*>(o) ) - return TQWIZARD_OBJECT_NAME_STRING; + return "TQWizard"; else if ( ::tqqt_cast<QDesignerPushButton*>(o) ) - return TQPUSHBUTTON_OBJECT_NAME_STRING; + return "TQPushButton"; else if ( ::tqqt_cast<QDesignerToolButton*>(o) ) - return TQTOOLBUTTON_OBJECT_NAME_STRING; + return "TQToolButton"; else if ( ::tqqt_cast<QDesignerRadioButton*>(o) ) - return TQRADIOBUTTON_OBJECT_NAME_STRING; + return "TQRadioButton"; else if ( ::tqqt_cast<QDesignerCheckBox*>(o) ) - return TQCHECKBOX_OBJECT_NAME_STRING; + return "TQCheckBox"; else if ( ::tqqt_cast<MenuBarEditor*>(o) ) - return TQMENUBAR_OBJECT_NAME_STRING; + return "TQMenuBar"; else if ( ::tqqt_cast<QDesignerToolBar*>(o) ) - return TQTOOLBAR_OBJECT_NAME_STRING; + return "TQToolBar"; else if ( ::tqqt_cast<QDesignerAction*>(o) ) - return TQACTION_OBJECT_NAME_STRING; + return "TQAction"; else if ( ::tqqt_cast<QDesignerActionGroup*>(o) ) - return TQACTIONGROUP_OBJECT_NAME_STRING; + return "TQActionGroup"; else if ( ::tqqt_cast<PopupMenuEditor*>(o) ) - return TQPOPUPMENU_OBJECT_NAME_STRING; + return "TQPopupMenu"; else if ( ::tqqt_cast<QDesignerToolBox*>(o) ) - return TQTOOLBOX_OBJECT_NAME_STRING; + return "TQToolBox"; #ifndef TQT_NO_SQL else if ( ::tqqt_cast<QDesignerDataBrowser*>(o) ) - return TQDATABROWSER_OBJECT_NAME_STRING; + return "TQDataBrowser"; else if ( ::tqqt_cast<QDesignerDataView*>(o) ) - return TQDATAVIEW_OBJECT_NAME_STRING; + return "TQDataView"; #endif return o->className(); } @@ -1317,7 +1317,7 @@ void WidgetFactory::initChangedProperties( TQObject *o ) } else if ( ::tqqt_cast<TQGroupBox*>(o) ) MetaDataBase::setPropertyChanged( o, "title", TRUE ); - else if ( o->isA( TQFRAME_OBJECT_NAME_STRING ) ) { + else if ( o->isA( "TQFrame" ) ) { MetaDataBase::setPropertyChanged( o, "frameShadow", TRUE ); MetaDataBase::setPropertyChanged( o, "frameShape", TRUE ); } else if ( ::tqqt_cast<TQTabWidget*>(o) || ::tqqt_cast<TQWizard*>(o) ) { @@ -1372,7 +1372,7 @@ bool WidgetFactory::hasSpecialEditor( int id, TQObject *editorWidget ) return TRUE; if ( className.contains( "IconView" ) ) return TRUE; - if ( className == TQTEXTEDIT_OBJECT_NAME_STRING || className == TQMULTILINEEDIT_OBJECT_NAME_STRING ) + if ( className == "TQTextEdit" || className == "TQMultiLineEdit" ) return TRUE; if ( ::tqqt_cast<TQTable*>(editorWidget) != 0 ) return TRUE; @@ -1435,7 +1435,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget, return; } - if ( className == TQMULTILINEEDIT_OBJECT_NAME_STRING || className == TQTEXTEDIT_OBJECT_NAME_STRING ) { + if ( className == "TQMultiLineEdit" || className == "TQTextEdit" ) { MultiLineEditor *e = new MultiLineEditor( FALSE, TRUE, parent, editWidget, fw ); e->exec(); delete e; @@ -1541,7 +1541,7 @@ void QDesignerLabel::updateBuddy() if ( myBuddy.isEmpty() ) return; - TQObjectList *l = topLevelWidget()->queryList( TQWIDGET_OBJECT_NAME_STRING, myBuddy, FALSE, TRUE ); + TQObjectList *l = topLevelWidget()->queryList( "TQWidget", myBuddy, FALSE, TRUE ); if ( !l || !l->first() ) { delete l; return; |