From 3ca10fd9a2dc631429d3b5d5c5e42a7d211d5a12 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 15 Dec 2011 15:50:21 -0600 Subject: Rename a number of old tq methods that are no longer tq specific --- kdgantt/KDGanttMinimizeSplitter.cpp | 164 ++++++++++++++-------------- kdgantt/KDGanttMinimizeSplitter.h | 6 +- kdgantt/KDGanttSemiSizingControl.cpp | 32 +++--- kdgantt/KDGanttSemiSizingControl.h | 4 +- kdgantt/KDGanttView.cpp | 206 +++++++++++++++++------------------ kdgantt/KDGanttView.h | 12 +- kdgantt/KDGanttViewItem.cpp | 168 ++++++++++++++-------------- kdgantt/KDGanttViewItem.h | 6 +- kdgantt/KDGanttViewItemDrag.cpp | 6 +- kdgantt/KDGanttViewItemDrag.h | 2 +- kdgantt/KDGanttViewSubwidgets.cpp | 62 +++++------ kdgantt/KDGanttViewSubwidgets.h | 8 +- kdgantt/KDGanttViewTaskItem.cpp | 2 +- kdgantt/KDGanttXMLTools.cpp | 2 +- kdgantt/Makefile.am | 2 +- kdgantt/itemAttributeDialog.ui | 6 +- kdgantt/itemAttributeDialog.ui.h | 22 ++-- kdgantt/qlayoutengine_p.h | 14 +-- 18 files changed, 362 insertions(+), 362 deletions(-) (limited to 'kdgantt') diff --git a/kdgantt/KDGanttMinimizeSplitter.cpp b/kdgantt/KDGanttMinimizeSplitter.cpp index f11832f37..1e9a9783c 100644 --- a/kdgantt/KDGanttMinimizeSplitter.cpp +++ b/kdgantt/KDGanttMinimizeSplitter.cpp @@ -39,8 +39,8 @@ #include "tqbitmap.h" #include "tqptrlist.h" #include "tqmemarray.h" -#include "tqlayout.h" -#include "tqlayoutengine_p.h" +#include "layout.h" +#include "layoutengine_p.h" #include "tqobjectlist.h" #include "tqstyle.h" #include "tqapplication.h" //sendPostedEvents @@ -64,7 +64,7 @@ KDGanttSplitterHandle::KDGanttSplitterHandle( Qt::Orientation o, setMouseTracking( true ); } -TQSize KDGanttSplitterHandle::tqsizeHint() const +TQSize KDGanttSplitterHandle::sizeHint() const { return TQSize(8,8); } @@ -108,7 +108,7 @@ void KDGanttSplitterHandle::mousePressEvent( TQMouseEvent *e ) _activeButton = onButton( e->pos() ); mouseOffset = s->pick(e->pos()); if ( _activeButton != 0) - tqrepaint(); + repaint(); updateCursor( e->pos() ); } } @@ -165,7 +165,7 @@ void KDGanttSplitterHandle::mouseReleaseEvent( TQMouseEvent *e ) s->moveSplitter( pos, id() ); } } - tqrepaint(); + repaint(); } int KDGanttSplitterHandle::onButton( const TQPoint& p ) @@ -238,16 +238,16 @@ void KDGanttSplitterHandle::paintEvent( TQPaintEvent * ) TQPainter p( &buffer ); // Draw the splitter rectangle - p.setBrush( tqcolorGroup().background() ); - p.setPen( tqcolorGroup().foreground() ); + p.setBrush( colorGroup().background() ); + p.setPen( colorGroup().foreground() ); p.drawRect( rect() ); parentWidget()->tqstyle().tqdrawPrimitive( TQStyle::PE_Panel, &p, rect(), - parentWidget()->tqcolorGroup()); + parentWidget()->colorGroup()); int sw = 8; // Hardcoded, given I didn't use styles anymore, I didn't like to use their size // arrow color - TQColor col = tqcolorGroup().background().dark( 200 ); + TQColor col = colorGroup().background().dark( 200 ); p.setBrush( col ); p.setPen( col ); @@ -256,13 +256,13 @@ void KDGanttSplitterHandle::paintEvent( TQPaintEvent * ) for ( TQValueList::Iterator it = list.begin(); it != list.end(); ++it ) { if ( index == _activeButton ) { p.save(); - p.translate( parentWidget()->tqstyle().tqpixelMetric( TQStyle::PM_ButtonShiftHorizontal ), - parentWidget()->tqstyle().tqpixelMetric( TQStyle::PM_ButtonShiftVertical ) ); - p.tqdrawPolygon( *it, true ); + p.translate( parentWidget()->tqstyle().pixelMetric( TQStyle::PM_ButtonShiftHorizontal ), + parentWidget()->tqstyle().pixelMetric( TQStyle::PM_ButtonShiftVertical ) ); + p.drawPolygon( *it, true ); p.restore(); } else { - p.tqdrawPolygon( *it, true ); + p.drawPolygon( *it, true ); } index++; } @@ -319,7 +319,7 @@ void kdganttGeomCalc( TQMemArray &chain, int start, int count, i 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 tqchildren. Any number of widgets + dragging the boundary between the children. Any number of widgets may be controlled. To show a TQListBox, a TQListView and a TQTextEdit side by side: @@ -332,14 +332,14 @@ void kdganttGeomCalc( TQMemArray &chain, int start, int count, i \endcode In KDGanttMinimizeSplitter, the boundary can be either horizontal or - vertical. The default is horizontal (the tqchildren are side by side) + vertical. The default is horizontal (the children 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 tqchildren only + Although KDGanttMinimizeSplitter normally resizes the children only at the end of a resize operation, if you call setOpaqueResize( TRUE ) the widgets are resized as often as possible. @@ -349,7 +349,7 @@ void kdganttGeomCalc( TQMemArray &chain, int start, int count, i sizes set by the user. If you hide() a child, its space will be distributed among the other - tqchildren. It will be reinstated when you show() it again. It is also + children. It will be reinstated when you show() it again. It is also possible to reorder the widgets within the splitter using moveToFirst() and moveToLast(). */ @@ -364,10 +364,10 @@ static TQSize minSize( const TQWidget* /*w*/ ) // This is the original version of minSize static TQSize minSizeHint( const TQWidget* w ) { - TQSize min = w->tqminimumSize(); + TQSize min = w->minimumSize(); TQSize s; if ( min.height() <= 0 || min.width() <= 0 ) - s = w->tqminimumSizeHint(); + s = w->minimumSizeHint(); if ( min.height() > 0 ) s.setHeight( min.height() ); if ( min.width() > 0 ) @@ -400,7 +400,7 @@ KDGanttMinimizeSplitter::KDGanttMinimizeSplitter( Qt::Orientation o, TQWidget *p } /*! - Destroys the splitter and any tqchildren. + Destroys the splitter and any children. */ KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter() { @@ -413,9 +413,9 @@ void KDGanttMinimizeSplitter::init() { data = new TQSplitterData; if ( orient == Qt::Horizontal ) - tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Minimum) ); + setSizePolicy( TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Minimum) ); else - tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Expanding) ); + setSizePolicy( TQSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Expanding) ); } @@ -433,9 +433,9 @@ void KDGanttMinimizeSplitter::setOrientation( Qt::Orientation o ) orient = o; if ( orient == Qt::Horizontal ) - tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Minimum ) ); + setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Minimum ) ); else - tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); + setSizePolicy( TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Expanding ) ); TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { @@ -478,7 +478,7 @@ TQSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bool fi s->wid = newHandle; newHandle->setId(data->list.count()); s->isSplitter = TRUE; - s->sizer = pick( newHandle->tqsizeHint() ); + s->sizer = pick( newHandle->sizeHint() ); if ( first ) data->list.insert( 0, s ); else @@ -487,8 +487,8 @@ TQSplitterLayoutStruct *KDGanttMinimizeSplitter::addWidget( TQWidget *w, bool fi s = new TQSplitterLayoutStruct; s->mode = Stretch; s->wid = w; - if ( !testWState( WState_Resized ) && w->tqsizeHint().isValid() ) - s->sizer = pick( w->tqsizeHint() ); + if ( !testWState( WState_Resized ) && w->sizeHint().isValid() ) + s->sizer = pick( w->sizeHint() ); else s->sizer = pick( w->size() ); s->isSplitter = FALSE; @@ -561,7 +561,7 @@ void KDGanttMinimizeSplitter::setRubberband( int p ) paint.setRasterOp( XorROP ); TQRect r = contentsRect(); const int rBord = 3; //Themable???? - int sw = tqstyle().tqpixelMetric(TQStyle::PM_SplitterWidth, this); + int sw = tqstyle().pixelMetric(TQStyle::PM_SplitterWidth, this); if ( orient == Qt::Horizontal ) { if ( opaqueOldPos >= 0 ) paint.drawRect( opaqueOldPos + sw/2 - rBord , r.y(), @@ -601,7 +601,7 @@ bool KDGanttMinimizeSplitter::event( TQEvent *e ) void KDGanttMinimizeSplitter::drawSplitter( TQPainter *p, TQCOORD x, TQCOORD y, TQCOORD w, TQCOORD h ) { - tqstyle().tqdrawPrimitive(TQStyle::PE_Splitter, p, TQRect(x, y, w, h), tqcolorGroup(), + tqstyle().tqdrawPrimitive(TQStyle::PE_Splitter, p, TQRect(x, y, w, h), colorGroup(), (orientation() == Qt::Horizontal ? TQStyle::Style_Horizontal : 0)); } @@ -632,7 +632,7 @@ int KDGanttMinimizeSplitter::idAfter( TQWidget* 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 tqlayout is reversed, and using this + For Arabic and Hebrew the layout 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. @@ -705,13 +705,13 @@ void KDGanttMinimizeSplitter::moveBefore( int pos, int id, bool upLeft ) } else { int dd, newLeft, nextPos; if( TQApplication::reverseLayout() && orient == Qt::Horizontal ) { - dd = w->tqgeometry().right() - pos; - dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize()))); + dd = w->geometry().right() - pos; + dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->maximumSize()))); newLeft = pos+1; nextPos = newLeft + dd; } else { dd = pos - pick( w->pos() ) + 1; - dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize()))); + dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->maximumSize()))); newLeft = pos-dd+1; nextPos = newLeft - 1; } @@ -760,13 +760,13 @@ void KDGanttMinimizeSplitter::moveAfter( int pos, int id, bool upLeft ) int right, dd,/* newRight,*/ newLeft, nextPos; if ( TQApplication::reverseLayout() && orient == Qt::Horizontal ) { dd = pos - left + 1; - dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize()))); + dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->maximumSize()))); newLeft = pos-dd+1; nextPos = newLeft - 1; } else { - right = pick( w->tqgeometry().bottomRight() ); + right = pick( w->geometry().bottomRight() ); dd = right - pos + 1; - dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->tqmaximumSize()))); + dd = TQMAX( pick(minSize(w)), TQMIN(dd, pick(w->maximumSize()))); /*newRight = pos+dd-1;*/ newLeft = pos; nextPos = newLeft + dd; @@ -820,7 +820,7 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) maxB += s->sizer; } else { minB += pick( minSize(s->wid) ); - maxB += pick( s->wid->tqmaximumSize() ); + maxB += pick( s->wid->maximumSize() ); } } for ( i = id; i < n; i++ ) { @@ -832,12 +832,12 @@ void KDGanttMinimizeSplitter::getRange( int id, int *min, int *max ) maxA += s->sizer; } else { minA += pick( minSize(s->wid) ); - maxA += pick( s->wid->tqmaximumSize() ); + maxA += pick( s->wid->maximumSize() ); } } TQRect r = contentsRect(); if ( orient == Qt::Horizontal && TQApplication::reverseLayout() ) { - int splitterWidth = tqstyle().tqpixelMetric(TQStyle::PM_SplitterWidth, this); + int splitterWidth = tqstyle().pixelMetric(TQStyle::PM_SplitterWidth, this); if ( min ) *min = pick(r.topRight()) - TQMIN( maxB, pick(r.size())-minA ) - splitterWidth; if ( max ) @@ -879,27 +879,27 @@ void KDGanttMinimizeSplitter::doResize() TQSplitterLayoutStruct *s = data->list.at(i); if ( s->wid->isHidden() ) { a[i].stretch = 0; - a[i].tqsizeHint = a[i].tqminimumSize = 0; - a[i].tqmaximumSize = 0; + a[i].sizeHint = a[i].minimumSize = 0; + a[i].maximumSize = 0; } else if ( s->isSplitter ) { a[i].stretch = 0; - a[i].tqsizeHint = a[i].tqminimumSize = a[i].tqmaximumSize = s->sizer; + a[i].sizeHint = a[i].minimumSize = a[i].maximumSize = s->sizer; a[i].empty = FALSE; } else if ( s->mode == KeepSize ) { a[i].stretch = 0; - a[i].tqminimumSize = pick( minSize(s->wid) ); - a[i].tqsizeHint = s->sizer; - a[i].tqmaximumSize = pick( s->wid->tqmaximumSize() ); + a[i].minimumSize = pick( minSize(s->wid) ); + a[i].sizeHint = s->sizer; + a[i].maximumSize = pick( s->wid->maximumSize() ); a[i].empty = FALSE; } else if ( s->mode == FollowSizeHint ) { a[i].stretch = 0; - a[i].tqminimumSize = a[i].tqsizeHint = pick( s->wid->tqsizeHint() ); - a[i].tqmaximumSize = pick( s->wid->tqmaximumSize() ); + a[i].minimumSize = a[i].sizeHint = pick( s->wid->sizeHint() ); + a[i].maximumSize = pick( s->wid->maximumSize() ); a[i].empty = FALSE; } else { //proportional a[i].stretch = s->sizer; - a[i].tqmaximumSize = pick( s->wid->tqmaximumSize() ); - a[i].tqsizeHint = a[i].tqminimumSize = pick( minSize(s->wid) ); + a[i].maximumSize = pick( s->wid->maximumSize() ); + a[i].sizeHint = a[i].minimumSize = pick( minSize(s->wid) ); a[i].empty = FALSE; } } @@ -953,9 +953,9 @@ void KDGanttMinimizeSplitter::recalc( bool update ) } else { TQSize minS = minSize(s->wid); minl += pick( minS ); - maxl += pick( s->wid->tqmaximumSize() ); + maxl += pick( s->wid->maximumSize() ); mint = TQMAX( mint, trans( minS )); - int tm = trans( s->wid->tqmaximumSize() ); + int tm = trans( s->wid->maximumSize() ); if ( tm > 0 ) maxt = TQMIN( maxt, tm ); } @@ -966,7 +966,7 @@ void KDGanttMinimizeSplitter::recalc( bool update ) // nested splitters; be nice maxl = maxt = 0; } else { - // KDGanttMinimizeSplitter with no tqchildren yet + // KDGanttMinimizeSplitter with no children yet maxl = TQWIDGETSIZE_MAX; } } else { @@ -1105,7 +1105,7 @@ void KDGanttMinimizeSplitter::recalcId() /*! Reimplemented from superclass. */ -TQSize KDGanttMinimizeSplitter::tqsizeHint() const +TQSize KDGanttMinimizeSplitter::sizeHint() const { constPolish(); int l = 0; @@ -1119,7 +1119,7 @@ TQSize KDGanttMinimizeSplitter::tqsizeHint() const ++it; if ( o->isWidgetType() && !((TQWidget*)o)->isHidden() ) { - TQSize s = ((TQWidget*)o)->tqsizeHint(); + TQSize s = ((TQWidget*)o)->sizeHint(); if ( s.isValid() ) { l += pick( s ); t = TQMAX( t, trans( s ) ); @@ -1135,7 +1135,7 @@ TQSize KDGanttMinimizeSplitter::tqsizeHint() const \reimp */ -TQSize KDGanttMinimizeSplitter::tqminimumSizeHint() const +TQSize KDGanttMinimizeSplitter::minimumSizeHint() const { constPolish(); int l = 0; @@ -1229,7 +1229,7 @@ bool KDGanttMinimizeSplitter::isHidden( TQWidget *w ) const splitter. Giving the values to another splitter's setSizes() function will - produce a splitter with the same tqlayout as this one. + produce a splitter with the same layout as this one. Note that if you want to iterate over the list, you should iterate over a copy, e.g. @@ -1309,7 +1309,7 @@ void KDGanttMinimizeSplitter::processChildEvents() void KDGanttMinimizeSplitter::styleChange( TQStyle& old ) { - int sw = tqstyle().tqpixelMetric(TQStyle::PM_SplitterWidth, this); + int sw = tqstyle().pixelMetric(TQStyle::PM_SplitterWidth, this); TQSplitterLayoutStruct *s = data->list.first(); while ( s ) { if ( s->isSplitter ) @@ -1364,9 +1364,9 @@ void kdganttGeomCalc( TQMemArray &chain, int start, int count, i int i; for ( i = start; i < start + count; i++ ) { chain[i].done = FALSE; - cHint += chain[i].tqsizeHint; - cMin += chain[i].tqminimumSize; - cMax += chain[i].tqmaximumSize; + cHint += chain[i].sizeHint; + cMin += chain[i].minimumSize; + cMax += chain[i].maximumSize; sumStretch += chain[i].stretch; if ( !chain[i].empty ) spacerCount++; @@ -1379,11 +1379,11 @@ void kdganttGeomCalc( TQMemArray &chain, int start, int count, i if ( space < cMin + spacerCount * spacer ) { // qDebug("not enough space"); for ( i = start; i < start+count; i++ ) { - chain[i].size = chain[i].tqminimumSize; + chain[i].size = chain[i].minimumSize; chain[i].done = TRUE; } } else if ( space < cHint + spacerCount*spacer ) { - // Less space than tqsizeHint, but more than minimum. + // Less space than sizeHint, 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; @@ -1391,10 +1391,10 @@ void kdganttGeomCalc( TQMemArray &chain, int start, int count, i int overdraft = cHint - space_left; //first give to the fixed ones: for ( i = start; i < start+count; i++ ) { - if ( !chain[i].done && chain[i].tqminimumSize >= chain[i].tqsizeHint) { - chain[i].size = chain[i].tqsizeHint; + if ( !chain[i].done && chain[i].minimumSize >= chain[i].sizeHint) { + chain[i].size = chain[i].sizeHint; chain[i].done = TRUE; - space_left -= chain[i].tqsizeHint; + space_left -= chain[i].sizeHint; // sumStretch -= chain[i].stretch; n--; } @@ -1413,13 +1413,13 @@ void kdganttGeomCalc( TQMemArray &chain, int start, int count, i // else // fp_w += (fp_over * chain[i].stretch) / sumStretch; int w = fRound( fp_w ); - chain[i].size = chain[i].tqsizeHint - w; + chain[i].size = chain[i].sizeHint - w; fp_w -= toFixed( w ); //give the difference to the next - if ( chain[i].size < chain[i].tqminimumSize ) { + if ( chain[i].size < chain[i].minimumSize ) { chain[i].done = TRUE; - chain[i].size = chain[i].tqminimumSize; + chain[i].size = chain[i].minimumSize; finished = FALSE; - overdraft -= chain[i].tqsizeHint - chain[i].tqminimumSize; + overdraft -= chain[i].sizeHint - chain[i].minimumSize; // sumStretch -= chain[i].stretch; n--; break; @@ -1431,11 +1431,11 @@ void kdganttGeomCalc( TQMemArray &chain, int start, int count, i 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].tqmaximumSize <= chain[i].tqsizeHint + if ( !chain[i].done && (chain[i].maximumSize <= chain[i].sizeHint || wannaGrow && !chain[i].expansive) ) { - chain[i].size = chain[i].tqsizeHint; + chain[i].size = chain[i].sizeHint; chain[i].done = TRUE; - space_left -= chain[i].tqsizeHint; + space_left -= chain[i].sizeHint; sumStretch -= chain[i].stretch; n--; } @@ -1467,20 +1467,20 @@ void kdganttGeomCalc( TQMemArray &chain, int start, int count, i int w = fRound( fp_w ); chain[i].size = w; fp_w -= toFixed( w ); // give the difference to the next - if ( w < chain[i].tqsizeHint ) { - deficit += chain[i].tqsizeHint - w; - } else if ( w > chain[i].tqmaximumSize ) { - surplus += w - chain[i].tqmaximumSize; + if ( w < chain[i].sizeHint ) { + deficit += chain[i].sizeHint - w; + } else if ( w > chain[i].maximumSize ) { + surplus += w - chain[i].maximumSize; } } 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].tqsizeHint ) { - chain[i].size = chain[i].tqsizeHint; + chain[i].size < chain[i].sizeHint ) { + chain[i].size = chain[i].sizeHint; chain[i].done = TRUE; - space_left -= chain[i].tqsizeHint; + space_left -= chain[i].sizeHint; sumStretch -= chain[i].stretch; n--; } @@ -1490,10 +1490,10 @@ void kdganttGeomCalc( TQMemArray &chain, int start, int count, i // take from the ones that have too much for ( i = start; i < start+count; i++ ) { if ( !chain[i].done && - chain[i].size > chain[i].tqmaximumSize ) { - chain[i].size = chain[i].tqmaximumSize; + chain[i].size > chain[i].maximumSize ) { + chain[i].size = chain[i].maximumSize; chain[i].done = TRUE; - space_left -= chain[i].tqmaximumSize; + space_left -= chain[i].maximumSize; sumStretch -= chain[i].stretch; n--; } diff --git a/kdgantt/KDGanttMinimizeSplitter.h b/kdgantt/KDGanttMinimizeSplitter.h index 0d3499ac1..1ebf7b543 100644 --- a/kdgantt/KDGanttMinimizeSplitter.h +++ b/kdgantt/KDGanttMinimizeSplitter.h @@ -70,8 +70,8 @@ public: void moveToLast( TQWidget * ); void refresh() { recalc( TRUE ); } - virtual TQSize tqsizeHint() const; - virtual TQSize tqminimumSizeHint() const; + virtual TQSize sizeHint() const; + virtual TQSize minimumSizeHint() const; TQValueList sizes() const; void setSizes( TQValueList ); @@ -147,7 +147,7 @@ public: bool opaque() const { return s->opaqueResize(); } - TQSize tqsizeHint() const; + TQSize sizeHint() const; int id() const { return myId; } // data->list.at(id())->wid == this void setId( int i ) { myId = i; } diff --git a/kdgantt/KDGanttSemiSizingControl.cpp b/kdgantt/KDGanttSemiSizingControl.cpp index bfaa161d0..dcc2f40d2 100644 --- a/kdgantt/KDGanttSemiSizingControl.cpp +++ b/kdgantt/KDGanttSemiSizingControl.cpp @@ -247,9 +247,9 @@ KDGanttSemiSizingControl::ArrowPosition KDGanttSemiSizingControl::arrowPosition( void KDGanttSemiSizingControl::init() { _but = new TQPushButton( this ); - _but->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) ); + _but->setSizePolicy( TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed ) ); connect( _but, TQT_SIGNAL( clicked() ), this, TQT_SLOT(changeState()) ); - _tqlayout = 0; + _layout = 0; TQWhatsThis::add( _but, "Click on this button to show the \nlegend at the bottom of the widget"); TQToolTip::add( _but, "Show / hide legend"); @@ -258,19 +258,19 @@ void KDGanttSemiSizingControl::init() void KDGanttSemiSizingControl::setup() { - //-------------------------------------------------- Setup tqlayout - delete _tqlayout; - TQBoxLayout* butLayout; // _tqlayout will delete me + //-------------------------------------------------- Setup layout + delete _layout; + TQBoxLayout* butLayout; // _layout will delete me if ( _orient == Qt::Horizontal || isMinimized() ) - _tqlayout = new TQHBoxLayout( this ); + _layout = new TQHBoxLayout( this ); else - _tqlayout = new TQVBoxLayout( this ); + _layout = new TQVBoxLayout( this ); if ( _orient == Qt::Vertical && !isMinimized() ) - butLayout = new TQHBoxLayout( _tqlayout ); + butLayout = new TQHBoxLayout( _layout ); else - butLayout = new TQVBoxLayout( _tqlayout ); + butLayout = new TQVBoxLayout( _layout ); @@ -306,9 +306,9 @@ void KDGanttSemiSizingControl::setup() widget = _maximizedWidget; if( widget ) { if ( _arrowPos == Before || _orient == Qt::Vertical && !isMinimized() ) - _tqlayout->addWidget( widget, 1 ); + _layout->addWidget( widget, 1 ); else - _tqlayout->insertWidget( 0, widget, 1 ); + _layout->insertWidget( 0, widget, 1 ); } ************************************************** */ // hack for the usage in KDGantt as pop-up legend widget @@ -319,16 +319,16 @@ void KDGanttSemiSizingControl::setup() widget = _minimizedWidget; if( widget ) { if ( _arrowPos == Before || _orient == Qt::Vertical && !isMinimized() ) - _tqlayout->addWidget( widget, 1 ); + _layout->addWidget( widget, 1 ); else - _tqlayout->insertWidget( 0, widget, 1 ); + _layout->insertWidget( 0, widget, 1 ); } } else { if ( _arrowPos == Before || _orient == Qt::Vertical && !isMinimized() ) - _tqlayout->addStretch( 1 ); + _layout->addStretch( 1 ); else - _tqlayout->insertStretch( 0, 1 ); + _layout->insertStretch( 0, 1 ); widget = _maximizedWidget; // the following is only the special case // arrowPos == Before and _orient == Qt::Vertical @@ -395,7 +395,7 @@ TQPixmap KDGanttSemiSizingControl::pixmap( Direction direction ) { TQPainter p( &pix ); p.setPen( black ); - p.setBrush( tqcolorGroup().button() ); + p.setBrush( colorGroup().button() ); p.drawPolygon( arr ); TQBitmap bit( s, s ); bit.fill( color0 ); diff --git a/kdgantt/KDGanttSemiSizingControl.h b/kdgantt/KDGanttSemiSizingControl.h index c1cc0b597..823eddacd 100644 --- a/kdgantt/KDGanttSemiSizingControl.h +++ b/kdgantt/KDGanttSemiSizingControl.h @@ -36,7 +36,7 @@ #define KDGANTTSEMISIZINGCONTROL_H #include "KDGanttSizingControl.h" -#include +#include class TQPushButton; class TQBoxLayout; @@ -83,7 +83,7 @@ private: ArrowPosition _arrowPos; TQWidget* _minimizedWidget; TQWidget* _maximizedWidget; - TQBoxLayout* _tqlayout; + TQBoxLayout* _layout; TQPushButton* _but; }; diff --git a/kdgantt/KDGanttView.cpp b/kdgantt/KDGanttView.cpp index 5a1618a31..1aaa1e468 100644 --- a/kdgantt/KDGanttView.cpp +++ b/kdgantt/KDGanttView.cpp @@ -41,7 +41,7 @@ #include "itemAttributeDialog.h" #include #include -#include +#include #include #include #include @@ -186,7 +186,7 @@ KDGanttView::KDGanttView( TQWidget* parent, const char* name ) fDropEnabled = false; closingBlocked = false; myTimeHeader->computeTicks(); - centerTimelineAfterShow( TQDateTime::tqcurrentDateTime () ); + centerTimelineAfterShow( TQDateTime::currentDateTime () ); setDisplayEmptyTasksAsLine( false ); TQValueList list; list.append(240); @@ -313,12 +313,12 @@ bool KDGanttView::close ( bool alsoDelete ) /*! Returns a useful size for the view. Returned width: - tqsizeHint().width() of the list view + width of TimeTable + sizeHint().width() of the list view + width of TimeTable Returned height: height() of TimeHeader + height() of TimeTable + height() of Legend (if shown) */ -TQSize KDGanttView::tqsizeHint() const +TQSize KDGanttView::sizeHint() const { bool block = myTimeTable->blockUpdating(); myTimeTable->setBlockUpdating( false ); @@ -342,9 +342,9 @@ TQSize KDGanttView::tqsizeHint() const if ( myLegend->isShown() ) hintHeight += myLegend->legendSizeHint().height() +10; hintHeight += myTimeTable->minimumHeight+myListView->frameWidth()*2+2; - int hintWid = myListView->tqsizeHint().width(); + int hintWid = myListView->sizeHint().width(); //hintWid += myTimeHeader->mySizeHint+myCanvasView->verticalScrollBar()->width(); - hintWid += myCanvasView->tqsizeHint().width(); + hintWid += myCanvasView->sizeHint().width(); // add 10 for the splitter-bars // qDebug("sizehint %d %d ",hintWid+10, hintHeight ); myTimeTable->setBlockUpdating( block ); @@ -532,7 +532,7 @@ void KDGanttView::slotMouseButtonPressed ( int button, TQListViewItem * item, the fastest mode. If Medium, there is extra repainting after releasing the scrollbar. This provides fast scrolling with updated content - after scrolling. Recommended, when tqrepaint problems occur. + after scrolling. Recommended, when repaint problems occur. This is the default value after startup. If Always, there is an extra update after every move of the scrollbar. This entails slow scrolling with updated @@ -615,7 +615,7 @@ void KDGanttView::slotHeaderSizeChanged() // legend is cleared - reinit legend with list legendItem* li; for ( li = myLegendItems->first(); li; li = myLegendItems->next() ) { - myLegend->addLegendItem(li->tqshape, li->color, li->text ); + myLegend->addLegendItem(li->shape, li->color, li->text ); } } } @@ -766,25 +766,25 @@ bool KDGanttView::editable() const /*! - Saves the state of the Gantt view in an IO tqdevice in XML format. The saved + Saves the state of the Gantt view in an IO device in XML format. The saved data can be reloaded with \a loadProject(). - \param tqdevice a pointer to the IO tqdevice in which to store the Gantt + \param device a pointer to the IO device in which to store the Gantt view state. \return true if the data could be written, false if an error occurred \sa loadProject() */ -bool KDGanttView::saveProject( TQIODevice* tqdevice ) +bool KDGanttView::saveProject( TQIODevice* device ) { - Q_ASSERT( tqdevice ); + Q_ASSERT( device ); TQDomDocument doc = saveXML(); - if( tqdevice->isOpen() ) - tqdevice->close(); - if( tqdevice->open( IO_WriteOnly ) ) { - TQTextStream ts( tqdevice ); + if( device->isOpen() ) + device->close(); + if( device->open( IO_WriteOnly ) ) { + TQTextStream ts( device ); ts << doc.toString(); return true; } else @@ -796,30 +796,30 @@ bool KDGanttView::saveProject( TQIODevice* tqdevice ) Loads a previously saved state of the Gantt view. All current settings and items are discarded before loading the data. - \param tqdevice a pointer to the IO tqdevice from which to load the + \param device a pointer to the IO device from which to load the Gantt view state. \return true if the file could be read, false if an error occurred \sa saveProject() */ -bool KDGanttView::loadProject( TQIODevice* tqdevice ) +bool KDGanttView::loadProject( TQIODevice* device ) { - Q_ASSERT( tqdevice ); + Q_ASSERT( device ); - if( tqdevice->isOpen() ) - tqdevice->close(); - if( tqdevice->open( IO_ReadOnly ) ) { + if( device->isOpen() ) + device->close(); + if( device->open( IO_ReadOnly ) ) { TQDomDocument doc( "GanttView" ); TQString err; int errline, errcol; - if ( !doc.setContent( tqdevice, &err, &errline, &errcol ) ) { + if ( !doc.setContent( device, &err, &errline, &errcol ) ) { qDebug("KDGantt::Error parsing XML data at line %d. Message is:", errline ); qDebug("%s ", err.latin1()); - tqdevice->close(); + device->close(); return false; } - tqdevice->close(); + device->close(); return loadXML( doc ); } else return false; @@ -868,7 +868,7 @@ void KDGanttView::print( TQPrinter* printer , TQSize size = drawContents( 0, printListView, printTimeLine, printLegend ); // at the top, we want to print current time/date - TQString date = "Printing Time: " + TQDateTime::tqcurrentDateTime().toString(); + TQString date = "Printing Time: " + TQDateTime::currentDateTime().toString(); int hei = p.boundingRect(0,0, 5, 5, TQt::AlignLeft, date ).height(); p.drawText( 0, 0, date ); @@ -1209,7 +1209,7 @@ bool KDGanttView::showTaskLinks() const void KDGanttView::setFont(const TQFont& font) { myListView->setFont(font); - myListView->tqrepaint(); + myListView->repaint(); myTimeHeader->setFont(font); myLegend->setFont( font ); TQWidget::setFont( font ); @@ -1299,21 +1299,21 @@ bool KDGanttView::showTimeTablePopupMenu() const /*! - Sets the tqshapes for a certain type of Gantt item. Not all items use - all three tqshapes (e.g., only summary items use the middle tqshape). + Sets the shapes for a certain type of Gantt item. Not all items use + all three shapes (e.g., only summary items use the middle shape). - This setting overrides any tqshape settings made on individual items. + This setting overrides any shape settings made on individual items. These settings will be taken as initial values of any newly created item of this certain type. See also the documentation of the KDGanttViewItem class. - \param type the type of Gantt items for which to set the tqshapes - \param start the tqshape to use for the beginning of the item - \param middle the tqshape to use for the middle of the item - \param end the tqshape to use for the end of the item - \param overwriteExisting if true, overwrites existing tqshape settings + \param type the type of Gantt items for which to set the shapes + \param start the shape to use for the beginning of the item + \param middle the shape to use for the middle of the item + \param end the shape to use for the end of the item + \param overwriteExisting if true, overwrites existing shape settings in the individual items - \sa tqshapes() + \sa shapes() */ void KDGanttView::setShapes( KDGanttViewItem::Type type, KDGanttViewItem::Shape start, @@ -1337,18 +1337,18 @@ void KDGanttView::setShapes( KDGanttViewItem::Type type, /*! - Queries the tqshapes for a particular type of Gantt item. + Queries the shapes for a particular type of Gantt item. - \param type the type of Gantt items for which to query the tqshapes - \param start the start tqshape is returned in this parameter - \param middle the middle tqshape is returned in this parameter - \param end the end tqshape is returned in this parameter - \return true if there was a general tqshape set for the specified - type. If the return value is false, the values of the three tqshape + \param type the type of Gantt items for which to query the shapes + \param start the start shape is returned in this parameter + \param middle the middle shape is returned in this parameter + \param end the end shape is returned in this parameter + \return true if there was a general shape set for the specified + type. If the return value is false, the values of the three shape parameters are undefined. \sa setShapes() */ -bool KDGanttView::tqshapes( KDGanttViewItem::Type type, +bool KDGanttView::shapes( KDGanttViewItem::Type type, KDGanttViewItem::Shape& start, KDGanttViewItem::Shape& middle, KDGanttViewItem::Shape& end ) const @@ -1562,19 +1562,19 @@ void KDGanttView::clearLegend( ) /*! Adds an item to the legend. - \param tqshape the tqshape to display - \param tqshapeColor the color in which to display the tqshape + \param shape the shape to display + \param shapeColor the color in which to display the shape \param text the text to display \sa clearLegend() */ -void KDGanttView::addLegendItem( KDGanttViewItem::Shape tqshape, - const TQColor& tqshapeColor, +void KDGanttView::addLegendItem( KDGanttViewItem::Shape shape, + const TQColor& shapeColor, const TQString& text ) { - myLegend->addLegendItem( tqshape,tqshapeColor,text ); + myLegend->addLegendItem( shape,shapeColor,text ); legendItem* item = new legendItem; - item->tqshape = tqshape; - item->color = tqshapeColor; + item->shape = shape; + item->color = shapeColor; item->text = text; myLegendItems->append( item ); } @@ -3415,58 +3415,58 @@ TQDomDocument KDGanttView::saveXML( bool withPI ) const showTimeTablePopupMenu() ); // the Shapes element - TQDomElement tqshapesElement = doc.createElement( "Shapes" ); - docRoot.appendChild( tqshapesElement ); - TQDomElement tqshapesEventElement = doc.createElement( "Event" ); - tqshapesElement.appendChild( tqshapesEventElement ); + TQDomElement shapesElement = doc.createElement( "Shapes" ); + docRoot.appendChild( shapesElement ); + TQDomElement shapesEventElement = doc.createElement( "Event" ); + shapesElement.appendChild( shapesEventElement ); KDGanttViewItem::Shape start, middle, end; - if( tqshapes( KDGanttViewItem::Event, start, middle, end ) ) { - KDGanttXML::createStringNode( doc, tqshapesEventElement, "Start", - KDGanttViewItem::tqshapeToString( start ) ); - KDGanttXML::createStringNode( doc, tqshapesEventElement, "Middle", - KDGanttViewItem::tqshapeToString( middle ) ); - KDGanttXML::createStringNode( doc, tqshapesEventElement, "End", - KDGanttViewItem::tqshapeToString( end ) ); + if( shapes( KDGanttViewItem::Event, start, middle, end ) ) { + KDGanttXML::createStringNode( doc, shapesEventElement, "Start", + KDGanttViewItem::shapeToString( start ) ); + KDGanttXML::createStringNode( doc, shapesEventElement, "Middle", + KDGanttViewItem::shapeToString( middle ) ); + KDGanttXML::createStringNode( doc, shapesEventElement, "End", + KDGanttViewItem::shapeToString( end ) ); } else { - KDGanttXML::createStringNode( doc, tqshapesEventElement, "Start", + KDGanttXML::createStringNode( doc, shapesEventElement, "Start", "Undefined" ); - KDGanttXML::createStringNode( doc, tqshapesEventElement, "Middle", + KDGanttXML::createStringNode( doc, shapesEventElement, "Middle", "Undefined" ); - KDGanttXML::createStringNode( doc, tqshapesEventElement, "End", + KDGanttXML::createStringNode( doc, shapesEventElement, "End", "Undefined" ); } - TQDomElement tqshapesTaskElement = doc.createElement( "Task" ); - tqshapesElement.appendChild( tqshapesTaskElement ); - if( tqshapes( KDGanttViewItem::Task, start, middle, end ) ) { - KDGanttXML::createStringNode( doc, tqshapesTaskElement, "Start", - KDGanttViewItem::tqshapeToString( start ) ); - KDGanttXML::createStringNode( doc, tqshapesTaskElement, "Middle", - KDGanttViewItem::tqshapeToString( middle ) ); - KDGanttXML::createStringNode( doc, tqshapesTaskElement, "End", - KDGanttViewItem::tqshapeToString( end ) ); + TQDomElement shapesTaskElement = doc.createElement( "Task" ); + shapesElement.appendChild( shapesTaskElement ); + if( shapes( KDGanttViewItem::Task, start, middle, end ) ) { + KDGanttXML::createStringNode( doc, shapesTaskElement, "Start", + KDGanttViewItem::shapeToString( start ) ); + KDGanttXML::createStringNode( doc, shapesTaskElement, "Middle", + KDGanttViewItem::shapeToString( middle ) ); + KDGanttXML::createStringNode( doc, shapesTaskElement, "End", + KDGanttViewItem::shapeToString( end ) ); } else { - KDGanttXML::createStringNode( doc, tqshapesTaskElement, "Start", + KDGanttXML::createStringNode( doc, shapesTaskElement, "Start", "Undefined" ); - KDGanttXML::createStringNode( doc, tqshapesTaskElement, "Middle", + KDGanttXML::createStringNode( doc, shapesTaskElement, "Middle", "Undefined" ); - KDGanttXML::createStringNode( doc, tqshapesTaskElement, "End", + KDGanttXML::createStringNode( doc, shapesTaskElement, "End", "Undefined" ); } - TQDomElement tqshapesSummaryElement = doc.createElement( "Summary" ); - tqshapesElement.appendChild( tqshapesSummaryElement ); - if( tqshapes( KDGanttViewItem::Event, start, middle, end ) ) { - KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "Start", - KDGanttViewItem::tqshapeToString( start ) ); - KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "Middle", - KDGanttViewItem::tqshapeToString( middle ) ); - KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "End", - KDGanttViewItem::tqshapeToString( end ) ); + TQDomElement shapesSummaryElement = doc.createElement( "Summary" ); + shapesElement.appendChild( shapesSummaryElement ); + if( shapes( KDGanttViewItem::Event, start, middle, end ) ) { + KDGanttXML::createStringNode( doc, shapesSummaryElement, "Start", + KDGanttViewItem::shapeToString( start ) ); + KDGanttXML::createStringNode( doc, shapesSummaryElement, "Middle", + KDGanttViewItem::shapeToString( middle ) ); + KDGanttXML::createStringNode( doc, shapesSummaryElement, "End", + KDGanttViewItem::shapeToString( end ) ); } else { - KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "Start", + KDGanttXML::createStringNode( doc, shapesSummaryElement, "Start", "Undefined" ); - KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "Middle", + KDGanttXML::createStringNode( doc, shapesSummaryElement, "Middle", "Undefined" ); - KDGanttXML::createStringNode( doc, tqshapesSummaryElement, "End", + KDGanttXML::createStringNode( doc, shapesSummaryElement, "End", "Undefined" ); } @@ -3604,7 +3604,7 @@ TQDomDocument KDGanttView::saveXML( bool withPI ) const TQDomElement legendItemElement = doc.createElement( "LegendItem" ); legendItemsElement.appendChild( legendItemElement ); KDGanttXML::createStringNode( doc, legendItemElement, "Shape", - KDGanttViewItem::tqshapeToString( current->tqshape ) ); + KDGanttViewItem::shapeToString( current->shape ) ); KDGanttXML::createColorNode( doc, legendItemElement, "Color", current->color ); KDGanttXML::createStringNode( doc, legendItemElement, "Text", @@ -3757,17 +3757,17 @@ void KDGanttView::editItem( KDGanttViewItem* item) /*! - This method returns the pixmap used for a certain tqshape, in the + This method returns the pixmap used for a certain shape, in the selected color and size. - \param tqshape the tqshape to generate - \param tqshapeColor the foreground color of the tqshape - \param backgroundColor the background color of the tqshape - \param itemSize the size of the tqshape - \return the generated tqshape pixmap + \param shape the shape to generate + \param shapeColor the foreground color of the shape + \param backgroundColor the background color of the shape + \param itemSize the size of the shape + \return the generated shape pixmap */ -TQPixmap KDGanttView::getPixmap( KDGanttViewItem::Shape tqshape, - const TQColor& tqshapeColor, +TQPixmap KDGanttView::getPixmap( KDGanttViewItem::Shape shape, + const TQColor& shapeColor, const TQColor& backgroundColor, int itemSize) { // 10 is a good value as size @@ -3777,11 +3777,11 @@ TQPixmap KDGanttView::getPixmap( KDGanttViewItem::Shape tqshape, p.fill( backgroundColor ); TQPainter paint (&p); TQBrush b = TQBrush ( TQt::SolidPattern ); - b.setColor( tqshapeColor ); + b.setColor( shapeColor ); paint.setBrush( b ); TQPen pen( TQt::black, 1 ) ; paint.setPen( pen ); - switch (tqshape) { + switch (shape) { case KDGanttViewItem::TriangleDown:{ TQPointArray arr = TQPointArray(3); arr.setPoint(0,-size/2,-hei); @@ -3864,8 +3864,8 @@ void KDGanttView::initDefaults() myDefaultColor [ getIndex( KDGanttViewItem::Summary ) ] = TQt::cyan;//summary myDefaultColorHL [ getIndex( KDGanttViewItem::Summary ) ] = TQt::red; - // setting the default tqshape types - // currently, we take for each item for all three tqshapes (start, middle, end) the same default tqshape + // setting the default shape types + // currently, we take for each item for all three shapes (start, middle, end) the same default shape for (i = 0;i<3;++i) { myDefaultShape [3*getIndex( KDGanttViewItem::Event )+ i] = KDGanttViewItem::Diamond; //event myDefaultShape [3*getIndex( KDGanttViewItem::Task ) +i] = KDGanttViewItem::Square; //task @@ -4239,7 +4239,7 @@ TQColor KDGanttView::legendHeaderBackgroundColor () const may add as many widgets as you want. They are ordered horizontally from left to right. To remove a widget from the spacer widget, call widget->reparent(newParent,...) or delete the widget. Since the spacer - is a TQHBox, the tqlayout of the added widgets is managed by this + is a TQHBox, the layout of the added widgets is managed by this TQHBox. \param w A pointer to the widget to be added. diff --git a/kdgantt/KDGanttView.h b/kdgantt/KDGanttView.h index 70b423218..ca0f78f3f 100644 --- a/kdgantt/KDGanttView.h +++ b/kdgantt/KDGanttView.h @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include #include @@ -193,7 +193,7 @@ public: KDGanttViewItem::Shape middle, KDGanttViewItem::Shape end, bool overwriteExisting = true ); - bool tqshapes( KDGanttViewItem::Type type, + bool shapes( KDGanttViewItem::Type type, KDGanttViewItem::Shape& start, KDGanttViewItem::Shape& middle, KDGanttViewItem::Shape& end ) const; @@ -228,7 +228,7 @@ public: TQPtrList taskLinkGroups() const; // Legend-related stuff - void addLegendItem( KDGanttViewItem::Shape tqshape, const TQColor& tqshapeColor, const TQString& text ); + void addLegendItem( KDGanttViewItem::Shape shape, const TQColor& shapeColor, const TQString& text ); void clearLegend(); // Header-related stuff void setHorizonStart( const TQDateTime& start ); @@ -298,7 +298,7 @@ public: void setWeekendDays( int start, int end ); void weekendDays( int& start, int& end ) const; - static TQPixmap getPixmap( KDGanttViewItem::Shape tqshape, const TQColor& tqshapeColor,const TQColor& backgroundColor, int itemSize); + static TQPixmap getPixmap( KDGanttViewItem::Shape shape, const TQColor& shapeColor,const TQColor& backgroundColor, int itemSize); void setHeaderVisible( bool ); bool headerVisible() const; @@ -330,7 +330,7 @@ public: virtual void lvStartDrag (KDGanttViewItem*); virtual bool lvDragMoveEvent (TQDragMoveEvent * e,KDGanttViewItem*, KDGanttViewItem*); virtual void lvDragEnterEvent (TQDragEnterEvent * e ); - virtual TQSize tqsizeHint() const; + virtual TQSize sizeHint() const; KDGanttViewItem* getItemByName( const TQString& name ) const; TQDateTime getDateTimeForCoordX(int coordX, bool global = true ) const; KDGanttViewItem* getItemByListViewPos( const TQPoint& pos ) const; @@ -422,7 +422,7 @@ private slots: void slot_lvDropped(TQDropEvent* e, KDGanttViewItem* droppedItem, KDGanttViewItem* itemBelowMouse ); private: struct legendItem { - KDGanttViewItem::Shape tqshape; + KDGanttViewItem::Shape shape; TQColor color; TQString text; }; diff --git a/kdgantt/KDGanttViewItem.cpp b/kdgantt/KDGanttViewItem.cpp index de80477a5..0bfc72794 100644 --- a/kdgantt/KDGanttViewItem.cpp +++ b/kdgantt/KDGanttViewItem.cpp @@ -52,20 +52,20 @@ directly. Instead, you should create items of one of the subclasses. This class provides methods common to all Gantt items. - The initialization of the tqshapes/colors of the item works as follows: + The initialization of the shapes/colors of the item works as follows: Shapes: - When a new item is created, the tqshapes are set to the default values + When a new item is created, the shapes are set to the default values for items of the type of this item, defined in the KDGanttView class with void setShapes( KDGanttViewItem::Type type, KDGanttViewItem::Shape start, KDGanttViewItem::Shape middle, KDGanttViewItem::Shape end ); If there is no default value defined for this type, - the tqshapes are set as follows: - For TaskViewItems all three tqshapes are set to Square. - For SummaryViewItems all three tqshapes are set to TriangleDown. - For EventViewItems all three tqshapes are set to Diamond. + the shapes are set as follows: + For TaskViewItems all three shapes are set to Square. + For SummaryViewItems all three shapes are set to TriangleDown. + For EventViewItems all three shapes are set to Diamond. Colors: When a new item is created, the colors are set to the default values @@ -75,7 +75,7 @@ const TQColor& middle, const TQColor& end ); If there is no default value defined for this type, - the colors of the tqshapes are set to the default color for items of this type, + the colors of the shapes are set to the default color for items of this type, defined in the KDGanttView class with: void setDefaultColor( KDGanttViewItem::Type type, const TQColor& ); The initial default color in the KDGanttView class is set to @@ -92,7 +92,7 @@ const TQColor& middle, const TQColor& end ); If there is no default value defined for this type, - the highlight colors of the tqshapes are set to the default color for + the highlight colors of the shapes are set to the default color for items of this type, defined in the KDGanttView class with: void setDefaultHighlightColor( KDGanttViewItem::Type type, const TQColor& ); The initial default highlight color in the KDGanttView class is set to red @@ -122,15 +122,15 @@ shown or not. In the other mode (set with setDisplaySubitemsAsGroup( true ); ), called "calendar mode", the item is displayed as follows: - If the item has no tqchildren, it is displayed as usual. - If the item is opened (i.e., its tqchildren are displayed), the + If the item has no children, it is displayed as usual. + If the item is opened (i.e., its children are displayed), the start/end time of this item is computed automatically according to - the earliest start time/latest end time of its tqchildren. The item - and its tqchildren are displayed as usual. - If the item is closed (i.e., its tqchildren are hidden in the left - list view), the item itself is hidden, and its tqchildren are displayed + the earliest start time/latest end time of its children. The item + and its children are displayed as usual. + If the item is closed (i.e., its children are hidden in the left + list view), the item itself is hidden, and its children are displayed on the timeline of this item instead. To control the painting of - overlapping tqchildren, call \a setPriority() for the childs. + overlapping children, call \a setPriority() for the childs. Blocking of user interaction to open item: If you want to block users to open items used as parents of calendar items, @@ -138,7 +138,7 @@ Example 1, Color: If you create an instance of a KDGanttView class and add a SummaryViewItem - without setting any color/tqshape values, you get an item with three tqshapes + without setting any color/shape values, you get an item with three shapes of the form TriangleDown in the color magenta. If the item is highlighted, the color will change to the highlight color red. @@ -147,12 +147,12 @@ \a KDGanttView::setCalendarMode( true ); \a KDGanttView::setDisplaySubitemsAsGroup( true ); Insert root items in the Gantt view. - Insert items as tqchildren of these root item in the Gantt view. + Insert items as children of these root item in the Gantt view. You may use any item type as parent and child; there are no limitations. It is, however, recommended to use KDGanttViewTaskItems - Actually, you may add child items to the tqchildren themselves. + Actually, you may add child items to the children themselves. Such a child behaves then like a parent. - Now set the start/end time of the tqchildren to specify a time + Now set the start/end time of the children to specify a time interval for these items. */ @@ -451,7 +451,7 @@ bool KDGanttViewItem::editable() const Useful to get a so called "calendar view" with many items in one row. When \a displaySubitemsAsGroup() is set to true, this item has a normal view, when it is expanded. If it is not expanded (and has at least one child), - the item itself is hidden, and all tqchildren are displayed instead. + the item itself is hidden, and all children are displayed instead. To manage the painting priority of the childs (if overlapping), you may set \a priority() of these items. @@ -735,7 +735,7 @@ TQString KDGanttViewItem::whatsThisText() const /*! Specifies whether this item should be shown highlighted. The user can also highlight items with the mouse. - If the item displays its subitems (tqchildren) as a group + If the item displays its subitems (children) as a group (displaySubitemsAsGroup() == true), all changes apply to all subitems as well. @@ -773,16 +773,16 @@ bool KDGanttViewItem::highlight() const /*! - Specifies the tqshapes to be used for this item. + Specifies the shapes to be used for this item. - It is advisable not to use this method, but rather set the tqshapes + It is advisable not to use this method, but rather set the shapes for all items of a type with KDGanttView::setShapes() in order to get a uniform Gantt view. - \param start the start tqshape - \param middle the middle tqshape - \param end the end tqshape - \sa tqshapes(), setColors(), colors() + \param start the start shape + \param middle the middle shape + \param end the end shape + \sa shapes(), setColors(), colors() */ void KDGanttViewItem::setShapes( Shape start, Shape middle, Shape end ) { @@ -799,20 +799,20 @@ void KDGanttViewItem::setShapes( Shape start, Shape middle, Shape end ) /*! - Creates tqshapes of the specified type \a tqshape. - The background tqshape color is set to black and the background tqshape - is slightly bit bigger than the foreground tqshape to have a black border - around the foreground tqshape. + Creates shapes of the specified type \a shape. + The background shape color is set to black and the background shape + is slightly bit bigger than the foreground shape to have a black border + around the foreground shape. - \param itemShape the foreground tqshape - \param middle itemShapeBack the background tqshape - \param tqshape the type of the tqshape + \param itemShape the foreground shape + \param middle itemShapeBack the background shape + \param shape the type of the shape (may be TriangleDown, TriangleUp, Diamond, Square, Circle) - \sa tqshapes(), setColors(), colors() + \sa shapes(), setColors(), colors() */ void KDGanttViewItem::createShape( KDCanvasPolygonItem* &itemShape, KDCanvasPolygonItem* &itemShapeBack, - Shape tqshape ) + Shape shape ) { if ( itemShape && type() == Task ) return; @@ -823,7 +823,7 @@ void KDGanttViewItem::createShape( KDCanvasPolygonItem* &itemShape, TQCanvasPolygonalItem * itemBack; int size = myItemSize+2; int hei = (myItemSize/3)/2; - switch (tqshape) { + switch (shape) { case TriangleDown: { item = new KDCanvasPolygon(myGanttView->myTimeTable, this,Type_is_KDGanttViewItem); @@ -912,8 +912,8 @@ void KDGanttViewItem::createShape( KDCanvasPolygonItem* &itemShape, break; } default: - // Uninitialized tqshape, can e.g. be the case with free-busy - // items which don't have any tqshapes + // Uninitialized shape, can e.g. be the case with free-busy + // items which don't have any shapes return; } item->setBrush(Qt::SolidPattern); @@ -927,14 +927,14 @@ void KDGanttViewItem::createShape( KDCanvasPolygonItem* &itemShape, /*! - Returns the tqshapes used for this item + Returns the shapes used for this item - \param start returns the start tqshape - \param middle returns the middle tqshape - \param end returns the end tqshape + \param start returns the start shape + \param middle returns the middle shape + \param end returns the end shape \sa setShapes(), setColors(), colors() */ -void KDGanttViewItem::tqshapes( Shape& start, Shape& middle, Shape& end ) const +void KDGanttViewItem::shapes( Shape& start, Shape& middle, Shape& end ) const { start = myStartShape; middle = myMiddleShape; @@ -943,16 +943,16 @@ void KDGanttViewItem::tqshapes( Shape& start, Shape& middle, Shape& end ) const /*! - Specifies the colors in which to draw the tqshapes of this item. + Specifies the colors in which to draw the shapes of this item. It is advisable not to use this method, but rather set the colors for all items of a type with KDGanttView::setColors() in order to get a uniform Gantt view. - \param start the color for the start tqshape - \param middle the color for the middle tqshape - \param end the color for the end tqshape - \sa colors(), setShapes(), tqshapes(), setDefaultColor(), defaultColor() + \param start the color for the start shape + \param middle the color for the middle shape + \param end the color for the end shape + \sa colors(), setShapes(), shapes(), setDefaultColor(), defaultColor() */ void KDGanttViewItem::setColors( const TQColor& start, const TQColor& middle, const TQColor& end ) @@ -980,7 +980,7 @@ void KDGanttViewItem::setColors( const TQColor& start, const TQColor& middle, \param start returns the start color \param middle returns the middle color \param end returns the end color - \sa setColors(), setShapes(), tqshapes(), setDefaultColor(), defaultColor() + \sa setColors(), setShapes(), shapes(), setDefaultColor(), defaultColor() */ void KDGanttViewItem::colors( TQColor& start, TQColor& middle, TQColor& end ) const { @@ -992,21 +992,21 @@ void KDGanttViewItem::colors( TQColor& start, TQColor& middle, TQColor& end ) co /*! - Specifies the highlight colors in which to draw the tqshapes of this item. + Specifies the highlight colors in which to draw the shapes of this item. It is advisable not to use this method, but rather set the highlight colors for all items of a type with KDGanttView::setHighlightColors() in order to get a uniform Gantt view. - If the item displays its subitems (tqchildren) as a group, + If the item displays its subitems (children) as a group, (displaySubitemsAsGroup() == true) all changes apply to all subitems as well. - \param start the highlight color for the start tqshape - \param middle the highlight color for the middle tqshape - \param end the highlight color for the end tqshape - \sa highlightColors(), setShapes(), tqshapes() + \param start the highlight color for the start shape + \param middle the highlight color for the middle shape + \param end the highlight color for the end shape + \sa highlightColors(), setShapes(), shapes() */ void KDGanttViewItem::setHighlightColors( const TQColor& start, const TQColor& middle, const TQColor& end ) { @@ -1032,7 +1032,7 @@ void KDGanttViewItem::setHighlightColors( const TQColor& start, const TQColor& m \param start returns the start highlight color \param middle returns the middle highlight color \param end returns the end highlight color - \sa setHighlightColors(), setShapes(), tqshapes() + \sa setHighlightColors(), setShapes(), shapes() */ void KDGanttViewItem::highlightColors( TQColor& start, TQColor& middle, TQColor& end ) const { @@ -1048,7 +1048,7 @@ void KDGanttViewItem::highlightColors( TQColor& start, TQColor& middle, TQColor& It is advisable not to use this method, but rather set the text color for all items with KDGanttView::setTextColor() in order to get a uniform Gantt view. - If the item displays its subitems (tqchildren) as a group, + If the item displays its subitems (children) as a group, (displaySubitemsAsGroup() == true) all changes apply to all subitems as well. \param color the text color @@ -1086,7 +1086,7 @@ TQColor KDGanttViewItem::textColor() const /*! \enum KDGanttViewItem::Shape - This enum is used in order to specify the tqshapes of a Gantt chart + This enum is used in order to specify the shapes of a Gantt chart item. */ @@ -1140,7 +1140,7 @@ const TQPixmap* KDGanttViewItem::pixmap( int column ) const for all items of a type with KDGanttView::setDefaultColor() in order to get a uniform Gantt view. - If the item displays its subitems (tqchildren) as a group, + If the item displays its subitems (children) as a group, (displaySubitemsAsGroup() == true) all changes apply to all subitems as well. @@ -1187,7 +1187,7 @@ TQColor KDGanttViewItem::defaultColor() const for all items of a type with KDGanttView::setDefaultHighlightColor() in order to get a uniform Gantt view. - If the item displays its subitems (tqchildren) as a group, + If the item displays its subitems (children) as a group, (displaySubitemsAsGroup() == true) all changes apply to all subitems as well. @@ -1226,7 +1226,7 @@ TQColor KDGanttViewItem::defaultHighlightColor() const /*! Returns the first child of this item. - \return the first child of this item, 0 if this item has no tqchildren + \return the first child of this item, 0 if this item has no children */ KDGanttViewItem* KDGanttViewItem::firstChild() const { @@ -1469,10 +1469,10 @@ void KDGanttViewItem::initColorAndShapes(Type t) setDefaultColor( myGanttView->defaultColor(myType)); // set default highlight color setDefaultHighlightColor(myGanttView->defaultHighlightColor(myType)); - // set tqshapes - if (!( tqshapeDefined = (myGanttView->tqshapes(myType,myStartShape,myMiddleShape,myEndShape)))) { + // set shapes + if (!( shapeDefined = (myGanttView->shapes(myType,myStartShape,myMiddleShape,myEndShape)))) { - //qDebug("KDGantt::KDGanttViewItem created with not user defined tqshapes"); + //qDebug("KDGantt::KDGanttViewItem created with not user defined shapes"); }; setShapes(myStartShape,myMiddleShape,myEndShape); @@ -1486,12 +1486,12 @@ void KDGanttViewItem::initColorAndShapes(Type t) floatStartShape = (KDCanvasPolygonItem*)new KDCanvasRectangle(myGanttView->myTimeTable,this,Type_is_KDGanttViewItem); floatEndShape = (KDCanvasPolygonItem*)new KDCanvasRectangle(myGanttView->myTimeTable,this,Type_is_KDGanttViewItem); - // set color of tqshapes + // set color of shapes if (!( colorDefined = (myGanttView->colors(myType,myStartColor,myMiddleColor,myEndColor)))) { }; setColors(defaultColor(),defaultColor(), defaultColor()); - // set highlight color of tqshapes + // set highlight color of shapes if (!( colorHLDefined = (myGanttView->highlightColors(myType,myStartColorHL,myMiddleColorHL,myEndColorHL)))) { }; @@ -1508,9 +1508,9 @@ void KDGanttViewItem::initColorAndShapes(Type t) } -TQString KDGanttViewItem::tqshapeToString( Shape tqshape ) +TQString KDGanttViewItem::shapeToString( Shape shape ) { - switch( tqshape ) { + switch( shape ) { case TriangleDown: return "TriangleDown"; case TriangleUp: @@ -1571,13 +1571,13 @@ void KDGanttViewItem::createNode( TQDomDocument& doc, KDGanttXML::createBoolNode( doc, itemElement, "Open", isOpen() ); KDGanttXML::createBoolNode( doc, itemElement, "Highlight", highlight() ); Shape startShape, middleShape, endShape; - tqshapes( startShape, middleShape, endShape ); + shapes( startShape, middleShape, endShape ); KDGanttXML::createStringNode( doc, itemElement, "StartShape", - tqshapeToString( startShape ) ); + shapeToString( startShape ) ); KDGanttXML::createStringNode( doc, itemElement, "MiddleShape", - tqshapeToString( middleShape ) ); + shapeToString( middleShape ) ); KDGanttXML::createStringNode( doc, itemElement, "EndShape", - tqshapeToString( endShape ) ); + shapeToString( endShape ) ); KDGanttXML::createColorNode( doc, itemElement, "DefaultColor", defaultColor() ); TQColor startColor, middleColor, endColor; colors( startColor, middleColor, endColor ); @@ -1944,9 +1944,9 @@ void KDGanttViewItem::showSubitemTree( int CoordY ) /*! - Returns the start time of the tqchildren of this item. + Returns the start time of the children of this item. - \return the start time of the tqchildren of this item + \return the start time of the children of this item */ TQDateTime KDGanttViewItem::myChildStartTime() { @@ -1978,9 +1978,9 @@ TQDateTime KDGanttViewItem::myChildStartTime() /*! - Returns the end time of the tqchildren of this item. + Returns the end time of the children of this item. - \return the end time of the tqchildren of this item + \return the end time of the children of this item */ TQDateTime KDGanttViewItem::myChildEndTime() { @@ -2044,7 +2044,7 @@ void KDGanttViewItem::setShowNoInformation( bool show ) /*! If the name of this item is \a name (i.e., listViewText() == name), the pointer to this item is returned. Otherwise, it looks for an - item with name \a name in the set of tqchildren and subtqchildren of + item with name \a name in the set of children and subchildren of this item. \param name the name of the item \return the pointer to the item with name \a name @@ -2365,37 +2365,37 @@ bool KDGanttViewItem::isCalendar( ) const /*! \var KDGanttViewItem::startShape - the tqshape at the beginning of the item + the shape at the beginning of the item */ /*! \var KDGanttViewItem::midShape - the tqshape in the middle of the item + the shape in the middle of the item */ /*! \var KDGanttViewItem::endShape - the tqshape at the end of the item + the shape at the end of the item */ /*! \var KDGanttViewItem::startShapeBack - the background tqshape at the beginning of the item + the background shape at the beginning of the item */ /*! \var KDGanttViewItem::midShapeBack - the background tqshape in the middle of the item + the background shape in the middle of the item */ /*! \var KDGanttViewItem::endShapeBack - the background tqshape at the end of the item + the background shape at the end of the item */ diff --git a/kdgantt/KDGanttViewItem.h b/kdgantt/KDGanttViewItem.h index 9e54755b8..e645029d8 100644 --- a/kdgantt/KDGanttViewItem.h +++ b/kdgantt/KDGanttViewItem.h @@ -146,7 +146,7 @@ public: //bool isCalendar( ) const; void setShapes( Shape start, Shape middle, Shape end ); - void tqshapes( Shape& start, Shape& middle, Shape& end ) const; + void shapes( Shape& start, Shape& middle, Shape& end ) const; void setDefaultColor( const TQColor& ); TQColor defaultColor() const; void setColors( const TQColor& start, const TQColor& middle, @@ -202,7 +202,7 @@ private: friend class KDGanttViewItemDrag; friend class itemAttributeDialog; - static TQString tqshapeToString( Shape tqshape ); + static TQString shapeToString( Shape shape ); static Shape stringToShape( const TQString& string ); static TQString typeToString( Type type ); @@ -242,7 +242,7 @@ private: bool isMyTextCanvas(TQCanvasItem *tc); TQPoint myTextOffset; TQString _name; - bool tqshapeDefined; + bool shapeDefined; int _priority; static TQDict sItemDict; diff --git a/kdgantt/KDGanttViewItemDrag.cpp b/kdgantt/KDGanttViewItemDrag.cpp index c73eff67f..158da0411 100644 --- a/kdgantt/KDGanttViewItemDrag.cpp +++ b/kdgantt/KDGanttViewItemDrag.cpp @@ -63,7 +63,7 @@ KDGanttViewItemDrag::KDGanttViewItemDrag( KDGanttViewItem* item , TQWidget *sour pix = *(item->pixmap()) ; else { KDGanttViewItem::Shape start, middle, end; - item->tqshapes( start, middle, end ); + item->shapes( start, middle, end ); TQColor st, mi, en; item->colors( st, mi, en ); pix =item->myGanttView->getPixmap( start, st, item->myGanttView->lvBackgroundColor(), 11 ); @@ -86,7 +86,7 @@ KDGanttViewItemDrag::KDGanttViewItemDrag( KDGanttViewItem* item , TQWidget *sour \param c the format of the data \return the encoded data of the drag object */ -TQByteArray KDGanttViewItemDrag::tqencodedData( const char * c) const +TQByteArray KDGanttViewItemDrag::encodedData( const char * c) const { TQString s ( c ); if ( s == "x-application/x-KDGanttViewItemDrag" ) { @@ -132,7 +132,7 @@ bool KDGanttViewItemDrag::canDecode ( const TQMimeSource * e ) bool KDGanttViewItemDrag::decode ( const TQMimeSource * e , TQString & string) { TQByteArray arr; - arr = e->tqencodedData( "x-application/x-KDGanttViewItemDrag"); + arr = e->encodedData( "x-application/x-KDGanttViewItemDrag"); TQDataStream s( arr, IO_ReadOnly ); s >> string; return true; diff --git a/kdgantt/KDGanttViewItemDrag.h b/kdgantt/KDGanttViewItemDrag.h index a4d6cb6f0..9219c9181 100644 --- a/kdgantt/KDGanttViewItemDrag.h +++ b/kdgantt/KDGanttViewItemDrag.h @@ -44,7 +44,7 @@ class KDGanttViewItemDrag :public TQStoredDrag public: KDGanttViewItemDrag(KDGanttViewItem* item, TQWidget *source, const char * name ) ; - TQByteArray tqencodedData( const char * c) const; + TQByteArray encodedData( const char * c) const; KDGanttViewItem* getItem(); static bool canDecode ( const TQMimeSource * e ); static bool decode ( const TQMimeSource * e, TQString & ); diff --git a/kdgantt/KDGanttViewSubwidgets.cpp b/kdgantt/KDGanttViewSubwidgets.cpp index bd83feb14..bb0756f38 100644 --- a/kdgantt/KDGanttViewSubwidgets.cpp +++ b/kdgantt/KDGanttViewSubwidgets.cpp @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include @@ -702,12 +702,12 @@ KDTimeHeaderWidget:: KDTimeHeaderWidget( TQWidget* parent,KDGanttView* gant ) mySizeHint = 0; myGanttView = gant; flagDoNotRecomputeAfterChange = true; - TQDateTime start = (TQDateTime::tqcurrentDateTime ()).addSecs(-3600); + TQDateTime start = (TQDateTime::currentDateTime ()).addSecs(-3600); setHorizonStart(start); setHorizonEnd( start.addSecs(3600*2)); flagStartTimeSet = false; flagEndTimeSet = false; - myCenterDateTime = TQDateTime::tqcurrentDateTime (); + myCenterDateTime = TQDateTime::currentDateTime (); setScale(KDGanttView::Auto); //setScale(KDGanttView::Hour); myMaxScale = KDGanttView::Month; @@ -792,7 +792,7 @@ void KDTimeHeaderWidget::preparePopupMenu() if (flagZoomToFit) myPopupMenu->changeItem( 1, i18n("Zoom (Fit)")); else - myPopupMenu->changeItem( 1, i18n("Zoom (%1)").tqarg( TQString::number( zoomFactor(), 'f',3) ) ); + myPopupMenu->changeItem( 1, i18n("Zoom (%1)").arg( TQString::number( zoomFactor(), 'f',3) ) ); int i = 0; int id; while ( ( id = scalePopupMenu->idAt( i++ )) >= 0 ) { @@ -1140,7 +1140,7 @@ void KDTimeHeaderWidget::zoomToSelection( TQDateTime start, TQDateTime end) } flagDoNotRepaintAfterChange = false; updateTimeTable(); - tqrepaint(); + repaint(); moveTimeLineTo((getCoordX(start)-(viewWid-timeWid)/2)); // Since we have disconnected autoupdate of scrollbars, we must do it ourselves if (myGanttView && myGanttView->myCanvasView) @@ -1487,7 +1487,7 @@ void KDTimeHeaderWidget::computeIntervals( int height ) { IntervalColorList::const_iterator it; for ( it = icList.begin(); it != icList.end(); ++it ) { - (*it)->tqlayout( this, height ); + (*it)->layout( this, height ); } } @@ -2086,7 +2086,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale) TQPainter p(this); int Width, Height; TQString testTextMinor,testTextMajor, tempStr; - TQRect tqitemRectMinor, tqitemRectMajor; + TQRect itemRectMinor, itemRectMajor; TQDate tempDate = myRealStart.date(); myRealEnd = myRealStart; // preparing the testtext for the differennt scales @@ -2109,25 +2109,25 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale) testTextMinor = "12 AM"; testTextMajor = "Mon Aug 30, x"; if ( yearFormat() != KDGanttView::NoDate ) - testTextMajor += getYear(TQDate::tqcurrentDate()); + testTextMajor += getYear(TQDate::currentDate()); minorPerMajor = 2400; break; case KDGanttView::Day: minorItems = minorItems/(60*24); testTextMinor = "88"; - testTextMajor = "Aug 30, x"+getYear(TQDate::tqcurrentDate()); + testTextMajor = "Aug 30, x"+getYear(TQDate::currentDate()); minorPerMajor = 700; break; case KDGanttView::Week: minorItems = minorItems/(60*24*7); testTextMinor = "88"; - testTextMajor = "Aug x"+getYear(TQDate::tqcurrentDate()); + testTextMajor = "Aug x"+getYear(TQDate::currentDate()); minorPerMajor = 435; // 435 = 365days/12months/7days * 100 break; case KDGanttView::Month: minorItems = (minorItems*12)/(60*24*365); testTextMinor = "M"; - testTextMajor = "x"+getYear(TQDate::tqcurrentDate()); + testTextMajor = "x"+getYear(TQDate::currentDate()); minorPerMajor = 1200; break; case KDGanttView::Auto: @@ -2135,12 +2135,12 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale) qDebug(" RealScale == Auto : This may not be! "); break; } - tqitemRectMinor = p.boundingRect ( 10, 10, 2, 2, TQt::AlignLeft,testTextMinor); - tqitemRectMajor = p.boundingRect ( 10, 10, 2, 2, TQt::AlignLeft,testTextMajor); + itemRectMinor = p.boundingRect ( 10, 10, 2, 2, TQt::AlignLeft,testTextMinor); + itemRectMajor = p.boundingRect ( 10, 10, 2, 2, TQt::AlignLeft,testTextMajor); p.end(); //qDebug(" tempMinorScaleCount %d ", tempMinorScaleCount); - Height = tqitemRectMinor.height()+tqitemRectMajor.height()+11; - Width = (tqitemRectMinor.width()+5); + Height = itemRectMinor.height()+itemRectMajor.height()+11; + Width = (itemRectMinor.width()+5); if (Width < minimumColumnWidth()) Width = minimumColumnWidth(); // if the desired width is greater than the maximum width of this widget // increase the minorscalecount @@ -2197,7 +2197,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale) // checking, if enough space for majorscale // if not, increasing MajorScaleCount - while ((minorPerMajor*Width)/100 < tqitemRectMajor.width()) { + while ((minorPerMajor*Width)/100 < itemRectMajor.width()) { minorPerMajor = minorPerMajor/tempMajorScaleCount; ++tempMajorScaleCount; minorPerMajor = minorPerMajor*tempMajorScaleCount; @@ -2207,13 +2207,13 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale) myGridMinorWidth = Width; // the width of this widget is the gridwidth * the amount of items Width *= minorItems; - // if size changed, reset tqgeometry + // if size changed, reset geometry if (width() != Width || height() != Height ) { resize( Width, Height ); emit sizeChanged( Width ); } - myMajorGridHeight = tqitemRectMajor.height()+5; + myMajorGridHeight = itemRectMajor.height()+5; TQTime tempTime = myRealStart.time(); TQDateTime tempDateTime; int i; @@ -2343,7 +2343,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale) myGanttView->myTimeTable->setBlockUpdating( block ); updateTimeTable(); centerDateTime(myCenterDateTime); - tqrepaint(); + repaint(); } @@ -2489,7 +2489,7 @@ void KDTimeHeaderWidget::mouseReleaseEvent ( TQMouseEvent * ) //zoomToSelection( getDateTimeForIndex(start),getDateTimeForIndex(end) ); } mouseDown = false; - tqrepaint(); + repaint(); } @@ -2504,11 +2504,11 @@ void KDTimeHeaderWidget::mouseMoveEvent ( TQMouseEvent * e ) if ( mouseDown ) { if ( e->pos().y() < -height() || e->pos().y() > 2* height() ) { mouseDown = false; - tqrepaint(); + repaint(); return; } endMouseDown = e->pos().x(); - //tqrepaint; + //repaint; int val = -1; if (endMouseDown < -x() ) { val = myGanttView->myCanvasView->horizontalScrollBar()->value() - @@ -2631,7 +2631,7 @@ TQSize KDLegendWidget::legendSize() TQSize KDLegendWidget::legendSizeHint() { TQApplication::sendPostedEvents( 0, TQEvent::LayoutHint ); - return TQSize( myLegend->tqsizeHint().width(), myLegend->tqsizeHint().height()+scroll->horizontalScrollBar()->height()); + return TQSize( myLegend->sizeHint().width(), myLegend->sizeHint().height()+scroll->horizontalScrollBar()->height()); } @@ -2652,7 +2652,7 @@ void KDLegendWidget::clearLegend ( ) myLegend->setFont( font() ); scroll->addChild( myLegend ); scroll->setResizePolicy( TQScrollView::AutoOneFit ); - myLegend->tqlayout()->setMargin( 11 ); + myLegend->layout()->setMargin( 11 ); myLegend->setFrameStyle( TQFrame::NoFrame ); if ( dock ) scroll->setMaximumHeight( 32000 ); @@ -2661,10 +2661,10 @@ void KDLegendWidget::clearLegend ( ) } -void KDLegendWidget::addLegendItem( KDGanttViewItem::Shape tqshape, const TQColor& tqshapeColor, const TQString& text ) +void KDLegendWidget::addLegendItem( KDGanttViewItem::Shape shape, const TQColor& shapeColor, const TQString& text ) { TQLabel * temp; - TQPixmap p = KDGanttView::getPixmap( tqshape, tqshapeColor, TQt::white, 10); + TQPixmap p = KDGanttView::getPixmap( shape, shapeColor, TQt::white, 10); TQWidget *w = new TQWidget( myLegend ); w->setBackgroundColor( TQt::white ); TQHBoxLayout *lay = new TQHBoxLayout( w ,0, 6); @@ -2884,7 +2884,7 @@ void KDListView::drawAllContents(TQPainter * p, int cx, int cy, int cw, int ch) c = fc; // draw to last interesting column - const TQColorGroup &cg = ( tqpalette().inactive() ); + const TQColorGroup &cg = ( palette().inactive() ); while ( c < lc && !drawables.isEmpty() ) { int i = header()->mapToLogical( c ); @@ -2921,7 +2921,7 @@ void KDListView::drawAllContents(TQPainter * p, int cx, int cy, int cw, int ch) if ( tx < 0 ) tx = header()->cellPos( cell ); - // do any tqchildren of current need to be painted? + // do any children of current need to be painted? /* FIXME: painting branches doesn't work for some reason... if ( ih != ith && rootIsDecorated() && @@ -2949,7 +2949,7 @@ void KDListView::drawAllContents(TQPainter * p, int cx, int cy, int cw, int ch) p->translate( rleft, crtop ); //kdDebug()<i->text(0)<i->paintBranches( p, tqcolorGroup(), treeStepSize(), + current->i->paintBranches( p, colorGroup(), treeStepSize(), rtop - crtop, r.height() ); p->restore(); } @@ -3510,7 +3510,7 @@ KDGanttCanvasView::MovingOperation KDGanttCanvasView::gvItemHitTest( KDGanttView void KDGanttCanvasView::contentsMousePressEvent ( TQMouseEvent * e ) { //qDebug("mousepress! %d ", this); - //qDebug("focus %d ",tqApp->tqfocusWidget()); + //qDebug("focus %d ",tqApp->focusWidget()); setFocus(); currentLink = 0; currentItem = 0; @@ -4018,7 +4018,7 @@ void KDIntervalColorRectangle::setColor( const TQColor& color ) /*! \internal */ -void KDIntervalColorRectangle::tqlayout( KDTimeHeaderWidget* timeHeader, int height ) +void KDIntervalColorRectangle::layout( KDTimeHeaderWidget* timeHeader, int height ) { int left = timeHeader->getCoordX(mStart); int right = timeHeader->getCoordX(mEnd); diff --git a/kdgantt/KDGanttViewSubwidgets.h b/kdgantt/KDGanttViewSubwidgets.h index 7b553222a..e8f27f8eb 100644 --- a/kdgantt/KDGanttViewSubwidgets.h +++ b/kdgantt/KDGanttViewSubwidgets.h @@ -49,9 +49,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -337,7 +337,7 @@ public: KDLegendWidget ( TQWidget* parent, KDGanttMinimizeSplitter* legendParent ); void showMe(bool); bool isShown(); - void addLegendItem( KDGanttViewItem::Shape tqshape, const TQColor& tqshapeColor, const TQString& text ); + void addLegendItem( KDGanttViewItem::Shape shape, const TQColor& shapeColor, const TQString& text ); void clearLegend(); void setFont( TQFont ); void drawToPainter( TQPainter *p ); @@ -471,7 +471,7 @@ public: enum HitTest { Start, Middle, End }; HitTest hitTest( KDTimeHeaderWidget* timeHeader, const TQPoint& pos ) const; - void tqlayout( KDTimeHeaderWidget* timeHeader, int height ); + void layout( KDTimeHeaderWidget* timeHeader, int height ); static const int RTTI = 0x0c58; /*reimp*/ int rtti() const { return RTTI; } diff --git a/kdgantt/KDGanttViewTaskItem.cpp b/kdgantt/KDGanttViewTaskItem.cpp index a89f23603..605cb9919 100644 --- a/kdgantt/KDGanttViewTaskItem.cpp +++ b/kdgantt/KDGanttViewTaskItem.cpp @@ -43,7 +43,7 @@ This class represents calendar items in Gantt charts. - A calendar item in a Gantt chart has no start/end tqshape, + A calendar item in a Gantt chart has no start/end shape, it is displayed as a rectangle. You can set the colors as usual, where only the first argument of setColors( col, col, col ) diff --git a/kdgantt/KDGanttXMLTools.cpp b/kdgantt/KDGanttXMLTools.cpp index 5f2909c07..367c8035a 100644 --- a/kdgantt/KDGanttXMLTools.cpp +++ b/kdgantt/KDGanttXMLTools.cpp @@ -33,7 +33,7 @@ **********************************************************************/ #include "KDGanttXMLTools.h" -#include +#include #include #include #include diff --git a/kdgantt/Makefile.am b/kdgantt/Makefile.am index 39e20bcb8..81222706b 100644 --- a/kdgantt/Makefile.am +++ b/kdgantt/Makefile.am @@ -33,7 +33,7 @@ noinst_HEADERS = \ KDGanttViewTaskLink.h \ KDGanttXMLTools.h \ itemAttributeDialog.ui.h \ - qtqlayoutengine_p.h + qlayoutengine_p.h METASOURCES = AUTO diff --git a/kdgantt/itemAttributeDialog.ui b/kdgantt/itemAttributeDialog.ui index a3616dcad..5a34dbb5e 100644 --- a/kdgantt/itemAttributeDialog.ui +++ b/kdgantt/itemAttributeDialog.ui @@ -64,7 +64,7 @@ Expanding - + 0 16 @@ -383,7 +383,7 @@ Expanding - + 0 16 @@ -462,7 +462,7 @@ Text color: - + AlignVCenter|AlignRight diff --git a/kdgantt/itemAttributeDialog.ui.h b/kdgantt/itemAttributeDialog.ui.h index 3ab24af83..8624d45d5 100644 --- a/kdgantt/itemAttributeDialog.ui.h +++ b/kdgantt/itemAttributeDialog.ui.h @@ -54,7 +54,7 @@ void itemAttributeDialog::ChangeText_clicked() myItem->setTextColor( c ); TQPixmap * pix = (TQPixmap *)ChangeText->pixmap(); pix->fill( myItem->textColor() ); - ChangeText->tqrepaint(); + ChangeText->repaint(); } @@ -62,7 +62,7 @@ void itemAttributeDialog::ChangeStart_clicked() { if ( !myItem) return; KDGanttViewItem::Shape start, middle, end; - myItem->tqshapes( start, middle, end ); + myItem->shapes( start, middle, end ); TQColor st, mi, en; myItem->colors( st, mi, en ); TQColor c = TQColorDialog::getColor( st, this ); @@ -79,7 +79,7 @@ void itemAttributeDialog::ChangeMiddle_clicked() { if ( !myItem) return; KDGanttViewItem::Shape start, middle, end; - myItem->tqshapes( start, middle, end ); + myItem->shapes( start, middle, end ); TQColor st, mi, en; myItem->colors( st, mi, en ); TQColor c = TQColorDialog::getColor( mi, this ); @@ -95,7 +95,7 @@ void itemAttributeDialog::ChangeEnd_clicked() { if ( !myItem) return; KDGanttViewItem::Shape start, middle, end; - myItem->tqshapes( start, middle, end ); + myItem->shapes( start, middle, end ); TQColor st, mi, en; myItem->colors( st, mi, en ); TQColor c = TQColorDialog::getColor( en, this ); @@ -244,7 +244,7 @@ void itemAttributeDialog::reset( KDGanttViewItem * item ) // DateEdit3->setRange(item->startTime().date(), item->endTime().date().addYears(10)); LineEdit1->setText( item->text() ); KDGanttViewItem::Shape start, middle, end; - item->tqshapes( start, middle, end ); + item->shapes( start, middle, end ); TQColor st, mi, en; item->colors( st, mi, en ); ChangeStart->setPixmap( KDGanttView::getPixmap( start, st, backgroundColor(), 10 ) ); @@ -272,7 +272,7 @@ void itemAttributeDialog::HighStart_clicked() { if ( !myItem) return; KDGanttViewItem::Shape start, middle, end; - myItem->tqshapes( start, middle, end ); + myItem->shapes( start, middle, end ); TQColor st, mi, en; myItem->highlightColors( st, mi, en ); TQColor c = TQColorDialog::getColor( st, this ); @@ -289,7 +289,7 @@ void itemAttributeDialog::HighMiddle_clicked() { if ( !myItem) return; KDGanttViewItem::Shape start, middle, end; - myItem->tqshapes( start, middle, end ); + myItem->shapes( start, middle, end ); TQColor st, mi, en; myItem->highlightColors( st, mi, en ); TQColor c = TQColorDialog::getColor( mi, this ); @@ -306,7 +306,7 @@ void itemAttributeDialog::HighEnd_clicked() { if ( !myItem) return; KDGanttViewItem::Shape start, middle, end; - myItem->tqshapes( start, middle, end ); + myItem->shapes( start, middle, end ); TQColor st, mi, en; myItem->highlightColors( st, mi, en ); TQColor c = TQColorDialog::getColor( en, this ); @@ -409,7 +409,7 @@ void itemAttributeDialog::LineEdit1_textChanged( const TQString & ) void itemAttributeDialog::StartBox_activated( const TQString & s ) { KDGanttViewItem::Shape start, middle, end; - myItem->tqshapes( start, middle, end ); + myItem->shapes( start, middle, end ); start = KDGanttViewItem::stringToShape( s ); myItem->setShapes( start, middle, end ); reset( myItem ); @@ -419,7 +419,7 @@ void itemAttributeDialog::StartBox_activated( const TQString & s ) void itemAttributeDialog::MiddleBox_activated( const TQString & s ) { KDGanttViewItem::Shape start, middle, end; - myItem->tqshapes( start, middle, end ); + myItem->shapes( start, middle, end ); middle = KDGanttViewItem::stringToShape( s ); myItem->setShapes( start, middle, end ); reset( myItem ); @@ -430,7 +430,7 @@ void itemAttributeDialog::MiddleBox_activated( const TQString & s ) void itemAttributeDialog::EndBox_activated( const TQString & s ) { KDGanttViewItem::Shape start, middle, end; - myItem->tqshapes( start, middle, end ); + myItem->shapes( start, middle, end ); end = KDGanttViewItem::stringToShape( s ); myItem->setShapes( start, middle, end ); reset( myItem ); diff --git a/kdgantt/qlayoutengine_p.h b/kdgantt/qlayoutengine_p.h index 1f03331d2..27fd861b9 100644 --- a/kdgantt/qlayoutengine_p.h +++ b/kdgantt/qlayoutengine_p.h @@ -46,7 +46,7 @@ // ------------- // // This file is not part of the TQt API. It exists for the convenience -// of qtqlayout.cpp, qlayoutengine.cpp, qmainwindow.cpp and qsplitter.cpp. +// of qlayout.cpp, qlayoutengine.cpp, qmainwindow.cpp and qsplitter.cpp. // This header file may change from version to version without notice, // or even be removed. // @@ -56,21 +56,21 @@ #ifndef TQT_H -#include "tqabstractqlayout.h" +#include "tqabstraclayout.h" #endif // TQT_H #ifndef TQT_NO_LAYOUT struct QLayoutStruct { - void initParameters() { tqminimumSize = tqsizeHint = 0; - tqmaximumSize = TQWIDGETSIZE_MAX; expansive = FALSE; empty = TRUE; } + void initParameters() { minimumSize = sizeHint = 0; + maximumSize = TQWIDGETSIZE_MAX; expansive = FALSE; empty = TRUE; } void init() { stretch = 0; initParameters(); } //permanent storage: int stretch; //parameters: - TQCOORD tqsizeHint; - TQCOORD tqmaximumSize; - TQCOORD tqminimumSize; + TQCOORD sizeHint; + TQCOORD maximumSize; + TQCOORD minimumSize; bool expansive; bool empty; //temporary storage: -- cgit v1.2.1