diff options
Diffstat (limited to 'kdgantt/KDGanttMinimizeSplitter.cpp')
-rw-r--r-- | kdgantt/KDGanttMinimizeSplitter.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/kdgantt/KDGanttMinimizeSplitter.cpp b/kdgantt/KDGanttMinimizeSplitter.cpp index ef40a626e..22eace451 100644 --- a/kdgantt/KDGanttMinimizeSplitter.cpp +++ b/kdgantt/KDGanttMinimizeSplitter.cpp @@ -55,7 +55,7 @@ static int mouseOffset; static int opaqueOldPos = -1; //### there's only one mouse, but this is a bit risky -KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, +KDGanttSplitterHandle::KDGanttSplitterHandle( TQt::Orientation o, KDGanttMinimizeSplitter *parent, const char * name ) : TQWidget( parent, name ), _activeButton( 0 ), _collapsed( false ) { @@ -69,11 +69,11 @@ TQSize KDGanttSplitterHandle::sizeHint() const return TQSize(8,8); } -void KDGanttSplitterHandle::setOrientation( Qt::Orientation o ) +void KDGanttSplitterHandle::setOrientation( TQt::Orientation o ) { orient = o; #ifndef TQT_NO_CURSOR - if ( o == Qt::Horizontal ) + if ( o == TQt::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()&Qt::LeftButton) ) + if ( !(e->state()&TQt::LeftButton) ) return; if ( _activeButton != 0) @@ -104,7 +104,7 @@ void KDGanttSplitterHandle::mouseMoveEvent( TQMouseEvent *e ) void KDGanttSplitterHandle::mousePressEvent( TQMouseEvent *e ) { - if ( e->button() == Qt::LeftButton ) { + if ( e->button() == TQt::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 == Qt::Horizontal ) + if ( orient == TQt::Horizontal ) setCursor( splitHCursor ); else setCursor( splitVCursor ); @@ -158,7 +158,7 @@ void KDGanttSplitterHandle::mouseReleaseEvent( TQMouseEvent *e ) updateCursor( e->pos() ); } else { - if ( !opaque() && e->button() == Qt::LeftButton ) { + if ( !opaque() && e->button() == TQt::LeftButton ) { TQCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos())) - mouseOffset; s->setRubberband( -1 ); @@ -384,7 +384,7 @@ static TQSize minSizeHint( const TQWidget* w ) KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( TQWidget *parent, const char *name ) :TQFrame(parent,name,WPaintUnclipped) { - orient = Qt::Horizontal; + orient = TQt::Horizontal; init(); } @@ -392,7 +392,7 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( TQWidget *parent, const char * Constructs a splitter with orientation \a o with the \a parent and \a name arguments being passed on to the TQFrame constructor. */ -KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Qt::Orientation o, TQWidget *parent, const char *name ) +KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( TQt::Orientation o, TQWidget *parent, const char *name ) :TQFrame(parent,name,WPaintUnclipped) { orient = o; @@ -412,7 +412,7 @@ KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() void KDGanttMinimizeSplitter::init() { data = new TQSplitterData; - if ( orient == Qt::Horizontal ) + if ( orient == TQt::Horizontal ) setSizePolicy( TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Minimum) ); else setSizePolicy( TQSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Expanding) ); @@ -424,15 +424,15 @@ 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 Qt::Horizontal (the default). + The possible orientations are TQt:Vertical and TQt::Horizontal (the default). */ -void KDGanttMinimizeSplitter::setOrientation( Qt::Orientation o ) +void KDGanttMinimizeSplitter::setOrientation( TQt::Orientation o ) { if ( orient == o ) return; orient = o; - if ( orient == Qt::Horizontal ) + if ( orient == TQt::Horizontal ) setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Minimum ) ); else setSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); @@ -562,7 +562,7 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) TQRect r = contentsRect(); const int rBord = 3; //Themable???? int sw = style().pixelMetric(TQStyle::PM_SplitterWidth, this); - if ( orient == Qt::Horizontal ) { + if ( orient == TQt::Horizontal ) { if ( opaqueOldPos >= 0 ) paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(), 2*rBord, r.height() ); @@ -602,7 +602,7 @@ void KDGanttMinimizeSplitter::drawSplitter( TQPainter *p, TQCOORD x, TQCOORD y, TQCOORD w, TQCOORD h ) { style().tqdrawPrimitive(TQStyle::PE_Splitter, p, TQRect(x, y, w, h), colorGroup(), - (orientation() == Qt::Horizontal ? + (orientation() == TQt::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 == Qt::Horizontal ? s->wid->x() : s->wid->y(); + int oldP = orient == TQt::Horizontal ? s->wid->x() : s->wid->y(); bool upLeft; - if ( TQApplication::reverseLayout() && orient == Qt::Horizontal ) { + if ( TQApplication::reverseLayout() && orient == TQt::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 == Qt::Horizontal ) { - if ( TQApplication::reverseLayout() && orient == Qt::Horizontal && !isSplitter ) + if ( orient == TQt::Horizontal ) { + if ( TQApplication::reverseLayout() && orient == TQt::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 == Qt::Horizontal ) { + if( TQApplication::reverseLayout() && orient == TQt::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 == Qt::Horizontal ) { + if( TQApplication::reverseLayout() && orient == TQt::Horizontal ) { dd = w->geometry().right() - pos; dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->maximumSize()))); 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 == Qt::Horizontal ) { + if( TQApplication::reverseLayout() && orient == TQt::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 == Qt::Horizontal ) { + if ( TQApplication::reverseLayout() && orient == TQt::Horizontal ) { dd = pos - left + 1; dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->maximumSize()))); newLeft = pos-dd+1; @@ -836,7 +836,7 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) } } TQRect r = contentsRect(); - if ( orient == Qt::Horizontal && TQApplication::reverseLayout() ) { + if ( orient == TQt::Horizontal && TQApplication::reverseLayout() ) { int splitterWidth = style().pixelMetric(TQStyle::PM_SplitterWidth, this); if ( min ) *min = pick(r.topRight()) - TQMIN( maxB, pick(r.size())-minA ) - splitterWidth; @@ -975,7 +975,7 @@ void KDGanttMinimizeSplitter::recalc( bool update ) if ( maxt < mint ) maxt = mint; - if ( orient == Qt::Horizontal ) { + if ( orient == TQt::Horizontal ) { setMaximumSize( maxl, maxt ); setMinimumSize( minl, mint ); } else { @@ -1127,7 +1127,7 @@ TQSize KDGanttMinimizeSplitter::sizeHint() const } } } - return orientation() == Qt::Horizontal ? TQSize( l, t ) : TQSize( t, l ); + return orientation() == TQt::Horizontal ? TQSize( l, t ) : TQSize( t, l ); } @@ -1157,7 +1157,7 @@ TQSize KDGanttMinimizeSplitter::minimumSizeHint() const } } } - return orientation() == Qt::Horizontal ? TQSize( l, t ) : TQSize( t, l ); + return orientation() == TQt::Horizontal ? TQSize( l, t ) : TQSize( t, l ); } @@ -1531,7 +1531,7 @@ void kdganttGeomCalc( TQMemArray<TQLayoutStruct> &chain, int start, int count, i */ /*! - \fn Qt::Orientation KDGanttMinimizeSplitter::orientation() const + \fn TQt::Orientation KDGanttMinimizeSplitter::orientation() const Returns the orientation of the splitter. */ |