summaryrefslogtreecommitdiffstats
path: root/kommander/factory/kommanderfactory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/factory/kommanderfactory.cpp')
-rw-r--r--kommander/factory/kommanderfactory.cpp152
1 files changed, 76 insertions, 76 deletions
diff --git a/kommander/factory/kommanderfactory.cpp b/kommander/factory/kommanderfactory.cpp
index 4b59f93b..ecfcb8cd 100644
--- a/kommander/factory/kommanderfactory.cpp
+++ b/kommander/factory/kommanderfactory.cpp
@@ -314,75 +314,75 @@ TQWidget *KommanderFactory::createWidget( const TQString &literalClassName, TQWi
// create widgets we know
if (className == TQPUSHBUTTON_OBJECT_NAME_STRING)
return new TQPushButton(parent, name);
- else if (className == "TQToolButton")
+ else if (className == TQTOOLBUTTON_OBJECT_NAME_STRING)
return new TQToolButton(parent, name);
- else if (className == "TQCheckBox")
+ else if (className == TQCHECKBOX_OBJECT_NAME_STRING)
return new TQCheckBox(parent, name);
- else if (className == "TQRadioButton")
+ else if (className == TQRADIOBUTTON_OBJECT_NAME_STRING)
return new TQRadioButton(parent, name);
- else if (className == "TQGroupBox")
+ else if (className == TQGROUPBOX_OBJECT_NAME_STRING)
return new TQGroupBox(parent, name);
- else if (className == "TQButtonGroup")
+ else if (className == TQBUTTONGROUP_OBJECT_NAME_STRING)
return new TQButtonGroup(parent, name);
- else if (className == "TQIconView")
+ else if (className == TQICONVIEW_OBJECT_NAME_STRING)
{
#if !defined(QT_NO_ICONVIEW)
return new TQIconView(parent, name);
#endif
}
- else if (className == "TQTable")
+ else if (className == TQTABLE_OBJECT_NAME_STRING)
{
#if !defined(QT_NO_TABLE)
return new TQTable(parent, name);
#endif
}
- else if (className == "TQListBox")
+ else if (className == TQLISTBOX_OBJECT_NAME_STRING)
return new TQListBox(parent, name);
- else if (className == "TQListView")
+ else if (className == TQLISTVIEW_OBJECT_NAME_STRING)
return new TQListView(parent, name);
- 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 == "TQMultiLineEdit")
+ else if (className == TQMULTILINEEDIT_OBJECT_NAME_STRING)
return new TQMultiLineEdit(parent, name);
- else if (className == "TQLabel")
+ else if (className == TQLABEL_OBJECT_NAME_STRING)
return new TQLabel(parent, name);
- else if (className == "QLayoutWidget")
+ else if (className == TQLAYOUTWIDGET_OBJECT_NAME_STRING)
return new TQWidget(parent, name);
- else if (className == "TQTabWidget")
+ else if (className == TQTABWIDGET_OBJECT_NAME_STRING)
return new TQTabWidget(parent, name);
- 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 (!qwf_stays_on_top)
return new TQWidget(parent, name);
return new TQWidget(parent, name, Qt::WStyle_StaysOnTop);
}
- else if (className == "TQDialog")
+ else if (className == TQDIALOG_OBJECT_NAME_STRING)
{
if (!qwf_stays_on_top)
return new TQDialog(parent, name);
return new TQDialog(parent, name, false, Qt::WStyle_StaysOnTop);
}
- else if (className == "TQWizard")
+ else if (className == TQWIZARD_OBJECT_NAME_STRING)
return new TQWizard(parent, name);
- 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)
return new TQSlider(parent, name);
- else if (className == "TQFrame")
+ else if (className == TQFRAME_OBJECT_NAME_STRING)
return new TQFrame(parent, name);
- else if (className == "TQSplitter")
+ else if (className == TQSPLITTER_OBJECT_NAME_STRING)
return new TQSplitter(parent, name);
else if (className == "Line")
{
@@ -390,21 +390,21 @@ TQWidget *KommanderFactory::createWidget( const TQString &literalClassName, TQWi
f->setFrameStyle(TQFrame::HLine | TQFrame::Sunken);
return f;
}
- else if (className == "TQTextEdit")
+ else if (className == TQTEXTEDIT_OBJECT_NAME_STRING)
return new TQTextEdit(parent, name);
- 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 == "TQScrollBar")
+ else if (className == TQSCROLLBAR_OBJECT_NAME_STRING)
return new TQScrollBar(parent, name);
- else if (className == "TQPopupMenu")
+ else if (className == TQPOPUPMENU_OBJECT_NAME_STRING)
return new TQPopupMenu(parent, name);
- else if (className == "TQWidgetStack")
+ else if (className == TQWIDGETSTACK_OBJECT_NAME_STRING)
return new TQWidgetStack(parent, name);
- else if (className == "TQMainWindow")
+ else if (className == TQMAINWINDOW_OBJECT_NAME_STRING)
{
TQMainWindow *mw = 0;
if (!qwf_stays_on_top)
@@ -417,11 +417,11 @@ TQWidget *KommanderFactory::createWidget( const TQString &literalClassName, TQWi
return mw;
}
#if !defined(QT_NO_SQL)
- else if (className == "TQDataTable")
+ else if (className == TQDATATABLE_OBJECT_NAME_STRING)
return new TQDataTable(parent, name);
- else if (className == "TQDataBrowser")
+ else if (className == TQDATABROWSER_OBJECT_NAME_STRING)
return new QDesignerDataBrowser2(parent, name);
- else if (className == "TQDataView")
+ else if (className == TQDATAVIEW_OBJECT_NAME_STRING)
return new QDesignerDataView2(parent, name);
#endif
@@ -512,9 +512,9 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
if ( colspan < 1 )
colspan = 1;
if ( !className.isEmpty() ) {
- if ( !layout && className == "QLayoutWidget" )
- className = "TQWidget";
- if ( layout && className == "QLayoutWidget" ) {
+ if ( !layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING )
+ className = TQWIDGET_OBJECT_NAME_STRING;
+ if ( layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
// hide layout widgets
w = parent;
} else {
@@ -526,7 +526,7 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
w = (TQWidget*)obj;
if ( !toplevel )
toplevel = w;
- if ( w->inherits( "TQMainWindow" ) )
+ if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
w = ( (TQMainWindow*)w )->centralWidget();
if ( layout ) {
switch( layoutType( layout ) ) {
@@ -556,39 +556,39 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge
createSpacer( n, layout );
} else if ( n.tagName() == "widget" ) {
TQMap< TQString, TQString> *oldDbControls = dbControls;
- createWidgetInternal( n, w, layout, n.attribute( "class", "TQWidget" ) );
+ createWidgetInternal( n, w, layout, n.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) );
dbControls = oldDbControls;
} else if ( n.tagName() == "hbox" ) {
TQLayout *parentLayout = layout;
- if ( layout && layout->inherits( "TQGridLayout" ) )
+ if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
layout = createLayout( 0, 0, KommanderFactory::HBox );
else
layout = createLayout( w, layout, KommanderFactory::HBox );
obj = layout;
n = n.firstChild().toElement();
- if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) )
+ if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 );
continue;
} else if ( n.tagName() == "grid" ) {
TQLayout *parentLayout = layout;
- if ( layout && layout->inherits( "TQGridLayout" ) )
+ if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
layout = createLayout( 0, 0, KommanderFactory::Grid );
else
layout = createLayout( w, layout, KommanderFactory::Grid );
obj = layout;
n = n.firstChild().toElement();
- if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) )
+ if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 );
continue;
} else if ( n.tagName() == "vbox" ) {
TQLayout *parentLayout = layout;
- if ( layout && layout->inherits( "TQGridLayout" ) )
+ if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
layout = createLayout( 0, 0, KommanderFactory::VBox );
else
layout = createLayout( w, layout, KommanderFactory::VBox );
obj = layout;
n = n.firstChild().toElement();
- if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) )
+ if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 );
continue;
} else if ( n.tagName() == "property" && obj ) {
@@ -596,14 +596,14 @@ 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 ( parent->inherits( "TQTabWidget" ) ) {
+ if ( parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) {
if ( attrib == "title" )
( (TQTabWidget*)parent )->insertTab( w, translate(v.toString()) );
} else
- if ( parent->inherits( "TQToolBox" ) ) {
+ if ( parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) {
if ( attrib == "label" )
( (TQToolBox*)parent )->addItem( w, translate(v.toString()) );
- }else if ( parent->inherits( "TQWizard" ) ) {
+ }else if ( parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
if ( attrib == "title" )
( (TQWizard*)parent )->addPage( w, translate(v.toString()) );
}
@@ -624,18 +624,18 @@ TQLayout *KommanderFactory::createLayout( TQWidget *widget, TQLayout* layout, L
int spacing = defSpacing;
int margin = defMargin;
- if ( !layout && widget && widget->inherits( "TQTabWidget" ) )
+ if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
widget = ((TQTabWidget*)widget)->currentPage();
- if ( !layout && widget && widget->inherits( "TQToolBox" ) )
+ if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
widget = ((TQToolBox*)widget)->currentItem();
- if ( !layout && widget && widget->inherits( "TQWizard" ) )
+ if ( !layout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
widget = ((TQWizard*)widget)->currentPage();
- if ( !layout && widget && widget->inherits( "TQWidgetStack" ) )
+ if ( !layout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
widget = ((TQWidgetStack*)widget)->visibleWidget();
- if ( !layout && widget && widget->inherits( "TQGroupBox" ) ) {
+ if ( !layout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, Qt::Vertical );
gb->layout()->setMargin( 0 );
@@ -714,11 +714,11 @@ TQLayout *KommanderFactory::createLayout( TQWidget *widget, TQLayout* layout, L
KommanderFactory::LayoutType KommanderFactory::layoutType( TQLayout *layout ) const
{
- if ( layout->inherits( "TQHBoxLayout" ) )
+ if ( layout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
return HBox;
- else if ( layout->inherits( "TQVBoxLayout" ) )
+ else if ( layout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
return VBox;
- else if ( layout->inherits( "TQGridLayout" ) )
+ else if ( layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
return Grid;
return NoLayout;
}
@@ -764,8 +764,8 @@ void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const T
TQWhatsThis::add( (TQWidget*)obj, translate(v.toString()) );
}
#ifndef QT_NO_SQL
- if ( prop == "database" && !obj->inherits( "TQDataView" )
- && !obj->inherits( "TQDataBrowser" ) ) {
+ if ( prop == "database" && !obj->inherits( TQDATAVIEW_OBJECT_NAME_STRING )
+ && !obj->inherits( TQDATABROWSER_OBJECT_NAME_STRING ) ) {
TQStringList lst = DomTool::elementToVariant( e, TQVariant( TQStringList() ) ).toStringList();
if ( lst.count() > 2 ) {
if ( dbControls )
@@ -775,7 +775,7 @@ void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const T
}
} else if ( prop == "database" ) {
TQStringList lst = DomTool::elementToVariant( e, TQVariant( TQStringList() ) ).toStringList();
- if ( lst.count() == 2 && obj->inherits( "TQWidget" ) ) {
+ if ( lst.count() == 2 && obj->inherits( TQWIDGET_OBJECT_NAME_STRING ) ) {
SqlWidgetConnection conn( lst[ 0 ], lst[ 1 ] );
sqlWidgetConnections.insert( (TQWidget*)obj, conn );
dbControls = conn.dbControls;
@@ -789,7 +789,7 @@ void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const T
noDatabaseWidgets << obj->name();
}
} else if ( prop == "buttonGroupId" ) {
- if ( obj->inherits( "TQButton" ) && obj->parent()->inherits( "TQButtonGroup" ) )
+ if ( obj->inherits( TQBUTTON_OBJECT_NAME_STRING ) && obj->parent()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) )
( (TQButtonGroup*)obj->parent() )->insert( (TQButton*)obj, v.toInt() );
}
@@ -884,7 +884,7 @@ void KommanderFactory::createSpacer( const TQDomElement &e, TQLayout *layout )
TQSpacerItem *item = new TQSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : TQSizePolicy::Minimum,
orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum );
if ( layout ) {
- if ( layout->inherits( "TQBoxLayout" ) )
+ if ( layout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) )
( (TQBoxLayout*)layout )->addItem( item );
else
( (TQGridLayout*)layout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1,
@@ -1148,7 +1148,7 @@ void KommanderFactory::loadTabOrder( const TQDomElement &e )
void KommanderFactory::createColumn( const TQDomElement &e, TQWidget *widget )
{
- if ( widget->inherits( "TQListView" ) && e.tagName() == "column" ) {
+ if ( widget->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) && e.tagName() == "column" ) {
TQListView *lv = (TQListView*)widget;
TQDomElement n = e.firstChild().toElement();
TQPixmap pix;
@@ -1182,10 +1182,10 @@ void KommanderFactory::createColumn( const TQDomElement &e, TQWidget *widget )
lv->header()->setResizeEnabled( resizeable, i );
}
#ifndef QT_NO_TABLE
- else if ( widget->inherits( "TQTable" ) ) {
+ else if ( widget->inherits( TQTABLE_OBJECT_NAME_STRING ) ) {
TQTable *table = (TQTable*)widget;
#ifndef QT_NO_SQL
- bool isSql = (widget->inherits( "TQDataTable" ));
+ bool isSql = (widget->inherits( TQDATATABLE_OBJECT_NAME_STRING ));
#endif
bool isRow;
if ( ( isRow = e.tagName() == "row" ) )
@@ -1270,14 +1270,14 @@ void KommanderFactory::loadItem( const TQDomElement &e, TQPixmap &pix, TQString
void KommanderFactory::createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i )
{
- if ( widget->inherits( "TQListBox" ) || widget->inherits( "TQComboBox" ) ) {
+ if ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) || widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) {
TQDomElement n = e.firstChild().toElement();
TQPixmap pix;
bool hasPixmap = false;
TQString txt;
loadItem( n, pix, txt, hasPixmap );
TQListBox *lb = 0;
- if ( widget->inherits( "TQListBox" ) )
+ if ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) )
lb = (TQListBox*)widget;
else
lb = ( (TQComboBox*)widget)->listBox();
@@ -1287,7 +1287,7 @@ void KommanderFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLi
new TQListBoxText( lb, txt );
}
#ifndef QT_NO_ICONVIEW
- } else if ( widget->inherits( "TQIconView" ) ) {
+ } else if ( widget->inherits( TQICONVIEW_OBJECT_NAME_STRING ) ) {
TQDomElement n = e.firstChild().toElement();
TQPixmap pix;
bool hasPixmap = false;
@@ -1297,7 +1297,7 @@ void KommanderFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLi
TQIconView *iv = (TQIconView*)widget;
new TQIconViewItem( iv, txt, pix );
#endif
- } else if ( widget->inherits( "TQListView" ) ) {
+ } else if ( widget->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) ) {
TQDomElement n = e.firstChild().toElement();
TQPixmap pix;
TQValueList<TQPixmap> pixmaps;
@@ -1358,7 +1358,7 @@ void KommanderFactory::loadChildAction( TQObject *parent, const TQDomElement &e
}
n2 = n2.nextSibling().toElement();
}
- if ( !parent->inherits( "TQAction" ) )
+ if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) )
actionList.append( a );
} else if ( n.tagName() == "actiongroup" ) {
a = new TQActionGroup( parent );
@@ -1375,7 +1375,7 @@ void KommanderFactory::loadChildAction( TQObject *parent, const TQDomElement &e
}
n2 = n2.nextSibling().toElement();
}
- if ( !parent->inherits( "TQAction" ) )
+ if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) )
actionList.append( a );
}
if ( a )
@@ -1415,7 +1415,7 @@ void KommanderFactory::loadToolBars( const TQDomElement &e )
} else if ( n2.tagName() == "separator" ) {
tb->addSeparator();
} else if ( n2.tagName() == "widget" ) {
- (void)createWidgetInternal( n2, tb, 0, n2.attribute( "class", "TQWidget" ) );
+ (void)createWidgetInternal( n2, tb, 0, n2.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) );
} else if ( n2.tagName() == "property" ) {
setProperty( tb, n2.attribute( "name" ), n2.firstChild().toElement() );
}
@@ -1460,7 +1460,7 @@ TQAction *KommanderFactory::findAction( const TQString &name )
for ( TQAction *a = actionList.first(); a; a = actionList.next() ) {
if ( TQString( a->name() ) == name )
return a;
- TQAction *ac = (TQAction*)a->child( name.latin1(), "TQAction" );
+ TQAction *ac = (TQAction*)a->child( name.latin1(), TQACTION_OBJECT_NAME_STRING );
if ( ac )
return ac;
}