diff options
Diffstat (limited to 'kommander/editor/resource.cpp')
-rw-r--r-- | kommander/editor/resource.cpp | 131 |
1 files changed, 61 insertions, 70 deletions
diff --git a/kommander/editor/resource.cpp b/kommander/editor/resource.cpp index d9d3fa7d..7aafdbb7 100644 --- a/kommander/editor/resource.cpp +++ b/kommander/editor/resource.cpp @@ -303,17 +303,8 @@ bool Resource::load( FormFile *ff, TQIODevice* dev ) if ( !customWidgets.isNull() ) loadCustomWidgets( customWidgets, this ); -#if defined (TQT_NON_COMMERCIAL) - bool previewMode = MainWindow::self->isPreviewing(); - TQWidget *w = (TQWidget*)createObject( widget, !previewMode ? (TQWidget*)formwindow : MainWindow::self); - if ( !w ) - return false; - if ( previewMode ) - w->reparent( MainWindow::self, TQt::WType_TopLevel, w->pos(), true ); -#else if ( !createObject( widget, formwindow) ) return false; -#endif if ( !forwards.isNull() ) { for ( TQDomElement n = forwards.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) @@ -363,7 +354,7 @@ bool Resource::load( FormFile *ff, TQIODevice* dev ) slot.returnType = n.attribute( "returnType", "void" ); if ( slot.returnType.isEmpty() ) slot.returnType = "void"; - slot.slot = n.firstChild().toText().data(); + slot.slot = n.firstChild().toText().data().utf8(); if ( !MetaDataBase::hasSlot( TQT_TQOBJECT(formwindow), slot.slot, true ) ) MetaDataBase::addSlot( TQT_TQOBJECT(formwindow), slot.slot, slot.specifier, slot.access, slot.language, slot.returnType ); @@ -440,13 +431,13 @@ bool Resource::save( TQIODevice* dev ) ts << "<!DOCTYPE UI><UI version=\"3.0\" stdsetdef=\"1\">" << endl; saveMetaInfoBefore( ts, 0 ); saveObject( TQT_TQOBJECT(formwindow->mainContainer()), 0, ts, 0 ); - if ( formwindow->mainContainer()->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) { + if ( formwindow->mainContainer()->inherits( "TQMainWindow" ) ) { saveMenuBar( (TQMainWindow*)formwindow->mainContainer(), ts, 0 ); saveToolBars( (TQMainWindow*)formwindow->mainContainer(), ts, 0 ); } if ( !MetaDataBase::customWidgets()->isEmpty() && !usedCustomWidgets.isEmpty() ) saveCustomWidgets( ts, 0 ); - if ( formwindow->mainContainer()->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) + if ( formwindow->mainContainer()->inherits( "TQMainWindow" ) ) saveActions( formwindow->actionList(), ts, 0 ); if ( !images.isEmpty() ) saveImageCollection( ts, 0 ); @@ -615,9 +606,9 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea return; } - if ( obj->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) { + if ( obj->inherits( "TQTabWidget" ) ) { TQTabWidget* tw = (TQTabWidget*) obj; - TQObjectList* tmpl = tw->queryList( TQWIDGETSTACK_OBJECT_NAME_STRING ); + TQObjectList* tmpl = tw->queryList( "TQWidgetStack" ); TQWidgetStack *ws = (TQWidgetStack*)tmpl->first(); TQTabBar *tb = ( (QDesignerTabWidget*)obj )->tabBar(); for ( int i = 0; i < tb->count(); ++i ) { @@ -678,7 +669,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "</widget>" << endl; } } - else if ( obj->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) { + else if ( obj->inherits( "TQWizard" ) ) { TQWizard* wiz = (TQWizard*)obj; for ( int i = 0; i < wiz->pageCount(); ++i ) { TQWidget *w = wiz->page( i ); if ( !w ) @@ -702,7 +693,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea --indent; ts << makeIndent( indent ) << "</widget>" << endl; } - } else if ( obj->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) { + } else if ( obj->inherits( "TQMainWindow" ) ) { saveChildrenOf( TQT_TQOBJECT(( (TQMainWindow*)obj )->centralWidget()), ts, indent ); } else { saveChildrenOf( obj, ts, indent ); @@ -714,9 +705,9 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) { - if ( obj->inherits( TQLISTBOX_OBJECT_NAME_STRING ) || obj->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) { + if ( obj->inherits( "TQListBox" ) || obj->inherits( "TQComboBox" ) ) { TQListBox *lb = 0; - if ( obj->inherits( TQLISTBOX_OBJECT_NAME_STRING ) ) + if ( obj->inherits( "TQListBox" ) ) lb = (TQListBox*)obj; else lb = ( (TQComboBox*)obj )->listBox(); @@ -734,7 +725,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) indent--; ts << makeIndent( indent ) << "</item>" << endl; } - } else if ( obj->inherits( TQICONVIEW_OBJECT_NAME_STRING ) ) { + } else if ( obj->inherits( "TQIconView" ) ) { TQIconView *iv = (TQIconView*)obj; TQIconViewItem *i = iv->firstItem(); @@ -750,7 +741,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) indent--; ts << makeIndent( indent ) << "</item>" << endl; } - } else if ( obj->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) ) { + } else if ( obj->inherits( "TQListView" ) ) { TQListView *lv = (TQListView*)obj; int i; for ( i = 0; i < lv->header()->count(); ++i ) { @@ -779,11 +770,11 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) saveItem( lv->firstChild(), ts, indent - 1 ); } #ifndef TQT_NO_TABLE - else if ( obj->inherits( TQTABLE_OBJECT_NAME_STRING ) ) { + else if ( obj->inherits( "TQTable" ) ) { TQTable *table = (TQTable*)obj; int i; TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( TQT_TQOBJECT(table) ); - bool isDataTable = table->inherits( TQDATATABLE_OBJECT_NAME_STRING ); + bool isDataTable = table->inherits( "TQDataTable" ); for ( i = 0; i < table->horizontalHeader()->count(); ++i ) { if ( !table->horizontalHeader()->label( i ).isNull() && table->horizontalHeader()->label( i ).toInt() != i + 1 || @@ -798,7 +789,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) if ( table->horizontalHeader()->iconSet( i ) ) pix.append( new TQPixmap( table->horizontalHeader()->iconSet( i )->pixmap() ) ); saveItem( l, pix, ts, indent ); - if ( table->inherits( TQDATATABLE_OBJECT_NAME_STRING ) && !columnFields.isEmpty() ) { + if ( table->inherits( "TQDataTable" ) && !columnFields.isEmpty() ) { ts << makeIndent( indent ) << "<property name=\"field\">" << endl; indent++; ts << makeIndent( indent ) << "<string>" << entitize( *columnFields.find( l[ 0 ] ) ) << "</string>" << endl; @@ -937,7 +928,7 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent ) // if the widget has a layout we pretend that all widget's childs are childs of the layout - makes the structure nicer TQLayout *layout = 0; QDesignerGridLayout* grid = 0; - if ( !obj->inherits( TQSPLITTER_OBJECT_NAME_STRING ) && + if ( !obj->inherits( "TQSplitter" ) && WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( obj ) ) ) && obj->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)obj, layout ) != WidgetFactory::NoLayout ) { @@ -989,7 +980,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) if ( !changed.contains( "geometry" ) ) changed << "geometry"; } - } else if ( w->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) { // #### should be cleaner (RS) + } else if ( w->inherits( "TQLayout" ) ) { // #### should be cleaner (RS) changed << "margin" << "spacing"; } @@ -1017,7 +1008,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) property( w->metaObject()->findProperty( it.current(), true ), true ); if ( !p || !p->stored( w ) || ( inLayout && qstrcmp( p->name(), "geometry" ) == 0 ) ) continue; - if ( w->inherits( TQLABEL_OBJECT_NAME_STRING ) && qstrcmp( p->name(), "pixmap" ) == 0 && + if ( w->inherits( "TQLabel" ) && qstrcmp( p->name(), "pixmap" ) == 0 && ( !( (TQLabel*)w )->pixmap() || ( (TQLabel*)w )->pixmap()->isNull() ) ) continue; if ( w->inherits( "QDesignerMenuBar" ) && @@ -1066,8 +1057,8 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) void Resource::saveSetProperty( TQObject *w, const TQString &name, TQVariant::Type, TQTextStream &ts, int indent ) { - const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name, true ), true ); - TQStrList l( p->valueToKeys( w->property( name ).toInt() ) ); + const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name.latin1(), true ), true ); + TQStrList l( p->valueToKeys( w->property( name.latin1() ).toInt() ) ); TQString v; for ( uint i = 0; i < l.count(); ++i ) { v += l.at( i ); @@ -1079,8 +1070,8 @@ void Resource::saveSetProperty( TQObject *w, const TQString &name, TQVariant::Ty void Resource::saveEnumProperty( TQObject *w, const TQString &name, TQVariant::Type, TQTextStream &ts, int indent ) { - const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name, true ), true ); - ts << makeIndent( indent ) << "<enum>" << p->valueToKey( w->property( name ).toInt() ) << "</enum>" << endl; + const TQMetaProperty *p = w->metaObject()->property( w->metaObject()->findProperty( name.latin1(), true ), true ); + ts << makeIndent( indent ) << "<enum>" << p->valueToKey( w->property( name.latin1() ).toInt() ) << "</enum>" << endl; } void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant &value, TQVariant::Type t, TQTextStream &ts, int indent ) @@ -1106,7 +1097,7 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant break; case TQVariant::Int: num = value.toInt(); - if ( w && w->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) { + if ( w && w->inherits( "TQLayout" ) ) { if ( name == "spacing" ) num = MetaDataBase::spacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( TQT_TQLAYOUT(TQT_BASE_OBJECT(w)) ) )) ); else if ( name == "margin" ) @@ -1124,7 +1115,7 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant break; case TQVariant::UInt: unum = value.toUInt(); - if ( w && w->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) { + if ( w && w->inherits( "TQLayout" ) ) { if ( name == "spacing" ) num = MetaDataBase::spacing( TQT_TQOBJECT(WidgetFactory::layoutParent( TQT_TQLAYOUT(TQT_BASE_OBJECT(w)) )) ); else if ( name == "margin" ) @@ -1332,7 +1323,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay if ( colspan < 1 ) colspan = 1; - TQString className = e.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ); + TQString className = e.attribute( "class", "TQWidget" ); if ( !className.isNull() ) { obj = TQT_TQOBJECT(WidgetFactory::create( WidgetDatabase::idFromClassName( className ), parent, 0, false )); @@ -1344,7 +1335,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay mainContainerSet = true; } w = (TQWidget*)obj; - if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) + if ( w->inherits( "TQMainWindow" ) ) w = ( (TQMainWindow*)w )->centralWidget(); if ( layout ) { switch ( WidgetFactory::layoutType( layout ) ) { @@ -1368,9 +1359,9 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay layout = 0; if ( w && formwindow ) { - if ( !parent || ( !parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) && !parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) && !parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) ) + if ( !parent || ( !parent->inherits( "TQToolBox" ) && !parent->inherits( "TQTabWidget" ) && !parent->inherits( "TQWizard" ) ) ) formwindow->insertWidget( w, pasting ); - else if ( parent && ( parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) || parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) || parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) ) + else if ( parent && ( parent->inherits( "TQToolBox" ) || parent->inherits( "TQTabWidget" ) || parent->inherits( "TQWizard" ) ) ) MetaDataBase::addEntry( TQT_TQOBJECT(w) ); if (w->inherits("Dialog")) dynamic_cast<Dialog*>(w)->setUseInternalParser(false); @@ -1402,14 +1393,14 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay } else if ( n.tagName() == "attribute" && w ) { TQString attrib = n.attribute( "name" ); TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); - if ( parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) { + if ( parent->inherits( "TQTabWidget" ) ) { if ( attrib == "title" ) ( (TQTabWidget*)parent )->insertTab( w, v.toString() ); } else - if ( parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) { + if ( parent->inherits( "TQToolBox" ) ) { if ( attrib == "label" ) ( (TQToolBox*)parent )->addItem( w, v.toString() ); - } else if ( parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) { + } else if ( parent->inherits( "TQWizard" ) ) { if ( attrib == "title" ) ( (TQWizard*)parent )->addPage( w, v.toString() ); } @@ -1436,7 +1427,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) if ( !widget ) return; - if ( widget->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) && e.tagName() == "column" ) { + if ( widget->inherits( "TQListView" ) && e.tagName() == "column" ) { TQListView *lv = (TQListView*)widget; TQDomElement n = e.firstChild().toElement(); TQPixmap pix; @@ -1470,7 +1461,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) lv->header()->setResizeEnabled( resizeable, i ); } #ifndef TQT_NO_TABLE - else if ( widget->inherits( TQTABLE_OBJECT_NAME_STRING ) ) { + else if ( widget->inherits( "TQTable" ) ) { TQTable *table = (TQTable*)widget; bool isRow; if ( ( isRow = e.tagName() == "row" ) ) @@ -1537,14 +1528,14 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ) ) ) return; - if ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) || widget->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) { + if ( widget->inherits( "TQListBox" ) || widget->inherits( "TQComboBox" ) ) { TQDomElement n = e.firstChild().toElement(); TQPixmap pix; bool hasPixmap = false; TQString txt; loadItem( n, pix, txt, hasPixmap ); TQListBox *lb = 0; - if ( widget->inherits( TQLISTBOX_OBJECT_NAME_STRING ) ) + if ( widget->inherits( "TQListBox" ) ) lb = (TQListBox*)widget; else lb = ( (TQComboBox*)widget)->listBox(); @@ -1553,7 +1544,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt } else { new TQListBoxText( lb, txt ); } - } else if ( widget->inherits( TQICONVIEW_OBJECT_NAME_STRING ) ) { + } else if ( widget->inherits( "TQIconView" ) ) { TQDomElement n = e.firstChild().toElement(); TQPixmap pix; bool hasPixmap = false; @@ -1562,7 +1553,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt TQIconView *iv = (TQIconView*)widget; new TQIconViewItem( iv, txt, pix ); - } else if ( widget->inherits( TQLISTVIEW_OBJECT_NAME_STRING ) ) { + } else if ( widget->inherits( "TQListView" ) ) { TQDomElement n = e.firstChild().toElement(); TQPixmap pix; TQValueList<TQPixmap> pixmaps; @@ -1630,7 +1621,7 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay if ( formwindow ) formwindow->insertWidget( spacer, pasting ); if ( layout ) { - if ( layout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) ) + if ( layout->inherits( "TQBoxLayout" ) ) ( (TQBoxLayout*)layout )->addWidget( spacer, 0, spacer->alignment() ); else ( (QDesignerGridLayout*)layout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1, @@ -1644,9 +1635,9 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay */ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQDomElement &e ) { - const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, true ), true ); + const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop.latin1(), true ), true ); - if ( !obj->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) {// no layouts in metadatabase... (RS) + if ( !obj->inherits( "TQLayout" ) ) {// no layouts in metadatabase... (RS) if ( obj->inherits( "CustomWidget" ) ) { MetaDataBase::CustomWidget *cw = ( (CustomWidget*)obj )->customWidget(); if ( cw && !cw->hasProperty( prop.latin1() ) && !p && prop != "toolTip" && prop != "whatsThis" ) @@ -1720,13 +1711,13 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD v = TQPalette( p ); } else if ( e.tagName() == "enum" && p && p->isEnumType() ) { TQString key( v.toString() ); - v = TQVariant( p->keyToValue( key ) ); + v = TQVariant( p->keyToValue( key.utf8() ) ); } else if ( e.tagName() == "set" && p && p->isSetType() ) { TQString keys( v.toString() ); TQStringList lst = TQStringList::split( '|', keys ); TQStrList l; for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) - l.append( *it ); + l.append( (*it).utf8() ); v = TQVariant( p->keysToValue( l ) ); } @@ -1754,7 +1745,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD } } - if ( obj->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) { + if ( obj->inherits( "TQLayout" ) ) { if ( prop == "spacing" ) { MetaDataBase::setSpacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)obj ) )), v.toInt() ); return; @@ -1769,7 +1760,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD if ( pasting ) { TQString s = v.toString(); formwindow->unify( TQT_TQOBJECT(obj), s, true ); - obj->setName( s ); + obj->setName( s.utf8() ); return; } else if ( formwindow && TQT_BASE_OBJECT(obj) == formwindow->mainContainer() ) { formwindow->setName( v.toCString() ); @@ -1781,7 +1772,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD sp.setHeightForWidth( ( (TQWidget*)obj )->sizePolicy().hasHeightForWidth() ); } - obj->setProperty( prop, v ); + obj->setProperty( prop.latin1(), v ); } @@ -1876,7 +1867,7 @@ static TQImage loadImageData( TQDomElement &n2 ) ::uncompress( (uchar*) baunzip.data(), &len, (uchar*) ba, data.length()/2 ); img.loadFromData( (const uchar*)baunzip.data(), len, "XPM" ); } else { - img.loadFromData( (const uchar*)ba, data.length() / 2, format ); + img.loadFromData( (const uchar*)ba, data.length() / 2, format.utf8() ); } delete [] ba; @@ -1955,7 +1946,7 @@ void Resource::saveConnections( TQTextStream &ts, int indent ) TQString lang = formwindow->project()->language(); LanguageInterface *iface = langIface; if ( iface && MetaDataBase::hasEvents( lang ) ) { - TQObjectList *l = formwindow->queryList( TQWIDGET_OBJECT_NAME_STRING ); + TQObjectList *l = formwindow->queryList( "TQWidget" ); l->append( formwindow ); TQPtrList<TQAction> lst = formwindow->actionList(); for ( TQAction *a = lst.first(); a; a = lst.next() ) @@ -1994,12 +1985,12 @@ void Resource::loadConnections( const TQDomElement &e ) if ( n2.tagName() == "sender" ) { conn.sender = 0; TQString name = n2.firstChild().toText().data(); - if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) { + if ( name == "this" || toplevel->name() == name ) { conn.sender = TQT_TQOBJECT(toplevel); } else { if ( name == "this" ) name = toplevel->name(); - TQObjectList *l = toplevel->queryList( 0, name, false ); + TQObjectList *l = toplevel->queryList( 0, name.utf8(), false ); if ( l ) { if ( l->first() ) conn.sender = l->first(); @@ -2009,13 +2000,13 @@ void Resource::loadConnections( const TQDomElement &e ) conn.sender = formwindow->findAction( name ); } } else if ( n2.tagName() == "signal" ) { - conn.signal = n2.firstChild().toText().data(); + conn.signal = n2.firstChild().toText().data().utf8(); } else if ( n2.tagName() == "receiver" ) { TQString name = n2.firstChild().toText().data(); - if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) { + if ( name == "this" || toplevel->name() == name ) { conn.receiver = TQT_TQOBJECT(toplevel); } else { - TQObjectList *l = toplevel->queryList( 0, name, false ); + TQObjectList *l = toplevel->queryList( 0, name.utf8(), false ); if ( l ) { if ( l->first() ) conn.receiver = l->first(); @@ -2023,7 +2014,7 @@ void Resource::loadConnections( const TQDomElement &e ) } } } else if ( n2.tagName() == "slot" ) { - conn.slot = n2.firstChild().toText().data(); + conn.slot = n2.firstChild().toText().data().utf8(); } n2 = n2.nextSibling().toElement(); } @@ -2060,7 +2051,7 @@ void Resource::loadConnections( const TQDomElement &e ) slot.returnType = n.attribute( "returnType", "void" ); if ( slot.returnType.isEmpty() ) slot.returnType = "void"; - slot.slot = n.firstChild().toText().data(); + slot.slot = n.firstChild().toText().data().utf8(); if ( !MetaDataBase::hasSlot( TQT_TQOBJECT(formwindow), slot.slot, true ) ) MetaDataBase::addSlot( TQT_TQOBJECT(formwindow), slot.slot, slot.specifier, slot.access, slot.language, slot.returnType ); @@ -2233,7 +2224,7 @@ void Resource::loadTabOrder( const TQDomElement &e ) TQString name = n.firstChild().toText().data(); if ( name.isEmpty() ) continue; - TQObjectList *l = toplevel->queryList( 0, name, false ); + TQObjectList *l = toplevel->queryList( 0, name.utf8(), false ); if ( l ) { if ( l->first() ) { TQWidget *w = (TQWidget*)l->first(); @@ -2374,10 +2365,10 @@ void Resource::saveChildActions( TQAction *a, TQTextStream &ts, int indent ) while ( it.current() ) { TQObject *o = it.current(); ++it; - if ( !o->inherits( TQACTION_OBJECT_NAME_STRING ) ) + if ( !o->inherits( "TQAction" ) ) continue; TQAction *ac = (TQAction*)o; - bool isGroup = ac->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ); + bool isGroup = ac->inherits( "TQActionGroup" ); if ( isGroup ) ts << makeIndent( indent ) << "<actiongroup>" << endl; else @@ -2406,7 +2397,7 @@ void Resource::saveActions( const TQPtrList<TQAction> &actions, TQTextStream &ts TQPtrListIterator<TQAction> it( actions ); while ( it.current() ) { TQAction *a = it.current(); - bool isGroup = a->inherits( TQACTIONGROUP_OBJECT_NAME_STRING ); + bool isGroup = a->inherits( "TQActionGroup" ); if ( isGroup ) ts << makeIndent( indent ) << "<actiongroup>" << endl; else @@ -2450,7 +2441,7 @@ void Resource::loadChildAction( TQObject *parent, const TQDomElement &e ) } n2 = n2.nextSibling().toElement(); } - if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) ) + if ( !parent->inherits( "TQAction" ) ) formwindow->actionList().append( a ); } else if ( n.tagName() == "actiongroup" ) { a = new QDesignerActionGroup( parent ); @@ -2472,7 +2463,7 @@ void Resource::loadChildAction( TQObject *parent, const TQDomElement &e ) } n2 = n2.nextSibling().toElement(); } - if ( !parent->inherits( TQACTION_OBJECT_NAME_STRING ) ) + if ( !parent->inherits( "TQAction" ) ) formwindow->actionList().append( a ); } } @@ -2539,7 +2530,7 @@ void Resource::saveToolBars( TQMainWindow *mw, TQTextStream &ts, int indent ) void Resource::saveMenuBar( TQMainWindow *mw, TQTextStream &ts, int indent ) { - if ( !mw->child( 0, TQMENUBAR_OBJECT_NAME_STRING ) ) + if ( !mw->child( 0, "TQMenuBar" ) ) return; ts << makeIndent( indent ) << "<menubar>" << endl; indent++; @@ -2611,7 +2602,7 @@ void Resource::loadMenuBar( const TQDomElement &e ) while ( !n.isNull() ) { if ( n.tagName() == "item" ) { QDesignerPopupMenu *popup = new QDesignerPopupMenu( mw ); - popup->setName( n.attribute( "name" ) ); + popup->setName( n.attribute( "name" ).utf8() ); TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "action" ) { |