diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-21 14:24:21 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-21 14:24:21 -0600 |
commit | abcbb684982167791304dc2fe0bc979489506b43 (patch) | |
tree | c705baa3702ffd62398873af8131525569b1af89 /kdevdesigner/uilib/qwidgetfactory.cpp | |
parent | 7e66d7c3611d907ea28b140281b472bb1c406be6 (diff) | |
download | tdevelop-abcbb684982167791304dc2fe0bc979489506b43.tar.gz tdevelop-abcbb684982167791304dc2fe0bc979489506b43.zip |
Rename obsolete tq methods to standard names
Diffstat (limited to 'kdevdesigner/uilib/qwidgetfactory.cpp')
-rw-r--r-- | kdevdesigner/uilib/qwidgetfactory.cpp | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/kdevdesigner/uilib/qwidgetfactory.cpp b/kdevdesigner/uilib/qwidgetfactory.cpp index f2a326a3..5c7c70b9 100644 --- a/kdevdesigner/uilib/qwidgetfactory.cpp +++ b/kdevdesigner/uilib/qwidgetfactory.cpp @@ -907,7 +907,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, { TQObject *obj = 0; TQWidget *widget = 0; - TQLayout *tqlayout = 0; + TQLayout *layout = 0; TQWidget *parentWidget = 0; TQLayout *parentLayout = 0; @@ -942,11 +942,11 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, type = VBox; } if ( parentLayout != 0 && parentLayout->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) { - tqlayout = createLayout( 0, 0, type ); + layout = createLayout( 0, 0, type ); } else { - tqlayout = createLayout( parentWidget, parentLayout, type ); + layout = createLayout( parentWidget, parentLayout, type ); } - obj = TQT_TQOBJECT(tqlayout); + obj = TQT_TQOBJECT(layout); } else if ( className == TQMENUBAR_OBJECT_NAME_STRING ) { unpackCString( strings, in, className ); widget = ((TQMainWindow *) parent)->menuBar(); @@ -1092,7 +1092,7 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, inputColumnOrRow( strings, in, obj, TRUE ); break; case Object_Spacer: - inputSpacer( strings, in, tqlayout ); + inputSpacer( strings, in, layout ); break; case Object_Separator: ((TQToolBar *) widget)->addSeparator(); @@ -1160,10 +1160,10 @@ TQObject *TQWidgetFactory::inputObject( TQObject **objects, int& numObjects, } else { ((TQBoxLayout *) parentLayout)->addWidget( widget ); } - } else if ( tqlayout != 0 ) { + } else if ( layout != 0 ) { if ( parentLayout->inherits(TQGRIDLAYOUT_OBJECT_NAME_STRING) ) { ((TQGridLayout *) parentLayout)->addMultiCellLayout( - tqlayout, row, row + rowspan - 1, column, + layout, row, row + rowspan - 1, column, column + colspan - 1 ); } } @@ -1568,7 +1568,7 @@ bool TQWidgetFactory::supportsWidget( const TQString &widget ) } TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget *parent, - TQLayout* tqlayout, const TQString &classNameArg ) + TQLayout* layout, const TQString &classNameArg ) { d->lastItem = 0; TQDomElement n = e.firstChild().toElement(); @@ -1589,12 +1589,12 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget bool isTQLayoutWidget = FALSE; if ( !className.isEmpty() ) { - if ( !tqlayout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) { + if ( !layout && className == TQLAYOUTWIDGET_OBJECT_NAME_STRING ) { className = TQWIDGET_OBJECT_NAME_STRING; isTQLayoutWidget = TRUE; } - 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(TQWidgetFactory::createWidget( className, parent, 0 )); @@ -1605,16 +1605,16 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget 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: @@ -1622,7 +1622,7 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget } } - tqlayout = 0; + layout = 0; } } #ifdef TQT_CONTAINER_CUSTOM_WIDGETS @@ -1636,45 +1636,45 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget int idx = 0; 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, TQWidgetFactory::HBox, isTQLayoutWidget ); + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + layout = createLayout( 0, 0, TQWidgetFactory::HBox, isTQLayoutWidget ); else - tqlayout = createLayout( w, tqlayout, TQWidgetFactory::HBox, isTQLayoutWidget ); - obj = TQT_TQOBJECT(tqlayout); + layout = createLayout( w, layout, TQWidgetFactory::HBox, isTQLayoutWidget ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, + ( (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, TQWidgetFactory::Grid, isTQLayoutWidget ); + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + layout = createLayout( 0, 0, TQWidgetFactory::Grid, isTQLayoutWidget ); else - tqlayout = createLayout( w, tqlayout, TQWidgetFactory::Grid, isTQLayoutWidget ); - obj = TQT_TQOBJECT(tqlayout); + layout = createLayout( w, layout, TQWidgetFactory::Grid, isTQLayoutWidget ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, + ( (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, TQWidgetFactory::VBox, isTQLayoutWidget ); + TQLayout *parentLayout = layout; + if ( layout && layout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) + layout = createLayout( 0, 0, TQWidgetFactory::VBox, isTQLayoutWidget ); else - tqlayout = createLayout( w, tqlayout, TQWidgetFactory::VBox, isTQLayoutWidget ); - obj = TQT_TQOBJECT(tqlayout); + layout = createLayout( w, layout, TQWidgetFactory::VBox, isTQLayoutWidget ); + obj = TQT_TQOBJECT(layout); n = n.firstChild().toElement(); if ( parentLayout && parentLayout->inherits( TQGRIDLAYOUT_OBJECT_NAME_STRING ) ) - ( (TQGridLayout*)parentLayout )->addMultiCellLayout( tqlayout, row, + ( (TQGridLayout*)parentLayout )->addMultiCellLayout( layout, row, row + rowspan - 1, col, col + colspan - 1 ); continue; } else if ( n.tagName() == "property" && obj ) { @@ -1728,47 +1728,47 @@ TQWidget *TQWidgetFactory::createWidgetInternal( const TQDomElement &e, TQWidget return w; } -TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* tqlayout, +TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* layout, LayoutType type, bool isTQLayoutWidget ) { int spacing = defSpacing; int margin = defMargin; - if ( tqlayout || !widget || isTQLayoutWidget ) + if ( layout || !widget || isTQLayoutWidget ) margin = 0; - 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( 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( TQTOOLBOX_OBJECT_NAME_STRING ) ) + if ( !layout && widget && widget->inherits( TQTOOLBOX_OBJECT_NAME_STRING ) ) widget = ((TQToolBox*)widget)->currentItem(); TQLayout *l = 0; int align = 0; - 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 ); - tqlayout = gb->tqlayout(); - tqlayout->setMargin( 0 ); - tqlayout->setSpacing( 0 ); + layout = gb->layout(); + layout->setMargin( 0 ); + layout->setSpacing( 0 ); align = TQt::AlignTop; } - if ( tqlayout ) { + if ( layout ) { switch ( type ) { case HBox: - l = new TQHBoxLayout( tqlayout ); + l = new TQHBoxLayout( layout ); break; case VBox: - l = new TQVBoxLayout( tqlayout ); + l = new TQVBoxLayout( layout ); break; case Grid: - l = new TQGridLayout( tqlayout ); + l = new TQGridLayout( layout ); break; default: return 0; @@ -1794,13 +1794,13 @@ TQLayout *TQWidgetFactory::createLayout( TQWidget *widget, TQLayout* tqlayout, return l; } -TQWidgetFactory::LayoutType TQWidgetFactory::layoutType( TQLayout *tqlayout ) const +TQWidgetFactory::LayoutType TQWidgetFactory::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; } @@ -1917,7 +1917,7 @@ void TQWidgetFactory::setProperty( TQObject* widget, const TQString &prop, const setProperty( widget, prop, value ); } -void TQWidgetFactory::createSpacer( const TQDomElement &e, TQLayout *tqlayout ) +void TQWidgetFactory::createSpacer( const TQDomElement &e, TQLayout *layout ) { TQDomElement n = e.firstChild().toElement(); int row = e.attribute( "row" ).toInt(); @@ -1952,11 +1952,11 @@ void TQWidgetFactory::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 ); } } |