diff options
Diffstat (limited to 'kommander/editor/resource.cpp')
-rw-r--r-- | kommander/editor/resource.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/kommander/editor/resource.cpp b/kommander/editor/resource.cpp index 09768081..f55c963c 100644 --- a/kommander/editor/resource.cpp +++ b/kommander/editor/resource.cpp @@ -290,9 +290,9 @@ bool Resource::load( FormFile *ff, TQIODevice* dev ) metaInfo.license = e.firstChild().toText().data(); } else if ( e.tagName() == "exportmacro" ) { exportMacro = e.firstChild().toText().data(); - } else if ( e.tagName() == "tqlayoutdefaults" ) { - formwindow->setLayoutDefaultSpacing( e.attribute( "spacing", TQString::number( formwindow->tqlayoutDefaultSpacing() ) ).toInt() ); - formwindow->setLayoutDefaultMargin( e.attribute( "margin", TQString::number( formwindow->tqlayoutDefaultMargin() ) ).toInt() ); + } else if ( e.tagName() == "layoutdefaults" ) { + formwindow->setLayoutDefaultSpacing( e.attribute( "spacing", TQString::number( formwindow->layoutDefaultSpacing() ) ).toInt() ); + formwindow->setLayoutDefaultMargin( e.attribute( "margin", TQString::number( formwindow->layoutDefaultMargin() ) ).toInt() ); } e = e.nextSibling().toElement(); @@ -473,14 +473,14 @@ TQString Resource::copy() TQWidgetList widgets = formwindow->selectedWidgets(); TQWidgetList tmp( widgets ); for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { - TQWidget *p = w->tqparentWidget(); + TQWidget *p = w->parentWidget(); bool save = true; while ( p ) { if ( tmp.tqfindRef( p ) != -1 ) { save = false; break; } - p = p->tqparentWidget(); + p = p->parentWidget(); } if ( save ) saveObject( TQT_TQOBJECT(w), 0, ts, 0 ); @@ -940,8 +940,8 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent ) if ( !obj->inherits( TQSPLITTER_OBJECT_NAME_STRING ) && WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( obj ) ) ) && obj->isWidgetType() && - WidgetFactory::tqlayoutType( (TQWidget*)obj, tqlayout ) != WidgetFactory::NoLayout ) { - WidgetFactory::LayoutType lay = WidgetFactory::tqlayoutType( (TQWidget*)obj, tqlayout ); + WidgetFactory::layoutType( (TQWidget*)obj, tqlayout ) != WidgetFactory::NoLayout ) { + WidgetFactory::LayoutType lay = WidgetFactory::layoutType( (TQWidget*)obj, tqlayout ); switch ( lay ) { case WidgetFactory::HBox: closeTag = makeIndent( indent ) + "</hbox>"; @@ -1003,8 +1003,8 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) if ( changed.isEmpty() ) return; - bool inLayout = TQT_BASE_OBJECT(w) != TQT_BASE_OBJECT(formwindow->mainContainer()) && !copying && w->isWidgetType() && ( (TQWidget*)w )->tqparentWidget() && - WidgetFactory::tqlayoutType( ( (TQWidget*)w )->tqparentWidget() ) != WidgetFactory::NoLayout; + bool inLayout = TQT_BASE_OBJECT(w) != TQT_BASE_OBJECT(formwindow->mainContainer()) && !copying && w->isWidgetType() && ( (TQWidget*)w )->parentWidget() && + WidgetFactory::layoutType( ( (TQWidget*)w )->parentWidget() ) != WidgetFactory::NoLayout; TQStrList lst = w->tqmetaObject()->propertyNames( !w->inherits( "Spacer" ) ); for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) { @@ -1085,7 +1085,7 @@ void Resource::saveEnumProperty( TQObject *w, const TQString &name, TQVariant::T void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant &value, TQVariant::Type t, TQTextStream &ts, int indent ) { - if ( name == "hAlign" || name =="vAlign" || name == "wordwrap" || name == "tqlayoutMargin" || name =="tqlayoutSpacing" ) + if ( name == "hAlign" || name =="vAlign" || name == "wordwrap" || name == "layoutMargin" || name =="layoutSpacing" ) return; int num, unum; double dob; @@ -1108,9 +1108,9 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant num = value.toInt(); if ( w && w->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) { if ( name == "spacing" ) - num = MetaDataBase::spacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( WidgetFactory::tqlayoutParent( TQT_TQLAYOUT(TQT_BASE_OBJECT(w)) ) )) ); + num = MetaDataBase::spacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( TQT_TQLAYOUT(TQT_BASE_OBJECT(w)) ) )) ); else if ( name == "margin" ) - num = MetaDataBase::margin( TQT_TQOBJECT(WidgetFactory::containerOfWidget( WidgetFactory::tqlayoutParent( TQT_TQLAYOUT(TQT_BASE_OBJECT(w)) ) )) ); + num = MetaDataBase::margin( TQT_TQOBJECT(WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( TQT_TQLAYOUT(TQT_BASE_OBJECT(w)) ) )) ); } ts << makeIndent( indent ) << "<number>" << TQString::number( num ) << "</number>" << endl; break; @@ -1126,9 +1126,9 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant unum = value.toUInt(); if ( w && w->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) { if ( name == "spacing" ) - num = MetaDataBase::spacing( TQT_TQOBJECT(WidgetFactory::tqlayoutParent( TQT_TQLAYOUT(TQT_BASE_OBJECT(w)) )) ); + num = MetaDataBase::spacing( TQT_TQOBJECT(WidgetFactory::layoutParent( TQT_TQLAYOUT(TQT_BASE_OBJECT(w)) )) ); else if ( name == "margin" ) - num = MetaDataBase::margin( TQT_TQOBJECT(WidgetFactory::tqlayoutParent( TQT_TQLAYOUT(TQT_BASE_OBJECT(w)) )) ); + num = MetaDataBase::margin( TQT_TQOBJECT(WidgetFactory::layoutParent( TQT_TQLAYOUT(TQT_BASE_OBJECT(w)) )) ); } ts << makeIndent( indent ) << "<number>" << TQString::number( unum ) << "</number>" << endl; break; @@ -1173,8 +1173,8 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant TQVariant v( value ); ts << makeIndent( indent ) << "<font>" << endl; TQFont f( tqApp->font() ); - if ( w && w->isWidgetType() && ((TQWidget*)w)->tqparentWidget() ) - f = ((TQWidget*)w)->tqparentWidget()->font(); + if ( w && w->isWidgetType() && ((TQWidget*)w)->parentWidget() ) + f = ((TQWidget*)w)->parentWidget()->font(); TQFont f2( v.toFont() ); indent++; if ( f.family() != f2.family() ) @@ -1347,7 +1347,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *tqparent, TQL if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) w = ( (TQMainWindow*)w )->centralWidget(); if ( tqlayout ) { - switch ( WidgetFactory::tqlayoutType( tqlayout ) ) { + switch ( WidgetFactory::layoutType( tqlayout ) ) { case WidgetFactory::HBox: ( (TQHBoxLayout*)tqlayout )->addWidget( w ); break; @@ -1646,7 +1646,7 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD { const TQMetaProperty *p = obj->tqmetaObject()->property( obj->tqmetaObject()->tqfindProperty( prop, true ), true ); - if ( !obj->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) {// no tqlayouts in metadatabase... (RS) + if ( !obj->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) {// 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" ) @@ -1658,8 +1658,8 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD TQVariant defVarient; if ( e.tagName() == "font" ) { TQFont f( tqApp->font() ); - if ( obj->isWidgetType() && ( (TQWidget*)obj )->tqparentWidget() ) - f = ( (TQWidget*)obj )->tqparentWidget()->font(); + if ( obj->isWidgetType() && ( (TQWidget*)obj )->parentWidget() ) + f = ( (TQWidget*)obj )->parentWidget()->font(); defVarient = TQVariant( f ); } @@ -1756,11 +1756,11 @@ void Resource::setObjectProperty( TQObject* obj, const TQString &prop, const TQD if ( obj->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) { if ( prop == "spacing" ) { - MetaDataBase::setSpacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( WidgetFactory::tqlayoutParent( (TQLayout*)obj ) )), v.toInt() ); + MetaDataBase::setSpacing( TQT_TQOBJECT(WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)obj ) )), v.toInt() ); return; } if ( prop == "margin" ) { - MetaDataBase::setMargin( TQT_TQOBJECT(WidgetFactory::containerOfWidget( WidgetFactory::tqlayoutParent( (TQLayout*)obj ) )), v.toInt() ); + MetaDataBase::setMargin( TQT_TQOBJECT(WidgetFactory::containerOfWidget( WidgetFactory::layoutParent( (TQLayout*)obj ) )), v.toInt() ); return; } } @@ -2342,8 +2342,8 @@ void Resource::saveMetaInfoAfter( TQTextStream &ts, int indent ) if ( !( exportMacro = MetaDataBase::exportMacro( TQT_TQOBJECT(formwindow->mainContainer()) ) ).isEmpty() ) ts << makeIndent( indent ) << "<exportmacro>" << exportMacro << "</exportmacro>" << endl; if ( formwindow ) - ts << makeIndent( indent ) << "<tqlayoutdefaults spacing=\"" << formwindow->tqlayoutDefaultSpacing() - << "\" margin=\"" << formwindow->tqlayoutDefaultMargin() << "\"/>" << endl; + ts << makeIndent( indent ) << "<layoutdefaults spacing=\"" << formwindow->layoutDefaultSpacing() + << "\" margin=\"" << formwindow->layoutDefaultMargin() << "\"/>" << endl; } TQColorGroup Resource::loadColorGroup( const TQDomElement &e ) |