From 170a65dc2a13f0a664d269d3058ffeab129ae83c Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 24 Feb 2011 07:08:32 +0000 Subject: Fix a number of runtime object identification problems which led to an even larger array of minor glitches NOTE: kdevelop and kdewebdev still need to be fully repaired git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1222475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdevdesigner/uilib/qwidgetfactory.cpp | 70 +++++++++++++++++------------------ 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'kdevdesigner/uilib/qwidgetfactory.cpp') diff --git a/kdevdesigner/uilib/qwidgetfactory.cpp b/kdevdesigner/uilib/qwidgetfactory.cpp index c9513043..562a647b 100644 --- a/kdevdesigner/uilib/qwidgetfactory.cpp +++ b/kdevdesigner/uilib/qwidgetfactory.cpp @@ -364,7 +364,7 @@ TQWidget *TQWidgetFactory::create( TQIODevice *dev, TQObject *connector, TQWidge for ( TQMap::Iterator it = widgetFactory->dbTables.begin(); it != widgetFactory->dbTables.end(); ++it ) { - TQDataTable *table = (TQDataTable*)widgetFactory->toplevel->child( it.key().ascii(), "TQDataTable" ); + TQDataTable *table = (TQDataTable*)widgetFactory->toplevel->child( it.key().ascii(), TQDATATABLE_OBJECT_NAME_STRING ); if ( !table ) continue; if ( widgetFactory->noDatabaseWidgets.find( table->name() ) != @@ -391,8 +391,8 @@ TQWidget *TQWidgetFactory::create( TQIODevice *dev, TQObject *connector, TQWidge for ( TQMap::Iterator it = widgetFactory->buddies.begin(); it != widgetFactory->buddies.end(); ++it ) { - TQLabel *label = (TQLabel*)widgetFactory->toplevel->child( it.key().ascii(), "TQLabel" ); - TQWidget *buddy = (TQWidget*)widgetFactory->toplevel->child( (*it).ascii(), "TQWidget" ); + TQLabel *label = (TQLabel*)widgetFactory->toplevel->child( it.key().ascii(), TQLABEL_OBJECT_NAME_STRING ); + TQWidget *buddy = (TQWidget*)widgetFactory->toplevel->child( (*it).ascii(), TQWIDGET_OBJECT_NAME_STRING ); if ( label && buddy ) label->setBuddy( buddy ); } @@ -466,7 +466,7 @@ TQWidget *TQWidgetFactory::createFromUiFile( TQDomDocument doc, TQObject *connec if ( !imageCollection.isNull() ) loadImageCollection( imageCollection ); - createWidgetInternal( widget, parent, 0, widget.attribute("class", "TQWidget") ); + createWidgetInternal( widget, parent, 0, widget.attribute("class", TQWIDGET_OBJECT_NAME_STRING) ); TQWidget *w = toplevel; if ( !w ) return 0; @@ -703,7 +703,7 @@ void TQWidgetFactory::inputSpacer( const UibStrTable& strings, TQDataStream& in, spacer = new TQSpacerItem( w, h, sizeType, TQSizePolicy::Minimum ); } - if ( parent->inherits("TQGridLayout") ) { + if ( parent->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) { ((TQGridLayout *) parent)->addMultiCell( spacer, row, row + rowspan - 1, column, column + colspan - 1, vertical ? Qt::AlignHCenter : Qt::AlignVCenter ); @@ -763,11 +763,11 @@ void TQWidgetFactory::inputColumnOrRow( const UibStrTable& strings, } if ( parent != 0 ) { - if ( parent->inherits("TQListView") ) { + if ( parent->inherits(TQLISTVIEW_OBJECT_NAME_STRING) ) { createListViewColumn( (TQListView *) parent, text, pixmap, clickable, resizable ); #ifndef QT_NO_TABLE - } else if ( parent->inherits("TQTable") ) { + } else if ( parent->inherits(TQTABLE_OBJECT_NAME_STRING) ) { createTableColumnOrRow( (TQTable *) parent, text, pixmap, field, isRow ); #endif @@ -786,7 +786,7 @@ void TQWidgetFactory::inputItem( const UibStrTable& strings, TQDataStream& in, Q_UINT8 objectTag; TQListView *listView = 0; - if ( parent != 0 && parent->inherits("TQListView") ) + if ( parent != 0 && parent->inherits(TQLISTVIEW_OBJECT_NAME_STRING) ) parent = (TQListView *) parent; TQListViewItem *item = 0; if ( listView != 0 ) { @@ -848,9 +848,9 @@ void TQWidgetFactory::inputItem( const UibStrTable& strings, TQDataStream& in, TQPixmap pixmap = pixmaps.last(); if ( parent != 0 ) { - if ( parent->inherits("TQComboBox") || - parent->inherits("TQListBox") ) { - TQListBox *listBox = (TQListBox *) parent->qt_cast( "TQListBox" ); + if ( parent->inherits(TQCOMBOBOX_OBJECT_NAME_STRING) || + parent->inherits(TQLISTBOX_OBJECT_NAME_STRING) ) { + TQListBox *listBox = (TQListBox *) parent->qt_cast( TQLISTBOX_OBJECT_NAME_STRING ); if ( listBox == 0 ) listBox = ((TQComboBox *) parent)->listBox(); @@ -860,7 +860,7 @@ void TQWidgetFactory::inputItem( const UibStrTable& strings, TQDataStream& in, (void) new TQListBoxPixmap( listBox, pixmap, text ); } #ifndef QT_NO_ICONVIEW - } else if ( parent->inherits("TQIconView") ) { + } else if ( parent->inherits(TQICONVIEW_OBJECT_NAME_STRING) ) { (void) new TQIconViewItem( (TQIconView *) parent, text, pixmap ); #endif } @@ -915,50 +915,50 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, if ( isQObject ) { if ( parent != 0 ) { if ( parent->isWidgetType() ) { - if ( parent->inherits("TQMainWindow") ) { + if ( parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING) ) { parentWidget = ((TQMainWindow *) parent)->centralWidget(); } else { parentWidget = (TQWidget *) parent; } - } else if ( parent->inherits("TQLayout") ) { + } else if ( parent->inherits(TQLAYOUT_OBJECT_NAME_STRING) ) { parentLayout = (TQLayout *) parent; parentWidget = ancestorWidget; } } - if ( className == "TQAction" ) { + if ( className == TQACTION_OBJECT_NAME_STRING ) { unpackCString( strings, in, className ); - if ( className == "TQActionGroup" ) { + if ( className == TQACTIONGROUP_OBJECT_NAME_STRING ) { obj = new TQActionGroup( parent ); } else { obj = new TQAction( parent ); } - } else if ( className == "TQLayout" ) { + } else if ( className == TQLAYOUT_OBJECT_NAME_STRING ) { unpackCString( strings, in, className ); LayoutType type = Grid; - if ( className == "TQHBoxLayout" ) { + if ( className == TQHBOXLAYOUT_OBJECT_NAME_STRING ) { type = HBox; - } else if ( className == "TQVBoxLayout" ) { + } else if ( className == TQVBOXLAYOUT_OBJECT_NAME_STRING ) { type = VBox; } - if ( parentLayout != 0 && parentLayout->inherits("TQGridLayout") ) { + if ( parentLayout != 0 && parentLayout->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) { layout = createLayout( 0, 0, type ); } else { layout = createLayout( parentWidget, parentLayout, type ); } obj = layout; - } else if ( className == "TQMenuBar" ) { + } else if ( className == TQMENUBAR_OBJECT_NAME_STRING ) { unpackCString( strings, in, className ); widget = ((TQMainWindow *) parent)->menuBar(); obj = widget; - } else if ( className == "TQToolBar" ) { + } else if ( className == TQTOOLBAR_OBJECT_NAME_STRING ) { Q_UINT8 dock; in >> dock; unpackCString( strings, in, className ); widget = new TQToolBar( TQString::null, (TQMainWindow *) parent, (Qt::Dock) dock ); obj = widget; - } else if ( className == "TQWidget" ) { + } else if ( className == TQWIDGET_OBJECT_NAME_STRING ) { unpackCString( strings, in, className ); widget = createWidget( className, parentWidget, 0 ); obj = widget; @@ -1099,15 +1099,15 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, break; case Object_SubAction: inputObject( objects, numObjects, strings, in, parentWidget, - obj != 0 ? obj : parent, "TQAction" ); + obj != 0 ? obj : parent, TQACTION_OBJECT_NAME_STRING ); break; case Object_SubLayout: inputObject( objects, numObjects, strings, in, parentWidget, obj, - "TQLayout" ); + TQLAYOUT_OBJECT_NAME_STRING ); break; case Object_SubWidget: inputObject( objects, numObjects, strings, in, parentWidget, obj, - "TQWidget" ); + TQWIDGET_OBJECT_NAME_STRING ); break; case Object_TextProperty: unpackCString( strings, in, name ); @@ -1118,9 +1118,9 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, if ( metAttribute > 0 ) { if ( name == "title" ) { if ( parent != 0 ) { - if ( parent->inherits("TQTabWidget") ) { + if ( parent->inherits(TQTABWIDGET_OBJECT_NAME_STRING) ) { ((TQTabWidget *) parent)->insertTab( widget, str ); - } else if ( parent->inherits("TQWizard") ) { + } else if ( parent->inherits(TQWIZARD_OBJECT_NAME_STRING) ) { ((TQWizard *) parent)->addPage( widget, str ); } } @@ -1136,7 +1136,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, if ( metAttribute > 0 ) { if ( name == "id" ) { - if ( parent != 0 && parent->inherits("TQWidgetStack") ) + if ( parent != 0 && parent->inherits(TQWIDGETSTACK_OBJECT_NAME_STRING) ) ((TQWidgetStack *) parent)->addWidget( widget, value.toInt() ); } } else { @@ -1153,7 +1153,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, if ( parentLayout != 0 ) { if ( widget != 0 ) { - if ( parentLayout->inherits("TQGridLayout") ) { + if ( parentLayout->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) { ((TQGridLayout *) parentLayout)->addMultiCellWidget( widget, row, row + rowspan - 1, column, column + colspan - 1 ); @@ -1161,7 +1161,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, ((TQBoxLayout *) parentLayout)->addWidget( widget ); } } else if ( layout != 0 ) { - if ( parentLayout->inherits("TQGridLayout") ) { + if ( parentLayout->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) { ((TQGridLayout *) parentLayout)->addMultiCellLayout( layout, row, row + rowspan - 1, column, column + colspan - 1 ); @@ -1219,7 +1219,7 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in, unpackUInt16( in, labelNo ); unpackUInt16( in, buddyNo ); TQLabel *label = - (TQLabel *) objects[labelNo]->qt_cast( "TQLabel" ); + (TQLabel *) objects[labelNo]->qt_cast( TQLABEL_OBJECT_NAME_STRING ); if ( label != 0 ) label->setBuddy( (TQWidget *) objects[buddyNo] ); } while ( !END_OF_BLOCK() ); @@ -1301,7 +1301,7 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in, break; case Block_Menubar: inputObject( objects, numObjects, strings, in, toplevel, toplevel, - "TQMenuBar" ); + TQMENUBAR_OBJECT_NAME_STRING ); break; case Block_Slots: { @@ -1334,7 +1334,7 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in, case Block_Toolbars: do { inputObject( objects, numObjects, strings, in, toplevel, - toplevel, "TQToolBar" ); + toplevel, TQTOOLBAR_OBJECT_NAME_STRING ); } while ( !END_OF_BLOCK() ); break; case Block_Variables: @@ -1345,7 +1345,7 @@ TQWidget *TQWidgetFactory::createFromUibFile( TQDataStream& in, case Block_Widget: toplevel = (TQWidget *) inputObject( objects, numObjects, strings, in, toplevel, parent, - "TQWidget" ); + TQWIDGET_OBJECT_NAME_STRING ); if ( toplevel != 0 ) toplevel->setName( name ); break; -- cgit v1.2.1