summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/widgetfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/widgetfactory.cpp')
-rw-r--r--kdevdesigner/designer/widgetfactory.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/kdevdesigner/designer/widgetfactory.cpp b/kdevdesigner/designer/widgetfactory.cpp
index 410dab23..a38e75af 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" ) {
+ if ( className == TQPUSHBUTTON_OBJECT_NAME_STRING ) {
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 && ::qt_cast<TQDialog*>(((FormWindow*)w)->mainContainer()) );
return b;
- } else if ( className == "TQToolButton" ) {
+ } else if ( className == TQTOOLBUTTON_OBJECT_NAME_STRING ) {
if ( init ) {
QDesignerToolButton *tb = new QDesignerToolButton( parent, name );
if ( ::qt_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" ) {
+ } else if ( className == TQCHECKBOX_OBJECT_NAME_STRING ) {
if ( init ) {
QDesignerCheckBox *cb = new QDesignerCheckBox( parent, name );
cb->setText( TQString::fromLatin1( name ) );
return cb;
}
return new QDesignerCheckBox( parent, name );
- } else if ( className == "TQRadioButton" ) {
+ } else if ( className == TQRADIOBUTTON_OBJECT_NAME_STRING ) {
if ( init ) {
QDesignerRadioButton *rb = new QDesignerRadioButton( parent, name );
rb->setText( TQString::fromLatin1( name ) );
return rb;
}
return new QDesignerRadioButton( parent, name );
- } else if ( className == "TQGroupBox" ) {
+ } else if ( className == TQGROUPBOX_OBJECT_NAME_STRING ) {
if ( init )
return new TQGroupBox( TQString::fromLatin1( name ), parent, name );
return new TQGroupBox( parent, name );
- } else if ( className == "TQButtonGroup" ) {
+ } else if ( className == TQBUTTONGROUP_OBJECT_NAME_STRING ) {
if ( init )
return new TQButtonGroup( TQString::fromLatin1( name ), parent, name );
return new TQButtonGroup( parent, name );
- } else if ( className == "TQIconView" ) {
+ } else if ( className == TQICONVIEW_OBJECT_NAME_STRING ) {
#if !defined(QT_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" ) {
+ } else if ( className == TQTABLE_OBJECT_NAME_STRING ) {
#if !defined(QT_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 QT_NO_SQL
- } else if ( className == "TQDataTable" ) {
+ } else if ( className == TQDATATABLE_OBJECT_NAME_STRING ) {
return new TQDataTable( parent, name );
#endif //QT_NO_SQL
- } else if ( className == "QDateEdit" ) {
+ } else if ( className == TQDATEEDIT_OBJECT_NAME_STRING ) {
return new QDateEdit( parent, name );
- } else if ( className == "QTimeEdit" ) {
+ } else if ( className == TQTIMEEDIT_OBJECT_NAME_STRING ) {
return new QTimeEdit( parent, name );
- } else if ( className == "QDateTimeEdit" ) {
+ } else if ( className == TQDATETIMEEDIT_OBJECT_NAME_STRING ) {
return new QDateTimeEdit( parent, name );
}
- else if ( className == "TQListBox" ) {
+ else if ( className == TQLISTBOX_OBJECT_NAME_STRING ) {
TQListBox* lb = new TQListBox( parent, name );
if ( init ) {
lb->insertItem( i18n( "New Item" ) );
lb->setCurrentItem( 0 );
}
return lb;
- } else if ( className == "TQListView" ) {
+ } else if ( className == TQLISTVIEW_OBJECT_NAME_STRING ) {
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" )
+ } else if ( className == TQLINEEDIT_OBJECT_NAME_STRING )
return new TQLineEdit( parent, name );
- else if ( className == "TQSpinBox" )
+ else if ( className == TQSPINBOX_OBJECT_NAME_STRING )
return new TQSpinBox( parent, name );
- else if ( className == "TQSplitter" )
+ else if ( className == TQSPLITTER_OBJECT_NAME_STRING )
return new TQSplitter( parent, name );
- else if ( className == "TQMultiLineEdit" )
+ else if ( className == TQMULTILINEEDIT_OBJECT_NAME_STRING )
return new TQMultiLineEdit( parent, name );
- else if ( className == "TQTextEdit" )
+ else if ( className == TQTEXTEDIT_OBJECT_NAME_STRING )
return new TQTextEdit( parent, name );
- else if ( className == "TQLabel" || className == "TextLabel" ) {
+ else if ( className == TQLABEL_OBJECT_NAME_STRING || 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( l, "scaledContents", TRUE );
}
return l;
- } else if ( className == "QLayoutWidget" )
+ } else if ( className == TQLAYOUTWIDGET_OBJECT_NAME_STRING )
return new QLayoutWidget( parent, name );
- else if ( className == "TQTabWidget" ) {
+ else if ( className == TQTABWIDGET_OBJECT_NAME_STRING ) {
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( w );
}
return tw;
- } else if ( className == "TQWidgetStack" ) {
+ } else if ( className == TQWIDGETSTACK_OBJECT_NAME_STRING ) {
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( ws );
}
return ws;
- } else if ( className == "TQComboBox" ) {
+ } else if ( className == TQCOMBOBOX_OBJECT_NAME_STRING ) {
return new TQComboBox( FALSE, parent, name );
- } else if ( className == "TQWidget" ) {
+ } else if ( className == TQWIDGET_OBJECT_NAME_STRING ) {
if ( parent &&
( ::qt_cast<FormWindow*>(parent) ||
::qt_cast<TQWizard*>(parent) ||
@@ -847,7 +847,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
}
}
return new TQWidget( parent, name );
- } else if ( className == "TQDialog" ) {
+ } else if ( className == TQDIALOG_OBJECT_NAME_STRING ) {
TQDialog *dia = 0;
if ( ::qt_cast<FormWindow*>(parent) )
dia = new QDesignerDialog( (FormWindow*)parent, parent, name );
@@ -860,7 +860,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
#endif
dia->reparent( parent, TQPoint( 0, 0 ), TRUE );
return dia;
- } else if ( className == "TQWizard" ) {
+ } else if ( className == TQWIZARD_OBJECT_NAME_STRING ) {
TQWizard *wiz = new QDesignerWizard( parent, name );
#if defined(QT_NON_COMMERCIAL)
if ( ::qt_cast<MainWindow*>(parent) )
@@ -889,17 +889,17 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
else
s->setOrientation( Qt::Horizontal );
return s;
- } else if ( className == "TQLCDNumber" )
+ } else if ( className == TQLCDNUMBER_OBJECT_NAME_STRING )
return new TQLCDNumber( parent, name );
- else if ( className == "TQProgressBar" )
+ else if ( className == TQPROGRESSBAR_OBJECT_NAME_STRING )
return new TQProgressBar( parent, name );
- else if ( className == "TQTextView" )
+ else if ( className == TQTEXTVIEW_OBJECT_NAME_STRING )
return new TQTextView( parent, name );
- else if ( className == "TQTextBrowser" )
+ else if ( className == TQTEXTBROWSER_OBJECT_NAME_STRING )
return new TQTextBrowser( parent, name );
- else if ( className == "TQDial" )
+ else if ( className == TQDIAL_OBJECT_NAME_STRING )
return new TQDial( parent, name );
- else if ( className == "TQSlider" ) {
+ else if ( className == TQSLIDER_OBJECT_NAME_STRING ) {
TQSlider *s = new TQSlider( parent, name );
if ( !r )
return s;
@@ -910,7 +910,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
MetaDataBase::addEntry( s );
MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
return s;
- } else if ( className == "TQScrollBar" ) {
+ } else if ( className == TQSCROLLBAR_OBJECT_NAME_STRING ) {
TQScrollBar *s = new TQScrollBar( parent, name );
if ( !r )
return s;
@@ -921,7 +921,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
MetaDataBase::addEntry( s );
MetaDataBase::setPropertyChanged( s, "orientation", TRUE );
return s;
- } else if ( className == "TQFrame" ) {
+ } else if ( className == TQFRAME_OBJECT_NAME_STRING ) {
if ( !init )
return new TQFrame( parent, name );
TQFrame *f = new TQFrame( parent, name );
@@ -940,7 +940,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" ) {
+ } else if ( className == TQMAINWINDOW_OBJECT_NAME_STRING ) {
TQMainWindow *mw = new TQMainWindow( parent, name, 0 );
mw->setDockEnabled( Qt::DockMinimized, FALSE );
QDesignerWidget *dw = new QDesignerWidget( (FormWindow*)parent, mw, "central widget" );
@@ -950,7 +950,7 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
(void)mw->statusBar();
dw->show();
return mw;
- } else if ( className == "TQToolBox" ) {
+ } else if ( className == TQTOOLBOX_OBJECT_NAME_STRING ) {
if ( !init )
return new QDesignerToolBox( parent, name );
TQToolBox *tb = new QDesignerToolBox( parent, name );
@@ -966,12 +966,12 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare
return tb;
}
#ifndef QT_NO_SQL
- else if ( className == "TQDataBrowser" ) {
+ else if ( className == TQDATABROWSER_OBJECT_NAME_STRING ) {
TQWidget *w = new QDesignerDataBrowser( parent, name );
if ( parent )
w->reparent( parent, TQPoint( 0, 0 ), TRUE );
return w;
- } else if ( className == "TQDataView" ) {
+ } else if ( className == TQDATAVIEW_OBJECT_NAME_STRING ) {
TQWidget *w = new QDesignerDataView( parent, name );
if ( parent )
w->reparent( parent, TQPoint( 0, 0 ), TRUE );
@@ -1029,7 +1029,7 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&lay
TQLayout *lay = w->layout();
if ( ::qt_cast<TQGroupBox*>(w) ) {
- TQObjectList *l = lay->queryList( "TQLayout" );
+ TQObjectList *l = lay->queryList( TQLAYOUT_OBJECT_NAME_STRING );
if ( l && l->first() )
lay = (TQLayout*)l->first();
delete l;
@@ -1325,7 +1325,7 @@ void WidgetFactory::initChangedProperties( TQObject *o )
}
else if ( ::qt_cast<TQGroupBox*>(o) )
MetaDataBase::setPropertyChanged( o, "title", TRUE );
- else if ( o->isA( "TQFrame" ) ) {
+ else if ( o->isA( TQFRAME_OBJECT_NAME_STRING ) ) {
MetaDataBase::setPropertyChanged( o, "frameShadow", TRUE );
MetaDataBase::setPropertyChanged( o, "frameShape", TRUE );
} else if ( ::qt_cast<TQTabWidget*>(o) || ::qt_cast<TQWizard*>(o) ) {
@@ -1380,7 +1380,7 @@ bool WidgetFactory::hasSpecialEditor( int id, TQObject *editorWidget )
return TRUE;
if ( className.contains( "IconView" ) )
return TRUE;
- if ( className == "TQTextEdit" || className == "TQMultiLineEdit" )
+ if ( className == TQTEXTEDIT_OBJECT_NAME_STRING || className == TQMULTILINEEDIT_OBJECT_NAME_STRING )
return TRUE;
if ( ::qt_cast<TQTable*>(editorWidget) != 0 )
return TRUE;
@@ -1443,7 +1443,7 @@ void WidgetFactory::editWidget( int id, TQWidget *parent, TQWidget *editWidget,
return;
}
- if ( className == "TQMultiLineEdit" || className == "TQTextEdit" ) {
+ if ( className == TQMULTILINEEDIT_OBJECT_NAME_STRING || className == TQTEXTEDIT_OBJECT_NAME_STRING ) {
MultiLineEditor *e = new MultiLineEditor( FALSE, TRUE, parent, editWidget, fw );
e->exec();
delete e;
@@ -1549,7 +1549,7 @@ void QDesignerLabel::updateBuddy()
if ( myBuddy.isEmpty() )
return;
- TQObjectList *l = topLevelWidget()->queryList( "TQWidget", myBuddy, FALSE, TRUE );
+ TQObjectList *l = topLevelWidget()->queryList( TQWIDGET_OBJECT_NAME_STRING, myBuddy, FALSE, TRUE );
if ( !l || !l->first() ) {
delete l;
return;