diff options
author | Timothy Pearson <[email protected]> | 2011-12-16 10:00:36 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2011-12-16 10:00:36 -0600 |
commit | 1fffbdafa12271a1a635caf46777fb8acfb6f31b (patch) | |
tree | 707785bd058e254fd865ca30ed35f37f206aebbc /kommander/editor/resource.cpp | |
parent | 2b0e1de2ffcca7bb93f1fd8ddd32f74041d0d076 (diff) | |
download | tdewebdev-1fffbdafa12271a1a635caf46777fb8acfb6f31b.tar.gz tdewebdev-1fffbdafa12271a1a635caf46777fb8acfb6f31b.zip |
Revert "Rename a number of old tq methods that are no longer tq specific"
This reverts commit 2b0e1de2ffcca7bb93f1fd8ddd32f74041d0d076.
Diffstat (limited to 'kommander/editor/resource.cpp')
-rw-r--r-- | kommander/editor/resource.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/kommander/editor/resource.cpp b/kommander/editor/resource.cpp index 81824fc6..93f6cc9b 100644 --- a/kommander/editor/resource.cpp +++ b/kommander/editor/resource.cpp @@ -27,7 +27,7 @@ #include "tqdom.h" #include "widgetdatabase.h" #include "widgetfactory.h" -#include "layout.h" +#include "tqlayout.h" #include "domtool.h" #include "command.h" #include "pixmapchooser.h" @@ -43,7 +43,7 @@ #include <tqfeatures.h> #include <tqfile.h> -#include <textstream.h> +#include <tqtextstream.h> #include <tqobject.h> #include <tqwidget.h> #include <tqobjectlist.h> @@ -52,7 +52,7 @@ #include <tqtabwidget.h> #include <tqapplication.h> #include <tqbuffer.h> -#include <layout.h> +#include <tqlayout.h> #include <tqtooltip.h> #include <tqwhatsthis.h> #include <tqlistbox.h> @@ -64,7 +64,7 @@ #include <tqiconview.h> #include <tqlabel.h> #include <tqwizard.h> -#include <textcodec.h> +#include <tqtextcodec.h> #include <tqregexp.h> #include <zlib.h> #include <tqdatetime.h> @@ -401,13 +401,13 @@ bool Resource::load( FormFile *ff, TQIODevice* dev ) if ( formwindow ) { formwindow->killAccels( TQT_TQOBJECT(formwindow) ); - if ( formwindow->layout() ) - formwindow->layout()->activate(); + if ( formwindow->tqlayout() ) + formwindow->tqlayout()->activate(); if ( hadGeometry ) - formwindow->resize( formwindow->size().expandedTo( formwindow->minimumSize(). - expandedTo( formwindow->minimumSizeHint() ) ) ); + formwindow->resize( formwindow->size().expandedTo( formwindow->tqminimumSize(). + expandedTo( formwindow->tqminimumSizeHint() ) ) ); else - formwindow->resize( formwindow->size().expandedTo( formwindow->sizeHint() ) ); + formwindow->resize( formwindow->size().expandedTo( formwindow->tqsizeHint() ) ); } return true; @@ -931,17 +931,17 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent ) { const TQObjectList l = obj->childrenListObject(); if ( l.isEmpty() ) - return; // no children to save + return; // no tqchildren to save TQString closeTag; - // 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; + // if the widget has a tqlayout we pretend that all widget's childs are childs of the tqlayout - makes the structure nicer + TQLayout *tqlayout = 0; QDesignerGridLayout* grid = 0; if ( !obj->inherits( TQSPLITTER_OBJECT_NAME_STRING ) && WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( obj ) ) ) && obj->isWidgetType() && - WidgetFactory::layoutType( (TQWidget*)obj, layout ) != WidgetFactory::NoLayout ) { - WidgetFactory::LayoutType lay = WidgetFactory::layoutType( (TQWidget*)obj, layout ); + WidgetFactory::layoutType( (TQWidget*)obj, tqlayout ) != WidgetFactory::NoLayout ) { + WidgetFactory::LayoutType lay = WidgetFactory::layoutType( (TQWidget*)obj, tqlayout ); switch ( lay ) { case WidgetFactory::HBox: closeTag = makeIndent( indent ) + "</hbox>"; @@ -957,15 +957,15 @@ void Resource::saveChildrenOf( TQObject* obj, TQTextStream &ts, int indent ) closeTag = makeIndent( indent ) + "</grid>"; ts << makeIndent( indent ) << "<grid>" << endl; ++indent; - grid = (QDesignerGridLayout*) layout; + grid = (QDesignerGridLayout*) tqlayout; break; default: break; } - // save properties of layout + // save properties of tqlayout if ( lay != WidgetFactory::NoLayout ) - saveObjectProperties( TQT_TQOBJECT(layout), ts, indent ); + saveObjectProperties( TQT_TQOBJECT(tqlayout), ts, indent ); } @@ -984,8 +984,8 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) changed = MetaDataBase::changedProperties( w ); if ( w->isWidgetType() ) { if ( w->inherits( "Spacer" ) ) { - if ( !changed.contains( "sizeHint" ) ) - changed << "sizeHint"; + if ( !changed.contains( "tqsizeHint" ) ) + changed << "tqsizeHint"; if ( !changed.contains( "geometry" ) ) changed << "geometry"; } @@ -1006,15 +1006,15 @@ void Resource::saveObjectProperties( TQObject *w, TQTextStream &ts, int indent ) 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->metaObject()->propertyNames( !w->inherits( "Spacer" ) ); + TQStrList lst = w->tqmetaObject()->propertyNames( !w->inherits( "Spacer" ) ); for ( TQPtrListIterator<char> it( lst ); it.current(); ++it ) { - if ( changed.find( TQString::fromLatin1( it.current() ) ) == changed.end() ) + if ( changed.find( TQString::tqfromLatin1( it.current() ) ) == changed.end() ) continue; - if ( saved.find( TQString::fromLatin1( it.current() ) ) != saved.end() ) + if ( saved.find( TQString::tqfromLatin1( it.current() ) ) != saved.end() ) continue; - saved << TQString::fromLatin1( it.current() ); - const TQMetaProperty* p = w->metaObject()-> - property( w->metaObject()->findProperty( it.current(), true ), true ); + saved << TQString::tqfromLatin1( it.current() ); + const TQMetaProperty* p = w->tqmetaObject()-> + property( w->tqmetaObject()->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 && @@ -1066,7 +1066,7 @@ 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 ); + const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->findProperty( name, true ), true ); TQStrList l( p->valueToKeys( w->property( name ).toInt() ) ); TQString v; for ( uint i = 0; i < l.count(); ++i ) { @@ -1079,7 +1079,7 @@ 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 ); + const TQMetaProperty *p = w->tqmetaObject()->property( w->tqmetaObject()->findProperty( name, true ), true ); ts << makeIndent( indent ) << "<enum>" << p->valueToKey( w->property( name ).toInt() ) << "</enum>" << endl; } @@ -1240,7 +1240,7 @@ void Resource::saveProperty( TQObject *w, const TQString &name, const TQVariant ts << makeIndent( indent ) << "</palette>" << endl; } break; case TQVariant::Cursor: - ts << makeIndent( indent ) << "<cursor>" << value.toCursor().shape() << "</cursor>" << endl; + ts << makeIndent( indent ) << "<cursor>" << value.toCursor().tqshape() << "</cursor>" << endl; break; case TQVariant::StringList: { TQStringList lst = value.toStringList(); @@ -1303,7 +1303,7 @@ void Resource::saveColorGroup( TQTextStream &ts, int indent, const TQColorGroup saveColor( ts, indent, cg.color( (TQColorGroup::ColorRole)r ) ); indent--; ts << makeIndent( indent ) << "</color>" << endl; - TQPixmap* pm = cg.brush( (TQColorGroup::ColorRole)r ).pixmap(); + TQPixmap* pm = cg.tqbrush( (TQColorGroup::ColorRole)r ).pixmap(); if ( pm && !pm->isNull() ) savePixmap( *pm, ts, indent ); } @@ -1316,7 +1316,7 @@ void Resource::saveColor( TQTextStream &ts, int indent, const TQColor &c ) ts << makeIndent( indent ) << "<blue>" << TQString::number( c.blue() ) << "</blue>" << endl; } -TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLayout* layout ) +TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLayout* tqlayout ) { lastItem = 0; TQDomElement n = e.firstChild().toElement(); @@ -1346,16 +1346,16 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay w = (TQWidget*)obj; if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) w = ( (TQMainWindow*)w )->centralWidget(); - if ( layout ) { - switch ( WidgetFactory::layoutType( layout ) ) { + if ( tqlayout ) { + switch ( WidgetFactory::layoutType( tqlayout ) ) { case WidgetFactory::HBox: - ( (TQHBoxLayout*)layout )->addWidget( w ); + ( (TQHBoxLayout*)tqlayout )->addWidget( w ); break; case WidgetFactory::VBox: - ( (TQVBoxLayout*)layout )->addWidget( w ); + ( (TQVBoxLayout*)tqlayout )->addWidget( w ); break; case WidgetFactory::Grid: - ( (QDesignerGridLayout*)layout )->addMultiCellWidget( w, row, row + rowspan - 1, + ( (QDesignerGridLayout*)tqlayout )->addMultiCellWidget( w, row, row + rowspan - 1, col, col + colspan - 1 ); break; default: @@ -1365,7 +1365,7 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay if ( !toplevel ) toplevel = w; - layout = 0; + tqlayout = 0; if ( w && formwindow ) { if ( !parent || ( !parent->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) && !parent->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) && !parent->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) ) @@ -1379,22 +1379,22 @@ TQObject *Resource::createObject( const TQDomElement &e, TQWidget *parent, TQLay while ( !n.isNull() ) { if ( n.tagName() == "spacer" ) { - createSpacer( n, w, layout, Qt::Horizontal ); + createSpacer( n, w, tqlayout, Qt::Horizontal ); } else if ( n.tagName() == "widget" ) { - createObject( n, w, layout ); + createObject( n, w, tqlayout ); } else if ( n.tagName() == "hbox" ) { - layout = WidgetFactory::createLayout( w, layout, WidgetFactory::HBox ); - obj = TQT_TQOBJECT(layout); + tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::HBox ); + obj = TQT_TQOBJECT(tqlayout); n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "grid" ) { - layout = WidgetFactory::createLayout( w, layout, WidgetFactory::Grid ); - obj = TQT_TQOBJECT(layout); + tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::Grid ); + obj = TQT_TQOBJECT(tqlayout); n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "vbox" ) { - layout = WidgetFactory::createLayout( w, layout, WidgetFactory::VBox ); - obj = TQT_TQOBJECT(layout); + tqlayout = WidgetFactory::createLayout( w, tqlayout, WidgetFactory::VBox ); + obj = TQT_TQOBJECT(tqlayout); n = n.firstChild().toElement(); continue; } else if ( n.tagName() == "property" && obj ) { @@ -1605,7 +1605,7 @@ void Resource::createItem( const TQDomElement &e, TQWidget *widget, TQListViewIt } } -TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLayout *layout, Qt::Orientation o ) +TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLayout *tqlayout, Qt::Orientation o ) { TQDomElement n = e.firstChild().toElement(); int row = e.attribute( "row" ).toInt(); @@ -1629,12 +1629,12 @@ TQWidget *Resource::createSpacer( const TQDomElement &e, TQWidget *parent, TQLay spacer->setInteraciveMode( true ); if ( formwindow ) formwindow->insertWidget( spacer, pasting ); - if ( layout ) { - if ( layout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQBoxLayout*)layout )->addWidget( spacer, 0, spacer->alignment() ); + if ( tqlayout ) { + if ( tqlayout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) ) + ( (TQBoxLayout*)tqlayout )->addWidget( spacer, 0, spacer->tqalignment() ); else - ( (QDesignerGridLayout*)layout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1, - spacer->alignment() ); + ( (QDesignerGridLayout*)tqlayout )->addMultiCellWidget( spacer, row, row + rowspan - 1, col, col + colspan - 1, + spacer->tqalignment() ); } return spacer; } @@ -1644,7 +1644,7 @@ 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->tqmetaObject()->property( obj->tqmetaObject()->findProperty( prop, true ), true ); if ( !obj->inherits( TQLAYOUT_OBJECT_NAME_STRING ) ) {// no layouts in metadatabase... (RS) if ( obj->inherits( "CustomWidget" ) ) { @@ -2090,8 +2090,8 @@ void Resource::saveCustomWidgets( TQTextStream &ts, int indent ) << "\">" << w->includeFile << "</header>" << endl; ts << makeIndent( indent ) << "<sizehint>" << endl; indent++; - ts << makeIndent( indent ) << "<width>" << w->sizeHint.width() << "</width>" << endl; - ts << makeIndent( indent ) << "<height>" << w->sizeHint.height() << "</height>" << endl; + ts << makeIndent( indent ) << "<width>" << w->tqsizeHint.width() << "</width>" << endl; + ts << makeIndent( indent ) << "<height>" << w->tqsizeHint.height() << "</height>" << endl; indent--; ts << makeIndent( indent ) << "</sizehint>" << endl; ts << makeIndent( indent ) << "<container>" << (int)w->isContainer << "</container>" << endl; @@ -2147,9 +2147,9 @@ void Resource::loadCustomWidgets( const TQDomElement &e, Resource *r ) TQDomElement n3 = n2.firstChild().toElement(); while ( !n3.isNull() ) { if ( n3.tagName() == "width" ) - w->sizeHint.setWidth( n3.firstChild().toText().data().toInt() ); + w->tqsizeHint.setWidth( n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "height" ) - w->sizeHint.setHeight( n3.firstChild().toText().data().toInt() ); + w->tqsizeHint.setHeight( n3.firstChild().toText().data().toInt() ); n3 = n3.nextSibling().toElement(); } } else if ( n2.tagName() == "sizepolicy" ) { |