From 2b0e1de2ffcca7bb93f1fd8ddd32f74041d0d076 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 15 Dec 2011 15:51:43 -0600 Subject: Rename a number of old tq methods that are no longer tq specific --- kommander/factory/kommanderfactory.cpp | 136 ++++++++++++++++----------------- 1 file changed, 68 insertions(+), 68 deletions(-) (limited to 'kommander/factory/kommanderfactory.cpp') diff --git a/kommander/factory/kommanderfactory.cpp b/kommander/factory/kommanderfactory.cpp index 0247a814..9058513a 100644 --- a/kommander/factory/kommanderfactory.cpp +++ b/kommander/factory/kommanderfactory.cpp @@ -36,7 +36,7 @@ #endif #include #include -#include +#include #include #include "domtool.h" #include @@ -79,13 +79,13 @@ #include #include #include -#include -#include +#include +#include #include #include #include #include -#include +#include #include #include #include @@ -497,7 +497,7 @@ FeatureList KommanderFactory::featureList() //iterate through widgetPlugins, appending KommanderPlugin::widgets() to features } -TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidget *parent, TQLayout* tqlayout, const TQString &classNameArg ) +TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidget *parent, TQLayout* layout, const TQString &classNameArg ) { lastItem = 0; TQDomElement n = e.firstChild().toElement(); @@ -515,10 +515,10 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge if ( colspan < 1 ) colspan = 1; if ( !className.isEmpty() ) { - if ( !tqlayout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) + if ( !layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) className = TQWIDGET_OBJECT_NAME_STRING; - if ( tqlayout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) { - // hide tqlayout widgets + if ( layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) { + // hide layout widgets w = parent; } else { obj = TQT_TQOBJECT(KommanderFactory::createWidget( className, parent, 0 )); @@ -531,16 +531,16 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge toplevel = w; if ( w->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) w = ( (TQMainWindow*)w )->centralWidget(); - if ( tqlayout ) { - switch( layoutType( tqlayout ) ) { + if ( layout ) { + switch( layoutType( layout ) ) { case HBox: - ( (TQHBoxLayout*)tqlayout )->addWidget( w ); + ( (TQHBoxLayout*)layout )->addWidget( w ); break; case VBox: - ( (TQVBoxLayout*)tqlayout )->addWidget( w ); + ( (TQVBoxLayout*)layout )->addWidget( w ); break; case Grid: - ( (TQGridLayout*)tqlayout )->addMultiCellWidget( w, row, row + rowspan - 1, + ( (TQGridLayout*)layout )->addMultiCellWidget( w, row, row + rowspan - 1, col, col + colspan - 1 ); break; default: @@ -548,7 +548,7 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge } } - tqlayout = 0; + layout = 0; } } if (className == "Dialog") @@ -556,43 +556,43 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge while ( !n.isNull() ) { if ( n.tagName() == "spacer" ) { - createSpacer( n, tqlayout ); + createSpacer( n, layout ); } else if ( n.tagName() == "widget" ) { TQMap< TQString, TQString> *oldDbControls = dbControls; - createWidgetInternal( n, w, tqlayout, n.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) ); + createWidgetInternal( n, w, layout, n.attribute( "class", TQWIDGET_OBJECT_NAME_STRING ) ); dbControls = oldDbControls; } else if ( n.tagName() == "hbox" ) { - TQLayout *parentLayout = tqlayout; - if ( tqlayout && tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - tqlayout = createLayout( 0, 0, KommanderFactory::HBox ); + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + layout = createLayout( 0, 0, KommanderFactory::HBox ); else - tqlayout = createLayout( w, tqlayout, KommanderFactory::HBox ); - obj = TQT_TQOBJECT(tqlayout); + layout = createLayout( w, layout, KommanderFactory::HBox ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, row + rowspan - 1, col, col + colspan - 1 ); + ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); continue; } else if ( n.tagName() == "grid" ) { - TQLayout *parentLayout = tqlayout; - if ( tqlayout && tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - tqlayout = createLayout( 0, 0, KommanderFactory::Grid ); + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + layout = createLayout( 0, 0, KommanderFactory::Grid ); else - tqlayout = createLayout( w, tqlayout, KommanderFactory::Grid ); - obj = TQT_TQOBJECT(tqlayout); + layout = createLayout( w, layout, KommanderFactory::Grid ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, row + rowspan - 1, col, col + colspan - 1 ); + ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); continue; } else if ( n.tagName() == "vbox" ) { - TQLayout *parentLayout = tqlayout; - if ( tqlayout && tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - tqlayout = createLayout( 0, 0, KommanderFactory::VBox ); + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + layout = createLayout( 0, 0, KommanderFactory::VBox ); else - tqlayout = createLayout( w, tqlayout, KommanderFactory::VBox ); - obj = TQT_TQOBJECT(tqlayout); + layout = createLayout( w, layout, KommanderFactory::VBox ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, row + rowspan - 1, col, col + colspan - 1 ); + ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); continue; } else if ( n.tagName() == "property" && obj ) { setProperty( obj, n.attribute( "name" ), n.firstChild().toElement() ); @@ -622,60 +622,60 @@ TQWidget *KommanderFactory::createWidgetInternal( const TQDomElement &e, TQWidge return w; } -TQLayout *KommanderFactory::createLayout( TQWidget *widget, TQLayout* tqlayout, LayoutType type ) +TQLayout *KommanderFactory::createLayout( TQWidget *widget, TQLayout* layout, LayoutType type ) { int spacing = defSpacing; int margin = defMargin; - if ( !tqlayout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( TQTABWIDGET_OBJECT_NAME_STRING ) ) widget = ((TQTabWidget*)widget)->currentPage(); - if ( !tqlayout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) widget = ((TQToolBox*)widget)->currentItem(); - if ( !tqlayout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( TQWIZARD_OBJECT_NAME_STRING ) ) widget = ((TQWizard*)widget)->currentPage(); - if ( !tqlayout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( TQWIDGETSTACK_OBJECT_NAME_STRING ) ) widget = ((TQWidgetStack*)widget)->visibleWidget(); - if ( !tqlayout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) { + if ( !layout && widget && widget->inherits( TQGROUPBOX_OBJECT_NAME_STRING ) ) { TQGroupBox *gb = (TQGroupBox*)widget; gb->setColumnLayout( 0, Qt::Vertical ); - gb->tqlayout()->setMargin( 0 ); - gb->tqlayout()->setSpacing( 0 ); + gb->layout()->setMargin( 0 ); + gb->layout()->setSpacing( 0 ); TQLayout *l; switch ( type ) { case HBox: - l = new TQHBoxLayout( gb->tqlayout() ); - l->tqsetAlignment( TQt::AlignTop ); + l = new TQHBoxLayout( gb->layout() ); + l->setAlignment( TQt::AlignTop ); return l; case VBox: - l = new TQVBoxLayout( gb->tqlayout(), spacing ); - l->tqsetAlignment( TQt::AlignTop ); + l = new TQVBoxLayout( gb->layout(), spacing ); + l->setAlignment( TQt::AlignTop ); return l; case Grid: - l = new TQGridLayout( gb->tqlayout() ); - l->tqsetAlignment( TQt::AlignTop ); + l = new TQGridLayout( gb->layout() ); + l->setAlignment( TQt::AlignTop ); return l; default: return 0; } } else { - if ( tqlayout ) { + if ( layout ) { TQLayout *l; switch ( type ) { case HBox: - l = new TQHBoxLayout( tqlayout ); + l = new TQHBoxLayout( layout ); l->setSpacing( spacing ); l->setMargin( margin ); return l; case VBox: - l = new TQVBoxLayout( tqlayout ); + l = new TQVBoxLayout( layout ); l->setSpacing( spacing ); l->setMargin( margin ); return l; case Grid: { - l = new TQGridLayout( tqlayout ); + l = new TQGridLayout( layout ); l->setSpacing( spacing ); l->setMargin( margin ); return l; @@ -715,20 +715,20 @@ TQLayout *KommanderFactory::createLayout( TQWidget *widget, TQLayout* tqlayout, } } -KommanderFactory::LayoutType KommanderFactory::layoutType( TQLayout *tqlayout ) const +KommanderFactory::LayoutType KommanderFactory::layoutType( TQLayout *layout ) const { - if ( tqlayout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) ) + if ( layout->inherits( TQHBOXLAYOUT_OBJECT_NAME_STRING ) ) return HBox; - else if ( tqlayout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) ) + else if ( layout->inherits( TQVBOXLAYOUT_OBJECT_NAME_STRING ) ) return VBox; - else if ( tqlayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + else if ( layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) return Grid; return NoLayout; } void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const TQDomElement &e ) { - const TQMetaProperty *p = obj->tqmetaObject()->property( obj->tqmetaObject()->findProperty( prop, true ), true ); + const TQMetaProperty *p = obj->metaObject()->property( obj->metaObject()->findProperty( prop, true ), true ); TQVariant defVariant; if ( e.tagName() == "font" ) { @@ -840,7 +840,7 @@ void KommanderFactory::setProperty( TQObject* obj, const TQString &prop, const T obj->setProperty( prop, v ); } -void KommanderFactory::createSpacer( const TQDomElement &e, TQLayout *tqlayout ) +void KommanderFactory::createSpacer( const TQDomElement &e, TQLayout *layout ) { TQDomElement n = e.firstChild().toElement(); int row = e.attribute( "row" ).toInt(); @@ -872,7 +872,7 @@ void KommanderFactory::createSpacer( const TQDomElement &e, TQLayout *tqlayout ) sizeType = TQSizePolicy::MinimumExpanding; else if ( n.firstChild().firstChild().toText().data() == "Expanding" ) sizeType = TQSizePolicy::Expanding; - } else if ( prop == "tqsizeHint" ) { + } else if ( prop == "sizeHint" ) { w = n.firstChild().firstChild().firstChild().toText().data().toInt(); h = n.firstChild().firstChild().nextSibling().firstChild().toText().data().toInt(); } @@ -886,11 +886,11 @@ void KommanderFactory::createSpacer( const TQDomElement &e, TQLayout *tqlayout ) colspan = 1; TQSpacerItem *item = new TQSpacerItem( w, h, orient == Qt::Horizontal ? sizeType : TQSizePolicy::Minimum, orient == Qt::Vertical ? sizeType : TQSizePolicy::Minimum ); - if ( tqlayout ) { - if ( tqlayout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQBoxLayout*)tqlayout )->addItem( item ); + if ( layout ) { + if ( layout->inherits( TQBOXLAYOUT_OBJECT_NAME_STRING ) ) + ( (TQBoxLayout*)layout )->addItem( item ); else - ( (TQGridLayout*)tqlayout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1, + ( (TQGridLayout*)layout )->addMultiCell( item, row, row + rowspan - 1, col, col + colspan - 1, orient == Qt::Horizontal ? TQt::AlignVCenter : TQt::AlignHCenter ); } } @@ -1093,16 +1093,16 @@ void KommanderFactory::loadConnections( const TQDomElement &e, TQObject *connect if ( lang == "C++" ) { TQString s = "2""%1"; - s = s.tqarg( conn.signal.data() ); + s = s.arg( conn.signal.data() ); TQString s2 = "1""%1"; - s2 = s2.tqarg( conn.slot.data() ); + s2 = s2.arg( conn.slot.data() ); - TQStrList signalList = sender->tqmetaObject()->signalNames( true ); - TQStrList slotList = receiver->tqmetaObject()->slotNames( true ); + TQStrList signalList = sender->metaObject()->signalNames( true ); + TQStrList slotList = receiver->metaObject()->slotNames( true ); // if this is a connection to a custom slot and we have a connector, try this as receiver if ( slotList.find( conn.slot ) == -1 && TQT_BASE_OBJECT(receiver) == TQT_BASE_OBJECT(toplevel) && connector ) { - slotList = connector->tqmetaObject()->slotNames( true ); + slotList = connector->metaObject()->slotNames( true ); receiver = connector; } -- cgit v1.2.3