diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-14 20:16:30 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-14 20:16:30 +0000 |
commit | 1c93fca14d9ce37499bcfdf994c660186a0b6f17 (patch) | |
tree | f2defe163a805a9e34a2142dfde4cdb5e49241e7 /kdgantt/KDGanttMinimizeSplitter.cpp | |
parent | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (diff) | |
download | tdepim-1c93fca14d9ce37499bcfdf994c660186a0b6f17.tar.gz tdepim-1c93fca14d9ce37499bcfdf994c660186a0b6f17.zip |
Enable kdepim compilation under Qt4
This will likely break Qt3 compilation temporarily, which is an unintended side effect.
A third and final kdepim commit will repair Qt3 compilation shortly.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227946 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdgantt/KDGanttMinimizeSplitter.cpp')
-rw-r--r-- | kdgantt/KDGanttMinimizeSplitter.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/kdgantt/KDGanttMinimizeSplitter.cpp b/kdgantt/KDGanttMinimizeSplitter.cpp index da6744c89..35c3eb0fb 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. ** @@ -73,7 +73,7 @@ void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) { orient = o; #ifndef TQT_NO_CURSOR - if ( o == KDGanttMinimizeSplitter::Horizontal ) + if ( o == Qt::Horizontal ) setCursor( splitHCursor ); else setCursor( splitVCursor ); @@ -84,7 +84,7 @@ void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) void KDGanttSplitterHandle::mouseMoveEvent( TQMouseEvent *e ) { updateCursor( e->pos() ); - if ( !(e->state()&LeftButton) ) + if ( !(e->state()&Qt::LeftButton) ) return; if ( _activeButton != 0) @@ -104,7 +104,7 @@ void KDGanttSplitterHandle::mouseMoveEvent( TQMouseEvent *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) @@ -119,7 +119,7 @@ void KDGanttSplitterHandle::updateCursor( const TQPoint& p) setCursor( arrowCursor ); } else { - if ( orient == KDGanttMinimizeSplitter::Horizontal ) + if ( orient == Qt::Horizontal ) setCursor( splitHCursor ); else setCursor( splitVCursor ); @@ -158,7 +158,7 @@ void KDGanttSplitterHandle::mouseReleaseEvent( TQMouseEvent *e ) updateCursor( e->pos() ); } else { - if ( !opaque() && e->button() == LeftButton ) { + if ( !opaque() && e->button() == Qt::LeftButton ) { TQCOORD pos = s->pick(tqparentWidget()->mapFromGlobal(e->globalPos())) - mouseOffset; s->setRubberband( -1 ); @@ -241,7 +241,7 @@ void KDGanttSplitterHandle::paintEvent( TQPaintEvent * ) p.setBrush( tqcolorGroup().background() ); p.setPen( tqcolorGroup().foreground() ); p.drawRect( rect() ); - tqparentWidget()->style().drawPrimitive( TQStyle::PE_Panel, &p, rect(), + 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 @@ -256,13 +256,13 @@ void KDGanttSplitterHandle::paintEvent( TQPaintEvent * ) for ( TQValueList<TQPointArray>::Iterator it = list.begin(); it != list.end(); ++it ) { if ( index == _activeButton ) { p.save(); - p.translate( tqparentWidget()->style().tqpixelMetric( TQStyle::PM_ButtonShiftHorizontal ), - tqparentWidget()->style().tqpixelMetric( TQStyle::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++; } @@ -302,7 +302,7 @@ public: bool firstShow; }; -void kdganttGeomCalc( TQMemArray<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 @@ -384,7 +384,7 @@ static TQSize minSizeHint( const TQWidget* w ) KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( TQWidget *tqparent, const char *name ) :TQFrame(tqparent,name,WPaintUnclipped) { - orient = Horizontal; + orient = Qt::Horizontal; init(); } @@ -412,7 +412,7 @@ KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() void KDGanttMinimizeSplitter::init() { data = new TQSplitterData; - if ( orient == Horizontal ) + if ( orient == Qt::Horizontal ) tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Minimum) ); else tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Expanding) ); @@ -424,7 +424,7 @@ 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 TQt:Vertical and TQt::Horizontal (the default). + The possible orientations are TQt:Vertical and Qt::Horizontal (the default). */ void KDGanttMinimizeSplitter::setOrientation( Qt::Orientation o ) { @@ -432,7 +432,7 @@ void KDGanttMinimizeSplitter::setOrientation( Qt::Orientation o ) return; orient = o; - if ( orient == Horizontal ) + if ( orient == Qt::Horizontal ) tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Minimum ) ); else tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); @@ -561,8 +561,8 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) paint.setRasterOp( XorROP ); TQRect r = contentsRect(); const int rBord = 3; //Themable???? - int sw = style().tqpixelMetric(TQStyle::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,8 +601,8 @@ bool KDGanttMinimizeSplitter::event( TQEvent *e ) void KDGanttMinimizeSplitter::drawSplitter( TQPainter *p, TQCOORD x, TQCOORD y, TQCOORD w, TQCOORD h ) { - style().drawPrimitive(TQStyle::PE_Splitter, p, TQRect(x, y, w, h), tqcolorGroup(), - (orientation() == TQt::Horizontal ? + tqstyle().tqdrawPrimitive(TQStyle::PE_Splitter, p, TQRect(x, y, w, h), tqcolorGroup(), + (orientation() == Qt::Horizontal ? TQStyle::Style_Horizontal : 0)); } @@ -644,9 +644,9 @@ void KDGanttMinimizeSplitter::moveSplitter( TQCOORD p, int id ) p = adjustPos( p, id ); TQSplitterLayoutStruct *s = data->list.at(id); - int oldP = orient == Horizontal ? s->wid->x() : s->wid->y(); + int oldP = orient == Qt::Horizontal ? s->wid->x() : s->wid->y(); bool upLeft; - if ( TQApplication::reverseLayout() && orient == Horizontal ) { + if ( TQApplication::reverseLayout() && orient == Qt::Horizontal ) { p += s->wid->width(); upLeft = p > oldP; } else @@ -661,8 +661,8 @@ void KDGanttMinimizeSplitter::moveSplitter( TQCOORD p, int id ) void KDGanttMinimizeSplitter::setG( TQWidget *w, int p, int s, bool isSplitter ) { - if ( orient == Horizontal ) { - if ( TQApplication::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 @@ -688,7 +688,7 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) } else if ( s->isSplitter ) { int pos1, pos2; int dd = s->sizer; - if( TQApplication::reverseLayout() && orient == Horizontal ) { + if( TQApplication::reverseLayout() && orient == Qt::Horizontal ) { pos1 = pos; pos2 = pos + dd; } else { @@ -704,7 +704,7 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) } } else { int dd, newLeft, nextPos; - if( TQApplication::reverseLayout() && orient == Horizontal ) { + if( TQApplication::reverseLayout() && orient == Qt::Horizontal ) { dd = w->tqgeometry().right() - pos; dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize()))); newLeft = pos+1; @@ -741,7 +741,7 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) } else if ( s->isSplitter ) { int dd = s->sizer; int pos1, pos2; - if( TQApplication::reverseLayout() && orient == Horizontal ) { + if( TQApplication::reverseLayout() && orient == Qt::Horizontal ) { pos2 = pos - dd; pos1 = pos2 + 1; } else { @@ -758,7 +758,7 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) } else { int left = pick( w->pos() ); int right, dd,/* newRight,*/ newLeft, nextPos; - if ( TQApplication::reverseLayout() && orient == Horizontal ) { + if ( TQApplication::reverseLayout() && orient == Qt::Horizontal ) { dd = pos - left + 1; dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize()))); newLeft = pos-dd+1; @@ -836,8 +836,8 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) } } TQRect r = contentsRect(); - if ( orient == Horizontal && TQApplication::reverseLayout() ) { - int splitterWidth = style().tqpixelMetric(TQStyle::PM_SplitterWidth, this); + if ( orient == Qt::Horizontal && TQApplication::reverseLayout() ) { + int splitterWidth = tqstyle().tqpixelMetric(TQStyle::PM_SplitterWidth, this); if ( min ) *min = pick(r.topRight()) - TQMIN( maxB, pick(r.size())-minA ) - splitterWidth; if ( max ) @@ -873,7 +873,7 @@ void KDGanttMinimizeSplitter::doResize() TQRect r = contentsRect(); int i; int n = data->list.count(); - TQMemArray<QLayoutStruct> a( n ); + TQMemArray<TQLayoutStruct> a( n ); for ( i = 0; i< n; i++ ) { a[i].init(); TQSplitterLayoutStruct *s = data->list.at(i); @@ -975,7 +975,7 @@ void KDGanttMinimizeSplitter::recalc( bool update ) if ( maxt < mint ) maxt = mint; - if ( orient == Horizontal ) { + if ( orient == Qt::Horizontal ) { setMaximumSize( maxl, maxt ); setMinimumSize( minl, mint ); } else { @@ -1110,9 +1110,9 @@ TQSize KDGanttMinimizeSplitter::tqsizeHint() const constPolish(); int l = 0; int t = 0; - if ( tqchildren() ) { - const TQObjectList * c = tqchildren(); - TQObjectListIt it( *c ); + if ( !childrenListObject().isEmpty() ) { + const TQObjectList c = childrenListObject(); + TQObjectListIt it( c ); TQObject * o; while( (o=it.current()) != 0 ) { @@ -1127,7 +1127,7 @@ TQSize KDGanttMinimizeSplitter::tqsizeHint() const } } } - return orientation() == Horizontal ? TQSize( l, t ) : TQSize( t, l ); + return orientation() == Qt::Horizontal ? TQSize( l, t ) : TQSize( t, l ); } @@ -1140,9 +1140,9 @@ TQSize KDGanttMinimizeSplitter::tqminimumSizeHint() const constPolish(); int l = 0; int t = 0; - if ( tqchildren() ) { - const TQObjectList * c = tqchildren(); - TQObjectListIt it( *c ); + if ( !childrenListObject().isEmpty() ) { + const TQObjectList c = childrenListObject(); + TQObjectListIt it( c ); TQObject * o; while( (o=it.current()) != 0 ) { @@ -1157,7 +1157,7 @@ TQSize KDGanttMinimizeSplitter::tqminimumSizeHint() const } } } - return orientation() == Horizontal ? TQSize( l, t ) : TQSize( t, l ); + return orientation() == Qt::Horizontal ? TQSize( l, t ) : TQSize( t, l ); } @@ -1309,7 +1309,7 @@ void KDGanttMinimizeSplitter::processChildEvents() void KDGanttMinimizeSplitter::styleChange( TQStyle& old ) { - int sw = style().tqpixelMetric(TQStyle::PM_SplitterWidth, this); + int sw = tqstyle().tqpixelMetric(TQStyle::PM_SplitterWidth, this); TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( s->isSplitter ) @@ -1348,7 +1348,7 @@ 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( TQMemArray<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; |