diff options
Diffstat (limited to 'kdevdesigner/designer/resource.cpp')
-rw-r--r-- | kdevdesigner/designer/resource.cpp | 204 |
1 files changed, 102 insertions, 102 deletions
diff --git a/kdevdesigner/designer/resource.cpp b/kdevdesigner/designer/resource.cpp index d4099e34..18b00d30 100644 --- a/kdevdesigner/designer/resource.cpp +++ b/kdevdesigner/designer/resource.cpp @@ -347,7 +347,7 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) formwindow->setProject( MainWindow::self->currProject() ); if ( mainwindow ) formwindow->setMainWindow( mainwindow ); - MetaDataBase::addEntry( TQT_TQOBJECT(formwindow) ); + MetaDataBase::addEntry( formwindow ); if ( !langIface ) { TQString lang = "TQt Script"; @@ -569,11 +569,11 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) function.returnType = "void"; function.type = "slot"; function.function = n.firstChild().toText().data(); - if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(formwindow), function.function, TRUE ) ) - MetaDataBase::addFunction( TQT_TQOBJECT(formwindow), function.function, function.specifier, + if ( !MetaDataBase::hasFunction( formwindow, function.function, TRUE ) ) + MetaDataBase::addFunction( formwindow, function.function, function.specifier, function.access, "slot", function.language, function.returnType ); else - MetaDataBase::changeFunctionAttributes( TQT_TQOBJECT(formwindow), function.function, function.function, + MetaDataBase::changeFunctionAttributes( formwindow, function.function, function.function, function.specifier, function.access, "slot", function.language, function.returnType ); @@ -597,12 +597,12 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) if ( function.returnType.isEmpty() ) function.returnType = "void"; function.function = n.firstChild().toText().data(); - if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(formwindow), function.function, TRUE ) ) - MetaDataBase::addFunction( TQT_TQOBJECT(formwindow), function.function, function.specifier, + if ( !MetaDataBase::hasFunction( formwindow, function.function, TRUE ) ) + MetaDataBase::addFunction( formwindow, function.function, function.specifier, function.access, function.type, function.language, function.returnType ); else - MetaDataBase::changeFunctionAttributes( TQT_TQOBJECT(formwindow), function.function, function.function, + MetaDataBase::changeFunctionAttributes( formwindow, function.function, function.function, function.specifier, function.access, function.type, function.language, function.returnType ); } @@ -623,13 +623,13 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) loadTabOrder( tabOrder ); if ( formwindow ) { - MetaDataBase::setIncludes( TQT_TQOBJECT(formwindow), metaIncludes ); - MetaDataBase::setForwards( TQT_TQOBJECT(formwindow), metaForwards ); - MetaDataBase::setVariables( TQT_TQOBJECT(formwindow), metaVariables ); - MetaDataBase::setSignalList( TQT_TQOBJECT(formwindow), metaSignals ); + MetaDataBase::setIncludes( formwindow, metaIncludes ); + MetaDataBase::setForwards( formwindow, metaForwards ); + MetaDataBase::setVariables( formwindow, metaVariables ); + MetaDataBase::setSignalList( formwindow, metaSignals ); metaInfo.classNameChanged = metaInfo.className != TQString( formwindow->name() ); - MetaDataBase::setMetaInfo( TQT_TQOBJECT(formwindow), metaInfo ); - MetaDataBase::setExportMacro( TQT_TQOBJECT(formwindow->mainContainer()), exportMacro ); + MetaDataBase::setMetaInfo( formwindow, metaInfo ); + MetaDataBase::setExportMacro( formwindow->mainContainer(), exportMacro ); } loadExtraSource( formwindow->formFile(), currFileName, langIface, hasFunctions ); @@ -638,7 +638,7 @@ bool Resource::load( FormFile *ff, TQIODevice* dev, Project *defProject ) mainwindow->insertFormWindow( formwindow ); if ( formwindow ) { - formwindow->killAccels( TQT_TQOBJECT(formwindow) ); + formwindow->killAccels( formwindow ); if ( formwindow->layout() ) formwindow->layout()->activate(); if ( hadGeometry ) @@ -719,7 +719,7 @@ bool Resource::save( TQIODevice* dev ) ts << "<!DOCTYPE UI><UI version=\"3.3\" stdsetdef=\"1\">" << endl; saveMetaInfoBefore( ts, 0 ); - saveObject( TQT_TQOBJECT(formwindow->mainContainer()), 0, ts, 0 ); + saveObject( formwindow->mainContainer(), 0, ts, 0 ); if ( ::tqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) { saveMenuBar( (TQMainWindow*)formwindow->mainContainer(), ts, 0 ); saveToolBars( (TQMainWindow*)formwindow->mainContainer(), ts, 0 ); @@ -730,8 +730,8 @@ bool Resource::save( TQIODevice* dev ) saveActions( formwindow->actionList(), ts, 0 ); if ( !images.isEmpty() ) saveImageCollection( ts, 0 ); - if ( !MetaDataBase::connections( TQT_TQOBJECT(formwindow) ).isEmpty() || - !MetaDataBase::slotList( TQT_TQOBJECT(formwindow) ).isEmpty() ) + if ( !MetaDataBase::connections( formwindow ).isEmpty() || + !MetaDataBase::slotList( formwindow ).isEmpty() ) saveConnections( ts, 0 ); saveTabOrder( ts, 0 ); saveMetaInfoAfter( ts, 0 ); @@ -765,7 +765,7 @@ TQString Resource::copy() p = p->parentWidget(); } if ( save ) - saveObject( TQT_TQOBJECT(w), 0, ts, 0 ); + saveObject( w, 0, ts, 0 ); } if ( !MetaDataBase::customWidgets()->isEmpty() && !usedCustomWidgets.isEmpty() ) saveCustomWidgets( ts, 0 ); @@ -823,7 +823,7 @@ void Resource::paste( const TQString &cb, TQWidget *parent ) y = TQMAX( 0, parent->height() - w->height() ); if ( x != w->x() || y != w->y() ) w->move( x, y ); - formwindow->selectWidget( TQT_TQOBJECT(w) ); + formwindow->selectWidget( w ); } else if ( firstWidget.tagName() == "spacer" ) { TQWidget *w = createSpacer( firstWidget, parent, 0, firstWidget.tagName() == "vspacer" ? TQt::Vertical : TQt::Horizontal ); if ( !w ) @@ -837,7 +837,7 @@ void Resource::paste( const TQString &cb, TQWidget *parent ) y = TQMAX( 0, parent->height() - w->height() ); if ( x != w->x() || y != w->y() ) w->move( x, y ); - formwindow->selectWidget( TQT_TQOBJECT(w) ); + formwindow->selectWidget( w ); } firstWidget = firstWidget.nextSibling().toElement(); } @@ -864,7 +864,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea inc.implDecl = "in implementation"; inc.header = WidgetDatabase::includeFile( classID ); bool found = false; - TQValueList<MetaDataBase::Include> includes = MetaDataBase::includes( TQT_TQOBJECT(formwindow) ); + TQValueList<MetaDataBase::Include> includes = MetaDataBase::includes( formwindow ); TQValueList<MetaDataBase::Include>::Iterator it; for ( it = includes.begin(); it != includes.end(); ++it ) { MetaDataBase::Include currInc = *it; @@ -878,7 +878,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea { includes << inc; } - MetaDataBase::setIncludes( TQT_TQOBJECT(formwindow), includes ); + MetaDataBase::setIncludes( formwindow, includes ); } if ( obj != formwindow && !formwindow->widgets()->find( (TQWidget*)obj ) ) @@ -926,7 +926,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea TQWidget *w = ws->widget( t->identifier() ); if ( !w ) continue; - if ( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(TQT_TQOBJECT(w)) ) == -1 ) + if ( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(w) ) == -1 ) continue; // we don't know this widget ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl; ++indent; @@ -941,7 +941,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "<string>" << entitize( t->text() ) << "</string>" << endl; indent--; ts << makeIndent( indent ) << "</attribute>" << endl; - saveChildrenOf( TQT_TQOBJECT(w), ts, indent ); + saveChildrenOf( w, ts, indent ); --indent; ts << makeIndent( indent ) << "</widget>" << endl; } @@ -951,7 +951,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea TQWidget *w = ws->page( i ); if ( !w ) continue; - if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))) == -1 ) + if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 ) continue; // we don't know this widget ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl; ++indent; @@ -965,7 +965,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "<number>" << TQString::number(i) << "</number>" << endl; indent--; ts << makeIndent( indent ) << "</attribute>" << endl; - saveChildrenOf( TQT_TQOBJECT(w), ts, indent ); + saveChildrenOf( w, ts, indent ); --indent; ts << makeIndent( indent ) << "</widget>" << endl; } @@ -975,7 +975,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea TQWidget *w = tb->item( i ); if ( !w ) continue; - if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))) == -1 ) + if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 ) continue; // we don't know this widget ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl; ++indent; @@ -986,7 +986,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "</property>" << endl; ts << makeIndent( indent ) << "<property name=\"backgroundMode\">" << endl; indent++; - saveEnumProperty( TQT_TQOBJECT(w), "backgroundMode", TQVariant::Invalid, ts, indent ); + saveEnumProperty( w, "backgroundMode", TQVariant::Invalid, ts, indent ); indent--; ts << makeIndent( indent ) << "</property>" << endl; ts << makeIndent( indent ) << "<attribute name=\"label\">" << endl; @@ -994,7 +994,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "<string>" << entitize( tb->itemLabel( tb->indexOf(w) ) ) << "</string>" << endl; indent--; ts << makeIndent( indent ) << "</attribute>" << endl; - saveChildrenOf( TQT_TQOBJECT(w), ts, indent ); + saveChildrenOf( w, ts, indent ); --indent; ts << makeIndent( indent ) << "</widget>" << endl; } @@ -1004,7 +1004,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea TQWidget *w = wiz->page( i ); if ( !w ) continue; - if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(TQT_TQOBJECT(w))) == -1 ) + if ( WidgetDatabase::idFromClassName(WidgetFactory::classNameOf(w)) == -1 ) continue; // we don't know this widget ts << makeIndent( indent ) << "<widget class=\"TQWidget\">" << endl; ++indent; @@ -1019,12 +1019,12 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "<string>" << entitize( wiz->title( w ) ) << "</string>" << endl; indent--; ts << makeIndent( indent ) << "</attribute>" << endl; - saveChildrenOf( TQT_TQOBJECT(w), ts, indent ); + saveChildrenOf( w, ts, indent ); --indent; ts << makeIndent( indent ) << "</widget>" << endl; } } else if ( ::tqt_cast<TQMainWindow*>(obj) ) { - saveChildrenOf( TQT_TQOBJECT(( (TQMainWindow*)obj )->centralWidget()), ts, indent ); + saveChildrenOf( ( (TQMainWindow*)obj )->centralWidget(), ts, indent ); } else { bool saved = FALSE; #ifdef TQT_CONTAINER_CUSTOM_WIDGETS @@ -1042,10 +1042,10 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea int i = 0; for ( TQWidget *w = containers.first(); w; w = containers.next(), ++i ) { if ( WidgetDatabase:: - idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ) == -1 ) + idFromClassName( WidgetFactory::classNameOf( w ) ) == -1 ) continue; // we don't know this widget ts << makeIndent( indent ) << "<widget class=\"" - << WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) + << WidgetFactory::classNameOf( w ) << "\">" << endl; ++indent; ts << makeIndent( indent ) << "<property name=\"name\">" << endl; @@ -1071,7 +1071,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea TQWidget *w = iface2->containerOfWidget( className, (TQWidget*)obj ); if ( obj != w ) { ts << makeIndent( indent ) << "<widget class=\"" - << WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) + << WidgetFactory::classNameOf( w ) << "\">" << endl; ++indent; ts << makeIndent( indent ) << "<property name=\"name\">" << endl; @@ -1229,7 +1229,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) else if ( ::tqt_cast<TQTable*>(obj) ) { TQTable *table = (TQTable*)obj; int i; - TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( TQT_TQOBJECT(table) ); + TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( table ); # ifndef TQT_NO_SQL bool isDataTable = ::tqt_cast<TQDataTable*>(table); # else @@ -1319,10 +1319,10 @@ void Resource::savePixmap( const TQPixmap &p, TQTextStream &ts, int indent, cons if ( formwindow && formwindow->savePixmapInline() ) ts << makeIndent( indent ) << "<" << tagname << ">" << saveInCollection( p ) << "</" << tagname << ">" << endl; else if ( formwindow && formwindow->savePixmapInProject() ) - ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapKey( TQT_TQOBJECT(formwindow), p.serialNumber() ) + ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapKey( formwindow, p.serialNumber() ) << "</" << tagname << ">" << endl; else - ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapArgument( TQT_TQOBJECT(formwindow), p.serialNumber() ) + ts << makeIndent( indent ) << "<" << tagname << ">" << MetaDataBase::pixmapArgument( formwindow, p.serialNumber() ) << "</" << tagname << ">" << endl; } @@ -1334,7 +1334,7 @@ TQPixmap Resource::loadPixmap( const TQDomElement &e, const TQString &/*tagname* TQImage img = loadFromCollection( arg ); TQPixmap pix; pix.convertFromImage( img ); - MetaDataBase::setPixmapArgument( TQT_TQOBJECT(formwindow), pix.serialNumber(), arg ); + MetaDataBase::setPixmapArgument( formwindow, pix.serialNumber(), arg ); return pix; } else if ( formwindow && formwindow->savePixmapInProject() ) { TQPixmap pix; @@ -1346,13 +1346,13 @@ TQPixmap Resource::loadPixmap( const TQDomElement &e, const TQString &/*tagname* pix.convertFromImage( pix.convertToImage() ); } - MetaDataBase::setPixmapKey( TQT_TQOBJECT(formwindow), pix.serialNumber(), arg ); + MetaDataBase::setPixmapKey( formwindow, pix.serialNumber(), arg ); return pix; } TQPixmap pix = BarIcon( "designer_image.png", KDevDesignerPartFactory::instance() ); // we have to force the pixmap to get a new and unique serial number. Unfortunately detatch() doesn't do that pix.convertFromImage( pix.convertToImage() ); - MetaDataBase::setPixmapArgument( TQT_TQOBJECT(formwindow), pix.serialNumber(), arg ); + MetaDataBase::setPixmapArgument( formwindow, pix.serialNumber(), arg ); return pix; } @@ -1420,7 +1420,7 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent ) // save properties of layout if ( lay != WidgetFactory::NoLayout ) - saveObjectProperties( TQT_TQOBJECT(layout), ts, indent ); + saveObjectProperties( layout, ts, indent ); } @@ -1452,12 +1452,12 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) } } } else if ( ::tqt_cast<TQLayout*>(w) ) { - if ( MetaDataBase::spacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) > -1 ) + if ( MetaDataBase::spacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) > -1 ) changed << "spacing"; - if ( MetaDataBase::margin( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) > -1 ) + if ( MetaDataBase::margin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) > -1 ) changed << "margin"; - if ( MetaDataBase::resizeMode( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) != "Auto" - && !MetaDataBase::resizeMode( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ).isEmpty() ) + if ( MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) != "Auto" + && !MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ).isEmpty() ) changed << "resizeMode"; } @@ -1569,7 +1569,7 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant switch ( t ) { case TQVariant::String: if ( name == "resizeMode" ) { - TQString resmod = MetaDataBase::resizeMode( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ); + TQString resmod = MetaDataBase::resizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ); if ( !resmod.isNull() && resmod != "Auto" ) { ts << makeIndent( indent ) << "<enum>"; ts << resmod; @@ -1592,9 +1592,9 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant if ( ::tqt_cast<TQLayout*>(w) ) { num = -1; if ( name == "spacing" ) - num = MetaDataBase::spacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ); + num = MetaDataBase::spacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ); else if ( name == "margin" ) - num = MetaDataBase::margin( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ); + num = MetaDataBase::margin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ); if ( num != -1 ) ts << makeIndent( indent ) << "<number>" << TQString::number( num ) << "</number>" << endl; } else { @@ -1824,7 +1824,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay // ### TODO loading for custom container widgets without pages #endif if ( !className.isNull() ) { - obj = TQT_TQOBJECT(WidgetFactory::create( WidgetDatabase::idFromClassName( className ), parent, 0, FALSE )); + obj = WidgetFactory::create( WidgetDatabase::idFromClassName( className ), parent, 0, FALSE ); if ( !obj ) { TQMessageBox::critical( MainWindow::self, i18n( "Loading File" ), i18n( "Error loading %1.\n" @@ -1881,7 +1881,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay || isPlugin #endif ) ) - MetaDataBase::addEntry( TQT_TQOBJECT(w) ); + MetaDataBase::addEntry( w ); } } @@ -1895,17 +1895,17 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay createObject( n, w, layout ); } else if ( n.tagName() == "hbox" ) { layout = WidgetFactory::createLayout( w, layout, WidgetFactory::HBox ); - obj = TQT_TQOBJECT(layout); + obj = layout; n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "grid" ) { layout = WidgetFactory::createLayout( w, layout, WidgetFactory::Grid ); - obj = TQT_TQOBJECT(layout); + obj = layout; n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "vbox" ) { layout = WidgetFactory::createLayout( w, layout, WidgetFactory::VBox ); - obj = TQT_TQOBJECT(layout); + obj = layout; n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "property" && obj ) { @@ -1968,7 +1968,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay if ( w->isWidgetType() ) widgets.insert( w->name(), w ); - return TQT_TQOBJECT(w); + return w; } void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) @@ -2023,7 +2023,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) bool hasPixmap = FALSE; TQString txt; TQString field; - TQMap<TQString, TQString> fieldMap = MetaDataBase::columnFields( TQT_TQOBJECT(table) ); + TQMap<TQString, TQString> fieldMap = MetaDataBase::columnFields( table ); while ( !n.isNull() ) { if ( n.tagName() == "property" ) { TQString attrib = n.attribute( "name" ); @@ -2048,7 +2048,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) h->setLabel( i, txt ); if ( !isRow && !field.isEmpty() ) fieldMap.insert( txt, field ); - MetaDataBase::setColumnFields( TQT_TQOBJECT(table), fieldMap ); + MetaDataBase::setColumnFields( table, fieldMap ); } #endif } @@ -2074,7 +2074,7 @@ void Resource::loadItem( const TQDomElement &e, TQPixmap &pix, TQString &txt, bo void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewItem *i ) { - if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ), TQT_TQOBJECT(widget) ) ) + if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( widget ) ), widget ) ) return; if ( ::tqt_cast<TQListBox*>(widget) || ::tqt_cast<TQComboBox*>(widget) ) { @@ -2164,7 +2164,7 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay spacer->setInteraciveMode( FALSE ); while ( !n.isNull() ) { if ( n.tagName() == "property" ) - setObjectProperty( TQT_TQOBJECT(spacer), n.attribute( "name" ), n.firstChild().toElement() ); + setObjectProperty( spacer, n.attribute( "name" ), n.firstChild().toElement() ); n = n.nextSibling().toElement(); } spacer->setInteraciveMode( TRUE ); @@ -2229,7 +2229,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD if ( !p ) { MetaDataBase::setFakeProperty( obj, prop, v ); if ( obj->isWidgetType() ) { - if ( prop == "database" && TQT_TQOBJECT(obj) != TQT_TQOBJECT(toplevel) ) { + if ( prop == "database" && obj != toplevel ) { TQStringList lst = MetaDataBase::fakeProperty( obj, "database" ).toStringList(); if ( lst.count() > 2 ) dbControls.insert( obj->name(), lst[ 2 ] ); @@ -2283,8 +2283,8 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD } if ( prop == "icon" ) { formwindow->setIcon( v.toPixmap() ); - TQString pmk = MetaDataBase::pixmapKey( TQT_TQOBJECT(formwindow), v.toPixmap().serialNumber() ); - MetaDataBase::setPixmapKey( TQT_TQOBJECT(formwindow), + TQString pmk = MetaDataBase::pixmapKey( formwindow, v.toPixmap().serialNumber() ); + MetaDataBase::setPixmapKey( formwindow, formwindow->icon()->serialNumber(), pmk ); } @@ -2302,13 +2302,13 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD if ( ::tqt_cast<TQLayout*>(obj) ) { if ( prop == "spacing" ) { - MetaDataBase::setSpacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) ), v.toInt() ); + MetaDataBase::setSpacing( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) , v.toInt() ); return; } else if ( prop == "margin" ) { - MetaDataBase::setMargin( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) ), v.toInt() ); + MetaDataBase::setMargin( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) , v.toInt() ); return; } else if ( e.tagName() == "enum" && prop == "resizeMode" ) { - MetaDataBase::setResizeMode( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) ), v.toString() ); + MetaDataBase::setResizeMode( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) , v.toString() ); return; } } @@ -2316,7 +2316,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD if ( prop == "name" ) { if ( pasting ) { TQString s = v.toString(); - formwindow->unify( TQT_TQOBJECT(obj), s, TRUE ); + formwindow->unify( obj, s, TRUE ); obj->setName( s ); return; } else if ( formwindow && obj == formwindow->mainContainer() ) { @@ -2485,7 +2485,7 @@ TQImage Resource::loadFromCollection( const TQString &name ) void Resource::saveConnections( TQTextStream &ts, int indent ) { - TQValueList<MetaDataBase::Connection> connections = MetaDataBase::connections( TQT_TQOBJECT(formwindow) ); + TQValueList<MetaDataBase::Connection> connections = MetaDataBase::connections( formwindow ); if ( connections.isEmpty() ) return; ts << makeIndent( indent ) << "<connections>" << endl; @@ -2498,8 +2498,8 @@ void Resource::saveConnections( TQTextStream &ts, int indent ) ( knownNames.findIndex( TQString( conn.receiver->name() ) ) == -1 && qstrcmp( conn.receiver->name(), "this" ) != 0 ) ) continue; - if ( formwindow->isMainContainer( TQT_TQOBJECT((*it).receiver) ) && - !MetaDataBase::hasSlot( TQT_TQOBJECT(formwindow), MetaDataBase::normalizeFunction( (*it).slot ).latin1() ) ) + if ( formwindow->isMainContainer( (*it).receiver ) && + !MetaDataBase::hasSlot( formwindow, MetaDataBase::normalizeFunction( (*it).slot ).latin1() ) ) continue; if ( conn.sender->inherits( "CustomWidget" ) ) { @@ -2542,7 +2542,7 @@ void Resource::loadConnections( const TQDomElement &e ) conn.sender = 0; TQString name = n2.firstChild().toText().data(); if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) { - conn.sender = TQT_TQOBJECT(toplevel); + conn.sender = toplevel; } else { if ( name == "this" ) name = toplevel->name(); @@ -2562,7 +2562,7 @@ void Resource::loadConnections( const TQDomElement &e ) conn.receiver = 0; TQString name = n2.firstChild().toText().data(); if ( name == "this" || qstrcmp( toplevel->name(), name ) == 0 ) { - conn.receiver = TQT_TQOBJECT(toplevel); + conn.receiver = toplevel; } else { TQObjectList *l = toplevel->queryList( 0, name, FALSE ); if ( l ) { @@ -2581,13 +2581,13 @@ void Resource::loadConnections( const TQDomElement &e ) } if ( formwindow ) { if ( conn.sender == formwindow ) - conn.sender = TQT_TQOBJECT(formwindow->mainContainer()); + conn.sender = formwindow->mainContainer(); if ( conn.receiver == formwindow ) - conn.receiver = TQT_TQOBJECT(formwindow->mainContainer()); + conn.receiver = formwindow->mainContainer(); } if ( conn.sender && conn.receiver ) { if ( lang == "C++" ) { - MetaDataBase::addConnection( TQT_TQOBJECT(formwindow ? formwindow : toplevel), + MetaDataBase::addConnection( formwindow ? formwindow : toplevel, conn.sender, conn.signal, conn.receiver, conn.slot ); } } @@ -2604,11 +2604,11 @@ void Resource::loadConnections( const TQDomElement &e ) if ( slot.returnType.isEmpty() ) slot.returnType = "void"; slot.function = n.firstChild().toText().data(); - if ( !MetaDataBase::hasFunction( TQT_TQOBJECT(formwindow), slot.function, TRUE ) ) - MetaDataBase::addFunction( TQT_TQOBJECT(formwindow), slot.function, slot.specifier, + if ( !MetaDataBase::hasFunction( formwindow, slot.function, TRUE ) ) + MetaDataBase::addFunction( formwindow, slot.function, slot.specifier, slot.access, "slot", slot.language, slot.returnType ); else - MetaDataBase::changeFunctionAttributes( TQT_TQOBJECT(formwindow), slot.function, slot.function, + MetaDataBase::changeFunctionAttributes( formwindow, slot.function, slot.function, slot.specifier, slot.access, "slot", slot.language, slot.returnType ); } @@ -2798,7 +2798,7 @@ void Resource::loadTabOrder( const TQDomElement &e ) void Resource::saveMetaInfoBefore( TQTextStream &ts, int indent ) { - MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( TQT_TQOBJECT(formwindow) ); + MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( formwindow ); TQString cn; if ( info.classNameChanged && !info.className.isEmpty() ) cn = info.className; @@ -2813,9 +2813,9 @@ void Resource::saveMetaInfoBefore( TQTextStream &ts, int indent ) void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) { - MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( TQT_TQOBJECT(formwindow) ); + MetaDataBase::MetaInfo info = MetaDataBase::metaInfo( formwindow ); if ( !langIface || formwindow->project()->isCpp() ) { - TQValueList<MetaDataBase::Include> includes = MetaDataBase::includes( TQT_TQOBJECT(formwindow) ); + TQValueList<MetaDataBase::Include> includes = MetaDataBase::includes( formwindow ); TQString extensionInclude; bool needExtensionInclude = FALSE; if ( langIface && @@ -2842,7 +2842,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) ts << makeIndent( indent ) << "</includes>" << endl; } - TQStringList forwards = MetaDataBase::forwards( TQT_TQOBJECT(formwindow) ); + TQStringList forwards = MetaDataBase::forwards( formwindow ); if ( !forwards.isEmpty() ) { ts << makeIndent( indent ) << "<forwards>" << endl; indent++; @@ -2851,7 +2851,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) indent--; ts << makeIndent( indent ) << "</forwards>" << endl; } - TQValueList<MetaDataBase::Variable> varLst = MetaDataBase::variables( TQT_TQOBJECT(formwindow) ); + TQValueList<MetaDataBase::Variable> varLst = MetaDataBase::variables( formwindow ); if ( !varLst.isEmpty() ) { ts << makeIndent( indent ) << "<variables>" << endl; indent++; @@ -2867,7 +2867,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) indent--; ts << makeIndent( indent ) << "</variables>" << endl; } - TQStringList sigs = MetaDataBase::signalList( TQT_TQOBJECT(formwindow) ); + TQStringList sigs = MetaDataBase::signalList( formwindow ); if ( !sigs.isEmpty() ) { ts << makeIndent( indent ) << "<signals>" << endl; indent++; @@ -2877,7 +2877,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) ts << makeIndent( indent ) << "</signals>" << endl; } - TQValueList<MetaDataBase::Function> slotList = MetaDataBase::slotList( TQT_TQOBJECT(formwindow) ); + TQValueList<MetaDataBase::Function> slotList = MetaDataBase::slotList( formwindow ); if ( !slotList.isEmpty() ) { ts << makeIndent( indent ) << "<slots>" << endl; indent++; @@ -2900,7 +2900,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) ts << makeIndent( indent ) << "</slots>" << endl; } - TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( TQT_TQOBJECT(formwindow), TRUE ); + TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formwindow, TRUE ); if ( !functionList.isEmpty() ) { ts << makeIndent( indent ) << "<functions>" << endl; indent++; @@ -2930,7 +2930,7 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) ts << makeIndent( indent ) << "<pixmapinproject/>" << endl; else ts << makeIndent( indent ) << "<pixmapfunction>" << formwindow->pixmapLoaderFunction() << "</pixmapfunction>" << endl; - if ( !( exportMacro = MetaDataBase::exportMacro( TQT_TQOBJECT(formwindow->mainContainer()) ) ).isEmpty() ) + if ( !( exportMacro = MetaDataBase::exportMacro( formwindow->mainContainer() ) ).isEmpty() ) ts << makeIndent( indent ) << "<exportmacro>" << exportMacro << "</exportmacro>" << endl; if ( formwindow ) { ts << makeIndent( indent ) << "<layoutdefaults spacing=\"" << formwindow->layoutDefaultSpacing() @@ -3085,9 +3085,9 @@ void Resource::loadActions( const TQDomElement &e ) TQDomElement n = e.firstChild().toElement(); while ( !n.isNull() ) { if ( n.tagName() == "action" ) { - loadChildAction( TQT_TQOBJECT(formwindow), n ); + loadChildAction( formwindow, n ); } else if ( n.tagName() == "actiongroup" ) { - loadChildAction( TQT_TQOBJECT(formwindow), n ); + loadChildAction( formwindow, n ); } n = n.nextSibling().toElement(); } @@ -3108,7 +3108,7 @@ void Resource::saveToolBars( TQMainWindow *mw, TQTextStream &ts, int indent ) continue; ts << makeIndent( indent ) << "<toolbar dock=\"" << i << "\">" << endl; indent++; - saveObjectProperties( TQT_TQOBJECT(tb), ts, indent ); + saveObjectProperties( tb, ts, indent ); TQPtrList<TQAction> actionList = ( (QDesignerToolBar*)tb )->insertedActions(); for ( TQAction *a = actionList.first(); a; a = actionList.next() ) { if ( ::tqt_cast<QSeparatorAction*>(a) ) { @@ -3117,14 +3117,14 @@ void Resource::saveToolBars( TQMainWindow *mw, TQTextStream &ts, int indent ) if ( ::tqt_cast<QDesignerAction*>(a) && !( (QDesignerAction*)a )->supportsMenu() ) { TQWidget *w = ( (QDesignerAction*)a )->widget(); ts << makeIndent( indent ) << "<widget class=\"" - << WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) << "\">" << endl; + << WidgetFactory::classNameOf( w ) << "\">" << endl; indent++; - const char *className = WidgetFactory::classNameOf( TQT_TQOBJECT(w) ); + const char *className = WidgetFactory::classNameOf( w ); if ( w->isA( "CustomWidget" ) ) usedCustomWidgets << TQString( className ); - if ( WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) ), TQT_TQOBJECT(w) ) ) - saveItems( TQT_TQOBJECT(w), ts, indent ); - saveObjectProperties( TQT_TQOBJECT(w), ts, indent ); + if ( WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( w ) ), w ) ) + saveItems( w, ts, indent ); + saveObjectProperties( w, ts, indent ); indent--; ts << makeIndent( indent ) << "</widget>" << endl; } else { @@ -3147,8 +3147,8 @@ void Resource::saveMenuBar( TQMainWindow *mw, TQTextStream &ts, int indent ) return; ts << makeIndent( indent ) << "<menubar>" << endl; indent++; - MetaDataBase::setPropertyChanged( TQT_TQOBJECT(mb), "name", TRUE ); // FIXME: remove - saveObjectProperties( TQT_TQOBJECT(mb), ts, indent ); + MetaDataBase::setPropertyChanged( mb, "name", TRUE ); // FIXME: remove + saveObjectProperties( mb, ts, indent ); for ( int i = 0; i < (int)mb->count(); ++i ) { MenuBarEditorItem *m = mb->item( i ); @@ -3217,12 +3217,12 @@ void Resource::loadToolBars( const TQDomElement &e ) tb->addAction( a ); } else if ( n2.tagName() == "widget" ) { TQWidget *w = (TQWidget*)createObject( n2, tb ); - QDesignerAction *a = new QDesignerAction( w, TQT_TQOBJECT(tb) ); + QDesignerAction *a = new QDesignerAction( w, tb ); a->addTo( tb ); tb->addAction( a ); tb->installEventFilters( w ); } else if ( n2.tagName() == "property" ) { - setObjectProperty( TQT_TQOBJECT(tb), n2.attribute( "name" ), n2.firstChild().toElement() ); + setObjectProperty( tb, n2.attribute( "name" ), n2.firstChild().toElement() ); } n2 = n2.nextSibling().toElement(); } @@ -3236,16 +3236,16 @@ void Resource::loadMenuBar( const TQDomElement &e ) TQDomElement n = e.firstChild().toElement(); TQMainWindow *mw = (TQMainWindow*)formwindow->mainContainer(); MenuBarEditor *mb = new MenuBarEditor( formwindow, mw ); - MetaDataBase::addEntry( TQT_TQOBJECT(mb) ); + MetaDataBase::addEntry( mb ); while ( !n.isNull() ) { if ( n.tagName() == "item" ) { PopupMenuEditor * popup = new PopupMenuEditor( formwindow, mw ); loadPopupMenu( popup, n ); popup->setName( n.attribute( "name" ) ); mb->insertItem( n.attribute( "text" ), popup ); - MetaDataBase::addEntry( TQT_TQOBJECT(popup) ); + MetaDataBase::addEntry( popup ); } else if ( n.tagName() == "property" ) { - setObjectProperty( TQT_TQOBJECT(mb), n.attribute( "name" ), n.firstChild().toElement() ); + setObjectProperty( mb, n.attribute( "name" ), n.firstChild().toElement() ); } else if ( n.tagName() == "separator" ) { mb->insertSeparator(); } @@ -3255,7 +3255,7 @@ void Resource::loadMenuBar( const TQDomElement &e ) void Resource::loadPopupMenu( PopupMenuEditor *p, const TQDomElement &e ) { - MetaDataBase::addEntry( TQT_TQOBJECT(p) ); + MetaDataBase::addEntry( p ); TQDomElement n = e.firstChild().toElement(); TQAction *a = 0; while ( !n.isNull() ) { |