diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /kdevdesigner/designer/layout.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdevdesigner/designer/layout.cpp')
-rw-r--r-- | kdevdesigner/designer/layout.cpp | 234 |
1 files changed, 117 insertions, 117 deletions
diff --git a/kdevdesigner/designer/layout.cpp b/kdevdesigner/designer/layout.cpp index 2926b4f6..1f37ea64 100644 --- a/kdevdesigner/designer/layout.cpp +++ b/kdevdesigner/designer/layout.cpp @@ -29,16 +29,16 @@ #include <widgetdatabase.h> #include "widgetfactory.h" -#include <qlayout.h> -#include <qevent.h> -#include <qpainter.h> -#include <qpen.h> -#include <qbitmap.h> -#include <qsplitter.h> -#include <qvaluevector.h> -#include <qmainwindow.h> +#include <tqlayout.h> +#include <tqevent.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqbitmap.h> +#include <tqsplitter.h> +#include <tqvaluevector.h> +#include <tqmainwindow.h> -bool operator<( const QGuardedPtr<QWidget> &p1, const QGuardedPtr<QWidget> &p2 ) +bool operator<( const TQGuardedPtr<TQWidget> &p1, const TQGuardedPtr<TQWidget> &p2 ) { return p1.operator->() < p2.operator->(); } @@ -61,7 +61,7 @@ bool operator<( const QGuardedPtr<QWidget> &p1, const QGuardedPtr<QWidget> &p2 ) widget is found later by Layout.) */ -Layout::Layout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, bool doSetup, bool splitter ) +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.setAutoDelete( FALSE ); @@ -78,11 +78,11 @@ Layout::Layout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, void Layout::setup() { - startPoint = QPoint( 32767, 32767 ); - QValueList<QWidgetList> lists; - QWidget *lastParent = 0; - QWidgetList *lastList = 0; - QWidget *w = 0; + startPoint = TQPoint( 32767, 32767 ); + TQValueList<TQWidgetList> lists; + TQWidget *lastParent = 0; + TQWidgetList *lastList = 0; + 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 @@ -96,13 +96,13 @@ void Layout::setup() if ( lastParent != w->parentWidget() ) { lastList = 0; lastParent = w->parentWidget(); - QValueList<QWidgetList>::Iterator it = lists.begin(); + TQValueList<TQWidgetList>::Iterator it = lists.begin(); for ( ; it != lists.end(); ++it ) { if ( ( *it ).first()->parentWidget() == w->parentWidget() ) lastList = &( *it ); } if ( !lastList ) { - QWidgetList l; + TQWidgetList l; l.setAutoDelete( FALSE ); lists.append( l ); lastList = &lists.last(); @@ -113,7 +113,7 @@ void Layout::setup() // So, now find the list with the most entries lastList = 0; - QValueList<QWidgetList>::Iterator it = lists.begin(); + TQValueList<TQWidgetList>::Iterator it = lists.begin(); for ( ; it != lists.end(); ++it ) { if ( !lastList || ( *it ).count() > lastList->count() ) lastList = &( *it ); @@ -128,7 +128,7 @@ void Layout::setup() layoutBase != formWindow->mainContainer() ) ) ) ) { widgets.clear(); - startPoint = QPoint( 0, 0 ); + startPoint = TQPoint( 0, 0 ); return; } @@ -142,11 +142,11 @@ void Layout::setup() // 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, SIGNAL( destroyed() ), - this, SLOT( widgetDestroyed() ) ); - startPoint = QPoint( QMIN( startPoint.x(), w->x() ), + connect( w, TQT_SIGNAL( destroyed() ), + this, TQT_SLOT( widgetDestroyed() ) ); + startPoint = TQPoint( QMIN( startPoint.x(), w->x() ), QMIN( startPoint.y(), w->y() ) ); - geometries.insert( w, QRect( w->pos(), w->size() ) ); + 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 @@ -157,23 +157,23 @@ void Layout::setup() void Layout::widgetDestroyed() { if ( sender() && sender()->isWidgetType() ) - widgets.removeRef( (QWidget*)sender() ); + widgets.removeRef( (TQWidget*)sender() ); } bool Layout::prepareLayout( bool &needMove, bool &needReparent ) { if ( !widgets.count() ) return FALSE; - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) w->raise(); needMove = !layoutBase; - needReparent = needMove || ::qt_cast<QLayoutWidget*>(layoutBase) || ::qt_cast<QSplitter*>(layoutBase); + needReparent = needMove || ::qt_cast<QLayoutWidget*>(layoutBase) || ::qt_cast<TQSplitter*>(layoutBase); if ( !layoutBase ) { if ( !useSplitter ) layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "QLayoutWidget" ), WidgetFactory::containerOfWidget( parent ) ); else - layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "QSplitter" ), + layoutBase = WidgetFactory::create( WidgetDatabase::idFromClassName( "TQSplitter" ), WidgetFactory::containerOfWidget( parent ) ); } else { WidgetFactory::deleteLayout( layoutBase ); @@ -182,11 +182,11 @@ bool Layout::prepareLayout( bool &needMove, bool &needReparent ) return TRUE; } -void Layout::finishLayout( bool needMove, QLayout *layout ) +void Layout::finishLayout( bool needMove, TQLayout *layout ) { if ( needMove ) layoutBase->move( startPoint ); - QRect g( QRect( layoutBase->pos(), layoutBase->size() ) ); + TQRect g( TQRect( layoutBase->pos(), layoutBase->size() ) ); if ( WidgetFactory::layoutType( layoutBase->parentWidget() ) == WidgetFactory::NoLayout && !isBreak ) layoutBase->adjustSize(); else if ( isBreak ) @@ -196,9 +196,9 @@ void Layout::finishLayout( bool needMove, QLayout *layout ) layout->activate(); formWindow->insertWidget( layoutBase ); formWindow->selectWidget( layoutBase ); - QString n = layoutBase->name(); + TQString n = layoutBase->name(); if ( n.find( "qt_dead_widget_" ) != -1 ) { - n.remove( 0, QString( "qt_dead_widget_" ).length() ); + n.remove( 0, TQString( "qt_dead_widget_" ).length() ); layoutBase->setName( n ); } } @@ -207,7 +207,7 @@ void Layout::undoLayout() { if ( !widgets.count() ) return; - QMap<QGuardedPtr<QWidget>, QRect>::Iterator it = geometries.begin(); + TQMap<TQGuardedPtr<TQWidget>, TQRect>::Iterator it = geometries.begin(); for ( ; it != geometries.end(); ++it ) { if ( !it.key() ) continue; @@ -216,9 +216,9 @@ void Layout::undoLayout() } formWindow->selectWidget( layoutBase, FALSE ); WidgetFactory::deleteLayout( layoutBase ); - if ( parent != layoutBase && !::qt_cast<QMainWindow*>(layoutBase) ) { + if ( parent != layoutBase && !::qt_cast<TQMainWindow*>(layoutBase) ) { layoutBase->hide(); - QString n = layoutBase->name(); + TQString n = layoutBase->name(); n.prepend( "qt_dead_widget_" ); layoutBase->setName( n ); } else { @@ -232,35 +232,35 @@ void Layout::undoLayout() void Layout::breakLayout() { - QMap<QWidget*, QRect> rects; + TQMap<TQWidget*, TQRect> rects; if ( !widgets.isEmpty() ) { - QWidget *w; + TQWidget *w; for ( w = widgets.first(); w; w = widgets.next() ) rects.insert( w, w->geometry() ); } WidgetFactory::deleteLayout( layoutBase ); bool needReparent = qstrcmp( layoutBase->className(), "QLayoutWidget" ) == 0 || - qstrcmp( layoutBase->className(), "QSplitter" ) == 0 || + qstrcmp( layoutBase->className(), "TQSplitter" ) == 0 || ( !WidgetDatabase::isContainer( WidgetDatabase::idFromClassName( WidgetFactory::classNameOf( layoutBase ) ) ) && layoutBase != formWindow->mainContainer() ); - bool needResize = qstrcmp( layoutBase->className(), "QSplitter" ) == 0; + bool needResize = qstrcmp( layoutBase->className(), "TQSplitter" ) == 0; bool add = geometries.isEmpty(); - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { if ( needReparent ) w->reparent( layoutBase->parentWidget(), 0, layoutBase->pos() + w->pos(), TRUE ); if ( needResize ) { - QMap<QWidget*, QRect>::Iterator it = rects.find( w ); + TQMap<TQWidget*, TQRect>::Iterator it = rects.find( w ); if ( it != rects.end() ) - w->setGeometry( QRect( layoutBase->pos() + (*it).topLeft(), (*it).size() ) ); + w->setGeometry( TQRect( layoutBase->pos() + (*it).topLeft(), (*it).size() ) ); } if ( add ) - geometries.insert( w, QRect( w->pos(), w->size() ) ); + geometries.insert( w, TQRect( w->pos(), w->size() ) ); } if ( needReparent ) { layoutBase->hide(); parent = layoutBase->parentWidget(); - QString n = layoutBase->name(); + TQString n = layoutBase->name(); n.prepend( "qt_dead_widget_" ); layoutBase->setName( n ); } else { @@ -275,12 +275,12 @@ void Layout::breakLayout() class HorizontalLayoutList : public QWidgetList { public: - HorizontalLayoutList( const QWidgetList &l ) - : QWidgetList( l ) {} + HorizontalLayoutList( const TQWidgetList &l ) + : TQWidgetList( l ) {} - int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) { - QWidget *w1 = (QWidget*)item1; - QWidget *w2 = (QWidget*)item2; + int compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ) { + TQWidget *w1 = (TQWidget*)item1; + TQWidget *w2 = (TQWidget*)item2; if ( w1->x() == w2->x() ) return 0; if ( w1->x() > w2->x() ) @@ -290,7 +290,7 @@ public: }; -HorizontalLayout::HorizontalLayout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, bool doSetup, bool splitter ) +HorizontalLayout::HorizontalLayout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, bool doSetup, bool splitter ) : Layout( wl, p, fw, lb, doSetup, splitter ) { if ( doSetup ) @@ -311,11 +311,11 @@ void HorizontalLayout::doLayout() if ( !prepareLayout( needMove, needReparent ) ) return; - QHBoxLayout *layout = (QHBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::HBox ); + TQHBoxLayout *layout = (TQHBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::HBox ); - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { if ( needReparent && w->parent() != layoutBase ) - w->reparent( layoutBase, 0, QPoint( 0, 0 ), FALSE ); + w->reparent( layoutBase, 0, TQPoint( 0, 0 ), FALSE ); if ( !useSplitter ) { if ( qstrcmp( w->className(), "Spacer" ) == 0 ) layout->addWidget( w, 0, ( (Spacer*)w )->alignment() ); @@ -327,8 +327,8 @@ void HorizontalLayout::doLayout() w->show(); } - if ( ::qt_cast<QSplitter*>(layoutBase) ) - ( (QSplitter*)layoutBase )->setOrientation( Qt::Horizontal ); + if ( ::qt_cast<TQSplitter*>(layoutBase) ) + ( (TQSplitter*)layoutBase )->setOrientation( Qt::Horizontal ); finishLayout( needMove, layout ); } @@ -339,12 +339,12 @@ void HorizontalLayout::doLayout() class VerticalLayoutList : public QWidgetList { public: - VerticalLayoutList( const QWidgetList &l ) - : QWidgetList( l ) {} + VerticalLayoutList( const TQWidgetList &l ) + : TQWidgetList( l ) {} - int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) { - QWidget *w1 = (QWidget*)item1; - QWidget *w2 = (QWidget*)item2; + int compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 ) { + TQWidget *w1 = (TQWidget*)item1; + TQWidget *w2 = (TQWidget*)item2; if ( w1->y() == w2->y() ) return 0; if ( w1->y() > w2->y() ) @@ -354,7 +354,7 @@ public: }; -VerticalLayout::VerticalLayout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, bool doSetup, bool splitter ) +VerticalLayout::VerticalLayout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, bool doSetup, bool splitter ) : Layout( wl, p, fw, lb, doSetup, splitter ) { if ( doSetup ) @@ -375,11 +375,11 @@ void VerticalLayout::doLayout() if ( !prepareLayout( needMove, needReparent ) ) return; - QVBoxLayout *layout = (QVBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::VBox ); + TQVBoxLayout *layout = (TQVBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::VBox ); - for ( QWidget *w = widgets.first(); w; w = widgets.next() ) { + for ( TQWidget *w = widgets.first(); w; w = widgets.next() ) { if ( needReparent && w->parent() != layoutBase ) - w->reparent( layoutBase, 0, QPoint( 0, 0 ), FALSE ); + w->reparent( layoutBase, 0, TQPoint( 0, 0 ), FALSE ); if ( !useSplitter ) { if ( qstrcmp( w->className(), "Spacer" ) == 0 ) layout->addWidget( w, 0, ( (Spacer*)w )->alignment() ); @@ -391,8 +391,8 @@ void VerticalLayout::doLayout() w->show(); } - if ( ::qt_cast<QSplitter*>(layoutBase) ) - ( (QSplitter*)layoutBase )->setOrientation( Qt::Vertical ); + if ( ::qt_cast<TQSplitter*>(layoutBase) ) + ( (TQSplitter*)layoutBase )->setOrientation( Qt::Vertical ); finishLayout( needMove, layout ); } @@ -407,9 +407,9 @@ public: Grid( int rows, int cols ); ~Grid(); - QWidget* cell( int row, int col ) const { return cells[ row * ncols + col]; } - void setCell( int row, int col, QWidget* w ) { cells[ row*ncols + col] = w; } - void setCells( QRect c, QWidget* w ) { + TQWidget* cell( int row, int col ) const { return cells[ row * ncols + col]; } + void setCell( int row, int col, TQWidget* w ) { cells[ row*ncols + col] = w; } + void setCells( TQRect c, TQWidget* w ) { for ( int rows = c.bottom()-c.top(); rows >= 0; rows--) for ( int cols = c.right()-c.left(); cols >= 0; cols--) { setCell(c.top()+rows, c.left()+cols, w); @@ -419,14 +419,14 @@ public: int numCols() const { return ncols; } void simplify(); - bool locateWidget( QWidget* w, int& row, int& col, int& rowspan, int& colspan ); + bool locateWidget( TQWidget* w, int& row, int& col, int& rowspan, int& colspan ); private: void merge(); int countRow( int r, int c ) const; int countCol( int r, int c ) const; - void setRow( int r, int c, QWidget* w, int count ); - void setCol( int r, int c, QWidget* w, int count ); + void setRow( int r, int c, TQWidget* w, int count ); + void setCol( int r, int c, TQWidget* w, int count ); bool isWidgetStartCol( int c ) const; bool isWidgetEndCol( int c ) const; bool isWidgetStartRow( int r ) const; @@ -436,7 +436,7 @@ private: void extendRight(); void extendUp(); void extendDown(); - QWidget** cells; + TQWidget** cells; bool* cols; bool* rows; int nrows, ncols; @@ -446,7 +446,7 @@ private: Grid::Grid( int r, int c ) : nrows( r ), ncols( c ) { - cells = new QWidget*[ r * c ]; + cells = new TQWidget*[ r * c ]; memset( cells, 0, sizeof( cells ) * r * c ); rows = new bool[ r ]; cols = new bool[ c ]; @@ -462,7 +462,7 @@ Grid::~Grid() int Grid::countRow( int r, int c ) const { - QWidget* w = cell( r, c ); + TQWidget* w = cell( r, c ); int i = c + 1; while ( i < ncols && cell( r, i ) == w ) i++; @@ -471,20 +471,20 @@ int Grid::countRow( int r, int c ) const int Grid::countCol( int r, int c ) const { - QWidget* w = cell( r, c ); + TQWidget* w = cell( r, c ); int i = r + 1; while ( i < nrows && cell( i, c ) == w ) i++; return i - r; } -void Grid::setCol( int r, int c, QWidget* w, int count ) +void Grid::setCol( int r, int c, TQWidget* w, int count ) { for (int i = 0; i < count; i++ ) setCell( r + i, c, w ); } -void Grid::setRow( int r, int c, QWidget* w, int count ) +void Grid::setRow( int r, int c, TQWidget* w, int count ) { for (int i = 0; i < count; i++ ) setCell( r, c + i, w ); @@ -534,7 +534,7 @@ bool Grid::isWidgetEndRow( int r ) const bool Grid::isWidgetTopLeft( int r, int c ) const { - QWidget* w = cell( r, c ); + TQWidget* w = cell( r, c ); if ( !w ) return FALSE; return ( !r || cell( r-1, c) != w ) && (!c || cell( r, c-1) != w); @@ -545,7 +545,7 @@ void Grid::extendLeft() int r,c,i; for ( c = 1; c < ncols; c++ ) { for ( r = 0; r < nrows; r++ ) { - QWidget* w = cell( r, c ); + TQWidget* w = cell( r, c ); if ( !w ) continue; int cc = countCol( r, c); @@ -576,7 +576,7 @@ void Grid::extendRight() int r,c,i; for ( c = ncols - 2; c >= 0; c-- ) { for ( r = 0; r < nrows; r++ ) { - QWidget* w = cell( r, c ); + TQWidget* w = cell( r, c ); if ( !w ) continue; int cc = countCol( r, c); @@ -607,7 +607,7 @@ void Grid::extendUp() int r,c,i; for ( r = 1; r < nrows; r++ ) { for ( c = 0; c < ncols; c++ ) { - QWidget* w = cell( r, c ); + TQWidget* w = cell( r, c ); if ( !w ) continue; int cr = countRow( r, c); @@ -637,7 +637,7 @@ void Grid::extendDown() int r,c,i; for ( r = nrows - 2; r >= 0; r-- ) { for ( c = 0; c < ncols; c++ ) { - QWidget* w = cell( r, c ); + TQWidget* w = cell( r, c ); if ( !w ) continue; int cr = countRow( r, c); @@ -692,7 +692,7 @@ void Grid::merge() } } -bool Grid::locateWidget( QWidget* w, int& row, int& col, int& rowspan, int & colspan ) +bool Grid::locateWidget( TQWidget* w, int& row, int& col, int& rowspan, int & colspan ) { int r,c, r2, c2; for ( c = 0; c < ncols; c++ ) { @@ -728,7 +728,7 @@ bool Grid::locateWidget( QWidget* w, int& row, int& col, int& rowspan, int & col -GridLayout::GridLayout( const QWidgetList &wl, QWidget *p, FormWindow *fw, QWidget *lb, const QSize &res, bool doSetup ) +GridLayout::GridLayout( const TQWidgetList &wl, TQWidget *p, FormWindow *fw, TQWidget *lb, const TQSize &res, bool doSetup ) : Layout( wl, p, fw, lb, doSetup ), resolution( res ) { grid = 0; @@ -752,12 +752,12 @@ void GridLayout::doLayout() if ( !grid ) buildGrid(); - QWidget* w; + TQWidget* w; 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, QPoint( 0, 0 ), FALSE ); + w->reparent( layoutBase, 0, TQPoint( 0, 0 ), FALSE ); if ( rs * cs == 1 ) { layout->addWidget( w, r, c, ::qt_cast<Spacer*>(w) ? ( (Spacer*)w )->alignment() : 0 ); } else { @@ -791,14 +791,14 @@ void GridLayout::buildGrid() // ----------------------------------------------------------------- // We need a list of both start and stop values for x- & y-axis - QValueVector<int> x( widgets.count()*2 ); - QValueVector<int> y( widgets.count()*2 ); + TQValueVector<int> x( widgets.count()*2 ); + TQValueVector<int> y( widgets.count()*2 ); // Using push_back would look nicer, but operator[] is much faster int index = 0; - QWidget* w = 0; + TQWidget* w = 0; for ( w = widgets.first(); w; w = widgets.next() ) { - QRect widgetPos = w->geometry(); + TQRect widgetPos = w->geometry(); x[index] = widgetPos.left(); x[index+1] = widgetPos.right(); y[index] = widgetPos.top(); @@ -811,7 +811,7 @@ void GridLayout::buildGrid() // Remove duplicate x enteries (Remove next, if equal to current) if ( !x.empty() ) { - for (QValueVector<int>::iterator current = x.begin() ; + for (TQValueVector<int>::iterator current = x.begin() ; (current != x.end()) && ((current+1) != x.end()) ; ) if ( (*current == *(current+1)) ) x.erase(current+1); @@ -821,7 +821,7 @@ void GridLayout::buildGrid() // Remove duplicate y enteries (Remove next, if equal to current) if ( !y.empty() ) { - for (QValueVector<int>::iterator current = y.begin() ; + for (TQValueVector<int>::iterator current = y.begin() ; (current != y.end()) && ((current+1) != y.end()) ; ) if ( (*current == *(current+1)) ) y.erase(current+1); @@ -837,7 +837,7 @@ void GridLayout::buildGrid() // Mark the cells in the grid that contains a widget for ( w = widgets.first(); w; w = widgets.next() ) { - QRect c(0,0,0,0), widgetPos = w->geometry(); + TQRect c(0,0,0,0), widgetPos = w->geometry(); // From left til right (not including) for (uint cw=0; cw<x.size(); cw++) { if ( x[cw] == widgetPos.left() ) @@ -863,17 +863,17 @@ void GridLayout::buildGrid() -Spacer::Spacer( QWidget *parent, const char *name ) - : QWidget( parent, name, WMouseNoMask ), - orient( Vertical ), interactive(TRUE), sh( QSize(20,20) ) +Spacer::Spacer( TQWidget *parent, const char *name ) + : TQWidget( parent, name, WMouseNoMask ), + orient( Vertical ), interactive(TRUE), sh( TQSize(20,20) ) { setSizeType( Expanding ); setAutoMask( TRUE ); } -void Spacer::paintEvent( QPaintEvent * ) +void Spacer::paintEvent( TQPaintEvent * ) { - QPainter p( this ); + TQPainter p( this ); p.setPen( Qt::blue ); if ( orient == Horizontal ) { @@ -905,37 +905,37 @@ void Spacer::paintEvent( QPaintEvent * ) } } -void Spacer::resizeEvent( QResizeEvent* e) +void Spacer::resizeEvent( TQResizeEvent* e) { - QWidget::resizeEvent( e ); + TQWidget::resizeEvent( e ); if ( !parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout ) sh = size(); } void Spacer::updateMask() { - QRegion r( rect() ); + TQRegion r( rect() ); if ( orient == Horizontal ) { const int amplitude = QMIN( 3, height() / 3 ); const int base = height() / 2; - r = r.subtract( QRect(1, 0, width() - 2, base - amplitude ) ); - r = r.subtract( QRect(1, base + amplitude, width() - 2, height() - base - amplitude ) ); + 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 base = width() / 2; - r = r.subtract( QRect(0, 1, base - amplitude, height() - 2 ) ); - r = r.subtract( QRect( base + amplitude, 1, width() - base - amplitude, height() - 2 ) ); + r = r.subtract( TQRect(0, 1, base - amplitude, height() - 2 ) ); + r = r.subtract( TQRect( base + amplitude, 1, width() - base - amplitude, height() - 2 ) ); } setMask( r ); } void Spacer::setSizeType( SizeType t ) { - QSizePolicy sizeP; + TQSizePolicy sizeP; if ( orient == Vertical ) - sizeP = QSizePolicy( QSizePolicy::Minimum, (QSizePolicy::SizeType)t ); + sizeP = TQSizePolicy( TQSizePolicy::Minimum, (TQSizePolicy::SizeType)t ); else - sizeP = QSizePolicy( (QSizePolicy::SizeType)t, QSizePolicy::Minimum ); + sizeP = TQSizePolicy( (TQSizePolicy::SizeType)t, TQSizePolicy::Minimum ); setSizePolicy( sizeP ); } @@ -954,9 +954,9 @@ int Spacer::alignment() const return AlignVCenter; } -QSize Spacer::minimumSize() const +TQSize Spacer::minimumSize() const { - QSize s = QSize( 20,20 ); + TQSize s = TQSize( 20,20 ); if ( sizeType() == Expanding ) if ( orient == Vertical ) s.rheight() = 0; @@ -965,13 +965,13 @@ QSize Spacer::minimumSize() const return s; } -QSize Spacer::sizeHint() const +TQSize Spacer::sizeHint() const { return sh; } -void Spacer::setSizeHint( const QSize &s ) +void Spacer::setSizeHint( const TQSize &s ) { sh = s; if ( !parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout ) @@ -993,7 +993,7 @@ void Spacer::setOrientation( Qt::Orientation o ) orient = o; setSizeType( st ); if ( interactive ) { - sh = QSize( sh.height(), sh.width() ); + sh = TQSize( sh.height(), sh.width() ); if (!parentWidget() || WidgetFactory::layoutType( parentWidget() ) == WidgetFactory::NoLayout ) resize( height(), width() ); } @@ -1003,15 +1003,15 @@ void Spacer::setOrientation( Qt::Orientation o ) } -void QDesignerGridLayout::addWidget( QWidget *w, int row, int col, int align_ ) +void QDesignerGridLayout::addWidget( TQWidget *w, int row, int col, int align_ ) { items.insert( w, Item(row, col, 1, 1) ); - QGridLayout::addWidget( w, row, col, align_ ); + TQGridLayout::addWidget( w, row, col, align_ ); } -void QDesignerGridLayout::addMultiCellWidget( QWidget *w, int fromRow, int toRow, +void QDesignerGridLayout::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) ); - QGridLayout::addMultiCellWidget( w, fromRow, toRow, fromCol, toCol, align_ ); + TQGridLayout::addMultiCellWidget( w, fromRow, toRow, fromCol, toCol, align_ ); } |