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 bf70e678..1f772e69 100644 --- a/kdgantt/KDGanttMinimizeSplitter.cpp +++ b/kdgantt/KDGanttMinimizeSplitter.cpp @@ -57,7 +57,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 ) { @@ -71,11 +71,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 ); @@ -86,7 +86,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) @@ -106,7 +106,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) @@ -121,7 +121,7 @@ void KDGanttSplitterHandle::updateCursor( const TQPoint& p) setCursor( arrowCursor ); } else { - if ( orient == Qt::Horizontal ) + if ( orient == TQt::Horizontal ) setCursor( splitHCursor ); else setCursor( splitVCursor ); @@ -160,7 +160,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 ); @@ -386,7 +386,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(); } @@ -394,7 +394,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; @@ -414,7 +414,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) ); @@ -426,15 +426,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 Qt::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 ) ); @@ -564,7 +564,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() ); @@ -604,7 +604,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)); } @@ -646,9 +646,9 @@ void KDGanttMinimizeSplitter::moveSplitter( TQCOORD p, int id ) p = adjustPos( p, id ); KDGanttSplitterLayoutStruct *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 @@ -663,8 +663,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 @@ -690,7 +690,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 { @@ -706,7 +706,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; @@ -743,7 +743,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 { @@ -760,7 +760,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; @@ -838,7 +838,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; @@ -977,7 +977,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 { @@ -1129,7 +1129,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 ); } @@ -1159,7 +1159,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 ); } @@ -1533,7 +1533,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. */ |