diff options
Diffstat (limited to 'kdevdesigner/designer/resource.cpp')
-rw-r--r-- | kdevdesigner/designer/resource.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/kdevdesigner/designer/resource.cpp b/kdevdesigner/designer/resource.cpp index 134f6c72..192e4ffc 100644 --- a/kdevdesigner/designer/resource.cpp +++ b/kdevdesigner/designer/resource.cpp @@ -720,13 +720,13 @@ 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 ); - if ( ::tqqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) { + if ( ::tqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) { saveMenuBar( (TQMainWindow*)formwindow->mainContainer(), ts, 0 ); saveToolBars( (TQMainWindow*)formwindow->mainContainer(), ts, 0 ); } if ( !MetaDataBase::customWidgets()->isEmpty() && !usedCustomWidgets.isEmpty() ) saveCustomWidgets( ts, 0 ); - if ( ::tqqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) + if ( ::tqt_cast<TQMainWindow*>(formwindow->mainContainer()) ) saveActions( formwindow->actionList(), ts, 0 ); if ( !images.isEmpty() ) saveImageCollection( ts, 0 ); @@ -914,7 +914,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea QDesignerWidgetStack* ws = 0; - if ( ::tqqt_cast<TQTabWidget*>(obj) ) { + if ( ::tqt_cast<TQTabWidget*>(obj) ) { TQTabWidget* tw = (TQTabWidget*) obj; TQObjectList* tmpl = tw->queryList( "TQWidgetStack" ); TQWidgetStack *ws = (TQWidgetStack*)tmpl->first(); @@ -946,7 +946,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea ts << makeIndent( indent ) << "</widget>" << endl; } delete tmpl; - } else if ( (ws = ::tqqt_cast<QDesignerWidgetStack*>(obj)) != 0 ) { + } else if ( (ws = ::tqt_cast<QDesignerWidgetStack*>(obj)) != 0 ) { for ( int i = 0; i < ws->count(); ++i ) { TQWidget *w = ws->page( i ); if ( !w ) @@ -969,7 +969,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea --indent; ts << makeIndent( indent ) << "</widget>" << endl; } - } else if ( ::tqqt_cast<TQToolBox*>(obj) ) { + } else if ( ::tqt_cast<TQToolBox*>(obj) ) { TQToolBox* tb = (TQToolBox*)obj; for ( int i = 0; i < tb->count(); ++i ) { TQWidget *w = tb->item( i ); @@ -998,7 +998,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea --indent; ts << makeIndent( indent ) << "</widget>" << endl; } - } else if ( ::tqqt_cast<TQWizard*>(obj) ) { + } else if ( ::tqt_cast<TQWizard*>(obj) ) { TQWizard* wiz = (TQWizard*)obj; for ( int i = 0; i < wiz->pageCount(); ++i ) { TQWidget *w = wiz->page( i ); @@ -1023,7 +1023,7 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea --indent; ts << makeIndent( indent ) << "</widget>" << endl; } - } else if ( ::tqqt_cast<TQMainWindow*>(obj) ) { + } else if ( ::tqt_cast<TQMainWindow*>(obj) ) { saveChildrenOf( TQT_TQOBJECT(( (TQMainWindow*)obj )->centralWidget()), ts, indent ); } else { bool saved = FALSE; @@ -1158,9 +1158,9 @@ void Resource::saveObject( TQObject *obj, QDesignerGridLayout* grid, TQTextStrea void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) { - if ( ::tqqt_cast<TQListBox*>(obj) || ::tqqt_cast<TQComboBox*>(obj) ) { + if ( ::tqt_cast<TQListBox*>(obj) || ::tqt_cast<TQComboBox*>(obj) ) { TQListBox *lb = 0; - if ( ::tqqt_cast<TQListBox*>(obj) ) + if ( ::tqt_cast<TQListBox*>(obj) ) lb = (TQListBox*)obj; else lb = ( (TQComboBox*)obj )->listBox(); @@ -1178,7 +1178,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) indent--; ts << makeIndent( indent ) << "</item>" << endl; } - } else if ( ::tqqt_cast<TQIconView*>(obj) ) { + } else if ( ::tqt_cast<TQIconView*>(obj) ) { TQIconView *iv = (TQIconView*)obj; TQIconViewItem *i = iv->firstItem(); @@ -1194,7 +1194,7 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) indent--; ts << makeIndent( indent ) << "</item>" << endl; } - } else if ( ::tqqt_cast<TQListView*>(obj) ) { + } else if ( ::tqt_cast<TQListView*>(obj) ) { TQListView *lv = (TQListView*)obj; int i; for ( i = 0; i < lv->header()->count(); ++i ) { @@ -1223,12 +1223,12 @@ void Resource::saveItems( TQObject *obj, TQTextStream &ts, int indent ) saveItem( lv->firstChild(), ts, indent - 1 ); } #if !defined (TQT_NO_TABLE) - else if ( ::tqqt_cast<TQTable*>(obj) ) { + else if ( ::tqt_cast<TQTable*>(obj) ) { TQTable *table = (TQTable*)obj; int i; TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( TQT_TQOBJECT(table) ); # ifndef TQT_NO_SQL - bool isDataTable = ::tqqt_cast<TQDataTable*>(table); + bool isDataTable = ::tqt_cast<TQDataTable*>(table); # else bool isDataTable = false; # endif @@ -1385,7 +1385,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 ( !::tqqt_cast<TQSplitter*>(obj) && + if ( !::tqt_cast<TQSplitter*>(obj) && WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( obj ) ) ) && obj->isWidgetType() && WidgetFactory::layoutType( (TQWidget*)obj, layout ) != WidgetFactory::NoLayout ) { @@ -1433,18 +1433,18 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) TQStringList changed; changed = MetaDataBase::changedProperties( w ); if ( w->isWidgetType() ) { - if ( ::tqqt_cast<Spacer*>(w) ) { + if ( ::tqt_cast<Spacer*>(w) ) { if ( !changed.contains( "sizeHint" ) ) changed << "sizeHint"; if ( !changed.contains( "geometry" ) ) changed << "geometry"; } else { - TQToolButton *tb = ::tqqt_cast<TQToolButton*>(w); + TQToolButton *tb = ::tqt_cast<TQToolButton*>(w); if ( tb && !tb->iconSet().isNull() ) { changed << "iconSet"; } } - } else if ( ::tqqt_cast<TQLayout*>(w) ) { + } else if ( ::tqt_cast<TQLayout*>(w) ) { if ( MetaDataBase::spacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) > -1 ) changed << "spacing"; if ( MetaDataBase::margin( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ) > -1 ) @@ -1467,7 +1467,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) bool inLayout = w != formwindow->mainContainer() && !copying && w->isWidgetType() && ( (TQWidget*)w )->parentWidget() && WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout; - TQStrList lst = w->metaObject()->propertyNames( !::tqqt_cast<Spacer*>(w) ); + TQStrList lst = w->metaObject()->propertyNames( !::tqt_cast<Spacer*>(w) ); for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) { if ( changed.find( TQString::fromLatin1( it.current() ) ) == changed.end() ) continue; @@ -1478,10 +1478,10 @@ 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 ( ::tqqt_cast<TQLabel*>(w) && qstrcmp( p->name(), "pixmap" ) == 0 && + if ( ::tqt_cast<TQLabel*>(w) && qstrcmp( p->name(), "pixmap" ) == 0 && ( !( (TQLabel*)w )->pixmap() || ( (TQLabel*)w )->pixmap()->isNull() ) ) continue; - if ( ::tqqt_cast<MenuBarEditor*>(w) && + if ( ::tqt_cast<MenuBarEditor*>(w) && ( qstrcmp( p->name(), "itemName" ) == 0 || qstrcmp( p->name(), "itemNumber" ) == 0 || qstrcmp( p->name(), "itemText" ) == 0 ) ) continue; @@ -1495,7 +1495,7 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) ts << " stdset=\"0\""; ts << ">" << endl; indent++; - if ( strcmp( it.current(), "resizeMode" ) == 0 && ::tqqt_cast<TQLayout*>(w) ) { + if ( strcmp( it.current(), "resizeMode" ) == 0 && ::tqt_cast<TQLayout*>(w) ) { saveProperty( w, it.current(), "", TQVariant::String, ts, indent ); } else if ( p->isSetType() ) { saveSetProperty( w, it.current(), TQVariant::nameToType( p->type() ), ts, indent ); @@ -1582,7 +1582,7 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant ts << makeIndent( indent ) << "<bool>" << mkBool( value.toBool() ) << "</bool>" << endl; break; case TQVariant::Int: - if ( ::tqqt_cast<TQLayout*>(w) ) { + if ( ::tqt_cast<TQLayout*>(w) ) { num = -1; if ( name == "spacing" ) num = MetaDataBase::spacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(w) ) ) ) ); @@ -1831,7 +1831,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay mainContainerSet = TRUE; } w = (TQWidget*)obj; - if ( ::tqqt_cast<TQMainWindow*>(w) ) + if ( ::tqt_cast<TQMainWindow*>(w) ) w = ( (TQMainWindow*)w )->centralWidget(); if ( layout ) { switch ( WidgetFactory::layoutType( layout ) ) { @@ -1856,20 +1856,20 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay if ( w && formwindow ) { if ( !parent || - ( !::tqqt_cast<TQTabWidget*>(parent) && - !::tqqt_cast<TQWidgetStack*>(parent) && - !::tqqt_cast<TQToolBox*>(parent) && - !::tqqt_cast<TQWizard*>(parent) + ( !::tqt_cast<TQTabWidget*>(parent) && + !::tqt_cast<TQWidgetStack*>(parent) && + !::tqt_cast<TQToolBox*>(parent) && + !::tqt_cast<TQWizard*>(parent) #ifdef TQT_CONTAINER_CUSTOM_WIDGETS && !isPlugin #endif ) ) formwindow->insertWidget( w, pasting ); else if ( parent && - ( ::tqqt_cast<TQTabWidget*>(parent) || - ::tqqt_cast<TQWidgetStack*>(parent) || - ::tqqt_cast<TQToolBox*>(parent) || - ::tqqt_cast<TQWizard*>(parent) + ( ::tqt_cast<TQTabWidget*>(parent) || + ::tqt_cast<TQWidgetStack*>(parent) || + ::tqt_cast<TQToolBox*>(parent) || + ::tqt_cast<TQWizard*>(parent) #ifdef TQT_CONTAINER_CUSTOM_WIDGETS || isPlugin #endif @@ -1912,16 +1912,16 @@ 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 ( ::tqqt_cast<TQTabWidget*>(parent) ) { + if ( ::tqt_cast<TQTabWidget*>(parent) ) { if ( attrib == "title" ) ( (TQTabWidget*)parent )->insertTab( w, v.toString() ); - } else if ( ::tqqt_cast<TQWidgetStack*>(parent) ) { + } else if ( ::tqt_cast<TQWidgetStack*>(parent) ) { if ( attrib == "id" ) ( (QDesignerWidgetStack*)parent )->insertPage( w, v.toInt() ); - } else if ( ::tqqt_cast<TQToolBox*>(parent) ) { + } else if ( ::tqt_cast<TQToolBox*>(parent) ) { if ( attrib == "label" ) ( (TQToolBox*)parent )->addItem( w, v.toString() ); - } else if ( ::tqqt_cast<TQWizard*>(parent) ) { + } else if ( ::tqt_cast<TQWizard*>(parent) ) { if ( attrib == "title" ) ( (TQWizard*)parent )->addPage( w, v.toString() ); #ifdef TQT_CONTAINER_CUSTOM_WIDGETS @@ -1969,7 +1969,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) if ( !widget ) return; - if ( ::tqqt_cast<TQListView*>(widget) && e.tagName() == "column" ) { + if ( ::tqt_cast<TQListView*>(widget) && e.tagName() == "column" ) { TQListView *lv = (TQListView*)widget; TQDomElement n = e.firstChild().toElement(); TQPixmap pix; @@ -2003,7 +2003,7 @@ void Resource::createColumn( const TQDomElement &e, TQWidget *widget ) lv->header()->setResizeEnabled( resizable, i ); } #ifndef TQT_NO_TABLE - else if ( ::tqqt_cast<TQTable*>(widget) ) { + else if ( ::tqt_cast<TQTable*>(widget) ) { TQTable *table = (TQTable*)widget; bool isRow; if ( ( isRow = e.tagName() == "row" ) ) @@ -2070,14 +2070,14 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt if ( !widget || !WidgetFactory::hasItems( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( TQT_TQOBJECT(widget) ) ), TQT_TQOBJECT(widget) ) ) return; - if ( ::tqqt_cast<TQListBox*>(widget) || ::tqqt_cast<TQComboBox*>(widget) ) { + if ( ::tqt_cast<TQListBox*>(widget) || ::tqt_cast<TQComboBox*>(widget) ) { TQDomElement n = e.firstChild().toElement(); TQPixmap pix; bool hasPixmap = FALSE; TQString txt; loadItem( n, pix, txt, hasPixmap ); TQListBox *lb = 0; - if ( ::tqqt_cast<TQListBox*>(widget) ) + if ( ::tqt_cast<TQListBox*>(widget) ) lb = (TQListBox*)widget; else lb = ( (TQComboBox*)widget)->listBox(); @@ -2086,7 +2086,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt } else { new TQListBoxText( lb, txt ); } - } else if ( ::tqqt_cast<TQIconView*>(widget) ) { + } else if ( ::tqt_cast<TQIconView*>(widget) ) { TQDomElement n = e.firstChild().toElement(); TQPixmap pix; bool hasPixmap = FALSE; @@ -2097,7 +2097,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt new TQIconViewItem( iv, txt, pix ); else new TQIconViewItem( iv, txt ); - } else if ( ::tqqt_cast<TQListView*>(widget) ) { + } else if ( ::tqt_cast<TQListView*>(widget) ) { TQDomElement n = e.firstChild().toElement(); TQPixmap pix; TQValueList<TQPixmap> pixmaps; @@ -2164,7 +2164,7 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay if ( formwindow ) formwindow->insertWidget( spacer, pasting ); if ( layout ) { - if ( ::tqqt_cast<TQBoxLayout*>(layout) ) + if ( ::tqt_cast<TQBoxLayout*>(layout) ) ( (TQBoxLayout*)layout )->addWidget( spacer, 0, spacer->alignment() ); else ( (QDesignerGridLayout*)layout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1, @@ -2180,7 +2180,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD { const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, TRUE ), TRUE ); - if ( !::tqqt_cast<TQLayout*>(obj) ) {// no layouts in metadatabase... (RS) + if ( !::tqt_cast<TQLayout*>(obj) ) {// 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" ) @@ -2293,7 +2293,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD } } - if ( ::tqqt_cast<TQLayout*>(obj) ) { + if ( ::tqt_cast<TQLayout*>(obj) ) { if ( prop == "spacing" ) { MetaDataBase::setSpacing( TQT_TQOBJECT( WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)(obj) ) ) ), v.toInt() ); return; @@ -2968,10 +2968,10 @@ void Resource::saveChildActions( TQAction *a, TQTextStream &ts, int indent ) while ( it.current() ) { TQObject *o = it.current(); ++it; - if ( !::tqqt_cast<TQAction*>(o) ) + if ( !::tqt_cast<TQAction*>(o) ) continue; TQAction *ac = (TQAction*)o; - bool isGroup = ::tqqt_cast<TQActionGroup*>(ac); + bool isGroup = ::tqt_cast<TQActionGroup*>(ac); if ( isGroup ) ts << makeIndent( indent ) << "<actiongroup>" << endl; else @@ -3000,7 +3000,7 @@ void Resource::saveActions( const TQPtrList<TQAction> &actions, TQTextStream &ts TQPtrListIterator<TQAction> it( actions ); while ( it.current() ) { TQAction *a = it.current(); - bool isGroup = ::tqqt_cast<TQActionGroup*>(a); + bool isGroup = ::tqt_cast<TQActionGroup*>(a); if ( isGroup ) ts << makeIndent( indent ) << "<actiongroup>" << endl; else @@ -3045,7 +3045,7 @@ void Resource::loadChildAction( TQObject *parent, const TQDomElement &e ) } n2 = n2.nextSibling().toElement(); } - if ( !::tqqt_cast<TQAction*>(parent) ) + if ( !::tqt_cast<TQAction*>(parent) ) formwindow->actionList().append( a ); } else if ( n.tagName() == "actiongroup" ) { a = new QDesignerActionGroup( parent ); @@ -3068,7 +3068,7 @@ void Resource::loadChildAction( TQObject *parent, const TQDomElement &e ) } n2 = n2.nextSibling().toElement(); } - if ( !::tqqt_cast<TQAction*>(parent) ) + if ( !::tqt_cast<TQAction*>(parent) ) formwindow->actionList().append( a ); } } @@ -3104,10 +3104,10 @@ void Resource::saveToolBars( TQMainWindow *mw, TQTextStream &ts, int indent ) saveObjectProperties( TQT_TQOBJECT(tb), ts, indent ); TQPtrList<TQAction> actionList = ( (QDesignerToolBar*)tb )->insertedActions(); for ( TQAction *a = actionList.first(); a; a = actionList.next() ) { - if ( ::tqqt_cast<QSeparatorAction*>(a) ) { + if ( ::tqt_cast<QSeparatorAction*>(a) ) { ts << makeIndent( indent ) << "<separator/>" << endl; } else { - if ( ::tqqt_cast<QDesignerAction*>(a) && !( (QDesignerAction*)a )->supportsMenu() ) { + if ( ::tqt_cast<QDesignerAction*>(a) && !( (QDesignerAction*)a )->supportsMenu() ) { TQWidget *w = ( (QDesignerAction*)a )->widget(); ts << makeIndent( indent ) << "<widget class=\"" << WidgetFactory::classNameOf( TQT_TQOBJECT(w) ) << "\">" << endl; @@ -3166,11 +3166,11 @@ void Resource::savePopupMenu( PopupMenuEditor *pm, TQMainWindow *mw, TQTextStrea { for ( PopupMenuEditorItem *i = pm->items()->first(); i; i = pm->items()->next() ) { TQAction *a = i->action(); - if ( ::tqqt_cast<QSeparatorAction*>(a) ) + if ( ::tqt_cast<QSeparatorAction*>(a) ) ts << makeIndent( indent ) << "<separator/>" << endl; - else if ( ::tqqt_cast<QDesignerAction*>(a) ) + else if ( ::tqt_cast<QDesignerAction*>(a) ) ts << makeIndent( indent ) << "<action name=\"" << a->name() << "\"/>" << endl; - else if ( ::tqqt_cast<QDesignerActionGroup*>(a) ) + else if ( ::tqt_cast<QDesignerActionGroup*>(a) ) ts << makeIndent( indent ) << "<actiongroup name=\"" << a->name() << "\"/>" << endl; PopupMenuEditor *s = i->subMenu(); if ( s && s->count() ) { |