diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kdgantt/KDGanttMinimizeSplitter.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdgantt/KDGanttMinimizeSplitter.cpp')
-rw-r--r-- | kdgantt/KDGanttMinimizeSplitter.cpp | 590 |
1 files changed, 284 insertions, 306 deletions
diff --git a/kdgantt/KDGanttMinimizeSplitter.cpp b/kdgantt/KDGanttMinimizeSplitter.cpp index 790b381a..f3bc91a2 100644 --- a/kdgantt/KDGanttMinimizeSplitter.cpp +++ b/kdgantt/KDGanttMinimizeSplitter.cpp @@ -3,7 +3,7 @@ */ /**************************************************************************** - ** Copyright (C) 2002-2004 Klarälvdalens Datakonsult AB. All rights reserved. + ** Copyright (C) 2002-2004 Klar�lvdalens Datakonsult AB. All rights reserved. ** ** This file is part of the KDGantt library. ** @@ -26,32 +26,25 @@ ** licensing are not clear to you. ** ** As a special exception, permission is given to link this program - ** with any edition of Qt, and distribute the resulting executable, - ** without including the source code for Qt in the source distribution. + ** with any edition of TQt, and distribute the resulting executable, + ** without including the source code for TQt in the source distribution. ** **********************************************************************/ #include "KDGanttMinimizeSplitter.h" -#ifndef QT_NO_SPLITTER - -#include "qpainter.h" -#include "qdrawutil.h" -#include "qbitmap.h" -#if QT_VERSION >= 300 -#include "qptrlist.h" -#include "qmemarray.h" -#else -#include <qlist.h> -#include <qarray.h> -#define QPtrList QList -#define QMemArray QArray -#endif -#include "qlayoutengine_p.h" -#include "qobjectlist.h" -#include "qstyle.h" -#include "qapplication.h" //sendPostedEvents -#include <qvaluelist.h> -#include <qcursor.h> +#ifndef TQT_NO_SPLITTER + +#include "tqpainter.h" +#include "tqdrawutil.h" +#include "tqbitmap.h" +#include "tqptrlist.h" +#include "tqmemarray.h" +#include "tqlayoutengine_p.h" +#include "tqobjectlist.h" +#include "tqstyle.h" +#include "tqapplication.h" //sendPostedEvents +#include <tqvaluelist.h> +#include <tqcursor.h> #ifndef KDGANTT_MASTER_CVS #include "KDGanttMinimizeSplitter.moc" #endif @@ -59,30 +52,29 @@ #ifndef DOXYGEN_SKIP_INTERNAL -#if QT_VERSION >= 300 static int mouseOffset; static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, - KDGanttMinimizeSplitter *parent, const char * name ) - : QWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) + KDGanttMinimizeSplitter *tqparent, const char * name ) + : TQWidget( tqparent, name ), _activeButton( 0 ), _collapsed( false ) { - s = parent; + s = tqparent; setOrientation(o); setMouseTracking( true ); } -QSize KDGanttSplitterHandle::sizeHint() const +TQSize KDGanttSplitterHandle::tqsizeHint() const { - return QSize(8,8); + return TQSize(8,8); } void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) { orient = o; -#ifndef QT_NO_CURSOR - if ( o == KDGanttMinimizeSplitter::Horizontal ) +#ifndef TQT_NO_CURSOR + if ( o == Qt::Horizontal ) setCursor( splitHCursor ); else setCursor( splitVCursor ); @@ -90,45 +82,45 @@ void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) } -void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e ) +void KDGanttSplitterHandle::mouseMoveEvent( TQMouseEvent *e ) { updateCursor( e->pos() ); - if ( !(e->state()&LeftButton) ) + if ( !(e->state()&Qt::LeftButton) ) return; if ( _activeButton != 0) return; - QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) + TQCOORD pos = s->pick(tqparentWidget()->mapFromGlobal(e->globalPos())) - mouseOffset; if ( opaque() ) { s->moveSplitter( pos, id() ); } else { int min = pos; int max = pos; s->getRange( id(), &min, &max ); - s->setRubberband( QMAX( min, QMIN(max, pos ))); + s->setRubberband( TQMAX( min, TQMIN(max, pos ))); } _collapsed = false; } -void KDGanttSplitterHandle::mousePressEvent( QMouseEvent *e ) +void KDGanttSplitterHandle::mousePressEvent( TQMouseEvent *e ) { - if ( e->button() == LeftButton ) { + if ( e->button() == Qt::LeftButton ) { _activeButton = onButton( e->pos() ); mouseOffset = s->pick(e->pos()); if ( _activeButton != 0) - repaint(); + tqrepaint(); updateCursor( e->pos() ); } } -void KDGanttSplitterHandle::updateCursor( const QPoint& p) +void KDGanttSplitterHandle::updateCursor( const TQPoint& p) { if ( onButton( p ) != 0 ) { setCursor( arrowCursor ); } else { - if ( orient == KDGanttMinimizeSplitter::Horizontal ) + if ( orient == Qt::Horizontal ) setCursor( splitHCursor ); else setCursor( splitVCursor ); @@ -136,7 +128,7 @@ void KDGanttSplitterHandle::updateCursor( const QPoint& p) } -void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) +void KDGanttSplitterHandle::mouseReleaseEvent( TQMouseEvent *e ) { if ( _activeButton != 0 ) { if ( onButton( e->pos() ) == _activeButton ) @@ -153,7 +145,7 @@ void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) pos = max; } - _origPos = s->pick(mapToParent( QPoint( 0,0 ) )); + _origPos = s->pick(mapToParent( TQPoint( 0,0 ) )); s->moveSplitter( pos, id() ); _collapsed = true; } @@ -167,27 +159,27 @@ void KDGanttSplitterHandle::mouseReleaseEvent( QMouseEvent *e ) updateCursor( e->pos() ); } else { - if ( !opaque() && e->button() == LeftButton ) { - QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) + if ( !opaque() && e->button() == Qt::LeftButton ) { + TQCOORD pos = s->pick(tqparentWidget()->mapFromGlobal(e->globalPos())) - mouseOffset; s->setRubberband( -1 ); s->moveSplitter( pos, id() ); } } - repaint(); + tqrepaint(); } -int KDGanttSplitterHandle::onButton( const QPoint& p ) +int KDGanttSplitterHandle::onButton( const TQPoint& p ) { - QValueList<QPointArray> list = buttonRegions(); + TQValueList<TQPointArray> list = buttonRegions(); int index = 1; - for( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { - QRect rect = (*it).boundingRect(); + for( TQValueList<TQPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { + TQRect rect = (*it).boundingRect(); rect.setLeft( rect.left()- 4 ); rect.setRight( rect.right() + 4); rect.setTop( rect.top()- 4 ); rect.setBottom( rect.bottom() + 4); - if ( rect.contains( p ) ) { + if ( rect.tqcontains( p ) ) { return index; } index++; @@ -196,14 +188,14 @@ int KDGanttSplitterHandle::onButton( const QPoint& p ) } -QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions() +TQValueList<TQPointArray> KDGanttSplitterHandle::buttonRegions() { - QValueList<QPointArray> list; + TQValueList<TQPointArray> list; int sw = 8; int voffset[] = { (int) -sw*3, (int) sw*3 }; for ( int i = 0; i < 2; i++ ) { - QPointArray arr; + TQPointArray arr; if ( !_collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Right || _collapsed && s->minimizeDirection() == KDGanttMinimizeSplitter::Left) { int mid = height()/2 + voffset[i]; @@ -241,37 +233,37 @@ QValueList<QPointArray> KDGanttSplitterHandle::buttonRegions() return list; } -void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) +void KDGanttSplitterHandle::paintEvent( TQPaintEvent * ) { - QPixmap buffer( size() ); - QPainter p( &buffer ); + TQPixmap buffer( size() ); + TQPainter p( &buffer ); // Draw the splitter rectangle - p.setBrush( colorGroup().background() ); - p.setPen( colorGroup().foreground() ); + p.setBrush( tqcolorGroup().background() ); + p.setPen( tqcolorGroup().foreground() ); p.drawRect( rect() ); - parentWidget()->style().drawPrimitive( QStyle::PE_Panel, &p, rect(), - parentWidget()->colorGroup()); + tqparentWidget()->tqstyle().tqdrawPrimitive( TQStyle::PE_Panel, &p, rect(), + tqparentWidget()->tqcolorGroup()); int sw = 8; // Hardcoded, given I didn't use styles anymore, I didn't like to use their size // arrow color - QColor col = colorGroup().background().dark( 200 ); + TQColor col = tqcolorGroup().background().dark( 200 ); p.setBrush( col ); p.setPen( col ); - QValueList<QPointArray> list = buttonRegions(); + TQValueList<TQPointArray> list = buttonRegions(); int index = 1; - for ( QValueList<QPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { + for ( TQValueList<TQPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { if ( index == _activeButton ) { p.save(); - p.translate( parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftHorizontal ), - parentWidget()->style().pixelMetric( QStyle::PM_ButtonShiftVertical ) ); - p.drawPolygon( *it, true ); + p.translate( tqparentWidget()->tqstyle().tqpixelMetric( TQStyle::PM_ButtonShiftHorizontal ), + tqparentWidget()->tqstyle().tqpixelMetric( TQStyle::PM_ButtonShiftVertical ) ); + p.tqdrawPolygon( *it, true ); p.restore(); } else { - p.drawPolygon( *it, true ); + p.tqdrawPolygon( *it, true ); } index++; } @@ -291,28 +283,27 @@ void KDGanttSplitterHandle::paintEvent( QPaintEvent * ) } bitBlt( this, 0, 0, &buffer ); } -#endif -class QSplitterLayoutStruct +class TQSplitterLayoutStruct { public: KDGanttMinimizeSplitter::ResizeMode mode; - QCOORD sizer; + TQCOORD sizer; bool isSplitter; - QWidget *wid; + TQWidget *wid; }; -class QSplitterData +class TQSplitterData { public: - QSplitterData() : opaque( FALSE ), firstShow( TRUE ) {} + TQSplitterData() : opaque( FALSE ), firstShow( TRUE ) {} - QPtrList<QSplitterLayoutStruct> list; + TQPtrList<TQSplitterLayoutStruct> list; bool opaque; bool firstShow; }; -void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, +void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, int pos, int space, int spacer ); #endif // DOXYGEN_SKIP_INTERNAL @@ -322,34 +313,34 @@ void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int \brief The KDGanttMinimizeSplitter class implements a splitter widget with minimize buttons. - This class (and its documentation) is largely a copy of Qt's - QSplitter; the copying was necessary because QSplitter is not - extensible at all. QSplitter and its documentation are licensed - according to the GPL and the Qt Professional License (if you hold + This class (and its documentation) is largely a copy of TQt's + TQSplitter; the copying was necessary because TQSplitter is not + extensible at all. TQSplitter and its documentation are licensed + according to the GPL and the TQt Professional License (if you hold such a license) and are (C) Trolltech AS. A splitter lets the user control the size of child widgets by - dragging the boundary between the children. Any number of widgets + dragging the boundary between the tqchildren. Any number of widgets may be controlled. - To show a QListBox, a QListView and a QTextEdit side by side: + To show a TQListBox, a TQListView and a TQTextEdit side by side: \code - KDGanttMinimizeSplitter *split = new KDGanttMinimizeSplitter( parent ); - QListBox *lb = new QListBox( split ); - QListView *lv = new QListView( split ); - QTextEdit *ed = new QTextEdit( split ); + KDGanttMinimizeSplitter *split = new KDGanttMinimizeSplitter( tqparent ); + TQListBox *lb = new TQListBox( split ); + TQListView *lv = new TQListView( split ); + TQTextEdit *ed = new TQTextEdit( split ); \endcode In KDGanttMinimizeSplitter, the boundary can be either horizontal or - vertical. The default is horizontal (the children are side by side) - but you can use setOrientation( QSplitter::Vertical ) to set it to + vertical. The default is horizontal (the tqchildren are side by side) + but you can use setOrientation( TQSplitter::Vertical ) to set it to vertical. Use setResizeMode() to specify that a widget should keep its size when the splitter is resized. - Although KDGanttMinimizeSplitter normally resizes the children only + Although KDGanttMinimizeSplitter normally resizes the tqchildren only at the end of a resize operation, if you call setOpaqueResize( TRUE ) the widgets are resized as often as possible. @@ -359,82 +350,74 @@ void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int sizes set by the user. If you hide() a child, its space will be distributed among the other - children. It will be reinstated when you show() it again. It is also + tqchildren. It will be reinstated when you show() it again. It is also possible to reorder the widgets within the splitter using moveToFirst() and moveToLast(). */ -static QSize minSize( const QWidget* /*w*/ ) +static TQSize minSize( const TQWidget* /*w*/ ) { - return QSize(0,0); + return TQSize(0,0); } // This is the original version of minSize -static QSize minSizeHint( const QWidget* w ) +static TQSize minSizeHint( const TQWidget* w ) { - QSize min = w->minimumSize(); - QSize s; + TQSize min = w->tqminimumSize(); + TQSize s; if ( min.height() <= 0 || min.width() <= 0 ) - s = w->minimumSizeHint(); + s = w->tqminimumSizeHint(); if ( min.height() > 0 ) s.setHeight( min.height() ); if ( min.width() > 0 ) s.setWidth( min.width() ); - return s.expandedTo(QSize(0,0)); + return s.expandedTo(TQSize(0,0)); } /*! - Constructs a horizontal splitter with the \a parent and \a - name arguments being passed on to the QFrame constructor. + Constructs a horizontal splitter with the \a tqparent and \a + name arguments being passed on to the TQFrame constructor. */ -KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( QWidget *parent, const char *name ) - :QFrame(parent,name,WPaintUnclipped) +KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( TQWidget *tqparent, const char *name ) + :TQFrame(tqparent,name,WPaintUnclipped) { -#if QT_VERSION >= 300 - orient = Horizontal; + orient =Qt::Horizontal; init(); -#endif } /*! - Constructs a splitter with orientation \a o with the \a parent - and \a name arguments being passed on to the QFrame constructor. + Constructs a splitter with orientation \a o with the \a tqparent + and \a name arguments being passed on to the TQFrame constructor. */ -KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Orientation o, QWidget *parent, const char *name ) - :QFrame(parent,name,WPaintUnclipped) +KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Qt::Orientation o, TQWidget *tqparent, const char *name ) + :TQFrame(tqparent,name,WPaintUnclipped) { -#if QT_VERSION >= 300 orient = o; init(); -#endif } /*! - Destroys the splitter and any children. + Destroys the splitter and any tqchildren. */ KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() { -#if QT_VERSION >= 300 data->list.setAutoDelete( TRUE ); delete data; -#endif } -#if QT_VERSION >= 300 void KDGanttMinimizeSplitter::init() { - data = new QSplitterData; - if ( orient == Horizontal ) - setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) ); + data = new TQSplitterData; + if ( orient ==Qt::Horizontal ) + tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Minimum) ); else - setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) ); + tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Expanding) ); } -#endif @@ -442,36 +425,33 @@ void KDGanttMinimizeSplitter::init() \brief the orientation of the splitter By default the orientation is horizontal (the widgets are side by side). - The possible orientations are Qt:Vertical and Qt::Horizontal (the default). + The possible orientations are TQt:Vertical and Qt::Horizontal (the default). */ -void KDGanttMinimizeSplitter::setOrientation( Orientation o ) +void KDGanttMinimizeSplitter::setOrientation( Qt::Orientation o ) { -#if QT_VERSION >= 300 if ( orient == o ) return; orient = o; - if ( orient == Horizontal ) - setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); + if ( orient ==Qt::Horizontal ) + tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Minimum ) ); else - setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) ); + tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); - QSplitterLayoutStruct *s = data->list.first(); + TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( s->isSplitter ) ((KDGanttSplitterHandle*)s->wid)->setOrientation( o ); s = data->list.next(); // ### next at end of loop, no iterator } recalc( isVisible() ); -#endif } -#if QT_VERSION >= 300 /*! Reimplemented from superclass. */ -void KDGanttMinimizeSplitter::resizeEvent( QResizeEvent * ) +void KDGanttMinimizeSplitter::resizeEvent( TQResizeEvent * ) { doResize(); } @@ -486,30 +466,30 @@ void KDGanttMinimizeSplitter::resizeEvent( QResizeEvent * ) needed. (If \a first is TRUE, then recalcId is very probably needed.) */ -QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( QWidget *w, bool first ) +TQSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bool first ) { - QSplitterLayoutStruct *s; + TQSplitterLayoutStruct *s; KDGanttSplitterHandle *newHandle = 0; if ( data->list.count() > 0 ) { - s = new QSplitterLayoutStruct; + s = new TQSplitterLayoutStruct; s->mode = KeepSize; - QString tmp = "qt_splithandle_"; + TQString tmp = "qt_splithandle_"; tmp += w->name(); newHandle = new KDGanttSplitterHandle( orientation(), this, tmp.latin1() ); s->wid = newHandle; newHandle->setId(data->list.count()); s->isSplitter = TRUE; - s->sizer = pick( newHandle->sizeHint() ); + s->sizer = pick( newHandle->tqsizeHint() ); if ( first ) data->list.insert( 0, s ); else data->list.append( s ); } - s = new QSplitterLayoutStruct; + s = new TQSplitterLayoutStruct; s->mode = Stretch; s->wid = w; - if ( !testWState( WState_Resized ) && w->sizeHint().isValid() ) - s->sizer = pick( w->sizeHint() ); + if ( !testWState( WState_Resized ) && w->tqsizeHint().isValid() ) + s->sizer = pick( w->tqsizeHint() ); else s->sizer = pick( w->size() ); s->isSplitter = FALSE; @@ -527,29 +507,29 @@ QSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( QWidget *w, bool firs Tells the splitter that a child widget has been inserted or removed. The event is passed in \a c. */ -void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) +void KDGanttMinimizeSplitter::childEvent( TQChildEvent *c ) { - if ( c->type() == QEvent::ChildInserted ) { + if ( c->type() == TQEvent::ChildInserted ) { if ( !c->child()->isWidgetType() ) return; - if ( ((QWidget*)c->child())->testWFlags( WType_TopLevel ) ) + if ( ((TQWidget*)c->child())->testWFlags( WType_TopLevel ) ) return; - QSplitterLayoutStruct *s = data->list.first(); + TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( s->wid == c->child() ) return; s = data->list.next(); } - addWidget( (QWidget*)c->child() ); + addWidget( (TQWidget*)c->child() ); recalc( isVisible() ); - } else if ( c->type() == QEvent::ChildRemoved ) { - QSplitterLayoutStruct *p = 0; + } else if ( c->type() == TQEvent::ChildRemoved ) { + TQSplitterLayoutStruct *p = 0; if ( data->list.count() > 1 ) p = data->list.at(1); //remove handle _after_ first widget. - QSplitterLayoutStruct *s = data->list.first(); + TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( s->wid == c->child() ) { data->list.removeRef( s ); @@ -576,14 +556,14 @@ void KDGanttMinimizeSplitter::childEvent( QChildEvent *c ) */ void KDGanttMinimizeSplitter::setRubberband( int p ) { - QPainter paint( this ); + TQPainter paint( this ); paint.setPen( gray ); paint.setBrush( gray ); paint.setRasterOp( XorROP ); - QRect r = contentsRect(); + TQRect r = contentsRect(); const int rBord = 3; //Themable???? - int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); - if ( orient == Horizontal ) { + int sw = tqstyle().tqpixelMetric(TQStyle::PM_SplitterWidth, this); + if ( orient ==Qt::Horizontal ) { if ( opaqueOldPos >= 0 ) paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(), 2*rBord, r.height() ); @@ -601,14 +581,14 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) /*! Reimplemented from superclass. */ -bool KDGanttMinimizeSplitter::event( QEvent *e ) +bool KDGanttMinimizeSplitter::event( TQEvent *e ) { - if ( e->type() == QEvent::LayoutHint || ( e->type() == QEvent::Show && data->firstShow ) ) { + if ( e->type() == TQEvent::LayoutHint || ( e->type() == TQEvent::Show && data->firstShow ) ) { recalc( isVisible() ); - if ( e->type() == QEvent::Show ) + if ( e->type() == TQEvent::Show ) data->firstShow = FALSE; } - return QWidget::event( e ); + return TQWidget::event( e ); } @@ -617,14 +597,14 @@ bool KDGanttMinimizeSplitter::event( QEvent *e ) Draws the splitter handle in the rectangle described by \a x, \a y, \a w, \a h using painter \a p. - \sa QStyle::drawPrimitive() + \sa TQStyle::drawPrimitive() */ -void KDGanttMinimizeSplitter::drawSplitter( QPainter *p, - QCOORD x, QCOORD y, QCOORD w, QCOORD h ) +void KDGanttMinimizeSplitter::drawSplitter( TQPainter *p, + TQCOORD x, TQCOORD y, TQCOORD w, TQCOORD h ) { - style().drawPrimitive(QStyle::PE_Splitter, p, QRect(x, y, w, h), colorGroup(), + tqstyle().tqdrawPrimitive(TQStyle::PE_Splitter, p, TQRect(x, y, w, h), tqcolorGroup(), (orientation() == Qt::Horizontal ? - QStyle::Style_Horizontal : 0)); + TQStyle::Style_Horizontal : 0)); } @@ -633,9 +613,9 @@ void KDGanttMinimizeSplitter::drawSplitter( QPainter *p, or 0 if there is no such splitter (i.e. it is either not in this KDGanttMinimizeSplitter or it is at the end). */ -int KDGanttMinimizeSplitter::idAfter( QWidget* w ) const +int KDGanttMinimizeSplitter::idAfter( TQWidget* w ) const { - QSplitterLayoutStruct *s = data->list.first(); + TQSplitterLayoutStruct *s = data->list.first(); bool seen_w = FALSE; while ( s ) { if ( s->isSplitter && seen_w ) @@ -653,21 +633,21 @@ int KDGanttMinimizeSplitter::idAfter( QWidget* w ) const close as possible to position \a p, which is the distance from the left (or top) edge of the widget. - For Arabic and Hebrew the layout is reversed, and using this + For Arabic and Hebrew the tqlayout is reversed, and using this function to set the position of the splitter might lead to unexpected results, since in Arabic and Hebrew the position of splitter one is to the left of the position of splitter zero. \sa idAfter() */ -void KDGanttMinimizeSplitter::moveSplitter( QCOORD p, int id ) +void KDGanttMinimizeSplitter::moveSplitter( TQCOORD p, int id ) { p = adjustPos( p, id ); - QSplitterLayoutStruct *s = data->list.at(id); - int oldP = orient == Horizontal ? s->wid->x() : s->wid->y(); + TQSplitterLayoutStruct *s = data->list.at(id); + int oldP = orient ==Qt::Horizontal ? s->wid->x() : s->wid->y(); bool upLeft; - if ( QApplication::reverseLayout() && orient == Horizontal ) { + if ( TQApplication::reverseLayout() && orient ==Qt::Horizontal ) { p += s->wid->width(); upLeft = p > oldP; } else @@ -680,10 +660,10 @@ void KDGanttMinimizeSplitter::moveSplitter( QCOORD p, int id ) } -void KDGanttMinimizeSplitter::setG( QWidget *w, int p, int s, bool isSplitter ) +void KDGanttMinimizeSplitter::setG( TQWidget *w, int p, int s, bool isSplitter ) { - if ( orient == Horizontal ) { - if ( QApplication::reverseLayout() && orient == Horizontal && !isSplitter ) + if ( orient ==Qt::Horizontal ) { + if ( TQApplication::reverseLayout() && orient ==Qt::Horizontal && !isSplitter ) p = contentsRect().width() - p - s; w->setGeometry( p, contentsRect().y(), s, contentsRect().height() ); } else @@ -700,16 +680,16 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) { if( id < 0 ) return; - QSplitterLayoutStruct *s = data->list.at(id); + TQSplitterLayoutStruct *s = data->list.at(id); if ( !s ) return; - QWidget *w = s->wid; + TQWidget *w = s->wid; if ( w->isHidden() ) { moveBefore( pos, id-1, upLeft ); } else if ( s->isSplitter ) { int pos1, pos2; int dd = s->sizer; - if( QApplication::reverseLayout() && orient == Horizontal ) { + if( TQApplication::reverseLayout() && orient ==Qt::Horizontal ) { pos1 = pos; pos2 = pos + dd; } else { @@ -725,14 +705,14 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) } } else { int dd, newLeft, nextPos; - if( QApplication::reverseLayout() && orient == Horizontal ) { - dd = w->geometry().right() - pos; - dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); + if( TQApplication::reverseLayout() && orient ==Qt::Horizontal ) { + dd = w->tqgeometry().right() - pos; + dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize()))); newLeft = pos+1; nextPos = newLeft + dd; } else { dd = pos - pick( w->pos() ) + 1; - dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); + dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize()))); newLeft = pos-dd+1; nextPos = newLeft - 1; } @@ -749,11 +729,11 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) */ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) { - QSplitterLayoutStruct *s = id < int(data->list.count()) ? + TQSplitterLayoutStruct *s = id < int(data->list.count()) ? data->list.at(id) : 0; if ( !s ) return; - QWidget *w = s->wid; + TQWidget *w = s->wid; if ( w->isHidden() ) { moveAfter( pos, id+1, upLeft ); } else if ( pick( w->pos() ) == pos ) { @@ -762,7 +742,7 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) } else if ( s->isSplitter ) { int dd = s->sizer; int pos1, pos2; - if( QApplication::reverseLayout() && orient == Horizontal ) { + if( TQApplication::reverseLayout() && orient ==Qt::Horizontal ) { pos2 = pos - dd; pos1 = pos2 + 1; } else { @@ -779,15 +759,15 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) } else { int left = pick( w->pos() ); int right, dd,/* newRight,*/ newLeft, nextPos; - if ( QApplication::reverseLayout() && orient == Horizontal ) { + if ( TQApplication::reverseLayout() && orient ==Qt::Horizontal ) { dd = pos - left + 1; - dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); + dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize()))); newLeft = pos-dd+1; nextPos = newLeft - 1; } else { - right = pick( w->geometry().bottomRight() ); + right = pick( w->tqgeometry().bottomRight() ); dd = right - pos + 1; - dd = QMAX( pick(minSize(w)), QMIN(dd, pick(w->maximumSize()))); + dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize()))); /*newRight = pos+dd-1;*/ newLeft = pos; nextPos = newLeft + dd; @@ -801,17 +781,17 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) void KDGanttMinimizeSplitter::expandPos( int id, int* min, int* max ) { - QSplitterLayoutStruct *s = data->list.at(id-1); - QWidget* w = s->wid; - *min = pick( w->mapToParent( QPoint(0,0) ) ); + TQSplitterLayoutStruct *s = data->list.at(id-1); + TQWidget* w = s->wid; + *min = pick( w->mapToParent( TQPoint(0,0) ) ); if ( (uint) id == data->list.count() ) { pick( size() ); } else { - QSplitterLayoutStruct *s = data->list.at(id+1); - QWidget* w = s->wid; - *max = pick( w->mapToParent( QPoint( w->width(), w->height() ) ) ) -8; + TQSplitterLayoutStruct *s = data->list.at(id+1); + TQWidget* w = s->wid; + *max = pick( w->mapToParent( TQPoint( w->width(), w->height() ) ) ) -8; } } @@ -833,7 +813,7 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) return; int i; for ( i = 0; i < id; i++ ) { - QSplitterLayoutStruct *s = data->list.at(i); + TQSplitterLayoutStruct *s = data->list.at(i); if ( s->wid->isHidden() ) { //ignore } else if ( s->isSplitter ) { @@ -841,11 +821,11 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) maxB += s->sizer; } else { minB += pick( minSize(s->wid) ); - maxB += pick( s->wid->maximumSize() ); + maxB += pick( s->wid->tqmaximumSize() ); } } for ( i = id; i < n; i++ ) { - QSplitterLayoutStruct *s = data->list.at(i); + TQSplitterLayoutStruct *s = data->list.at(i); if ( s->wid->isHidden() ) { //ignore } else if ( s->isSplitter ) { @@ -853,21 +833,21 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) maxA += s->sizer; } else { minA += pick( minSize(s->wid) ); - maxA += pick( s->wid->maximumSize() ); + maxA += pick( s->wid->tqmaximumSize() ); } } - QRect r = contentsRect(); - if ( orient == Horizontal && QApplication::reverseLayout() ) { - int splitterWidth = style().pixelMetric(QStyle::PM_SplitterWidth, this); + TQRect r = contentsRect(); + if ( orient ==Qt::Horizontal && TQApplication::reverseLayout() ) { + int splitterWidth = tqstyle().tqpixelMetric(TQStyle::PM_SplitterWidth, this); if ( min ) - *min = pick(r.topRight()) - QMIN( maxB, pick(r.size())-minA ) - splitterWidth; + *min = pick(r.topRight()) - TQMIN( maxB, pick(r.size())-minA ) - splitterWidth; if ( max ) - *max = pick(r.topRight()) - QMAX( minB, pick(r.size())-maxA ) - splitterWidth; + *max = pick(r.topRight()) - TQMAX( minB, pick(r.size())-maxA ) - splitterWidth; } else { if ( min ) - *min = pick(r.topLeft()) + QMAX( minB, pick(r.size())-maxA ); + *min = pick(r.topLeft()) + TQMAX( minB, pick(r.size())-maxA ); if ( max ) - *max = pick(r.topLeft()) + QMIN( maxB, pick(r.size())-minA ); + *max = pick(r.topLeft()) + TQMIN( maxB, pick(r.size())-minA ); } } @@ -883,7 +863,7 @@ int KDGanttMinimizeSplitter::adjustPos( int p, int id ) int min = 0; int max = 0; getRange( id, &min, &max ); - p = QMAX( min, QMIN( p, max ) ); + p = TQMAX( min, TQMIN( p, max ) ); return p; } @@ -891,36 +871,36 @@ int KDGanttMinimizeSplitter::adjustPos( int p, int id ) void KDGanttMinimizeSplitter::doResize() { - QRect r = contentsRect(); + TQRect r = contentsRect(); int i; int n = data->list.count(); - QMemArray<QLayoutStruct> a( n ); + TQMemArray<TQLayoutStruct> a( n ); for ( i = 0; i< n; i++ ) { a[i].init(); - QSplitterLayoutStruct *s = data->list.at(i); + TQSplitterLayoutStruct *s = data->list.at(i); if ( s->wid->isHidden() ) { a[i].stretch = 0; - a[i].sizeHint = a[i].minimumSize = 0; - a[i].maximumSize = 0; + a[i].tqsizeHint = a[i].tqminimumSize = 0; + a[i].tqmaximumSize = 0; } else if ( s->isSplitter ) { a[i].stretch = 0; - a[i].sizeHint = a[i].minimumSize = a[i].maximumSize = s->sizer; + a[i].tqsizeHint = a[i].tqminimumSize = a[i].tqmaximumSize = s->sizer; a[i].empty = FALSE; } else if ( s->mode == KeepSize ) { a[i].stretch = 0; - a[i].minimumSize = pick( minSize(s->wid) ); - a[i].sizeHint = s->sizer; - a[i].maximumSize = pick( s->wid->maximumSize() ); + a[i].tqminimumSize = pick( minSize(s->wid) ); + a[i].tqsizeHint = s->sizer; + a[i].tqmaximumSize = pick( s->wid->tqmaximumSize() ); a[i].empty = FALSE; } else if ( s->mode == FollowSizeHint ) { a[i].stretch = 0; - a[i].minimumSize = a[i].sizeHint = pick( s->wid->sizeHint() ); - a[i].maximumSize = pick( s->wid->maximumSize() ); + a[i].tqminimumSize = a[i].tqsizeHint = pick( s->wid->tqsizeHint() ); + a[i].tqmaximumSize = pick( s->wid->tqmaximumSize() ); a[i].empty = FALSE; } else { //proportional a[i].stretch = s->sizer; - a[i].maximumSize = pick( s->wid->maximumSize() ); - a[i].sizeHint = a[i].minimumSize = pick( minSize(s->wid) ); + a[i].tqmaximumSize = pick( s->wid->tqmaximumSize() ); + a[i].tqsizeHint = a[i].tqminimumSize = pick( minSize(s->wid) ); a[i].empty = FALSE; } } @@ -928,7 +908,7 @@ void KDGanttMinimizeSplitter::doResize() kdganttGeomCalc( a, 0, n, pick( r.topLeft() ), pick( r.size() ), 0 ); for ( i = 0; i< n; i++ ) { - QSplitterLayoutStruct *s = data->list.at(i); + TQSplitterLayoutStruct *s = data->list.at(i); setG( s->wid, a[i].pos, a[i].size ); } @@ -940,7 +920,7 @@ void KDGanttMinimizeSplitter::recalc( bool update ) int fi = 2*frameWidth(); int maxl = fi; int minl = fi; - int maxt = QWIDGETSIZE_MAX; + int maxt = TQWIDGETSIZE_MAX; int mint = fi; int n = data->list.count(); bool first = TRUE; @@ -950,9 +930,9 @@ void KDGanttMinimizeSplitter::recalc( bool update ) The splitter before any other visible widget is visible. */ for ( int i = 0; i< n; i++ ) { - QSplitterLayoutStruct *s = data->list.at(i); + TQSplitterLayoutStruct *s = data->list.at(i); if ( !s->isSplitter ) { - QSplitterLayoutStruct *p = (i > 0) ? data->list.at( i-1 ) : 0; + TQSplitterLayoutStruct *p = (i > 0) ? data->list.at( i-1 ) : 0; if ( p && p->isSplitter ) if ( first || s->wid->isHidden() ) p->wid->hide(); //may trigger new recalc @@ -965,38 +945,38 @@ void KDGanttMinimizeSplitter::recalc( bool update ) bool empty=TRUE; for ( int j = 0; j< n; j++ ) { - QSplitterLayoutStruct *s = data->list.at(j); + TQSplitterLayoutStruct *s = data->list.at(j); if ( !s->wid->isHidden() ) { empty = FALSE; if ( s->isSplitter ) { minl += s->sizer; maxl += s->sizer; } else { - QSize minS = minSize(s->wid); + TQSize minS = minSize(s->wid); minl += pick( minS ); - maxl += pick( s->wid->maximumSize() ); - mint = QMAX( mint, trans( minS )); - int tm = trans( s->wid->maximumSize() ); + maxl += pick( s->wid->tqmaximumSize() ); + mint = TQMAX( mint, trans( minS )); + int tm = trans( s->wid->tqmaximumSize() ); if ( tm > 0 ) - maxt = QMIN( maxt, tm ); + maxt = TQMIN( maxt, tm ); } } } if ( empty ) { - if ( parentWidget() != 0 && parentWidget()->inherits("KDGanttMinimizeSplitter") ) { + if ( tqparentWidget() != 0 && tqparentWidget()->inherits("KDGanttMinimizeSplitter") ) { // nested splitters; be nice maxl = maxt = 0; } else { - // KDGanttMinimizeSplitter with no children yet - maxl = QWIDGETSIZE_MAX; + // KDGanttMinimizeSplitter with no tqchildren yet + maxl = TQWIDGETSIZE_MAX; } } else { - maxl = QMIN( maxl, QWIDGETSIZE_MAX ); + maxl = TQMIN( maxl, TQWIDGETSIZE_MAX ); } if ( maxt < mint ) maxt = mint; - if ( orient == Horizontal ) { + if ( orient ==Qt::Horizontal ) { setMaximumSize( maxl, maxt ); setMinimumSize( minl, mint ); } else { @@ -1013,10 +993,10 @@ void KDGanttMinimizeSplitter::recalc( bool update ) \sa ResizeMode */ -void KDGanttMinimizeSplitter::setResizeMode( QWidget *w, ResizeMode mode ) +void KDGanttMinimizeSplitter::setResizeMode( TQWidget *w, ResizeMode mode ) { processChildEvents(); - QSplitterLayoutStruct *s = data->list.first(); + TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( s->wid == w ) { s->mode = mode; @@ -1059,15 +1039,15 @@ void KDGanttMinimizeSplitter::setOpaqueResize( bool on ) Moves widget \a w to the leftmost/top position. */ -void KDGanttMinimizeSplitter::moveToFirst( QWidget *w ) +void KDGanttMinimizeSplitter::moveToFirst( TQWidget *w ) { processChildEvents(); bool found = FALSE; - QSplitterLayoutStruct *s = data->list.first(); + TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( s->wid == w ) { found = TRUE; - QSplitterLayoutStruct *p = data->list.prev(); + TQSplitterLayoutStruct *p = data->list.prev(); if ( p ) { // not already at first place data->list.take(); //take p data->list.take(); // take s @@ -1088,16 +1068,16 @@ void KDGanttMinimizeSplitter::moveToFirst( QWidget *w ) Moves widget \a w to the rightmost/bottom position. */ -void KDGanttMinimizeSplitter::moveToLast( QWidget *w ) +void KDGanttMinimizeSplitter::moveToLast( TQWidget *w ) { processChildEvents(); bool found = FALSE; - QSplitterLayoutStruct *s = data->list.first(); + TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( s->wid == w ) { found = TRUE; data->list.take(); // take s - QSplitterLayoutStruct *p = data->list.current(); + TQSplitterLayoutStruct *p = data->list.current(); if ( p ) { // the splitter handle after s data->list.take(); //take p data->list.append( p ); @@ -1117,7 +1097,7 @@ void KDGanttMinimizeSplitter::recalcId() { int n = data->list.count(); for ( int i = 0; i < n; i++ ) { - QSplitterLayoutStruct *s = data->list.at(i); + TQSplitterLayoutStruct *s = data->list.at(i); if ( s->isSplitter ) ((KDGanttSplitterHandle*)s->wid)->setId(i); } @@ -1126,29 +1106,29 @@ void KDGanttMinimizeSplitter::recalcId() /*! Reimplemented from superclass. */ -QSize KDGanttMinimizeSplitter::sizeHint() const +TQSize KDGanttMinimizeSplitter::tqsizeHint() const { constPolish(); int l = 0; int t = 0; - if ( children() ) { - const QObjectList * c = children(); - QObjectListIt it( *c ); - QObject * o; + TQObjectList clo = childrenListObject(); + if ( !clo.isEmpty() ) { + TQObjectListIt it( clo ); + TQObject * o; while( (o=it.current()) != 0 ) { ++it; if ( o->isWidgetType() && - !((QWidget*)o)->isHidden() ) { - QSize s = ((QWidget*)o)->sizeHint(); + !((TQWidget*)o)->isHidden() ) { + TQSize s = ((TQWidget*)o)->tqsizeHint(); if ( s.isValid() ) { l += pick( s ); - t = QMAX( t, trans( s ) ); + t = TQMAX( t, trans( s ) ); } } } } - return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); + return orientation() ==Qt::Horizontal ? TQSize( l, t ) : TQSize( t, l ); } @@ -1156,29 +1136,29 @@ QSize KDGanttMinimizeSplitter::sizeHint() const \reimp */ -QSize KDGanttMinimizeSplitter::minimumSizeHint() const +TQSize KDGanttMinimizeSplitter::tqminimumSizeHint() const { constPolish(); int l = 0; int t = 0; - if ( children() ) { - const QObjectList * c = children(); - QObjectListIt it( *c ); - QObject * o; + TQObjectList clo = childrenListObject(); + if ( !clo.isEmpty() ) { + TQObjectListIt it( clo ); + TQObject * o; while( (o=it.current()) != 0 ) { ++it; if ( o->isWidgetType() && - !((QWidget*)o)->isHidden() ) { - QSize s = minSizeHint((QWidget*)o); + !((TQWidget*)o)->isHidden() ) { + TQSize s = minSizeHint((TQWidget*)o); if ( s.isValid() ) { l += pick( s ); - t = QMAX( t, trans( s ) ); + t = TQMAX( t, trans( s ) ); } } } } - return orientation() == Horizontal ? QSize( l, t ) : QSize( t, l ); + return orientation() ==Qt::Horizontal ? TQSize( l, t ) : TQSize( t, l ); } @@ -1188,7 +1168,7 @@ QSize KDGanttMinimizeSplitter::minimumSizeHint() const void KDGanttMinimizeSplitter::storeSizes() { - QSplitterLayoutStruct *s = data->list.first(); + TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( !s->isSplitter ) s->sizer = pick( s->wid->size() ); @@ -1203,17 +1183,17 @@ void KDGanttMinimizeSplitter::storeSizes() Hides \a w if \a hide is TRUE and updates the splitter. \warning Due to a limitation in the current implementation, - calling QWidget::hide() will not work. + calling TQWidget::hide() will not work. */ -void KDGanttMinimizeSplitter::setHidden( QWidget *w, bool hide ) +void KDGanttMinimizeSplitter::setHidden( TQWidget *w, bool hide ) { if ( w == w1 ) { w1show = !hide; } else if ( w == w2 ) { w2show = !hide; } else { -#ifdef QT_CHECK_RANGE +#ifdef TQT_CHECK_RANGE qWarning( "KDGanttMinimizeSplitter::setHidden(), unknown widget" ); #endif return; @@ -1230,13 +1210,13 @@ void KDGanttMinimizeSplitter::setHidden( QWidget *w, bool hide ) Returns the hidden status of \a w */ -bool KDGanttMinimizeSplitter::isHidden( QWidget *w ) const +bool KDGanttMinimizeSplitter::isHidden( TQWidget *w ) const { if ( w == w1 ) return !w1show; else if ( w == w2 ) return !w2show; -#ifdef QT_CHECK_RANGE +#ifdef TQT_CHECK_RANGE else qWarning( "KDGanttMinimizeSplitter::isHidden(), unknown widget" ); #endif @@ -1250,13 +1230,13 @@ bool KDGanttMinimizeSplitter::isHidden( QWidget *w ) const splitter. Giving the values to another splitter's setSizes() function will - produce a splitter with the same layout as this one. + produce a splitter with the same tqlayout as this one. Note that if you want to iterate over the list, you should iterate over a copy, e.g. \code - QValueList<int> list = mySplitter.sizes(); - QValueList<int>::Iterator it = list.begin(); + TQValueList<int> list = mySplitter.sizes(); + TQValueList<int>::Iterator it = list.begin(); while( it != list.end() ) { myProcessing( *it ); ++it; @@ -1266,14 +1246,14 @@ bool KDGanttMinimizeSplitter::isHidden( QWidget *w ) const \sa setSizes() */ -QValueList<int> KDGanttMinimizeSplitter::sizes() const +TQValueList<int> KDGanttMinimizeSplitter::sizes() const { if ( !testWState(WState_Polished) ) { - QWidget* that = (QWidget*) this; + TQWidget* that = (TQWidget*) this; that->polish(); } - QValueList<int> list; - QSplitterLayoutStruct *s = data->list.first(); + TQValueList<int> list; + TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( !s->isSplitter ) list.append( s->sizer ); @@ -1297,11 +1277,11 @@ QValueList<int> KDGanttMinimizeSplitter::sizes() const \sa sizes() */ -void KDGanttMinimizeSplitter::setSizes( QValueList<int> list ) +void KDGanttMinimizeSplitter::setSizes( TQValueList<int> list ) { processChildEvents(); - QValueList<int>::Iterator it = list.begin(); - QSplitterLayoutStruct *s = data->list.first(); + TQValueList<int>::Iterator it = list.begin(); + TQSplitterLayoutStruct *s = data->list.first(); while ( s && it != list.end() ) { if ( !s->isSplitter ) { s->sizer = *it; @@ -1320,7 +1300,7 @@ void KDGanttMinimizeSplitter::setSizes( QValueList<int> list ) void KDGanttMinimizeSplitter::processChildEvents() { - QApplication::sendPostedEvents( this, QEvent::ChildInserted ); + TQApplication::sendPostedEvents( this, TQEvent::ChildInserted ); } @@ -1328,21 +1308,19 @@ void KDGanttMinimizeSplitter::processChildEvents() Reimplemented from superclass. */ -void KDGanttMinimizeSplitter::styleChange( QStyle& old ) +void KDGanttMinimizeSplitter::styleChange( TQStyle& old ) { - int sw = style().pixelMetric(QStyle::PM_SplitterWidth, this); - QSplitterLayoutStruct *s = data->list.first(); + int sw = tqstyle().tqpixelMetric(TQStyle::PM_SplitterWidth, this); + TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( s->isSplitter ) s->sizer = sw; s = data->list.next(); } doResize(); - QFrame::styleChange( old ); + TQFrame::styleChange( old ); } -#endif - /*! Specifies the direction of the minimize buttons. If the orientation of the splitter is horizontal then with @@ -1364,14 +1342,14 @@ KDGanttMinimizeSplitter::Direction KDGanttMinimizeSplitter::minimizeDirection() } /* - This is a copy of qGeomCalc() in qlayoutengine.cpp which + This is a copy of qGeomCalc() in qtqlayoutengine.cpp which unfortunately isn't exported. */ static inline int toFixed( int i ) { return i * 256; } static inline int fRound( int i ) { return ( i % 256 < 128 ) ? i / 256 : 1 + i / 256; } -void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int pos, +void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, int pos, int space, int spacer ) { typedef int fixed; @@ -1387,9 +1365,9 @@ void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int int i; for ( i = start; i < start + count; i++ ) { chain[i].done = FALSE; - cHint += chain[i].sizeHint; - cMin += chain[i].minimumSize; - cMax += chain[i].maximumSize; + cHint += chain[i].tqsizeHint; + cMin += chain[i].tqminimumSize; + cMax += chain[i].tqmaximumSize; sumStretch += chain[i].stretch; if ( !chain[i].empty ) spacerCount++; @@ -1402,22 +1380,22 @@ void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int if ( space < cMin + spacerCount * spacer ) { // qDebug("not enough space"); for ( i = start; i < start+count; i++ ) { - chain[i].size = chain[i].minimumSize; + chain[i].size = chain[i].tqminimumSize; chain[i].done = TRUE; } } else if ( space < cHint + spacerCount*spacer ) { - // Less space than sizeHint, but more than minimum. - // Currently take space equally from each, like in Qt 2.x. + // Less space than tqsizeHint, but more than minimum. + // Currently take space equally from each, like in TQt 2.x. // Commented-out lines will give more space to stretchier items. int n = count; int space_left = space - spacerCount*spacer; int overdraft = cHint - space_left; //first give to the fixed ones: for ( i = start; i < start+count; i++ ) { - if ( !chain[i].done && chain[i].minimumSize >= chain[i].sizeHint) { - chain[i].size = chain[i].sizeHint; + if ( !chain[i].done && chain[i].tqminimumSize >= chain[i].tqsizeHint) { + chain[i].size = chain[i].tqsizeHint; chain[i].done = TRUE; - space_left -= chain[i].sizeHint; + space_left -= chain[i].tqsizeHint; // sumStretch -= chain[i].stretch; n--; } @@ -1436,13 +1414,13 @@ void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int // else // fp_w += (fp_over * chain[i].stretch) / sumStretch; int w = fRound( fp_w ); - chain[i].size = chain[i].sizeHint - w; + chain[i].size = chain[i].tqsizeHint - w; fp_w -= toFixed( w ); //give the difference to the next - if ( chain[i].size < chain[i].minimumSize ) { + if ( chain[i].size < chain[i].tqminimumSize ) { chain[i].done = TRUE; - chain[i].size = chain[i].minimumSize; + chain[i].size = chain[i].tqminimumSize; finished = FALSE; - overdraft -= chain[i].sizeHint - chain[i].minimumSize; + overdraft -= chain[i].tqsizeHint - chain[i].tqminimumSize; // sumStretch -= chain[i].stretch; n--; break; @@ -1454,11 +1432,11 @@ void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int int space_left = space - spacerCount*spacer; // first give to the fixed ones, and handle non-expansiveness for ( i = start; i < start + count; i++ ) { - if ( !chain[i].done && (chain[i].maximumSize <= chain[i].sizeHint + if ( !chain[i].done && (chain[i].tqmaximumSize <= chain[i].tqsizeHint || wannaGrow && !chain[i].expansive) ) { - chain[i].size = chain[i].sizeHint; + chain[i].size = chain[i].tqsizeHint; chain[i].done = TRUE; - space_left -= chain[i].sizeHint; + space_left -= chain[i].tqsizeHint; sumStretch -= chain[i].stretch; n--; } @@ -1490,20 +1468,20 @@ void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int int w = fRound( fp_w ); chain[i].size = w; fp_w -= toFixed( w ); // give the difference to the next - if ( w < chain[i].sizeHint ) { - deficit += chain[i].sizeHint - w; - } else if ( w > chain[i].maximumSize ) { - surplus += w - chain[i].maximumSize; + if ( w < chain[i].tqsizeHint ) { + deficit += chain[i].tqsizeHint - w; + } else if ( w > chain[i].tqmaximumSize ) { + surplus += w - chain[i].tqmaximumSize; } } if ( deficit > 0 && surplus <= deficit ) { // give to the ones that have too little for ( i = start; i < start+count; i++ ) { if ( !chain[i].done && - chain[i].size < chain[i].sizeHint ) { - chain[i].size = chain[i].sizeHint; + chain[i].size < chain[i].tqsizeHint ) { + chain[i].size = chain[i].tqsizeHint; chain[i].done = TRUE; - space_left -= chain[i].sizeHint; + space_left -= chain[i].tqsizeHint; sumStretch -= chain[i].stretch; n--; } @@ -1513,10 +1491,10 @@ void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int // take from the ones that have too much for ( i = start; i < start+count; i++ ) { if ( !chain[i].done && - chain[i].size > chain[i].maximumSize ) { - chain[i].size = chain[i].maximumSize; + chain[i].size > chain[i].tqmaximumSize ) { + chain[i].size = chain[i].tqmaximumSize; chain[i].done = TRUE; - space_left -= chain[i].maximumSize; + space_left -= chain[i].tqmaximumSize; sumStretch -= chain[i].stretch; n--; } @@ -1554,7 +1532,7 @@ void kdganttGeomCalc( QMemArray<QLayoutStruct> &chain, int start, int count, int */ /*! - \fn Orientation KDGanttMinimizeSplitter::orientation() const + \fn Qt::Orientation KDGanttMinimizeSplitter::orientation() const Returns the orientation of the splitter. */ |