diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-21 14:24:21 -0600 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2012-06-23 19:35:21 +0200 |
commit | 39d7cb00553d01cea32bfd52fa406aac15742ba0 (patch) | |
tree | 5c385fb00eec3e82327af85dca39e730faa5cebe /kdevdesigner/designer/widgetfactory.cpp | |
parent | ec049c7c32d50faf317b13d5c844a19978881fc3 (diff) | |
download | tdevelop-39d7cb00553d01cea32bfd52fa406aac15742ba0.tar.gz tdevelop-39d7cb00553d01cea32bfd52fa406aac15742ba0.zip |
Rename obsolete tq methods to standard names
(cherry picked from commit abcbb684982167791304dc2fe0bc979489506b43)
Diffstat (limited to 'kdevdesigner/designer/widgetfactory.cpp')
-rw-r--r-- | kdevdesigner/designer/widgetfactory.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/kdevdesigner/designer/widgetfactory.cpp b/kdevdesigner/designer/widgetfactory.cpp index 11d7b5d9..d27cfc30 100644 --- a/kdevdesigner/designer/widgetfactory.cpp +++ b/kdevdesigner/designer/widgetfactory.cpp @@ -553,11 +553,11 @@ TQWidget *WidgetFactory::create( int id, TQWidget *parent, const char *name, boo return w; } -/*! Creates a tqlayout on the widget \a widget of the type \a type +/*! Creates a layout on the widget \a widget of the type \a type which can be \c HBox, \c VBox or \c Grid. */ -TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, LayoutType type ) +TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *layout, LayoutType type ) { int spacing = MainWindow::self->currentLayoutDefaultSpacing(); int margin = 0; @@ -570,40 +570,40 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, Lay widget && ::tqqt_cast<FormWindow*>(widget->parentWidget()) ) ) margin = MainWindow::self->currentLayoutDefaultMargin(); - if ( !tqlayout && ::tqqt_cast<TQTabWidget*>(widget) ) + if ( !layout && ::tqqt_cast<TQTabWidget*>(widget) ) widget = ((TQTabWidget*)widget)->currentPage(); - if ( !tqlayout && ::tqqt_cast<TQWizard*>(widget) ) + if ( !layout && ::tqqt_cast<TQWizard*>(widget) ) widget = ((TQWizard*)widget)->currentPage(); - if ( !tqlayout && ::tqqt_cast<TQMainWindow*>(widget) ) + if ( !layout && ::tqqt_cast<TQMainWindow*>(widget) ) widget = ((TQMainWindow*)widget)->centralWidget(); - if ( !tqlayout && ::tqqt_cast<TQWidgetStack*>(widget) ) + if ( !layout && ::tqqt_cast<TQWidgetStack*>(widget) ) widget = ((TQWidgetStack*)widget)->visibleWidget(); - if ( !tqlayout && ::tqqt_cast<TQToolBox*>(widget) ) + if ( !layout && ::tqqt_cast<TQToolBox*>(widget) ) widget = ((TQToolBox*)widget)->currentItem(); MetaDataBase::addEntry( TQT_TQOBJECT(widget) ); TQLayout *l = 0; int align = 0; - if ( !tqlayout && ::tqqt_cast<TQGroupBox*>(widget) ) { + if ( !layout && ::tqqt_cast<TQGroupBox*>(widget) ) { 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 ); 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 QDesignerGridLayout( tqlayout ); + l = new QDesignerGridLayout( layout ); break; default: return 0; @@ -612,16 +612,16 @@ TQLayout *WidgetFactory::createLayout( TQWidget *widget, TQLayout *tqlayout, Lay MetaDataBase::setMargin( TQT_TQOBJECT(gb), metamargin ); MetaDataBase::setSpacing( TQT_TQOBJECT(gb), metaspacing ); } else { - 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 QDesignerGridLayout( tqlayout ); + l = new QDesignerGridLayout( layout ); break; default: return 0; @@ -673,7 +673,7 @@ void WidgetFactory::deleteLayout( TQWidget *widget ) widget = ((TQWidgetStack*)widget)->visibleWidget(); if ( ::tqqt_cast<TQToolBox*>(widget) ) widget = ((TQToolBox*)widget)->currentItem(); - delete widget->tqlayout(); + delete widget->layout(); } /*! Factory functions for creating a widget of the type \a className @@ -1001,14 +1001,14 @@ TQWidget *WidgetFactory::createWidget( const TQString &className, TQWidget *pare -/*! Find out which type the tqlayout of the widget is. Returns \c HBox, - \c VBox, \c Grid or \c NoLayout. \a tqlayout points to this - TQWidget::tqlayout() of \a w or to 0 after the function call. +/*! Find out which type the layout of the widget is. Returns \c HBox, + \c VBox, \c Grid or \c NoLayout. \a layout points to this + TQWidget::layout() of \a w or to 0 after the function call. */ -WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tqlayout ) +WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&layout ) { - tqlayout = 0; + layout = 0; if ( ::tqqt_cast<TQTabWidget*>(w) ) w = ((TQTabWidget*)w)->currentPage(); @@ -1024,9 +1024,9 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql if ( ::tqqt_cast<TQSplitter*>(w) ) return ( (TQSplitter*)w )->orientation() ==Qt::Horizontal ? HBox : VBox; - if ( !w || !w->tqlayout() ) + if ( !w || !w->layout() ) return NoLayout; - TQLayout *lay = w->tqlayout(); + TQLayout *lay = w->layout(); if ( ::tqqt_cast<TQGroupBox*>(w) ) { TQObjectList *l = TQT_TQOBJECT(lay)->queryList( TQLAYOUT_OBJECT_NAME_STRING ); @@ -1034,7 +1034,7 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql lay = (TQLayout*)l->first(); delete l; } - tqlayout = lay; + layout = lay; if ( ::tqqt_cast<TQHBoxLayout*>(lay) ) return HBox; @@ -1048,13 +1048,13 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w, TQLayout *&tql /*! \overload */ -WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *tqlayout ) +WidgetFactory::LayoutType WidgetFactory::layoutType( TQLayout *layout ) { - if ( ::tqqt_cast<TQHBoxLayout*>(tqlayout) ) + if ( ::tqqt_cast<TQHBoxLayout*>(layout) ) return HBox; - else if ( ::tqqt_cast<TQVBoxLayout*>(tqlayout) ) + else if ( ::tqqt_cast<TQVBoxLayout*>(layout) ) return VBox; - else if ( ::tqqt_cast<TQGridLayout*>(tqlayout) ) + else if ( ::tqqt_cast<TQGridLayout*>(layout) ) return Grid; return NoLayout; } @@ -1069,9 +1069,9 @@ WidgetFactory::LayoutType WidgetFactory::layoutType( TQWidget *w ) } -TQWidget *WidgetFactory::layoutParent( TQLayout *tqlayout ) +TQWidget *WidgetFactory::layoutParent( TQLayout *layout ) { - TQObject *o = TQT_TQOBJECT(tqlayout); + TQObject *o = TQT_TQOBJECT(layout); while ( o ) { if ( o->isWidgetType() ) return (TQWidget*)o; @@ -1601,7 +1601,7 @@ bool TQLayoutWidget::event( TQEvent *e ) /* This function must be called on TQLayoutWidget creation and whenever - the TQLayoutWidget's parent tqlayout changes (e.g., from a TQHBoxLayout + the TQLayoutWidget's parent layout changes (e.g., from a TQHBoxLayout to a TQVBoxLayout), because of the (illogical) way layouting works. */ void TQLayoutWidget::updateSizePolicy() @@ -1624,14 +1624,14 @@ void TQLayoutWidget::updateSizePolicy() int ht = (int) TQSizePolicy::Preferred; int vt = (int) TQSizePolicy::Preferred; - if ( tqlayout() ) { + if ( layout() ) { /* - parentLayout is set to the parent tqlayout if there is one and if it is + parentLayout is set to the parent layout if there is one and if it is top level, in which case layouting is illogical. */ TQLayout *parentLayout = 0; if ( parent() && parent()->isWidgetType() ) { - parentLayout = ((TQWidget *)parent())->tqlayout(); + parentLayout = ((TQWidget *)parent())->layout(); if ( parentLayout && ::tqqt_cast<TQLayoutWidget*>(parentLayout->mainWidget()) ) parentLayout = 0; @@ -1640,7 +1640,7 @@ void TQLayoutWidget::updateSizePolicy() TQObjectListIt it( childrenListObject() ); TQObject *o; - if ( ::tqqt_cast<TQVBoxLayout*>(tqlayout()) ) { + if ( ::tqqt_cast<TQVBoxLayout*>(layout()) ) { if ( ::tqqt_cast<TQHBoxLayout*>(parentLayout) ) vt = TQSizePolicy::Minimum; else @@ -1661,7 +1661,7 @@ void TQLayoutWidget::updateSizePolicy() if ( w->sizePolicy().mayShrinkVertically() ) vt |= TQSizePolicy::Maximum; } - } else if ( ::tqqt_cast<TQHBoxLayout*>(tqlayout()) ) { + } else if ( ::tqqt_cast<TQHBoxLayout*>(layout()) ) { if ( ::tqqt_cast<TQVBoxLayout*>(parentLayout) ) ht = TQSizePolicy::Minimum; else @@ -1682,7 +1682,7 @@ void TQLayoutWidget::updateSizePolicy() if ( !w->sizePolicy().mayShrinkVertically() ) vt &= ~TQSizePolicy::Maximum; } - } else if ( ::tqqt_cast<TQGridLayout*>(tqlayout()) ) { + } else if ( ::tqqt_cast<TQGridLayout*>(layout()) ) { ht = TQSizePolicy::Fixed; vt = TQSizePolicy::Fixed; if ( parentLayout ) { @@ -1709,19 +1709,19 @@ void TQLayoutWidget::updateSizePolicy() } } #ifdef USE_QT4 - if ( tqlayout()->expanding() & TQSizePolicy::Horizontally ) + if ( layout()->expanding() & TQSizePolicy::Horizontally ) #else // USE_QT4 - if ( tqlayout()->expanding() & TQSizePolicy::Horizontally ) + if ( layout()->expanding() & TQSizePolicy::Horizontally ) #endif // USE_QT4 ht = TQSizePolicy::Expanding; #ifdef USE_QT4 - if ( tqlayout()->expanding() & TQSizePolicy::Vertically ) + if ( layout()->expanding() & TQSizePolicy::Vertically ) #else // USE_QT4 - if ( tqlayout()->expanding() & TQSizePolicy::Vertically ) + if ( layout()->expanding() & TQSizePolicy::Vertically ) #endif // USE_QT4 vt = TQSizePolicy::Expanding; - tqlayout()->invalidate(); + layout()->invalidate(); } sp = TQSizePolicy( (TQSizePolicy::SizeType) ht, (TQSizePolicy::SizeType) vt ); |