summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kdevdesigner/designer/widgetfactory.h24
-rw-r--r--kdevdesigner/uilib/qwidgetfactory.cpp188
2 files changed, 106 insertions, 106 deletions
diff --git a/kdevdesigner/designer/widgetfactory.h b/kdevdesigner/designer/widgetfactory.h
index 7b59f803..d3d315fc 100644
--- a/kdevdesigner/designer/widgetfactory.h
+++ b/kdevdesigner/designer/widgetfactory.h
@@ -392,13 +392,13 @@ public:
: TQToolButton( parent, name ) {}
bool isInButtonGroup() const {
- return parentWidget() && parentWidget()->inherits( "TQButtonGroup" );
+ return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
}
int buttonGroupId() const {
- return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
+ return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
}
void setButtonGroupId( int id ) {
- if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) {
+ if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id );
}
@@ -415,13 +415,13 @@ public:
: TQRadioButton( parent, name ) {}
bool isInButtonGroup() const {
- return parentWidget() && parentWidget()->inherits( "TQButtonGroup" );
+ return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
}
int buttonGroupId() const {
- return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
+ return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
}
void setButtonGroupId( int id ) {
- if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) {
+ if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id );
}
@@ -439,13 +439,13 @@ public:
: TQPushButton( parent, name ) {}
bool isInButtonGroup() const {
- return parentWidget() && parentWidget()->inherits( "TQButtonGroup" );
+ return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
}
int buttonGroupId() const {
- return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
+ return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
}
void setButtonGroupId( int id ) {
- if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) {
+ if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id );
}
@@ -463,13 +463,13 @@ public:
: TQCheckBox( parent, name ) {}
bool isInButtonGroup() const {
- return parentWidget() && parentWidget()->inherits( "TQButtonGroup" );
+ return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
}
int buttonGroupId() const {
- return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
+ return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ? ( (TQButtonGroup*)parentWidget() )->id( (TQButton*)this ) : -1;
}
void setButtonGroupId( int id ) {
- if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) {
+ if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id );
}
diff --git a/kdevdesigner/uilib/qwidgetfactory.cpp b/kdevdesigner/uilib/qwidgetfactory.cpp
index 562a647b..a3a16755 100644
--- a/kdevdesigner/uilib/qwidgetfactory.cpp
+++ b/kdevdesigner/uilib/qwidgetfactory.cpp
@@ -133,19 +133,19 @@ static void setupWidgetListAndMap()
return;
setupPluginDir();
availableWidgetList = new TQStringList;
- (*availableWidgetList) << "TQPushButton" << "TQToolButton" << "TQCheckBox" << "TQRadioButton"
- << "TQGroupBox" << "TQButtonGroup" << "TQIconView" << "TQTable"
- << "TQListBox" << "TQListView" << "TQLineEdit" << "TQSpinBox"
- << "TQMultiLineEdit" << "TQLabel" << "TextLabel" << "PixmapLabel"
- << "QLayoutWidget" << "TQTabWidget" << "TQComboBox"
- << "TQWidget" << "TQDialog" << "TQWizard" << "TQLCDNumber";
+ (*availableWidgetList) << TQPUSHBUTTON_OBJECT_NAME_STRING << TQTOOLBUTTON_OBJECT_NAME_STRING << TQCHECKBOX_OBJECT_NAME_STRING << TQRADIOBUTTON_OBJECT_NAME_STRING
+ << TQGROUPBOX_OBJECT_NAME_STRING << TQBUTTONGROUP_OBJECT_NAME_STRING << TQICONVIEW_OBJECT_NAME_STRING << TQTABLE_OBJECT_NAME_STRING
+ << TQLISTBOX_OBJECT_NAME_STRING << TQLISTVIEW_OBJECT_NAME_STRING << TQLINEEDIT_OBJECT_NAME_STRING << TQSPINBOX_OBJECT_NAME_STRING
+ << TQMULTILINEEDIT_OBJECT_NAME_STRING << TQLABEL_OBJECT_NAME_STRING << "TextLabel" << "PixmapLabel"
+ << TQLAYOUTWIDGET_OBJECT_NAME_STRING << TQTABWIDGET_OBJECT_NAME_STRING << TQCOMBOBOX_OBJECT_NAME_STRING
+ << TQWIDGET_OBJECT_NAME_STRING << TQDIALOG_OBJECT_NAME_STRING << TQWIZARD_OBJECT_NAME_STRING << TQLCDNUMBER_OBJECT_NAME_STRING;
// put less stress on the compiler by limiting the template nesting depth
- (*availableWidgetList) << "TQProgressBar" << "TQTextView" << "TQTextBrowser"
- << "TQDial" << "TQSlider" << "TQFrame" << "Line" << "TQTextEdit"
- << "QDateEdit" << "QTimeEdit" << "QDateTimeEdit" << "TQScrollBar"
- << "TQPopupMenu" << "TQWidgetStack" << "TQMainWindow"
- << "TQDataTable" << "TQDataBrowser" << "TQDataView"
- << "TQVBox" << "TQHBox" << "TQGrid" << "TQToolBox";
+ (*availableWidgetList) << TQPROGRESSBAR_OBJECT_NAME_STRING << TQTEXTVIEW_OBJECT_NAME_STRING << TQTEXTBROWSER_OBJECT_NAME_STRING
+ << TQDIAL_OBJECT_NAME_STRING << TQSLIDER_OBJECT_NAME_STRING << TQFRAME_OBJECT_NAME_STRING << "Line" << TQTEXTEDIT_OBJECT_NAME_STRING
+ << TQDATEEDIT_OBJECT_NAME_STRING << TQTIMEEDIT_OBJECT_NAME_STRING << TQDATETIMEEDIT_OBJECT_NAME_STRING << TQSCROLLBAR_OBJECT_NAME_STRING
+ << TQPOPUPMENU_OBJECT_NAME_STRING << TQWIDGETSTACK_OBJECT_NAME_STRING << TQMAINWINDOW_OBJECT_NAME_STRING
+ << TQDATATABLE_OBJECT_NAME_STRING << TQDATABROWSER_OBJECT_NAME_STRING << TQDATAVIEW_OBJECT_NAME_STRING
+ << TQVBOX_OBJECT_NAME_STRING << TQHBOX_OBJECT_NAME_STRING << TQGRID_OBJECT_NAME_STRING << TQTOOLBOX_OBJECT_NAME_STRING;
if ( !widgetInterfaceManager )
widgetInterfaceManager =
@@ -1410,97 +1410,97 @@ TQWidget *TQWidgetFactory::createWidget( const TQString &className, TQWidget *pa
const char *name ) const
{
// create widgets we know
- if ( className == "TQPushButton" ) {
+ 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" || className == "TextLabel" || className == "PixmapLabel" ) {
+ } else if ( className == TQLABEL_OBJECT_NAME_STRING || className == "TextLabel" || className == "PixmapLabel" ) {
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" ) {
TQFrame *f = new TQFrame( parent, name );
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 == "TQToolBox" ) {
+ } else if ( className == TQTOOLBOX_OBJECT_NAME_STRING ) {
return new TQToolBox( parent, name );
- } else if ( className == "TQVBox" ) {
+ } else if ( className == TQVBOX_OBJECT_NAME_STRING ) {
return new TQVBox( parent, name );
- } else if ( className == "TQHBox" ) {
+ } else if ( className == TQHBOX_OBJECT_NAME_STRING ) {
return new TQHBox( parent, name );
- } else if ( className == "TQGrid" ) {
+ } else if ( className == TQGRID_OBJECT_NAME_STRING ) {
return new TQGrid( 4, parent, name );
- } else if ( className == "TQMainWindow" ) {
+ } else if ( className == TQMAINWINDOW_OBJECT_NAME_STRING ) {
TQMainWindow *mw = 0;
if ( !qwf_stays_on_top )
mw = new TQMainWindow( parent, name );
@@ -1513,11 +1513,11 @@ TQWidget *TQWidgetFactory::createWidget( const TQString &className, TQWidget *pa
}
#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
@@ -1589,11 +1589,11 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
bool isQLayoutWidget = FALSE;
if ( !className.isEmpty() ) {
- if ( !layout && className == "QLayoutWidget" ) {
- className = "TQWidget";
+ if ( !layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
+ className = TQWIDGET_OBJECT_NAME_STRING;
isQLayoutWidget = TRUE;
}
- if ( layout && className == "QLayoutWidget" ) {
+ if ( layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
// hide layout widgets
w = parent;
} else {
@@ -1603,7 +1603,7 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
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 ) ) {
@@ -1639,41 +1639,41 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
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, TQWidgetFactory::HBox, isQLayoutWidget );
else
layout = createLayout( w, layout, TQWidgetFactory::HBox, isQLayoutWidget );
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, TQWidgetFactory::Grid, isQLayoutWidget );
else
layout = createLayout( w, layout, TQWidgetFactory::Grid, isQLayoutWidget );
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, TQWidgetFactory::VBox, isQLayoutWidget );
else
layout = createLayout( w, layout, TQWidgetFactory::VBox, isQLayoutWidget );
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;
@@ -1683,16 +1683,16 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
TQString attrib = n.attribute( "name" );
TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
if ( parent ) {
- 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( "TQWidgetStack" ) ) {
+ } else if ( parent->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) {
if ( attrib == "id" )
( (TQWidgetStack*)parent )->addWidget( w, v.toInt() );
- } else if ( parent->inherits( "TQToolBox" ) ) {
+ } else if ( parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) {
if ( attrib == "label" )
( (TQToolBox*)parent )->addItem( w, 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() ) );
#ifdef QT_CONTAINER_CUSTOM_WIDGETS
@@ -1737,21 +1737,21 @@ TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* layout,
if ( layout || !widget || isQLayoutWidget )
margin = 0;
- if ( !layout && widget && widget->inherits( "TQTabWidget" ) )
+ if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
widget = ((TQTabWidget*)widget)->currentPage();
- 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( "TQToolBox" ) )
+ if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
widget = ((TQToolBox*)widget)->currentItem();
TQLayout *l = 0;
int align = 0;
- if ( !layout && widget && widget->inherits( "TQGroupBox" ) ) {
+ if ( !layout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, Qt::Vertical );
layout = gb->layout();
@@ -1796,11 +1796,11 @@ TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* layout,
TQWidgetFactory::LayoutType TQWidgetFactory::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;
}
@@ -1850,11 +1850,11 @@ void TQWidgetFactory::setProperty( TQObject* obj, const TQString &prop,
} else if ( prop == "buddy" ) {
buddies.insert( obj->name(), value.toCString() );
} 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, value.toInt() );
#ifndef QT_NO_SQL
- } else if ( prop == "database" && !obj->inherits( "TQDataView" )
- && !obj->inherits( "TQDataBrowser" ) ) {
+ } else if ( prop == "database" && !obj->inherits( TQDATAVIEW_OBJECT_NAME_STRING )
+ && !obj->inherits( TQDATABROWSER_OBJECT_NAME_STRING ) ) {
const TQStringList& lst = value.asStringList();
if ( lst.count() > 2 ) {
if ( dbControls )
@@ -1864,7 +1864,7 @@ void TQWidgetFactory::setProperty( TQObject* obj, const TQString &prop,
}
} else if ( prop == "database" ) {
const TQStringList& lst = value.asStringList();
- 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;
@@ -1953,7 +1953,7 @@ void TQWidgetFactory::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,
@@ -2212,7 +2212,7 @@ void TQWidgetFactory::createTableColumnOrRow( TQTable *table, const TQString& tx
const TQString& field, bool isRow )
{
#ifndef QT_NO_SQL
- bool isSql = table->inherits( "TQDataTable" );
+ bool isSql = table->inherits( TQDATATABLE_OBJECT_NAME_STRING );
#endif
if ( isRow )
table->setNumRows( table->numRows() + 1 );
@@ -2256,7 +2256,7 @@ void TQWidgetFactory::createTableColumnOrRow( TQTable *table, const TQString& tx
void TQWidgetFactory::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;
@@ -2280,7 +2280,7 @@ void TQWidgetFactory::createColumn( const TQDomElement &e, TQWidget *widget )
createListViewColumn( lv, txt, pix, clickable, resizable );
}
#ifndef QT_NO_TABLE
- else if ( widget->inherits( "TQTable" ) ) {
+ else if ( widget->inherits( TQTABLE_OBJECT_NAME_STRING ) ) {
TQTable *table = (TQTable*)widget;
TQDomElement n = e.firstChild().toElement();
@@ -2328,14 +2328,14 @@ void TQWidgetFactory::loadItem( const TQDomElement &e, TQPixmap &pix, TQString &
void TQWidgetFactory::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();
@@ -2345,7 +2345,7 @@ void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLis
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;
@@ -2355,7 +2355,7 @@ void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLis
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;
@@ -2417,7 +2417,7 @@ void TQWidgetFactory::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 );
@@ -2435,7 +2435,7 @@ void TQWidgetFactory::loadChildAction( TQObject *parent, const TQDomElement &e )
}
n2 = n2.nextSibling().toElement();
}
- if ( !parent->inherits( "TQAction" ) )
+ if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) )
actionList.append( a );
}
@@ -2476,7 +2476,7 @@ void TQWidgetFactory::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() );
}
@@ -2551,7 +2551,7 @@ TQAction *TQWidgetFactory::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;
}