diff options
| author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-16 19:02:47 +0000 | 
|---|---|---|
| committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-16 19:02:47 +0000 | 
| commit | e985f7e545f4739493965aad69bbecb136dc9346 (patch) | |
| tree | 54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /kommander/editor/layout.cpp | |
| parent | f7670c198945adc3b95ad69a959fe5f8ae55b493 (diff) | |
| download | tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip | |
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/editor/layout.cpp')
| -rw-r--r-- | kommander/editor/layout.cpp | 298 | 
1 files changed, 149 insertions, 149 deletions
| diff --git a/kommander/editor/layout.cpp b/kommander/editor/layout.cpp index 7860aeae..998b4fce 100644 --- a/kommander/editor/layout.cpp +++ b/kommander/editor/layout.cpp @@ -1,7 +1,7 @@  /**********************************************************************  ** Copyright (C) 2000 Trolltech AS.  All rights reserved.  ** -** This file is part of Qt Designer. +** This file is part of TQt Designer.  **  ** This file may be distributed and/or modified under the terms of the  ** GNU General Public License version 2 as published by the Free Software @@ -19,11 +19,11 @@  **********************************************************************/  #include "formwindow.h" -#include "layout.h" +#include "tqlayout.h"  #include "widgetdatabase.h"  #include "widgetfactory.h" -#include <tqlayout.h> +#include <layout.h>  #include <tqevent.h>  #include <tqpainter.h>  #include <tqpen.h> @@ -36,34 +36,34 @@ bool operator<( const TQGuardedPtr<TQWidget> &p1, const TQGuardedPtr<TQWidget> &  }  /*! -  \class Layout layout.h -  \brief Baseclass for layouting widgets in the Designer +  \class Layout tqlayout.h +  \brief Baseclass for tqlayouting widgets in the Designer -  Classes derived from this abstract base class are used for layouting +  Classes derived from this abstract base class are used for tqlayouting    operations in the Designer.  */ -/*!  \a p specifies the parent of the layoutBase \a lb. The parent -  might be changed in setup(). If the layoutBase is a -  container, the parent and the layoutBase are the same. Also they +/*!  \a p specifies the tqparent of the tqlayoutBase \a lb. The tqparent +  might be changed in setup(). If the tqlayoutBase is a +  container, the tqparent and the tqlayoutBase are the same. Also they    always have to be a widget known to the designer (e.g. in the case -  of the tabwidget parent and layoutBase are the tabwidget and not the +  of the tabwidget tqparent and tqlayoutBase are the tabwidget and not the    page which actually gets laid out. For actual usage the correct    widget is found later by Layout.)   */  Layout::Layout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, bool doSetup, bool splitter ) -    : widgets( wl ), parent( p ), formWindow( fw ), isBreak( !doSetup ), useSplitter( splitter ) +    : widgets( wl ), tqparent( p ), formWindow( fw ), isBreak( !doSetup ), useSplitter( splitter )  {      widgets.setAutoDelete( false ); -    layoutBase = lb; -    if ( !doSetup && layoutBase ) -	oldGeometry = layoutBase->geometry(); +    tqlayoutBase = lb; +    if ( !doSetup && tqlayoutBase ) +	oldGeometry = tqlayoutBase->tqgeometry();  }  /*!  The widget list we got in the constructor might contain too much -  widgets (like widgets with different parents, already laid out +  widgets (like widgets with different tqparents, already laid out    widgets, etc.). Here we set up the list and so the only the "best"    widgets get laid out.  */ @@ -77,20 +77,20 @@ void Layout::setup()      TQWidget *w = 0;      // Go through all widgets of the list we got. As we can only -    // layout widgets which have the same parent, we first do some -    // sorting which means create a list for each parent containing +    // tqlayout widgets which have the same tqparent, we first do some +    // sorting which means create a list for each tqparent containing      // its child here. After that we keep working on the list of      // childs which has the most entries.      // Widgets which are already laid out are thrown away here too      for ( w = widgets.first(); w; w = widgets.next() ) { -	if ( w->parentWidget() && WidgetFactory::layoutType( w->parentWidget() ) != WidgetFactory::NoLayout ) +	if ( w->tqparentWidget() && WidgetFactory::tqlayoutType( w->tqparentWidget() ) != WidgetFactory::NoLayout )  	    continue; -	if ( lastParent != w->parentWidget() ) { +	if ( lastParent != w->tqparentWidget() ) {  	    lastList = 0; -	    lastParent = w->parentWidget(); +	    lastParent = w->tqparentWidget();  	    TQValueList<TQWidgetList>::Iterator it = lists.begin();  	    for ( ; it != lists.end(); ++it ) { -		if ( ( *it ).first()->parentWidget() == w->parentWidget() ) +		if ( ( *it ).first()->tqparentWidget() == w->tqparentWidget() )  		    lastList = &( *it );  	    }  	    if ( !lastList ) { @@ -112,12 +112,12 @@ void Layout::setup()      }      // If we found no list (because no widget did fit at all) or the -    // best list has only one entry and we do not layout a container, +    // best list has only one entry and we do not tqlayout a container,      // we leave here.      if ( !lastList || ( lastList->count() < 2 && -			( !layoutBase || -			  ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( layoutBase ) ) ) && -			    layoutBase != formWindow->mainContainer() ) ) +			( !tqlayoutBase || +			  ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(TQT_TQOBJECT( tqlayoutBase )) ) ) && +			    tqlayoutBase != formWindow->mainContainer() ) )  			) ) {  	widgets.clear();  	startPoint = TQPoint( 0, 0 ); @@ -125,23 +125,23 @@ void Layout::setup()      }      // Now we have a new and clean widget list, which makes sense -    // to layout +    // to tqlayout      widgets = *lastList; -    // Also use the only correct parent later, so store it -    parent = WidgetFactory::widgetOfContainer( widgets.first()->parentWidget() ); -    // Now calculate the position where the layout-meta-widget should +    // Also use the only correct tqparent later, so store it +    tqparent = WidgetFactory::widgetOfContainer( widgets.first()->tqparentWidget() ); +    // Now calculate the position where the tqlayout-meta-widget should      // be placed and connect to widgetDestroyed() signals of the      // widgets to get informed if one gets deleted to be able to      // handle that and do not crash in this case      for ( w = widgets.first(); w; w = widgets.next() ) {  	connect( w, TQT_SIGNAL( destroyed() ),  		 this, TQT_SLOT( widgetDestroyed() ) ); -	startPoint = TQPoint( QMIN( startPoint.x(), w->x() ), -			     QMIN( startPoint.y(), w->y() ) ); +	startPoint = TQPoint( TQMIN( startPoint.x(), w->x() ), +			     TQMIN( startPoint.y(), w->y() ) );  	geometries.insert( w, TQRect( w->pos(), w->size() ) );  	// Change the Z-order, as saving/loading uses the Z-order for  	// writing/creating widgets and this has to be the same as in -	// the layout. Else saving + loading will give different results +	// the tqlayout. Else saving + loading will give different results  	w->raise();      }  } @@ -152,46 +152,46 @@ void Layout::widgetDestroyed()  	widgets.removeRef( (TQWidget*)sender() );  } -bool Layout::prepareLayout( bool &needMove, bool &needReparent ) +bool Layout::prepareLayout( bool &needMove, bool &needRetqparent )  {      if ( !widgets.count() )  	return false;      for ( TQWidget *w = widgets.first(); w; w = widgets.next() )  	w->raise(); -    needMove = !layoutBase; -    needReparent = needMove || layoutBase->inherits( "QLayoutWidget" ) || layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ); -    if ( !layoutBase ) { +    needMove = !tqlayoutBase; +    needRetqparent = needMove || tqlayoutBase->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) || tqlayoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ); +    if ( !tqlayoutBase ) {  	if ( !useSplitter ) -	    layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "QLayoutWidget" ), -						WidgetFactory::containerOfWidget( parent ) ); +	    tqlayoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( TQLAYOUTWIDGET_OBJECT_NAME_STRING ), +						WidgetFactory::containerOfWidget( tqparent ) );  	else -	    layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( TQSPLITTER_OBJECT_NAME_STRING ), -						WidgetFactory::containerOfWidget( parent ) ); +	    tqlayoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( TQSPLITTER_OBJECT_NAME_STRING ), +						WidgetFactory::containerOfWidget( tqparent ) );      } else { -	WidgetFactory::deleteLayout( layoutBase ); +	WidgetFactory::deleteLayout( tqlayoutBase );      }      return true;  } -void Layout::finishLayout( bool needMove, TQLayout *layout ) +void Layout::finishLayout( bool needMove, TQLayout *tqlayout )  {      if ( needMove ) -	layoutBase->move( startPoint ); -    TQRect g( TQRect( layoutBase->pos(), layoutBase->size() ) ); -    if ( WidgetFactory::layoutType( layoutBase->parentWidget() ) == WidgetFactory::NoLayout && !isBreak ) -	layoutBase->adjustSize(); +	tqlayoutBase->move( startPoint ); +    TQRect g( TQRect( tqlayoutBase->pos(), tqlayoutBase->size() ) ); +    if ( WidgetFactory::tqlayoutType( tqlayoutBase->tqparentWidget() ) == WidgetFactory::NoLayout && !isBreak ) +	tqlayoutBase->adjustSize();      else if ( isBreak ) -	layoutBase->setGeometry( oldGeometry ); +	tqlayoutBase->setGeometry( oldGeometry );      oldGeometry = g; -    layoutBase->show(); -    layout->activate(); -    formWindow->insertWidget( layoutBase ); -    formWindow->selectWidget( layoutBase ); -    TQString n = layoutBase->name(); -    if ( n.find( "qt_dead_widget_" ) != -1 ) { +    tqlayoutBase->show(); +    tqlayout->activate(); +    formWindow->insertWidget( tqlayoutBase ); +    formWindow->selectWidget( TQT_TQOBJECT(tqlayoutBase) ); +    TQString n = tqlayoutBase->name(); +    if ( n.tqfind( "qt_dead_widget_" ) != -1 ) {  	n.remove( 0, TQString( "qt_dead_widget_" ).length() ); -	layoutBase->setName( n ); +	tqlayoutBase->setName( n );      }  } @@ -203,23 +203,23 @@ void Layout::undoLayout()      for ( ; it != geometries.end(); ++it ) {  	if ( !it.key() )  	    continue; -	it.key()->reparent( WidgetFactory::containerOfWidget( parent ), 0, ( *it ).topLeft(), it.key()->isVisibleTo( formWindow ) ); +	it.key()->reparent( WidgetFactory::containerOfWidget( tqparent ), 0, ( *it ).topLeft(), it.key()->isVisibleTo( formWindow ) );  	it.key()->resize( ( *it ).size() );      } -    formWindow->selectWidget( layoutBase, false ); -    WidgetFactory::deleteLayout( layoutBase ); -    if ( parent != layoutBase && !layoutBase->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) { -	layoutBase->hide(); -	TQString n = layoutBase->name(); +    formWindow->selectWidget( TQT_TQOBJECT(tqlayoutBase), false ); +    WidgetFactory::deleteLayout( tqlayoutBase ); +    if ( tqparent != tqlayoutBase && !tqlayoutBase->inherits( TQMAINWINDOW_OBJECT_NAME_STRING ) ) { +	tqlayoutBase->hide(); +	TQString n = tqlayoutBase->name();  	n.prepend( "qt_dead_widget_" ); -	layoutBase->setName( n ); +	tqlayoutBase->setName( n );      } else { -	layoutBase->setGeometry( oldGeometry ); +	tqlayoutBase->setGeometry( oldGeometry );      }      if ( widgets.first() ) -	formWindow->selectWidget( widgets.first() ); +	formWindow->selectWidget( TQT_TQOBJECT(widgets.first()) );      else -	formWindow->selectWidget( formWindow ); +	formWindow->selectWidget( TQT_TQOBJECT(formWindow) );  }  void Layout::breakLayout() @@ -228,43 +228,43 @@ void Layout::breakLayout()      if ( !widgets.isEmpty() ) {  	TQWidget *w;  	for ( w = widgets.first(); w; w = widgets.next() ) -	    rects.insert( w, w->geometry() ); +	    rects.insert( w, w->tqgeometry() );      } -    WidgetFactory::deleteLayout( layoutBase ); -    bool needReparent = qstrcmp( layoutBase->className(), "QLayoutWidget" ) == 0 || -			qstrcmp( layoutBase->className(), TQSPLITTER_OBJECT_NAME_STRING ) == 0 || -			( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( layoutBase ) ) ) && -			  layoutBase != formWindow->mainContainer() ); -    bool needResize = qstrcmp( layoutBase->className(), TQSPLITTER_OBJECT_NAME_STRING ) == 0; +    WidgetFactory::deleteLayout( tqlayoutBase ); +    bool needRetqparent = qstrcmp( tqlayoutBase->className(), TQLAYOUTWIDGET_OBJECT_NAME_STRING ) == 0 || +			qstrcmp( tqlayoutBase->className(), TQSPLITTER_OBJECT_NAME_STRING ) == 0 || +			( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf(TQT_TQOBJECT( tqlayoutBase )) ) ) && +			  tqlayoutBase != formWindow->mainContainer() ); +    bool needResize = qstrcmp( tqlayoutBase->className(), TQSPLITTER_OBJECT_NAME_STRING ) == 0;      bool add = geometries.isEmpty();      for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { -	if ( needReparent ) -	    w->reparent( layoutBase->parentWidget(), 0, -			 layoutBase->pos() + w->pos(), true ); +	if ( needRetqparent ) +	    w->reparent( tqlayoutBase->tqparentWidget(), 0, +			 tqlayoutBase->pos() + w->pos(), true );  	if ( needResize ) { -	    TQMap<TQWidget*, TQRect>::Iterator it = rects.find( w ); +	    TQMap<TQWidget*, TQRect>::Iterator it = rects.tqfind( w );  	    if ( it != rects.end() ) -		w->setGeometry( TQRect( layoutBase->pos() + (*it).topLeft(), (*it).size() ) ); +		w->setGeometry( TQRect( tqlayoutBase->pos() + (*it).topLeft(), (*it).size() ) );  	}  	if ( add )  	    geometries.insert( w, TQRect( w->pos(), w->size() ) );      } -    if ( needReparent ) { -	layoutBase->hide(); -	parent = layoutBase->parentWidget(); -	TQString n = layoutBase->name(); +    if ( needRetqparent ) { +	tqlayoutBase->hide(); +	tqparent = tqlayoutBase->tqparentWidget(); +	TQString n = tqlayoutBase->name();  	n.prepend( "qt_dead_widget_" ); -	layoutBase->setName( n ); +	tqlayoutBase->setName( n );      } else { -	parent = layoutBase; +	tqparent = tqlayoutBase;      }      if ( widgets.first() && widgets.first()->isVisibleTo( formWindow ) ) -	formWindow->selectWidget( widgets.first() ); +	formWindow->selectWidget( TQT_TQOBJECT(widgets.first()) );      else -	formWindow->selectWidget( formWindow ); +	formWindow->selectWidget( TQT_TQOBJECT(formWindow) );  } -class HorizontalLayoutList : public QWidgetList +class HorizontalLayoutList : public TQWidgetList  {  public:      HorizontalLayoutList( const TQWidgetList &l ) @@ -299,36 +299,36 @@ void HorizontalLayout::setup()  void HorizontalLayout::doLayout()  { -    bool needMove, needReparent; -    if ( !prepareLayout( needMove, needReparent ) ) +    bool needMove, needRetqparent; +    if ( !prepareLayout( needMove, needRetqparent ) )  	return; -    TQHBoxLayout *layout = (TQHBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::HBox ); +    TQHBoxLayout *tqlayout = (TQHBoxLayout*)WidgetFactory::createLayout( tqlayoutBase, 0, WidgetFactory::HBox );      for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { -	if ( needReparent && w->parent() != layoutBase ) -	    w->reparent( layoutBase, 0, TQPoint( 0, 0 ), false ); +	if ( needRetqparent && TQT_BASE_OBJECT(w->tqparent()) != TQT_BASE_OBJECT(tqlayoutBase) ) +	    w->reparent( tqlayoutBase, 0, TQPoint( 0, 0 ), false );  	if ( !useSplitter ) {  	    if ( qstrcmp( w->className(), "Spacer" ) == 0 ) -		layout->addWidget( w, 0, ( (Spacer*)w )->alignment() ); +		tqlayout->addWidget( w, 0, ( (Spacer*)w )->tqalignment() );  	    else -		layout->addWidget( w ); -	    if ( w->inherits( "QLayoutWidget" ) ) -		( (QLayoutWidget*)w )->updateSizePolicy(); +		tqlayout->addWidget( w ); +	    if ( w->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) ) +		( (TQLayoutWidget*)w )->updateSizePolicy();  	}  	w->show();      } -    if ( layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ) -	( (TQSplitter*)layoutBase )->setOrientation( Qt::Horizontal ); +    if ( tqlayoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ) +	( (TQSplitter*)tqlayoutBase )->setOrientation( Qt::Horizontal ); -    finishLayout( needMove, layout ); +    finishLayout( needMove, tqlayout );  } -class VerticalLayoutList : public QWidgetList +class VerticalLayoutList : public TQWidgetList  {  public:      VerticalLayoutList( const TQWidgetList &l ) @@ -363,30 +363,30 @@ void VerticalLayout::setup()  void VerticalLayout::doLayout()  { -    bool needMove, needReparent; -    if ( !prepareLayout( needMove, needReparent ) ) +    bool needMove, needRetqparent; +    if ( !prepareLayout( needMove, needRetqparent ) )  	return; -    TQVBoxLayout *layout = (TQVBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::VBox ); +    TQVBoxLayout *tqlayout = (TQVBoxLayout*)WidgetFactory::createLayout( tqlayoutBase, 0, WidgetFactory::VBox );      for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { -	if ( needReparent && w->parent() != layoutBase ) -	    w->reparent( layoutBase, 0, TQPoint( 0, 0 ), false ); +	if ( needRetqparent && TQT_BASE_OBJECT(w->tqparent()) != TQT_BASE_OBJECT(tqlayoutBase) ) +	    w->reparent( tqlayoutBase, 0, TQPoint( 0, 0 ), false );  	if ( !useSplitter ) {  	    if ( qstrcmp( w->className(), "Spacer" ) == 0 ) -		layout->addWidget( w, 0, ( (Spacer*)w )->alignment() ); +		tqlayout->addWidget( w, 0, ( (Spacer*)w )->tqalignment() );  	    else -		layout->addWidget( w ); -	    if ( w->inherits( "QLayoutWidget" ) ) -		( (QLayoutWidget*)w )->updateSizePolicy(); +		tqlayout->addWidget( w ); +	    if ( w->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) ) +		( (TQLayoutWidget*)w )->updateSizePolicy();  	}  	w->show();      } -    if ( layoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ) -	( (TQSplitter*)layoutBase )->setOrientation( Qt::Vertical ); +    if ( tqlayoutBase->inherits( TQSPLITTER_OBJECT_NAME_STRING ) ) +	( (TQSplitter*)tqlayoutBase )->setOrientation( Qt::Vertical ); -    finishLayout( needMove, layout ); +    finishLayout( needMove, tqlayout );  } @@ -729,11 +729,11 @@ GridLayout::~GridLayout()  void GridLayout::doLayout()  { -    bool needMove, needReparent; -    if ( !prepareLayout( needMove, needReparent ) ) +    bool needMove, needRetqparent; +    if ( !prepareLayout( needMove, needRetqparent ) )  	return; -    QDesignerGridLayout *layout = (QDesignerGridLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::Grid ); +    TQDesignerGridLayout *tqlayout = (TQDesignerGridLayout*)WidgetFactory::createLayout( tqlayoutBase, 0, WidgetFactory::Grid );      if ( !grid )  	buildGrid(); @@ -742,21 +742,21 @@ void GridLayout::doLayout()      int r, c, rs, cs;      for ( w = widgets.first(); w; w = widgets.next() ) {  	if ( grid->locateWidget( w, r, c, rs, cs) ) { -	    if ( needReparent && w->parent() != layoutBase ) -		w->reparent( layoutBase, 0, TQPoint( 0, 0 ), false ); +	    if ( needRetqparent && TQT_BASE_OBJECT(w->tqparent()) != TQT_BASE_OBJECT(tqlayoutBase) ) +		w->reparent( tqlayoutBase, 0, TQPoint( 0, 0 ), false );  	    if ( rs * cs == 1 ) { -		layout->addWidget( w, r, c, w->inherits( "Spacer" ) ? ( (Spacer*)w )->alignment() : 0 ); +		tqlayout->addWidget( w, r, c, w->inherits( "Spacer" ) ? ( (Spacer*)w )->tqalignment() : 0 );  	    } else { -		layout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, w->inherits( "Spacer" ) ? ( (Spacer*)w )->alignment() : 0 ); +		tqlayout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, w->inherits( "Spacer" ) ? ( (Spacer*)w )->tqalignment() : 0 );  	    } -	    if ( w->inherits( "QLayoutWidget" ) ) -		( (QLayoutWidget*)w )->updateSizePolicy(); +	    if ( w->inherits( TQLAYOUTWIDGET_OBJECT_NAME_STRING ) ) +		( (TQLayoutWidget*)w )->updateSizePolicy();  	    w->show();  	} else { -	    qWarning("ooops, widget '%s' does not fit in layout", w->name() ); +	    qWarning("ooops, widget '%s' does not fit in tqlayout", w->name() );  	}      } -    finishLayout( needMove, layout ); +    finishLayout( needMove, tqlayout );  }  void GridLayout::setup() @@ -770,7 +770,7 @@ void GridLayout::buildGrid()      TQWidget* w;      TQRect br;      for ( w = widgets.first(); w; w = widgets.next() ) -	br = br.unite( w->geometry() ); +	br = br.unite( w->tqgeometry() );      delete grid;      grid = new Grid( br.height() / resolution.height() + 1, @@ -784,7 +784,7 @@ void GridLayout::buildGrid()  	    TQRect cr( p, resolution );  	    for ( w = widgets.first(); w; w = widgets.next() ) {  		    // check that the overlap is significant -		    TQRect intersect = cr.intersect( w->geometry() ); +		    TQRect intersect = cr.intersect( w->tqgeometry() );  		    if ( intersect.size().width() > resolution.width()/2 &&  			 intersect.size().height() > resolution.height()/2 ) {  			grid->setCell( r, c, w ); @@ -801,9 +801,9 @@ void GridLayout::buildGrid() -Spacer::Spacer( TQWidget *parent, const char *name ) -    : TQWidget( parent, name, WMouseNoMask ), -      orient( Vertical ), interactive(true), sh( TQSize(20,20) ) +Spacer::Spacer( TQWidget *tqparent, const char *name ) +    : TQWidget( tqparent, name, WMouseNoMask ), +      orient(Qt::Vertical ), interactive(true), sh( TQSize(20,20) )  {      setSizeType( Expanding );      setAutoMask( true ); @@ -812,11 +812,11 @@ Spacer::Spacer( TQWidget *parent, const char *name )  void Spacer::paintEvent( TQPaintEvent * )  {      TQPainter p( this ); -    p.setPen( Qt::blue ); +    p.setPen( TQt::blue ); -    if ( orient == Horizontal ) { +    if ( orient ==Qt::Horizontal ) {  	const int dist = 3; -	const int amplitude = QMIN( 3, height() / 3 ); +	const int amplitude = TQMIN( 3, height() / 3 );  	const int base = height() / 2;  	int i = 0;  	p.setPen( white ); @@ -829,7 +829,7 @@ void Spacer::paintEvent( TQPaintEvent * )  	p.drawLine( width() - 1, 0, width() - 1, height());      } else {  	const int dist = 3; -	const int amplitude = QMIN( 3, width() / 3 ); +	const int amplitude = TQMIN( 3, width() / 3 );  	const int base = width() / 2;  	int i = 0;  	p.setPen( white ); @@ -846,20 +846,20 @@ void Spacer::paintEvent( TQPaintEvent * )  void Spacer::resizeEvent( TQResizeEvent* e)  {      TQWidget::resizeEvent( e ); -    if ( !parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout ) +    if ( !tqparentWidget() || WidgetFactory::tqlayoutType( tqparentWidget() ) == WidgetFactory::NoLayout )  	sh = size();  }  void Spacer::updateMask()  {      TQRegion r( rect() ); -    if ( orient == Horizontal ) { -	const int amplitude = QMIN( 3, height() / 3 ); +    if ( orient ==Qt::Horizontal ) { +	const int amplitude = TQMIN( 3, height() / 3 );  	const int base = height() / 2;  	r = r.subtract( TQRect(1, 0, width() - 2, base - amplitude ) );  	r = r.subtract( TQRect(1, base + amplitude, width() - 2, height() - base - amplitude ) );      } else { -	const int amplitude = QMIN( 3, width() / 3 ); +	const int amplitude = TQMIN( 3, width() / 3 );  	const int base = width() / 2;  	r = r.subtract( TQRect(0, 1, base - amplitude, height() - 2 ) );  	r = r.subtract( TQRect( base + amplitude, 1, width() - base - amplitude, height() - 2 ) ); @@ -870,38 +870,38 @@ void Spacer::updateMask()  void Spacer::setSizeType( SizeType t )  {      TQSizePolicy sizeP; -    if ( orient == Vertical ) +    if ( orient ==Qt::Vertical )  	sizeP = TQSizePolicy( TQSizePolicy::Minimum, (TQSizePolicy::SizeType)t );      else  	sizeP = TQSizePolicy( (TQSizePolicy::SizeType)t, TQSizePolicy::Minimum ); -    setSizePolicy( sizeP ); +    tqsetSizePolicy( sizeP );  }  Spacer::SizeType Spacer::sizeType() const  { -    if ( orient == Vertical ) -	return (SizeType)sizePolicy().verData(); -    return (SizeType)sizePolicy().horData(); +    if ( orient ==Qt::Vertical ) +	return (SizeType)tqsizePolicy().verData(); +    return (SizeType)tqsizePolicy().horData();  } -int Spacer::alignment() const +int Spacer::tqalignment() const  { -    if ( orient == Vertical ) +    if ( orient ==Qt::Vertical )  	return AlignHCenter;      return AlignVCenter;  } -TQSize Spacer::minimumSize() const +TQSize Spacer::tqminimumSize() const  {      return TQSize( 20, 20 );  } -TQSize Spacer::sizeHint() const +TQSize Spacer::tqsizeHint() const  {      TQSize s = sh.expandedTo( TQSize(0,0) );      if ( sizeType() == Expanding ) -	if ( orient == Horizontal ) +	if ( orient ==Qt::Horizontal )  	    s.rheight() = 0;  	else  	    s.rwidth() = 0; @@ -912,8 +912,8 @@ TQSize Spacer::sizeHint() const  void Spacer::setSizeHint( const TQSize &s )  {      sh = s; -    if ( !parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout ) -	resize( sizeHint() ); +    if ( !tqparentWidget() || WidgetFactory::tqlayoutType( tqparentWidget() ) == WidgetFactory::NoLayout ) +	resize( tqsizeHint() );      updateGeometry();  } @@ -932,7 +932,7 @@ void Spacer::setOrientation( Qt::Orientation o )      setSizeType( st );      if ( interactive ) {  	sh = TQSize( sh.height(), sh.width() ); -	if (!parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout ) +	if (!tqparentWidget() || WidgetFactory::tqlayoutType( tqparentWidget() ) == WidgetFactory::NoLayout )  	    resize( height(), width() );      }      updateMask(); @@ -941,13 +941,13 @@ void Spacer::setOrientation( Qt::Orientation o )  } -void QDesignerGridLayout::addWidget( TQWidget *w, int row, int col, int align_ ) +void TQDesignerGridLayout::addWidget( TQWidget *w, int row, int col, int align_ )  {      items.insert( w, Item(row, col, 1, 1) );      TQGridLayout::addWidget( w, row, col, align_ );  } -void QDesignerGridLayout::addMultiCellWidget( TQWidget *w, int fromRow, int toRow, +void TQDesignerGridLayout::addMultiCellWidget( TQWidget *w, int fromRow, int toRow,  					      int fromCol, int toCol, int align_ )  {      items.insert( w, Item(fromRow, fromCol, toRow - fromRow + 1, toCol - fromCol +1) ); | 
