Runtime object naming repaired in kdevelop

NOTE: kdewebdev is still an outstanding issue


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1222477 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 170a65dc2a
commit c0183f5dc9

@ -392,13 +392,13 @@ public:
: TQToolButton( parent, name ) {} : TQToolButton( parent, name ) {}
bool isInButtonGroup() const { bool isInButtonGroup() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ); return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
} }
int buttonGroupId() const { 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 ) { void setButtonGroupId( int id ) {
if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) { if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this ); ( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id ); ( (TQButtonGroup*)parentWidget() )->insert( this, id );
} }
@ -415,13 +415,13 @@ public:
: TQRadioButton( parent, name ) {} : TQRadioButton( parent, name ) {}
bool isInButtonGroup() const { bool isInButtonGroup() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ); return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
} }
int buttonGroupId() const { 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 ) { void setButtonGroupId( int id ) {
if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) { if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this ); ( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id ); ( (TQButtonGroup*)parentWidget() )->insert( this, id );
} }
@ -439,13 +439,13 @@ public:
: TQPushButton( parent, name ) {} : TQPushButton( parent, name ) {}
bool isInButtonGroup() const { bool isInButtonGroup() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ); return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
} }
int buttonGroupId() const { 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 ) { void setButtonGroupId( int id ) {
if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) { if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this ); ( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id ); ( (TQButtonGroup*)parentWidget() )->insert( this, id );
} }
@ -463,13 +463,13 @@ public:
: TQCheckBox( parent, name ) {} : TQCheckBox( parent, name ) {}
bool isInButtonGroup() const { bool isInButtonGroup() const {
return parentWidget() && parentWidget()->inherits( "TQButtonGroup" ); return parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING );
} }
int buttonGroupId() const { 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 ) { void setButtonGroupId( int id ) {
if ( parentWidget() && parentWidget()->inherits( "TQButtonGroup" ) ) { if ( parentWidget() && parentWidget()->inherits( TQBUTTONGROUP_OBJECT_NAME_STRING ) ) {
( (TQButtonGroup*)parentWidget() )->remove( this ); ( (TQButtonGroup*)parentWidget() )->remove( this );
( (TQButtonGroup*)parentWidget() )->insert( this, id ); ( (TQButtonGroup*)parentWidget() )->insert( this, id );
} }

@ -133,19 +133,19 @@ static void setupWidgetListAndMap()
return; return;
setupPluginDir(); setupPluginDir();
availableWidgetList = new TQStringList; availableWidgetList = new TQStringList;
(*availableWidgetList) << "TQPushButton" << "TQToolButton" << "TQCheckBox" << "TQRadioButton" (*availableWidgetList) << TQPUSHBUTTON_OBJECT_NAME_STRING << TQTOOLBUTTON_OBJECT_NAME_STRING << TQCHECKBOX_OBJECT_NAME_STRING << TQRADIOBUTTON_OBJECT_NAME_STRING
<< "TQGroupBox" << "TQButtonGroup" << "TQIconView" << "TQTable" << TQGROUPBOX_OBJECT_NAME_STRING << TQBUTTONGROUP_OBJECT_NAME_STRING << TQICONVIEW_OBJECT_NAME_STRING << TQTABLE_OBJECT_NAME_STRING
<< "TQListBox" << "TQListView" << "TQLineEdit" << "TQSpinBox" << TQLISTBOX_OBJECT_NAME_STRING << TQLISTVIEW_OBJECT_NAME_STRING << TQLINEEDIT_OBJECT_NAME_STRING << TQSPINBOX_OBJECT_NAME_STRING
<< "TQMultiLineEdit" << "TQLabel" << "TextLabel" << "PixmapLabel" << TQMULTILINEEDIT_OBJECT_NAME_STRING << TQLABEL_OBJECT_NAME_STRING << "TextLabel" << "PixmapLabel"
<< "QLayoutWidget" << "TQTabWidget" << "TQComboBox" << TQLAYOUTWIDGET_OBJECT_NAME_STRING << TQTABWIDGET_OBJECT_NAME_STRING << TQCOMBOBOX_OBJECT_NAME_STRING
<< "TQWidget" << "TQDialog" << "TQWizard" << "TQLCDNumber"; << 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 // put less stress on the compiler by limiting the template nesting depth
(*availableWidgetList) << "TQProgressBar" << "TQTextView" << "TQTextBrowser" (*availableWidgetList) << TQPROGRESSBAR_OBJECT_NAME_STRING << TQTEXTVIEW_OBJECT_NAME_STRING << TQTEXTBROWSER_OBJECT_NAME_STRING
<< "TQDial" << "TQSlider" << "TQFrame" << "Line" << "TQTextEdit" << TQDIAL_OBJECT_NAME_STRING << TQSLIDER_OBJECT_NAME_STRING << TQFRAME_OBJECT_NAME_STRING << "Line" << TQTEXTEDIT_OBJECT_NAME_STRING
<< "QDateEdit" << "QTimeEdit" << "QDateTimeEdit" << "TQScrollBar" << TQDATEEDIT_OBJECT_NAME_STRING << TQTIMEEDIT_OBJECT_NAME_STRING << TQDATETIMEEDIT_OBJECT_NAME_STRING << TQSCROLLBAR_OBJECT_NAME_STRING
<< "TQPopupMenu" << "TQWidgetStack" << "TQMainWindow" << TQPOPUPMENU_OBJECT_NAME_STRING << TQWIDGETSTACK_OBJECT_NAME_STRING << TQMAINWINDOW_OBJECT_NAME_STRING
<< "TQDataTable" << "TQDataBrowser" << "TQDataView" << TQDATATABLE_OBJECT_NAME_STRING << TQDATABROWSER_OBJECT_NAME_STRING << TQDATAVIEW_OBJECT_NAME_STRING
<< "TQVBox" << "TQHBox" << "TQGrid" << "TQToolBox"; << TQVBOX_OBJECT_NAME_STRING << TQHBOX_OBJECT_NAME_STRING << TQGRID_OBJECT_NAME_STRING << TQTOOLBOX_OBJECT_NAME_STRING;
if ( !widgetInterfaceManager ) if ( !widgetInterfaceManager )
widgetInterfaceManager = widgetInterfaceManager =
@ -1410,97 +1410,97 @@ TQWidget *TQWidgetFactory::createWidget( const TQString &className, TQWidget *pa
const char *name ) const const char *name ) const
{ {
// create widgets we know // create widgets we know
if ( className == "TQPushButton" ) { if ( className == TQPUSHBUTTON_OBJECT_NAME_STRING ) {
return new TQPushButton( parent, name ); return new TQPushButton( parent, name );
} else if ( className == "TQToolButton" ) { } else if ( className == TQTOOLBUTTON_OBJECT_NAME_STRING ) {
return new TQToolButton( parent, name ); return new TQToolButton( parent, name );
} else if ( className == "TQCheckBox" ) { } else if ( className == TQCHECKBOX_OBJECT_NAME_STRING ) {
return new TQCheckBox( parent, name ); return new TQCheckBox( parent, name );
} else if ( className == "TQRadioButton" ) { } else if ( className == TQRADIOBUTTON_OBJECT_NAME_STRING ) {
return new TQRadioButton( parent, name ); return new TQRadioButton( parent, name );
} else if ( className == "TQGroupBox" ) { } else if ( className == TQGROUPBOX_OBJECT_NAME_STRING ) {
return new TQGroupBox( parent, name ); return new TQGroupBox( parent, name );
} else if ( className == "TQButtonGroup" ) { } else if ( className == TQBUTTONGROUP_OBJECT_NAME_STRING ) {
return new TQButtonGroup( parent, name ); return new TQButtonGroup( parent, name );
} else if ( className == "TQIconView" ) { } else if ( className == TQICONVIEW_OBJECT_NAME_STRING ) {
#if !defined(QT_NO_ICONVIEW) #if !defined(QT_NO_ICONVIEW)
return new TQIconView( parent, name ); return new TQIconView( parent, name );
#endif #endif
} else if ( className == "TQTable" ) { } else if ( className == TQTABLE_OBJECT_NAME_STRING ) {
#if !defined(QT_NO_TABLE) #if !defined(QT_NO_TABLE)
return new TQTable( parent, name ); return new TQTable( parent, name );
#endif #endif
} else if ( className == "TQListBox" ) { } else if ( className == TQLISTBOX_OBJECT_NAME_STRING ) {
return new TQListBox( parent, name ); return new TQListBox( parent, name );
} else if ( className == "TQListView" ) { } else if ( className == TQLISTVIEW_OBJECT_NAME_STRING ) {
return new TQListView( parent, name ); return new TQListView( parent, name );
} else if ( className == "TQLineEdit" ) { } else if ( className == TQLINEEDIT_OBJECT_NAME_STRING ) {
return new TQLineEdit( parent, name ); return new TQLineEdit( parent, name );
} else if ( className == "TQSpinBox" ) { } else if ( className == TQSPINBOX_OBJECT_NAME_STRING ) {
return new TQSpinBox( parent, name ); return new TQSpinBox( parent, name );
} else if ( className == "TQMultiLineEdit" ) { } else if ( className == TQMULTILINEEDIT_OBJECT_NAME_STRING ) {
return new TQMultiLineEdit( parent, name ); 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 ); return new TQLabel( parent, name );
} else if ( className == "QLayoutWidget" ) { } else if ( className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
return new TQWidget( parent, name ); return new TQWidget( parent, name );
} else if ( className == "TQTabWidget" ) { } else if ( className == TQTABWIDGET_OBJECT_NAME_STRING ) {
return new TQTabWidget( parent, name ); return new TQTabWidget( parent, name );
} else if ( className == "TQComboBox" ) { } else if ( className == TQCOMBOBOX_OBJECT_NAME_STRING ) {
return new TQComboBox( FALSE, parent, name ); return new TQComboBox( FALSE, parent, name );
} else if ( className == "TQWidget" ) { } else if ( className == TQWIDGET_OBJECT_NAME_STRING ) {
if ( !qwf_stays_on_top ) if ( !qwf_stays_on_top )
return new TQWidget( parent, name ); return new TQWidget( parent, name );
return new TQWidget( parent, name, Qt::WStyle_StaysOnTop ); return new TQWidget( parent, name, Qt::WStyle_StaysOnTop );
} else if ( className == "TQDialog" ) { } else if ( className == TQDIALOG_OBJECT_NAME_STRING ) {
if ( !qwf_stays_on_top ) if ( !qwf_stays_on_top )
return new TQDialog( parent, name ); return new TQDialog( parent, name );
return new TQDialog( parent, name, FALSE, Qt::WStyle_StaysOnTop ); 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 ); return new TQWizard( parent, name );
} else if ( className == "TQLCDNumber" ) { } else if ( className == TQLCDNUMBER_OBJECT_NAME_STRING ) {
return new TQLCDNumber( parent, name ); return new TQLCDNumber( parent, name );
} else if ( className == "TQProgressBar" ) { } else if ( className == TQPROGRESSBAR_OBJECT_NAME_STRING ) {
return new TQProgressBar( parent, name ); return new TQProgressBar( parent, name );
} else if ( className == "TQTextView" ) { } else if ( className == TQTEXTVIEW_OBJECT_NAME_STRING ) {
return new TQTextView( parent, name ); return new TQTextView( parent, name );
} else if ( className == "TQTextBrowser" ) { } else if ( className == TQTEXTBROWSER_OBJECT_NAME_STRING ) {
return new TQTextBrowser( parent, name ); return new TQTextBrowser( parent, name );
} else if ( className == "TQDial" ) { } else if ( className == TQDIAL_OBJECT_NAME_STRING ) {
return new TQDial( parent, name ); return new TQDial( parent, name );
} else if ( className == "TQSlider" ) { } else if ( className == TQSLIDER_OBJECT_NAME_STRING ) {
return new TQSlider( parent, name ); return new TQSlider( parent, name );
} else if ( className == "TQFrame" ) { } else if ( className == TQFRAME_OBJECT_NAME_STRING ) {
return new TQFrame( parent, name ); return new TQFrame( parent, name );
} else if ( className == "TQSplitter" ) { } else if ( className == TQSPLITTER_OBJECT_NAME_STRING ) {
return new TQSplitter( parent, name ); return new TQSplitter( parent, name );
} else if ( className == "Line" ) { } else if ( className == "Line" ) {
TQFrame *f = new TQFrame( parent, name ); TQFrame *f = new TQFrame( parent, name );
f->setFrameStyle( TQFrame::HLine | TQFrame::Sunken ); f->setFrameStyle( TQFrame::HLine | TQFrame::Sunken );
return f; return f;
} else if ( className == "TQTextEdit" ) { } else if ( className == TQTEXTEDIT_OBJECT_NAME_STRING ) {
return new TQTextEdit( parent, name ); return new TQTextEdit( parent, name );
} else if ( className == "QDateEdit" ) { } else if ( className == TQDATEEDIT_OBJECT_NAME_STRING ) {
return new QDateEdit( parent, name ); return new QDateEdit( parent, name );
} else if ( className == "QTimeEdit" ) { } else if ( className == TQTIMEEDIT_OBJECT_NAME_STRING ) {
return new QTimeEdit( parent, name ); return new QTimeEdit( parent, name );
} else if ( className == "QDateTimeEdit" ) { } else if ( className == TQDATETIMEEDIT_OBJECT_NAME_STRING ) {
return new QDateTimeEdit( parent, name ); return new QDateTimeEdit( parent, name );
} else if ( className == "TQScrollBar" ) { } else if ( className == TQSCROLLBAR_OBJECT_NAME_STRING ) {
return new TQScrollBar( parent, name ); return new TQScrollBar( parent, name );
} else if ( className == "TQPopupMenu" ) { } else if ( className == TQPOPUPMENU_OBJECT_NAME_STRING ) {
return new TQPopupMenu( parent, name ); return new TQPopupMenu( parent, name );
} else if ( className == "TQWidgetStack" ) { } else if ( className == TQWIDGETSTACK_OBJECT_NAME_STRING ) {
return new TQWidgetStack( parent, name ); return new TQWidgetStack( parent, name );
} else if ( className == "TQToolBox" ) { } else if ( className == TQTOOLBOX_OBJECT_NAME_STRING ) {
return new TQToolBox( parent, name ); return new TQToolBox( parent, name );
} else if ( className == "TQVBox" ) { } else if ( className == TQVBOX_OBJECT_NAME_STRING ) {
return new TQVBox( parent, name ); return new TQVBox( parent, name );
} else if ( className == "TQHBox" ) { } else if ( className == TQHBOX_OBJECT_NAME_STRING ) {
return new TQHBox( parent, name ); return new TQHBox( parent, name );
} else if ( className == "TQGrid" ) { } else if ( className == TQGRID_OBJECT_NAME_STRING ) {
return new TQGrid( 4, parent, name ); return new TQGrid( 4, parent, name );
} else if ( className == "TQMainWindow" ) { } else if ( className == TQMAINWINDOW_OBJECT_NAME_STRING ) {
TQMainWindow *mw = 0; TQMainWindow *mw = 0;
if ( !qwf_stays_on_top ) if ( !qwf_stays_on_top )
mw = new TQMainWindow( parent, name ); mw = new TQMainWindow( parent, name );
@ -1513,11 +1513,11 @@ TQWidget *TQWidgetFactory::createWidget( const TQString &className, TQWidget *pa
} }
#if !defined(QT_NO_SQL) #if !defined(QT_NO_SQL)
else if ( className == "TQDataTable" ) { else if ( className == TQDATATABLE_OBJECT_NAME_STRING ) {
return new TQDataTable( parent, name ); return new TQDataTable( parent, name );
} else if ( className == "TQDataBrowser" ) { } else if ( className == TQDATABROWSER_OBJECT_NAME_STRING ) {
return new QDesignerDataBrowser2( parent, name ); return new QDesignerDataBrowser2( parent, name );
} else if ( className == "TQDataView" ) { } else if ( className == TQDATAVIEW_OBJECT_NAME_STRING ) {
return new QDesignerDataView2( parent, name ); return new QDesignerDataView2( parent, name );
} }
#endif #endif
@ -1589,11 +1589,11 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
bool isQLayoutWidget = FALSE; bool isQLayoutWidget = FALSE;
if ( !className.isEmpty() ) { if ( !className.isEmpty() ) {
if ( !layout && className == "QLayoutWidget" ) { if ( !layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
className = "TQWidget"; className = TQWIDGET_OBJECT_NAME_STRING;
isQLayoutWidget = TRUE; isQLayoutWidget = TRUE;
} }
if ( layout && className == "QLayoutWidget" ) { if ( layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) {
// hide layout widgets // hide layout widgets
w = parent; w = parent;
} else { } else {
@ -1603,7 +1603,7 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
w = (TQWidget*)obj; w = (TQWidget*)obj;
if ( !toplevel ) if ( !toplevel )
toplevel = w; toplevel = w;
if ( w->inherits( "TQMainWindow" ) ) if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) )
w = ( (TQMainWindow*)w )->centralWidget(); w = ( (TQMainWindow*)w )->centralWidget();
if ( layout ) { if ( layout ) {
switch( layoutType( layout ) ) { switch( layoutType( layout ) ) {
@ -1639,41 +1639,41 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
createSpacer( n, layout ); createSpacer( n, layout );
} else if ( n.tagName() == "widget" ) { } else if ( n.tagName() == "widget" ) {
TQMap< TQString, TQString> *oldDbControls = dbControls; 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; dbControls = oldDbControls;
} else if ( n.tagName() == "hbox" ) { } else if ( n.tagName() == "hbox" ) {
TQLayout *parentLayout = layout; TQLayout *parentLayout = layout;
if ( layout && layout->inherits( "TQGridLayout" ) ) if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
layout = createLayout( 0, 0, TQWidgetFactory::HBox, isQLayoutWidget ); layout = createLayout( 0, 0, TQWidgetFactory::HBox, isQLayoutWidget );
else else
layout = createLayout( w, layout, TQWidgetFactory::HBox, isQLayoutWidget ); layout = createLayout( w, layout, TQWidgetFactory::HBox, isQLayoutWidget );
obj = layout; obj = layout;
n = n.firstChild().toElement(); n = n.firstChild().toElement();
if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) ) if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row,
row + rowspan - 1, col, col + colspan - 1 ); row + rowspan - 1, col, col + colspan - 1 );
continue; continue;
} else if ( n.tagName() == "grid" ) { } else if ( n.tagName() == "grid" ) {
TQLayout *parentLayout = layout; TQLayout *parentLayout = layout;
if ( layout && layout->inherits( "TQGridLayout" ) ) if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
layout = createLayout( 0, 0, TQWidgetFactory::Grid, isQLayoutWidget ); layout = createLayout( 0, 0, TQWidgetFactory::Grid, isQLayoutWidget );
else else
layout = createLayout( w, layout, TQWidgetFactory::Grid, isQLayoutWidget ); layout = createLayout( w, layout, TQWidgetFactory::Grid, isQLayoutWidget );
obj = layout; obj = layout;
n = n.firstChild().toElement(); n = n.firstChild().toElement();
if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) ) if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row,
row + rowspan - 1, col, col + colspan - 1 ); row + rowspan - 1, col, col + colspan - 1 );
continue; continue;
} else if ( n.tagName() == "vbox" ) { } else if ( n.tagName() == "vbox" ) {
TQLayout *parentLayout = layout; TQLayout *parentLayout = layout;
if ( layout && layout->inherits( "TQGridLayout" ) ) if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
layout = createLayout( 0, 0, TQWidgetFactory::VBox, isQLayoutWidget ); layout = createLayout( 0, 0, TQWidgetFactory::VBox, isQLayoutWidget );
else else
layout = createLayout( w, layout, TQWidgetFactory::VBox, isQLayoutWidget ); layout = createLayout( w, layout, TQWidgetFactory::VBox, isQLayoutWidget );
obj = layout; obj = layout;
n = n.firstChild().toElement(); n = n.firstChild().toElement();
if ( parentLayout && parentLayout->inherits( "TQGridLayout" ) ) if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row,
row + rowspan - 1, col, col + colspan - 1 ); row + rowspan - 1, col, col + colspan - 1 );
continue; continue;
@ -1683,16 +1683,16 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget
TQString attrib = n.attribute( "name" ); TQString attrib = n.attribute( "name" );
TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() );
if ( parent ) { if ( parent ) {
if ( parent->inherits( "TQTabWidget" ) ) { if ( parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) {
if ( attrib == "title" ) if ( attrib == "title" )
( (TQTabWidget*)parent )->insertTab( w, translate( v.toString() ) ); ( (TQTabWidget*)parent )->insertTab( w, translate( v.toString() ) );
} else if ( parent->inherits( "TQWidgetStack" ) ) { } else if ( parent->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) {
if ( attrib == "id" ) if ( attrib == "id" )
( (TQWidgetStack*)parent )->addWidget( w, v.toInt() ); ( (TQWidgetStack*)parent )->addWidget( w, v.toInt() );
} else if ( parent->inherits( "TQToolBox" ) ) { } else if ( parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) {
if ( attrib == "label" ) if ( attrib == "label" )
( (TQToolBox*)parent )->addItem( w, v.toString() ); ( (TQToolBox*)parent )->addItem( w, v.toString() );
} else if ( parent->inherits( "TQWizard" ) ) { } else if ( parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) {
if ( attrib == "title" ) if ( attrib == "title" )
( (TQWizard*)parent )->addPage( w, translate( v.toString() ) ); ( (TQWizard*)parent )->addPage( w, translate( v.toString() ) );
#ifdef QT_CONTAINER_CUSTOM_WIDGETS #ifdef QT_CONTAINER_CUSTOM_WIDGETS
@ -1737,21 +1737,21 @@ TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* layout,
if ( layout || !widget || isQLayoutWidget ) if ( layout || !widget || isQLayoutWidget )
margin = 0; margin = 0;
if ( !layout && widget && widget->inherits( "TQTabWidget" ) ) if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) )
widget = ((TQTabWidget*)widget)->currentPage(); widget = ((TQTabWidget*)widget)->currentPage();
if ( !layout && widget && widget->inherits( "TQWizard" ) ) if ( !layout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) )
widget = ((TQWizard*)widget)->currentPage(); widget = ((TQWizard*)widget)->currentPage();
if ( !layout && widget && widget->inherits( "TQWidgetStack" ) ) if ( !layout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) )
widget = ((TQWidgetStack*)widget)->visibleWidget(); widget = ((TQWidgetStack*)widget)->visibleWidget();
if ( !layout && widget && widget->inherits( "TQToolBox" ) ) if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) )
widget = ((TQToolBox*)widget)->currentItem(); widget = ((TQToolBox*)widget)->currentItem();
TQLayout *l = 0; TQLayout *l = 0;
int align = 0; int align = 0;
if ( !layout && widget && widget->inherits( "TQGroupBox" ) ) { if ( !layout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) {
TQGroupBox *gb = (TQGroupBox*)widget; TQGroupBox *gb = (TQGroupBox*)widget;
gb->setColumnLayout( 0, Qt::Vertical ); gb->setColumnLayout( 0, Qt::Vertical );
layout = gb->layout(); layout = gb->layout();
@ -1796,11 +1796,11 @@ TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* layout,
TQWidgetFactory::LayoutType TQWidgetFactory::layoutType( TQLayout *layout ) const TQWidgetFactory::LayoutType TQWidgetFactory::layoutType( TQLayout *layout ) const
{ {
if ( layout->inherits( "TQHBoxLayout" ) ) if ( layout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) )
return HBox; return HBox;
else if ( layout->inherits( "TQVBoxLayout" ) ) else if ( layout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) )
return VBox; return VBox;
else if ( layout->inherits( "TQGridLayout" ) ) else if ( layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) )
return Grid; return Grid;
return NoLayout; return NoLayout;
} }
@ -1850,11 +1850,11 @@ void TQWidgetFactory::setProperty( TQObject* obj, const TQString &prop,
} else if ( prop == "buddy" ) { } else if ( prop == "buddy" ) {
buddies.insert( obj->name(), value.toCString() ); buddies.insert( obj->name(), value.toCString() );
} else if ( prop == "buttonGroupId" ) { } 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() ); ( (TQButtonGroup*)obj->parent() )->insert( (TQButton*)obj, value.toInt() );
#ifndef QT_NO_SQL #ifndef QT_NO_SQL
} else if ( prop == "database" && !obj->inherits( "TQDataView" ) } else if ( prop == "database" && !obj->inherits( TQDATAVIEW_OBJECT_NAME_STRING )
&& !obj->inherits( "TQDataBrowser" ) ) { && !obj->inherits( TQDATABROWSER_OBJECT_NAME_STRING ) ) {
const TQStringList& lst = value.asStringList(); const TQStringList& lst = value.asStringList();
if ( lst.count() > 2 ) { if ( lst.count() > 2 ) {
if ( dbControls ) if ( dbControls )
@ -1864,7 +1864,7 @@ void TQWidgetFactory::setProperty( TQObject* obj, const TQString &prop,
} }
} else if ( prop == "database" ) { } else if ( prop == "database" ) {
const TQStringList& lst = value.asStringList(); 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 ] ); SqlWidgetConnection conn( lst[ 0 ], lst[ 1 ] );
sqlWidgetConnections.insert( (TQWidget*)obj, conn ); sqlWidgetConnections.insert( (TQWidget*)obj, conn );
dbControls = conn.dbControls; 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, TQSpacerItem *item = new TQSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : TQSizePolicy::Minimum,
orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum ); orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum );
if ( layout ) { if ( layout ) {
if ( layout->inherits( "TQBoxLayout" ) ) if ( layout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) )
( (TQBoxLayout*)layout )->addItem( item ); ( (TQBoxLayout*)layout )->addItem( item );
else else
( (TQGridLayout*)layout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1, ( (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 ) const TQString& field, bool isRow )
{ {
#ifndef QT_NO_SQL #ifndef QT_NO_SQL
bool isSql = table->inherits( "TQDataTable" ); bool isSql = table->inherits( TQDATATABLE_OBJECT_NAME_STRING );
#endif #endif
if ( isRow ) if ( isRow )
table->setNumRows( table->numRows() + 1 ); 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 ) 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; TQListView *lv = (TQListView*)widget;
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
@ -2280,7 +2280,7 @@ void TQWidgetFactory::createColumn( const TQDomElement &e, TQWidget *widget )
createListViewColumn( lv, txt, pix, clickable, resizable ); createListViewColumn( lv, txt, pix, clickable, resizable );
} }
#ifndef QT_NO_TABLE #ifndef QT_NO_TABLE
else if ( widget->inherits( "TQTable" ) ) { else if ( widget->inherits( TQTABLE_OBJECT_NAME_STRING ) ) {
TQTable *table = (TQTable*)widget; TQTable *table = (TQTable*)widget;
TQDomElement n = e.firstChild().toElement(); 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 ) 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(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
bool hasPixmap = FALSE; bool hasPixmap = FALSE;
TQString txt; TQString txt;
loadItem( n, pix, txt, hasPixmap ); loadItem( n, pix, txt, hasPixmap );
TQListBox *lb = 0; TQListBox *lb = 0;
if ( widget->inherits( "TQListBox" ) ) if ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) )
lb = (TQListBox*)widget; lb = (TQListBox*)widget;
else else
lb = ( (TQComboBox*)widget)->listBox(); lb = ( (TQComboBox*)widget)->listBox();
@ -2345,7 +2345,7 @@ void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLis
new TQListBoxText( lb, txt ); new TQListBoxText( lb, txt );
} }
#ifndef QT_NO_ICONVIEW #ifndef QT_NO_ICONVIEW
} else if ( widget->inherits( "TQIconView" ) ) { } else if ( widget->inherits( TQICONVIEW_OBJECT_NAME_STRING ) ) {
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
bool hasPixmap = FALSE; bool hasPixmap = FALSE;
@ -2355,7 +2355,7 @@ void TQWidgetFactory::createItem( const TQDomElement &e, TQWidget *widget, TQLis
TQIconView *iv = (TQIconView*)widget; TQIconView *iv = (TQIconView*)widget;
new TQIconViewItem( iv, txt, pix ); new TQIconViewItem( iv, txt, pix );
#endif #endif
} else if ( widget->inherits( "TQListView" ) ) { } else if ( widget->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) ) {
TQDomElement n = e.firstChild().toElement(); TQDomElement n = e.firstChild().toElement();
TQPixmap pix; TQPixmap pix;
TQValueList<TQPixmap> pixmaps; TQValueList<TQPixmap> pixmaps;
@ -2417,7 +2417,7 @@ void TQWidgetFactory::loadChildAction( TQObject *parent, const TQDomElement &e )
} }
n2 = n2.nextSibling().toElement(); n2 = n2.nextSibling().toElement();
} }
if ( !parent->inherits( "TQAction" ) ) if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) )
actionList.append( a ); actionList.append( a );
} else if ( n.tagName() == "actiongroup" ) { } else if ( n.tagName() == "actiongroup" ) {
a = new TQActionGroup( parent ); a = new TQActionGroup( parent );
@ -2435,7 +2435,7 @@ void TQWidgetFactory::loadChildAction( TQObject *parent, const TQDomElement &e )
} }
n2 = n2.nextSibling().toElement(); n2 = n2.nextSibling().toElement();
} }
if ( !parent->inherits( "TQAction" ) ) if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) )
actionList.append( a ); actionList.append( a );
} }
@ -2476,7 +2476,7 @@ void TQWidgetFactory::loadToolBars( const TQDomElement &e )
} else if ( n2.tagName() == "separator" ) { } else if ( n2.tagName() == "separator" ) {
tb->addSeparator(); tb->addSeparator();
} else if ( n2.tagName() == "widget" ) { } 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" ) { } else if ( n2.tagName() == "property" ) {
setProperty( tb, n2.attribute( "name" ), n2.firstChild().toElement() ); 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() ) { for ( TQAction *a = actionList.first(); a; a = actionList.next() ) {
if ( TQString( a->name() ) == name ) if ( TQString( a->name() ) == name )
return a; return a;
TQAction *ac = (TQAction*)a->child( name.latin1(), "TQAction" ); TQAction *ac = (TQAction*)a->child( name.latin1(), TQACTION_OBJECT_NAME_STRING );
if ( ac ) if ( ac )
return ac; return ac;
} }

Loading…
Cancel
Save