diff options
Diffstat (limited to 'kdgantt/KDGanttViewSubwidgets.cpp')
-rw-r--r-- | kdgantt/KDGanttViewSubwidgets.cpp | 684 |
1 files changed, 342 insertions, 342 deletions
diff --git a/kdgantt/KDGanttViewSubwidgets.cpp b/kdgantt/KDGanttViewSubwidgets.cpp index d35f7eba5..ffec65282 100644 --- a/kdgantt/KDGanttViewSubwidgets.cpp +++ b/kdgantt/KDGanttViewSubwidgets.cpp @@ -41,43 +41,43 @@ #include "KDGanttViewSubwidgets.moc" #endif -#include <qlabel.h> -#include <qheader.h> -#include <qpainter.h> -#include <qrect.h> -#include <qtooltip.h> -#include <qapplication.h> -#include <qdrawutil.h> -#include <qpalette.h> -#include <qdragobject.h> -#include <qptrlist.h> -#include <qpen.h> +#include <tqlabel.h> +#include <tqheader.h> +#include <tqpainter.h> +#include <tqrect.h> +#include <tqtooltip.h> +#include <tqapplication.h> +#include <tqdrawutil.h> +#include <tqpalette.h> +#include <tqdragobject.h> +#include <tqptrlist.h> +#include <tqpen.h> #include <kglobal.h> #include <klocale.h> #include <kcalendarsystem.h> #include <kdebug.h> -KDTimeTableWidget:: KDTimeTableWidget( QWidget* parent,KDGanttView* myGantt) - : QCanvas (parent) +KDTimeTableWidget:: KDTimeTableWidget( TQWidget* parent,KDGanttView* myGantt) + : TQCanvas (parent) { myGanttView = myGantt; taskLinksVisible = true; flag_blockUpdating = false; int_blockUpdating = 0; gridPen.setStyle(Qt::DotLine); - gridPen.setColor(QColor(100,100,100)); + gridPen.setColor(TQColor(100,100,100)); maximumComputedGridHeight = 0; denseLineCount = 0; - denseLineBrush = QBrush( QColor ( 240,240,240 )); - noInfoLineBrush = QBrush( QColor ( 100,100,100 ), Qt::FDiagPattern ); + denseLineBrush = TQBrush( TQColor ( 240,240,240 )); + noInfoLineBrush = TQBrush( TQColor ( 100,100,100 ), Qt::FDiagPattern ); pendingHeight = 0; pendingWidth = 0; retune(256); resize(1,1); } -QPtrList<KDGanttViewTaskLink> KDTimeTableWidget::taskLinks() +TQPtrList<KDGanttViewTaskLink> KDTimeTableWidget::taskLinks() { return myTaskLinkList; } @@ -85,7 +85,7 @@ QPtrList<KDGanttViewTaskLink> KDTimeTableWidget::taskLinks() void KDTimeTableWidget::clearTaskLinks() { // cannot use clear() here, as tasklinks will remove themselves from my list when deleted! - QPtrListIterator<KDGanttViewTaskLink> it(myTaskLinkList); + TQPtrListIterator<KDGanttViewTaskLink> it(myTaskLinkList); while (it.current()) { delete it.current(); } @@ -120,38 +120,38 @@ void KDTimeTableWidget::checkHeight( int hei ) } -void KDTimeTableWidget::setNoInformationBrush( const QBrush& brush ) +void KDTimeTableWidget::setNoInformationBrush( const TQBrush& brush ) { noInfoLineBrush = brush; updateMyContent(); } -QBrush KDTimeTableWidget::noInformationBrush() const +TQBrush KDTimeTableWidget::noInformationBrush() const { return noInfoLineBrush; } void KDTimeTableWidget::removeItemFromTasklinks( KDGanttViewItem* item) { - QPtrListIterator<KDGanttViewTaskLink> it((myTaskLinkList)); + TQPtrListIterator<KDGanttViewTaskLink> it((myTaskLinkList)); for ( ; it.current(); ++it ) { it.current()->removeItemFromList( item ); } } -void KDTimeTableWidget::expandItem( QListViewItem * item) +void KDTimeTableWidget::expandItem( TQListViewItem * item) { item->invalidateHeight () ; //qApp->processEvents(); updateMyContent(); } -void KDTimeTableWidget::collapseItem( QListViewItem * item) +void KDTimeTableWidget::collapseItem( TQListViewItem * item) { item->invalidateHeight () ; //qApp->processEvents(); updateMyContent(); } -void KDTimeTableWidget::highlightItem( QListViewItem * item ) +void KDTimeTableWidget::highlightItem( TQListViewItem * item ) { static bool itemwashighlighted; static KDGanttViewItem* highlightedItem = 0; @@ -203,15 +203,15 @@ void KDTimeTableWidget::computeVerticalGrid() wid = width(); KDCanvasLine* templine; KDCanvasRectangle* temprect; - QColor colcol; - QPen colPen; + TQColor colcol; + TQPen colPen; bool colorIterator = true; if (myGanttView->showMinorTicks()){//minor colPen.setWidth(cw); - QPtrListIterator<KDCanvasRectangle> itcol(columnColorList); - QPtrListIterator<KDCanvasLine> itgrid(verGridList); + TQPtrListIterator<KDCanvasRectangle> itcol(columnColorList); + TQPtrListIterator<KDCanvasLine> itgrid(verGridList); for ( ; itgrid.current(); ++itgrid ) { if (i < wid) { itgrid.current()->setPoints(i,0,i,h); @@ -229,8 +229,8 @@ void KDTimeTableWidget::computeVerticalGrid() itcol.current()->setPoints(i+(cw/2),0,i+(cw/2),h); */ - itcol.current()->setPen( QPen::NoPen ); - itcol.current()->setBrush( QBrush( colcol, SolidPattern) ); + itcol.current()->setPen( TQPen::NoPen ); + itcol.current()->setBrush( TQBrush( colcol, SolidPattern) ); itcol.current()->setSize(cw ,h ); itcol.current()->move( i, 0 ); itcol.current()->show(); @@ -243,8 +243,8 @@ void KDTimeTableWidget::computeVerticalGrid() templine->setPoints(i+(cw/2),0,i+(cw/2),h); */ temprect = new KDCanvasRectangle(this,0,Type_is_KDGanttGridItem); - temprect->setPen( QPen::NoPen ); - temprect->setBrush( QBrush( colcol, SolidPattern) ); + temprect->setPen( TQPen::NoPen ); + temprect->setBrush( TQBrush( colcol, SolidPattern) ); temprect->setSize(cw ,h ); temprect->move( i, 0 ); temprect->setZ(-20); @@ -275,16 +275,16 @@ void KDTimeTableWidget::computeVerticalGrid() itcol.current()->setPen(colPen); itcol.current()->setPoints(i+(cw/2),0,i+(cw/2),h); */ - itcol.current()->setPen( QPen::NoPen ); - itcol.current()->setBrush( QBrush( colcol, SolidPattern) ); + itcol.current()->setPen( TQPen::NoPen ); + itcol.current()->setBrush( TQBrush( colcol, SolidPattern) ); itcol.current()->setSize(cw ,h ); itcol.current()->move( i, 0 ); itcol.current()->show(); ++itcol; } else { temprect = new KDCanvasRectangle(this,0,Type_is_KDGanttGridItem); - temprect->setPen( QPen::NoPen ); - temprect->setBrush( QBrush( colcol, SolidPattern) ); + temprect->setPen( TQPen::NoPen ); + temprect->setBrush( TQBrush( colcol, SolidPattern) ); temprect->setSize(cw ,h ); temprect->move( i, 0 ); temprect->setZ(-20); @@ -306,10 +306,10 @@ void KDTimeTableWidget::computeVerticalGrid() itcol.current()->hide(); } else {//major if (myGanttView->showMajorTicks()) { - QValueList<int>::iterator intIt = myGanttView->myTimeHeader->majorTicks.begin(); - QValueList<int>::iterator intItEnd = myGanttView->myTimeHeader->majorTicks.end(); - QPtrListIterator<KDCanvasRectangle> itcol(columnColorList); - QPtrListIterator<KDCanvasLine> itgrid(verGridList); + TQValueList<int>::iterator intIt = myGanttView->myTimeHeader->majorTicks.begin(); + TQValueList<int>::iterator intItEnd = myGanttView->myTimeHeader->majorTicks.end(); + TQPtrListIterator<KDCanvasRectangle> itcol(columnColorList); + TQPtrListIterator<KDCanvasLine> itgrid(verGridList); int left = 0; for ( ; itgrid.current(); ++itgrid ) { if (intIt != intItEnd) { @@ -331,16 +331,16 @@ void KDTimeTableWidget::computeVerticalGrid() itcol.current()->setPen(colPen); itcol.current()->setPoints(i+mid,0,mid,h); */ - itcol.current()->setPen( QPen::NoPen ); - itcol.current()->setBrush( QBrush( colcol, SolidPattern) ); + itcol.current()->setPen( TQPen::NoPen ); + itcol.current()->setBrush( TQBrush( colcol, SolidPattern) ); itcol.current()->setSize(mid ,h ); itcol.current()->move( left, 0 ); itcol.current()->show(); ++itcol; } else { temprect = new KDCanvasRectangle(this,0,Type_is_KDGanttGridItem); - temprect->setPen( QPen::NoPen ); - temprect->setBrush( QBrush( colcol, SolidPattern) ); + temprect->setPen( TQPen::NoPen ); + temprect->setBrush( TQBrush( colcol, SolidPattern) ); temprect->setSize(mid,h ); temprect->move( left, 0 ); temprect->setZ(-20); @@ -385,16 +385,16 @@ void KDTimeTableWidget::computeVerticalGrid() itcol.current()->setPen(colPen); itcol.current()->setPoints(i+mid,0,mid,h); */ - itcol.current()->setPen( QPen::NoPen ); - itcol.current()->setBrush( QBrush( colcol, SolidPattern) ); + itcol.current()->setPen( TQPen::NoPen ); + itcol.current()->setBrush( TQBrush( colcol, SolidPattern) ); itcol.current()->setSize(mid ,h ); itcol.current()->move( left, 0 ); itcol.current()->show(); ++itcol; } else { temprect = new KDCanvasRectangle(this,0,Type_is_KDGanttGridItem); - temprect->setPen( QPen::NoPen ); - temprect->setBrush( QBrush( colcol, SolidPattern) ); + temprect->setPen( TQPen::NoPen ); + temprect->setBrush( TQBrush( colcol, SolidPattern) ); temprect->setSize(mid ,h ); temprect->move( left, 0 ); temprect->setZ(-20); @@ -420,11 +420,11 @@ void KDTimeTableWidget::computeVerticalGrid() } else { //hideall - QPtrListIterator<KDCanvasLine> itgrid(verGridList); + TQPtrListIterator<KDCanvasLine> itgrid(verGridList); for ( ; itgrid.current(); ++itgrid ) { itgrid.current()->hide(); } - QPtrListIterator<KDCanvasRectangle> itcol(columnColorList); + TQPtrListIterator<KDCanvasRectangle> itcol(columnColorList); for ( ; itcol.current(); ++itcol ) { itcol.current()->hide(); } @@ -442,7 +442,7 @@ void KDTimeTableWidget::computeHorizontalGrid() else wid = width(); KDCanvasLine* templine; - QPtrListIterator<KDCanvasLine> ithor(horGridList); + TQPtrListIterator<KDCanvasLine> ithor(horGridList); if ( ithor.current() ) { templine = ithor.current(); ++ithor; @@ -467,11 +467,11 @@ void KDTimeTableWidget::computeHorizontalGrid() templine->setZ(0); horGridList.append(templine); } - if ( templine->endPoint() != QPoint(wid,posY )) + if ( templine->endPoint() != TQPoint(wid,posY )) templine->setPoints(0,posY,wid,posY ); if ( !templine->isVisible() ) templine->show(); - //QString ts = "asGroup"; + //TQString ts = "asGroup"; //if (!temp->displaySubitemsAsGroup() ) // ts = " NOT asGroup"; //qDebug("temp name %s %s", temp->listViewText(0).latin1(), ts.latin1()); @@ -493,7 +493,7 @@ void KDTimeTableWidget::computeDenseLines() wid = pendingWidth; else wid = width(); - QPtrListIterator<KDCanvasRectangle> ithordense(horDenseList); + TQPtrListIterator<KDCanvasRectangle> ithordense(horDenseList); KDCanvasRectangle* denseLine; int tempDenseLineCount = 0; while ( temp ) { @@ -509,12 +509,12 @@ void KDTimeTableWidget::computeDenseLines() denseLine->setZ(-2); horDenseList.append( denseLine ); } - if ( denseLine->rect() != QRect(0, temp->itemPos(),wid, temp->height()) ) { + if ( denseLine->rect() != TQRect(0, temp->itemPos(),wid, temp->height()) ) { denseLine->move( 0, temp->itemPos() ); denseLine->setSize( wid, temp->height()); } if (denseLine->brush() != denseLineBrush ) { - denseLine->setPen( QPen( Qt::NoPen ) ); + denseLine->setPen( TQPen( Qt::NoPen ) ); denseLine->setBrush( denseLineBrush); } if (!denseLine->isVisible() ) @@ -541,7 +541,7 @@ void KDTimeTableWidget::computeShowNoInformation() wid = pendingWidth; else wid = width(); - QPtrListIterator<KDCanvasRectangle> itnoinfo(showNoInfoList); + TQPtrListIterator<KDCanvasRectangle> itnoinfo(showNoInfoList); KDCanvasRectangle* noInfoLine; while ( temp ) { if ( temp->showNoInformation() ) { @@ -555,7 +555,7 @@ void KDTimeTableWidget::computeShowNoInformation() } noInfoLine->move( 0, temp->itemPos() ); noInfoLine->setSize( wid, temp->height()); - noInfoLine->setPen( QPen( Qt::NoPen ) ); + noInfoLine->setPen( TQPen( Qt::NoPen ) ); noInfoLine->setBrush( noInfoLineBrush); noInfoLine->show(); } @@ -571,7 +571,7 @@ void KDTimeTableWidget::computeShowNoInformation() void KDTimeTableWidget::computeTaskLinks() { //compute and show tasklinks - QPtrListIterator<KDGanttViewTaskLink> it((myTaskLinkList)); + TQPtrListIterator<KDGanttViewTaskLink> it((myTaskLinkList)); for ( ; it.current(); ++it ) { if (it.current()->isVisible()) it.current()->showMe(true); @@ -673,7 +673,7 @@ bool KDTimeTableWidget::showTaskLinks() { return taskLinksVisible; } -void KDTimeTableWidget::setHorBackgroundLines( int count, QBrush brush ) +void KDTimeTableWidget::setHorBackgroundLines( int count, TQBrush brush ) { denseLineBrush = brush; denseLineCount = 0; @@ -682,32 +682,32 @@ void KDTimeTableWidget::setHorBackgroundLines( int count, QBrush brush ) } -int KDTimeTableWidget::horBackgroundLines( QBrush& brush ) +int KDTimeTableWidget::horBackgroundLines( TQBrush& brush ) { brush = denseLineBrush; return denseLineCount; } -int KDTimeTableWidget::getCoordX( QDateTime dt ) { +int KDTimeTableWidget::getCoordX( TQDateTime dt ) { return myGanttView->myTimeHeader->getCoordX(dt); } /* *************************************************************** KDTimeHeaderWidget:: KDTimeHeaderWidget ***************************************************************** */ -KDTimeHeaderWidget:: KDTimeHeaderWidget( QWidget* parent,KDGanttView* gant ) - : QWidget (parent) +KDTimeHeaderWidget:: KDTimeHeaderWidget( TQWidget* parent,KDGanttView* gant ) + : TQWidget (parent) { myToolTip = new KDTimeHeaderToolTip(this,this); mySizeHint = 0; myGanttView = gant; flagDoNotRecomputeAfterChange = true; - QDateTime start = (QDateTime::currentDateTime ()).addSecs(-3600); + TQDateTime start = (TQDateTime::currentDateTime ()).addSecs(-3600); setHorizonStart(start); setHorizonEnd( start.addSecs(3600*2)); flagStartTimeSet = false; flagEndTimeSet = false; - myCenterDateTime = QDateTime::currentDateTime (); + myCenterDateTime = TQDateTime::currentDateTime (); setScale(KDGanttView::Auto); //setScale(KDGanttView::Hour); myMaxScale = KDGanttView::Month; @@ -719,48 +719,48 @@ KDTimeHeaderWidget:: KDTimeHeaderWidget( QWidget* parent,KDGanttView* gant ) setYearFormat(KDGanttView::FourDigit ); setHourFormat( KDGanttView::Hour_12 ); myZoomFactor = 1.0; - setWeekendBackgroundColor(QColor(220,220,220) ); + setWeekendBackgroundColor(TQColor(220,220,220) ); setWeekendDays( 6, 7 ); myGridMinorWidth = 0; - myPopupMenu = new QPopupMenu(this); - QPopupMenu * zoomPopupMenu = new QPopupMenu(this); + myPopupMenu = new TQPopupMenu(this); + TQPopupMenu * zoomPopupMenu = new TQPopupMenu(this); myPopupMenu->insertItem (i18n("Zoom"),zoomPopupMenu, 1); - zoomPopupMenu->insertItem( i18n("Zoom to 100%"),this, SLOT(setSettings(int)),0 ,21,21 ); - zoomPopupMenu->insertItem( i18n("Zoom to Fit"),this, SLOT(setSettings(int)),0 ,20,20 ); - zoomPopupMenu->insertItem( i18n("Zoom In (x 2)"),this, SLOT(setSettings(int)),0 ,22,22 ); - zoomPopupMenu->insertItem( i18n("Zoom In (x 6)"),this, SLOT(setSettings(int)),0 ,24,24 ); - zoomPopupMenu->insertItem( i18n("Zoom In (x 12)"),this, SLOT(setSettings(int)),0 ,26,26 ); - zoomPopupMenu->insertItem( i18n("Zoom Out (x 1/2)"),this, SLOT(setSettings(int)),0 ,23,23 ); - zoomPopupMenu->insertItem( i18n("Zoom Out (x 1/6)"),this, SLOT(setSettings(int)),0 ,25,25 ); - zoomPopupMenu->insertItem( i18n("Zoom Out (x 1/12)"),this, SLOT(setSettings(int)),0 ,27,27 ); - scalePopupMenu = new QPopupMenu(this); + zoomPopupMenu->insertItem( i18n("Zoom to 100%"),this, TQT_SLOT(setSettings(int)),0 ,21,21 ); + zoomPopupMenu->insertItem( i18n("Zoom to Fit"),this, TQT_SLOT(setSettings(int)),0 ,20,20 ); + zoomPopupMenu->insertItem( i18n("Zoom In (x 2)"),this, TQT_SLOT(setSettings(int)),0 ,22,22 ); + zoomPopupMenu->insertItem( i18n("Zoom In (x 6)"),this, TQT_SLOT(setSettings(int)),0 ,24,24 ); + zoomPopupMenu->insertItem( i18n("Zoom In (x 12)"),this, TQT_SLOT(setSettings(int)),0 ,26,26 ); + zoomPopupMenu->insertItem( i18n("Zoom Out (x 1/2)"),this, TQT_SLOT(setSettings(int)),0 ,23,23 ); + zoomPopupMenu->insertItem( i18n("Zoom Out (x 1/6)"),this, TQT_SLOT(setSettings(int)),0 ,25,25 ); + zoomPopupMenu->insertItem( i18n("Zoom Out (x 1/12)"),this, TQT_SLOT(setSettings(int)),0 ,27,27 ); + scalePopupMenu = new TQPopupMenu(this); myPopupMenu->insertItem (i18n("Scale"),scalePopupMenu, 2); - scalePopupMenu->insertItem( i18n("Minute"),this, SLOT(setSettings(int)),0 ,1,1 ); - scalePopupMenu->insertItem( i18n("Hour"),this, SLOT(setSettings(int)),0 ,2,2 ); - scalePopupMenu->insertItem( i18n("Day"),this, SLOT(setSettings(int)),0 ,3,3 ); - scalePopupMenu->insertItem( i18n("Week"),this, SLOT(setSettings(int)),0 ,4,4 ); - scalePopupMenu->insertItem( i18n("Month"),this, SLOT(setSettings(int)),0 ,5,5 ); - scalePopupMenu->insertItem( i18n("Auto"),this, SLOT(setSettings(int)),0 ,6,6 ); + scalePopupMenu->insertItem( i18n("Minute"),this, TQT_SLOT(setSettings(int)),0 ,1,1 ); + scalePopupMenu->insertItem( i18n("Hour"),this, TQT_SLOT(setSettings(int)),0 ,2,2 ); + scalePopupMenu->insertItem( i18n("Day"),this, TQT_SLOT(setSettings(int)),0 ,3,3 ); + scalePopupMenu->insertItem( i18n("Week"),this, TQT_SLOT(setSettings(int)),0 ,4,4 ); + scalePopupMenu->insertItem( i18n("Month"),this, TQT_SLOT(setSettings(int)),0 ,5,5 ); + scalePopupMenu->insertItem( i18n("Auto"),this, TQT_SLOT(setSettings(int)),0 ,6,6 ); scalePopupMenu->setCheckable ( true ); - timePopupMenu = new QPopupMenu(this); + timePopupMenu = new TQPopupMenu(this); myPopupMenu->insertItem (i18n("Time Format"),timePopupMenu, 3); - timePopupMenu->insertItem( i18n("24 Hour"),this, SLOT(setSettings(int)),0 ,40,40 ); - timePopupMenu->insertItem( i18n("12 PM Hour"),this, SLOT(setSettings(int)),0 ,41,41 ); - timePopupMenu->insertItem( i18n("24:00 Hour"),this, SLOT(setSettings(int)),0 ,42,42 ); - yearPopupMenu = new QPopupMenu(this); + timePopupMenu->insertItem( i18n("24 Hour"),this, TQT_SLOT(setSettings(int)),0 ,40,40 ); + timePopupMenu->insertItem( i18n("12 PM Hour"),this, TQT_SLOT(setSettings(int)),0 ,41,41 ); + timePopupMenu->insertItem( i18n("24:00 Hour"),this, TQT_SLOT(setSettings(int)),0 ,42,42 ); + yearPopupMenu = new TQPopupMenu(this); myPopupMenu->insertItem (i18n("Year Format"),yearPopupMenu, 4); - yearPopupMenu->insertItem( i18n("Four Digit"),this, SLOT(setSettings(int)),0 ,50,50 ); - yearPopupMenu->insertItem( i18n("Two Digit"),this, SLOT(setSettings(int)),0 ,51,51 ); - yearPopupMenu->insertItem( i18n("Two Digit Apostrophe"),this, SLOT(setSettings(int)),0 ,52,52 ); - yearPopupMenu->insertItem( i18n("No Date on Minute/Hour Scale"),this, SLOT(setSettings(int)),0 ,53,53 ); + yearPopupMenu->insertItem( i18n("Four Digit"),this, TQT_SLOT(setSettings(int)),0 ,50,50 ); + yearPopupMenu->insertItem( i18n("Two Digit"),this, TQT_SLOT(setSettings(int)),0 ,51,51 ); + yearPopupMenu->insertItem( i18n("Two Digit Apostrophe"),this, TQT_SLOT(setSettings(int)),0 ,52,52 ); + yearPopupMenu->insertItem( i18n("No Date on Minute/Hour Scale"),this, TQT_SLOT(setSettings(int)),0 ,53,53 ); - gridPopupMenu = new QPopupMenu(this); + gridPopupMenu = new TQPopupMenu(this); myPopupMenu->insertItem (i18n("Grid"),gridPopupMenu,5); - gridPopupMenu->insertItem( i18n("Show Minor Grid"),this, SLOT(setSettings(int)),0 ,10,10 ); - gridPopupMenu->insertItem( i18n("Show Major Grid"),this, SLOT(setSettings(int)),0 ,11,11 ); - gridPopupMenu->insertItem( i18n("Show No Grid"),this, SLOT(setSettings(int)),0 ,12,12 ); - myPopupMenu->insertItem( i18n("Print"),this, SLOT(setSettings(int)),0 ,30,30 ); - connect(myPopupMenu, SIGNAL ( aboutToShow () ) , this, SLOT( preparePopupMenu() )) ; + gridPopupMenu->insertItem( i18n("Show Minor Grid"),this, TQT_SLOT(setSettings(int)),0 ,10,10 ); + gridPopupMenu->insertItem( i18n("Show Major Grid"),this, TQT_SLOT(setSettings(int)),0 ,11,11 ); + gridPopupMenu->insertItem( i18n("Show No Grid"),this, TQT_SLOT(setSettings(int)),0 ,12,12 ); + myPopupMenu->insertItem( i18n("Print"),this, TQT_SLOT(setSettings(int)),0 ,30,30 ); + connect(myPopupMenu, TQT_SIGNAL ( aboutToShow () ) , this, TQT_SLOT( preparePopupMenu() )) ; flagZoomToFit = false; setShowMinorTicks( true ); myRealEnd = myHorizonEnd; @@ -792,7 +792,7 @@ void KDTimeHeaderWidget::preparePopupMenu() if (flagZoomToFit) myPopupMenu->changeItem( 1, i18n("Zoom (Fit)")); else - myPopupMenu->changeItem( 1, i18n("Zoom (%1)").arg( QString::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 ) { @@ -822,7 +822,7 @@ void KDTimeHeaderWidget::preparePopupMenu() } -QString KDTimeHeaderWidget::getToolTipText(QPoint p) +TQString KDTimeHeaderWidget::getToolTipText(TQPoint p) { return KGlobal::locale()->formatDateTime(getDateTimeForIndex(p.x())); } @@ -860,7 +860,7 @@ void KDTimeHeaderWidget::checkWidth( int wid ) // Update (horizontal) scrollbar, // We probably come from an external resize and then we must // calculate on basis of myCanvasView. - // (NOTE: we have disconnected the auto QScrollView scrollbar update) + // (NOTE: we have disconnected the auto TQScrollView scrollbar update) if (myGanttView && myGanttView->myCanvasView) myGanttView->myCanvasView->updateScrollBars(); } @@ -868,9 +868,9 @@ void KDTimeHeaderWidget::checkWidth( int wid ) bool KDTimeHeaderWidget::registerStartTime() { - QListViewItemIterator it( myGanttView->myListView ); + TQListViewItemIterator it( myGanttView->myListView ); if (!flagStartTimeSet) { - QDateTime temp , time; + TQDateTime temp , time; KDGanttViewItem* item; bool setNewTime = false; item = (KDGanttViewItem*)myGanttView->myListView->firstChild(); @@ -916,14 +916,14 @@ bool KDTimeHeaderWidget::registerStartTime() bool KDTimeHeaderWidget::registerEndTime() { if (!flagEndTimeSet) { - QDateTime temp , time; + TQDateTime temp , time; KDGanttViewItem* item; bool setNewTime = false; item = (KDGanttViewItem*)myGanttView->myListView->firstChild(); if ( item ) { temp = item->startTime(); time = temp; - QListViewItemIterator it( myGanttView->myListView ); + TQListViewItemIterator it( myGanttView->myListView ); for ( ; it.current(); ++it ) { item = ( KDGanttViewItem* )it.current(); if (item->isVisibleInGanttView) { @@ -1094,9 +1094,9 @@ double KDTimeHeaderWidget::zoomFactor() { return myZoomFactor; } -double KDTimeHeaderWidget::secsFromTo( QDateTime begin, QDateTime end ) +double KDTimeHeaderWidget::secsFromTo( TQDateTime begin, TQDateTime end ) { - QDateTime temp; + TQDateTime temp; double secs, days; days = begin.daysTo(end); temp = begin.addDays((int) days); @@ -1106,7 +1106,7 @@ double KDTimeHeaderWidget::secsFromTo( QDateTime begin, QDateTime end ) } -void KDTimeHeaderWidget::zoomToSelection( QDateTime start, QDateTime end) +void KDTimeHeaderWidget::zoomToSelection( TQDateTime start, TQDateTime end) { if (start < myHorizonStart) { myHorizonStart = start; @@ -1189,7 +1189,7 @@ void KDTimeHeaderWidget::zoom(double factor, bool absolute) \param start the start of the horizon \sa horizonStart() */ -void KDTimeHeaderWidget::setHorizonStart( const QDateTime& start ) +void KDTimeHeaderWidget::setHorizonStart( const TQDateTime& start ) { myHorizonStart = start; flagStartTimeSet = true; @@ -1203,7 +1203,7 @@ void KDTimeHeaderWidget::setHorizonStart( const QDateTime& start ) \return the start of the horizon of the Gantt chart \sa setHorizonStart() */ -QDateTime KDTimeHeaderWidget::horizonStart() const +TQDateTime KDTimeHeaderWidget::horizonStart() const { return myHorizonStart; } @@ -1216,7 +1216,7 @@ QDateTime KDTimeHeaderWidget::horizonStart() const \param end the end of the horizon \sa setHorizonEnd() */ -void KDTimeHeaderWidget::setHorizonEnd( const QDateTime& start ) +void KDTimeHeaderWidget::setHorizonEnd( const TQDateTime& start ) { myHorizonEnd = start; flagEndTimeSet = true; @@ -1231,7 +1231,7 @@ void KDTimeHeaderWidget::setHorizonEnd( const QDateTime& start ) \return the end of the horizon of the Gantt chart \sa setHorizonEnd() */ -QDateTime KDTimeHeaderWidget::horizonEnd() const +TQDateTime KDTimeHeaderWidget::horizonEnd() const { return myHorizonEnd; } @@ -1461,8 +1461,8 @@ bool KDTimeHeaderWidget::showMinorTicks() const \sa columnBackgroundColor(), setWeekendBackgroundColor(), weekendBackgroundColor() */ -void KDTimeHeaderWidget::setColumnBackgroundColor( const QDateTime& column, - const QColor& color, +void KDTimeHeaderWidget::setColumnBackgroundColor( const TQDateTime& column, + const TQColor& color, Scale mini, Scale maxi ) { ColumnColorList::iterator it; @@ -1498,10 +1498,10 @@ void KDTimeHeaderWidget::addIntervalBackgroundColor( KDIntervalColorRectangle* n } #if 0 -bool KDTimeHeaderWidget::changeBackgroundInterval( const QDateTime& oldstart, - const QDateTime& oldend, - const QDateTime& newstart, - const QDateTime& newend ) +bool KDTimeHeaderWidget::changeBackgroundInterval( const TQDateTime& oldstart, + const TQDateTime& oldend, + const TQDateTime& newstart, + const TQDateTime& newend ) { IntervalColorList::iterator it; for ( it = icList.begin(); it != icList.end(); ++it ) { @@ -1519,8 +1519,8 @@ bool KDTimeHeaderWidget::changeBackgroundInterval( const QDateTime& oldstart, } return false; } -bool KDTimeHeaderWidget::deleteBackgroundInterval( const QDateTime& start, - const QDateTime& end) +bool KDTimeHeaderWidget::deleteBackgroundInterval( const TQDateTime& start, + const TQDateTime& end) { IntervalColorList::iterator it; for ( it = icList.begin(); it != icList.end(); ++it ) { @@ -1535,9 +1535,9 @@ bool KDTimeHeaderWidget::deleteBackgroundInterval( const QDateTime& start, return false; } -void KDTimeHeaderWidget::setIntervalBackgroundColor( const QDateTime& start, - const QDateTime& end, - const QColor& color, +void KDTimeHeaderWidget::setIntervalBackgroundColor( const TQDateTime& start, + const TQDateTime& end, + const TQColor& color, Scale mini , Scale maxi ) { @@ -1581,11 +1581,11 @@ void KDTimeHeaderWidget::clearBackgroundColor() icList.clear(); updateTimeTable(); } -QDateTime KDTimeHeaderWidget::getDateTimeForIndex(int X, bool local ) +TQDateTime KDTimeHeaderWidget::getDateTimeForIndex(int X, bool local ) { int coordX = X; if ( !local ) { - QPoint p = QPoint ( X, 1 ); + TQPoint p = TQPoint ( X, 1 ); coordX = myGanttView->myTimeHeaderScroll->viewportToContents(myGanttView->myTimeHeaderScroll->mapFromGlobal( p )).x(); } @@ -1602,11 +1602,11 @@ QDateTime KDTimeHeaderWidget::getDateTimeForIndex(int X, bool local ) // *none* get weekend color (haven't figured out why) // Proposal: Only use weekend color if the whole column is a weekend. // Alt: Color the area that actually is the weekend. -bool KDTimeHeaderWidget::getColumnColor(QColor& col,int coordLow, int coordHigh) +bool KDTimeHeaderWidget::getColumnColor(TQColor& col,int coordLow, int coordHigh) { if (!flagShowMajorTicks && !flagShowMinorTicks) return false; - QDateTime start,end; + TQDateTime start,end; start = getDateTimeForIndex(coordLow); end = getDateTimeForIndex(coordHigh).addSecs(-1); Scale tempScale = myRealScale; @@ -1663,9 +1663,9 @@ bool KDTimeHeaderWidget::getColumnColor(QColor& col,int coordLow, int coordHigh) \sa setColumnBackgroundColor(), setWeekendBackgroundColor(), weekendBackgroundColor() */ -QColor KDTimeHeaderWidget::columnBackgroundColor( const QDateTime& column ) const +TQColor KDTimeHeaderWidget::columnBackgroundColor( const TQDateTime& column ) const { - QColor c; + TQColor c; c = white; ColumnColorList::const_iterator ite; for ( ite = ccList.begin(); ite != ccList.end(); ++ite ) { @@ -1685,7 +1685,7 @@ QColor KDTimeHeaderWidget::columnBackgroundColor( const QDateTime& column ) cons \param color the background color to use for weekend days. \sa weekendBackgroundColor(), setWeekendDays(), weekendDays() */ -void KDTimeHeaderWidget::setWeekendBackgroundColor( const QColor& color ) +void KDTimeHeaderWidget::setWeekendBackgroundColor( const TQColor& color ) { myWeekendBackgroundColor = color ; updateTimeTable(); @@ -1698,7 +1698,7 @@ void KDTimeHeaderWidget::setWeekendBackgroundColor( const QColor& color ) \return the background color for weekend days \sa setWeekendBackgroundColor(), setWeekendDays(), weekendDays() */ -QColor KDTimeHeaderWidget::weekendBackgroundColor() const +TQColor KDTimeHeaderWidget::weekendBackgroundColor() const { return myWeekendBackgroundColor; } @@ -1713,7 +1713,7 @@ QColor KDTimeHeaderWidget::weekendBackgroundColor() const \param weekday the day of the week (Monday = 1, Sunday = 7) \sa weekendBackgroundColor(), setWeekendDays(), weekendDays() */ -void KDTimeHeaderWidget::setWeekdayBackgroundColor( const QColor& color, int weekday ) +void KDTimeHeaderWidget::setWeekdayBackgroundColor( const TQColor& color, int weekday ) { weekdayColor[weekday] = color; updateTimeTable(); @@ -1727,7 +1727,7 @@ void KDTimeHeaderWidget::setWeekdayBackgroundColor( const QColor& color, int we \return the background color for weekend days \sa setWeekendBackgroundColor(), setWeekendDays(), weekendDays() */ -QColor KDTimeHeaderWidget::weekdayBackgroundColor(int weekday) const +TQColor KDTimeHeaderWidget::weekdayBackgroundColor(int weekday) const { return weekdayColor[weekday]; } @@ -1817,7 +1817,7 @@ int KDTimeHeaderWidget::minorScaleCount() const } -void KDTimeHeaderWidget::resizeEvent ( QResizeEvent * ) +void KDTimeHeaderWidget::resizeEvent ( TQResizeEvent * ) { // qDebug("KDTimeHeaderWidget:: resizeEvent "); paintPix.resize( 800, height () ); @@ -1831,7 +1831,7 @@ void KDTimeHeaderWidget::updateTimeTable() // setting the scrolling steps int scrollLineStep = myGridMinorWidth; if (showMajorTicks()) { - QValueList<int>::iterator intIt = majorTicks.begin(); + TQValueList<int>::iterator intIt = majorTicks.begin(); scrollLineStep = 5 * myGridMinorWidth; if (intIt != majorTicks.end()) { int left = *intIt; @@ -1861,22 +1861,22 @@ int KDTimeHeaderWidget::autoScaleMinorTickCount() } -void KDTimeHeaderWidget::repaintMe(int left,int paintwid, QPainter* painter) +void KDTimeHeaderWidget::repaintMe(int left,int paintwid, TQPainter* painter) { if (flagDoNotRecomputeAfterChange) return; - QColorGroup qcg =QColorGroup( white, black,white, darkGray,black,gray,gray) ; - QPainter* p; + TQColorGroup qcg =TQColorGroup( white, black,white, darkGray,black,gray,gray) ; + TQPainter* p; int offsetLeft = 0; if ( paintwid > paintPix.width()-100 ) paintPix.resize( paintwid+100, height () ); if ( painter ) p = painter; else { - p = new QPainter( &paintPix ); + p = new TQPainter( &paintPix ); offsetLeft = left-50; } if ( mouseDown ) { - p->fillRect( left-offsetLeft, 0, paintwid, height(), QBrush(paletteBackgroundColor()) ); + p->fillRect( left-offsetLeft, 0, paintwid, height(), TQBrush(paletteBackgroundColor()) ); int start ; int wid; if ( beginMouseDown < endMouseDown ) { @@ -1886,13 +1886,13 @@ void KDTimeHeaderWidget::repaintMe(int left,int paintwid, QPainter* painter) start = endMouseDown ; wid = -endMouseDown + beginMouseDown ; } - p->fillRect( start-offsetLeft, 0, wid, height(), QBrush(paletteBackgroundColor().dark()) ); + p->fillRect( start-offsetLeft, 0, wid, height(), TQBrush(paletteBackgroundColor().dark()) ); } else { if (! painter ) - p->fillRect( left-offsetLeft, 0, paintwid, height(), QBrush(paletteBackgroundColor()) ); + p->fillRect( left-offsetLeft, 0, paintwid, height(), TQBrush(paletteBackgroundColor()) ); } - p->setPen(QColor(40,40,40)); - QFont tempFont = p->font(); + p->setPen(TQColor(40,40,40)); + TQFont tempFont = p->font(); tempFont.setWeight(63); p->setFont(tempFont); int hei1 = myMajorGridHeight, @@ -1901,8 +1901,8 @@ void KDTimeHeaderWidget::repaintMe(int left,int paintwid, QPainter* painter) int xCoord; int lwid = 1; - QValueList<QString>::iterator it; - QValueList<int>::iterator intIt = majorTicks.begin(); + TQValueList<TQString>::iterator it; + TQValueList<int>::iterator intIt = majorTicks.begin(); for ( it = majorText.begin(); it != majorText.end(); ++it ) { xCoord = (*intIt++); if (((*intIt)>= left && xCoord <= left+paintwid)) { @@ -1933,9 +1933,9 @@ void KDTimeHeaderWidget::repaintMe(int left,int paintwid, QPainter* painter) // cuts the secs in the DateTime if scale is Minute , // the minutes and secs if scale is Hour and so on -QDateTime KDTimeHeaderWidget::getEvenTimeDate(QDateTime tempdatetime ,Scale sc) +TQDateTime KDTimeHeaderWidget::getEvenTimeDate(TQDateTime tempdatetime ,Scale sc) { - QDate tempdate; + TQDate tempdate; int min, hour; int tempMinorScaleCount = myRealMinorScaleCount; switch (sc) @@ -1946,24 +1946,24 @@ QDateTime KDTimeHeaderWidget::getEvenTimeDate(QDateTime tempdatetime ,Scale sc) tempdate = tempdate.addDays(-1); //while (tempdate.month ()!= 1 ) //tempdate = tempdate.addMonths(-1); - tempdatetime = QDateTime (tempdate, QTime (0,0)); + tempdatetime = TQDateTime (tempdate, TQTime (0,0)); break; case KDGanttView::Week: tempdate = tempdatetime.date(); while (tempdate.dayOfWeek ()!= KGlobal::locale()->weekStartDay()) tempdate = tempdate.addDays(-1); //tempdate = tempdate.addDays(-7); - tempdatetime = QDateTime (tempdate, QTime (0,0)); + tempdatetime = TQDateTime (tempdate, TQTime (0,0)); break; case KDGanttView::Day: - tempdatetime = QDateTime (tempdatetime.date(), QTime ( 0,0 ) ); + tempdatetime = TQDateTime (tempdatetime.date(), TQTime ( 0,0 ) ); break; case KDGanttView::Hour: hour = tempdatetime.time().hour(); while (24%tempMinorScaleCount > 0 && 24%tempMinorScaleCount < 24) ++tempMinorScaleCount; hour = ( hour /tempMinorScaleCount)*tempMinorScaleCount; - tempdatetime = QDateTime (tempdatetime.date(), QTime (hour, 0 )); + tempdatetime = TQDateTime (tempdatetime.date(), TQTime (hour, 0 )); break; case KDGanttView::Minute: min = tempdatetime.time().minute(); @@ -1971,7 +1971,7 @@ QDateTime KDTimeHeaderWidget::getEvenTimeDate(QDateTime tempdatetime ,Scale sc) ++tempMinorScaleCount; // qDebug("myMinorScaleCount %d %d %d",myMinorScaleCount, myRealMinorScaleCount, tempMinorScaleCount); min = (min /tempMinorScaleCount)*tempMinorScaleCount; - tempdatetime = QDateTime (tempdatetime.date(), QTime (tempdatetime.time().hour(),min )); + tempdatetime = TQDateTime (tempdatetime.date(), TQTime (tempdatetime.time().hour(),min )); break; case KDGanttView::Auto: @@ -1981,7 +1981,7 @@ QDateTime KDTimeHeaderWidget::getEvenTimeDate(QDateTime tempdatetime ,Scale sc) } -void KDTimeHeaderWidget::computeRealScale(QDateTime start) +void KDTimeHeaderWidget::computeRealScale(TQDateTime start) { if (myScale ==KDGanttView::Auto) { @@ -2083,11 +2083,11 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale) int minorItems,minorPerMajor = 1; minorItems = (int) (secsFromTo( myRealStart, myHorizonEnd)/60.0); //qDebug("tempMinorScaleCount %d ", tempMinorScaleCount); - QPainter p(this); + TQPainter p(this); int Width, Height; - QString testTextMinor,testTextMajor, tempStr; - QRect itemRectMinor, itemRectMajor; - QDate tempDate = myRealStart.date(); + TQString testTextMinor,testTextMajor, tempStr; + TQRect itemRectMinor, itemRectMajor; + TQDate tempDate = myRealStart.date(); myRealEnd = myRealStart; // preparing the testtext for the differennt scales switch (myRealScale) @@ -2109,25 +2109,25 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale) testTextMinor = "12 AM"; testTextMajor = "Mon Aug 30, x"; if ( yearFormat() != KDGanttView::NoDate ) - testTextMajor += getYear(QDate::currentDate()); + testTextMajor += getYear(TQDate::currentDate()); minorPerMajor = 2400; break; case KDGanttView::Day: minorItems = minorItems/(60*24); testTextMinor = "88"; - testTextMajor = "Aug 30, x"+getYear(QDate::currentDate()); + testTextMajor = "Aug 30, x"+getYear(TQDate::currentDate()); minorPerMajor = 700; break; case KDGanttView::Week: minorItems = minorItems/(60*24*7); testTextMinor = "88"; - testTextMajor = "Aug x"+getYear(QDate::currentDate()); + 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(QDate::currentDate()); + testTextMajor = "x"+getYear(TQDate::currentDate()); minorPerMajor = 1200; break; case KDGanttView::Auto: @@ -2214,8 +2214,8 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale) emit sizeChanged( Width ); } myMajorGridHeight = itemRectMajor.height()+5; - QTime tempTime = myRealStart.time(); - QDateTime tempDateTime; + TQTime tempTime = myRealStart.time(); + TQDateTime tempDateTime; int i; const KCalendarSystem * calendar = KGlobal::locale()->calendar(); switch (myRealScale) @@ -2280,7 +2280,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale) if (tempMinorScaleCount == 1) minorText.append((calendar->weekDayName(tempDate, true)).left(1)); //TODO: BIDI else - minorText.append(QString::number(tempDate.day())); + minorText.append(TQString::number(tempDate.day())); tempDate = tempDate.addDays(tempMinorScaleCount); } tempDate = myRealStart.date(); @@ -2361,7 +2361,7 @@ void KDTimeHeaderWidget::saveCenterDateTime() } -void KDTimeHeaderWidget::centerDateTime( const QDateTime& center ) +void KDTimeHeaderWidget::centerDateTime( const TQDateTime& center ) { moveTimeLineTo(getCoordX( center )-(myGanttView->myCanvasView->viewport()->width() /2)); // qDebug("centerDateTime %s %d %d", center.toString().latin1(),getCoordX( center ),(myGanttView->myCanvasView->viewport()->width() /2) ); @@ -2369,23 +2369,23 @@ void KDTimeHeaderWidget::centerDateTime( const QDateTime& center ) } -void KDTimeHeaderWidget::paintEvent(QPaintEvent *p) +void KDTimeHeaderWidget::paintEvent(TQPaintEvent *p) { repaintMe(p->rect().x(),p->rect().width()); } -int KDTimeHeaderWidget::getCoordX(QDate date) +int KDTimeHeaderWidget::getCoordX(TQDate date) { int wid = width(); int daysAll = myRealStart.daysTo(myRealEnd); if (daysAll == 0) return 0; - int days = myRealStart.daysTo(QDateTime(date)); + int days = myRealStart.daysTo(TQDateTime(date)); return (wid *days) /daysAll; } -int KDTimeHeaderWidget::getCoordX(QDateTime datetime) +int KDTimeHeaderWidget::getCoordX(TQDateTime datetime) { double wid = width(); double secsAll = secsFromTo( myRealStart, myRealEnd ); @@ -2395,9 +2395,9 @@ int KDTimeHeaderWidget::getCoordX(QDateTime datetime) } -QString KDTimeHeaderWidget::getYear(QDate date) +TQString KDTimeHeaderWidget::getYear(TQDate date) { - QString ret; + TQString ret; ret.setNum(date.year()); switch (yearFormat()) { case KDGanttView::FourDigit: @@ -2417,9 +2417,9 @@ QString KDTimeHeaderWidget::getYear(QDate date) } -QString KDTimeHeaderWidget::getHour(QTime time) +TQString KDTimeHeaderWidget::getHour(TQTime time) { - QString ret; + TQString ret; int hour = time.hour(); if (myHourFormat == KDGanttView::Hour_12) { if (hour >= 12) { @@ -2443,7 +2443,7 @@ QString KDTimeHeaderWidget::getHour(QTime time) } -void KDTimeHeaderWidget::mousePressEvent ( QMouseEvent * e ) +void KDTimeHeaderWidget::mousePressEvent ( TQMouseEvent * e ) { mouseDown = false; switch ( e->button() ) { @@ -2465,7 +2465,7 @@ void KDTimeHeaderWidget::mousePressEvent ( QMouseEvent * e ) } -void KDTimeHeaderWidget::mouseReleaseEvent ( QMouseEvent * ) +void KDTimeHeaderWidget::mouseReleaseEvent ( TQMouseEvent * ) { if ( mouseDown ) { mouseDown = false; @@ -2493,13 +2493,13 @@ void KDTimeHeaderWidget::mouseReleaseEvent ( QMouseEvent * ) } -void KDTimeHeaderWidget::mouseDoubleClickEvent ( QMouseEvent * ) +void KDTimeHeaderWidget::mouseDoubleClickEvent ( TQMouseEvent * ) { } -void KDTimeHeaderWidget::mouseMoveEvent ( QMouseEvent * e ) +void KDTimeHeaderWidget::mouseMoveEvent ( TQMouseEvent * e ) { if ( mouseDown ) { if ( e->pos().y() < -height() || e->pos().y() > 2* height() ) { @@ -2537,17 +2537,17 @@ void KDTimeHeaderWidget::mouseMoveEvent ( QMouseEvent * e ) /* *************************************************************** KDLegendWidget:: KDLegendWidget ***************************************************************** */ -KDLegendWidget:: KDLegendWidget( QWidget* parent, +KDLegendWidget:: KDLegendWidget( TQWidget* parent, KDGanttMinimizeSplitter* legendParent ) : KDGanttSemiSizingControl ( KDGanttSemiSizingControl::Before, Vertical, parent) { myLegendParent = legendParent; dock = 0; - scroll = new QScrollView( legendParent ); + scroll = new TQScrollView( legendParent ); setMaximizedWidget( scroll ); - setMinimizedWidget( myLabel = new QLabel( i18n( " Legend is hidden" ), this) ); + setMinimizedWidget( myLabel = new TQLabel( i18n( " Legend is hidden" ), this) ); setGeometry( 0, 0, 50, 50 ); myLegend = 0; clearLegend(); @@ -2562,7 +2562,7 @@ void KDLegendWidget::setAsDockwindow( bool dockwin ) setMaximizedWidget( 0 ); showMe ( false ); if ( dock ) delete dock; - dock = new QDockWindow(QDockWindow:: OutsideDock,0 ); + dock = new TQDockWindow(TQDockWindow:: OutsideDock,0 ); dock->resize( 200, 100 ); dock->setHorizontallyStretchable( true ); dock->setVerticallyStretchable( true ); @@ -2571,7 +2571,7 @@ void KDLegendWidget::setAsDockwindow( bool dockwin ) delete myLegend; myLegend = 0; delete scroll; - scroll = new QScrollView( dock ); + scroll = new TQScrollView( dock ); clearLegend(); dock->setWidget(scroll); setMaximizedWidget( dock ); @@ -2585,7 +2585,7 @@ void KDLegendWidget::setAsDockwindow( bool dockwin ) delete scroll; delete dock; dock = 0; - scroll = new QScrollView( myLegendParent ); + scroll = new TQScrollView( myLegendParent ); clearLegend(); setMaximizedWidget( scroll ); showMe ( false ); @@ -2602,36 +2602,36 @@ bool KDLegendWidget::asDockwindow( ) } -QDockWindow* KDLegendWidget::dockwindow( ) +TQDockWindow* KDLegendWidget::dockwindow( ) { return dock; } -void KDLegendWidget::setFont( QFont font) +void KDLegendWidget::setFont( TQFont font) { myLegend->setFont( font); myLabel->setFont( font); - QWidget::setFont( font ); + TQWidget::setFont( font ); } -void KDLegendWidget::drawToPainter( QPainter *p ) +void KDLegendWidget::drawToPainter( TQPainter *p ) { - p->drawPixmap( 0, 0, QPixmap::grabWidget( myLegend ) ); + p->drawPixmap( 0, 0, TQPixmap::grabWidget( myLegend ) ); } -QSize KDLegendWidget::legendSize() +TQSize KDLegendWidget::legendSize() { return myLegend->size(); } -QSize KDLegendWidget::legendSizeHint() +TQSize KDLegendWidget::legendSizeHint() { - QApplication::sendPostedEvents( 0, QEvent::LayoutHint ); - return QSize( myLegend->sizeHint().width(), myLegend->sizeHint().height()+scroll->horizontalScrollBar()->height()); + TQApplication::sendPostedEvents( 0, TQEvent::LayoutHint ); + return TQSize( myLegend->sizeHint().width(), myLegend->sizeHint().height()+scroll->horizontalScrollBar()->height()); } @@ -2645,15 +2645,15 @@ void KDLegendWidget::clearLegend ( ) { if ( myLegend ) delete myLegend; if ( dock ) - myLegend = new QGroupBox( 1, Qt::Horizontal, scroll->viewport() ); + myLegend = new TQGroupBox( 1, Qt::Horizontal, scroll->viewport() ); else - myLegend = new QGroupBox( 1, Qt::Horizontal, i18n( "Legend" ), scroll->viewport() ); + myLegend = new TQGroupBox( 1, Qt::Horizontal, i18n( "Legend" ), scroll->viewport() ); myLegend->setBackgroundColor( Qt::white ); myLegend->setFont( font() ); scroll->addChild( myLegend ); - scroll->setResizePolicy( QScrollView::AutoOneFit ); + scroll->setResizePolicy( TQScrollView::AutoOneFit ); myLegend->layout()->setMargin( 11 ); - myLegend->setFrameStyle( QFrame::NoFrame ); + myLegend->setFrameStyle( TQFrame::NoFrame ); if ( dock ) scroll->setMaximumHeight( 32000 ); else @@ -2661,17 +2661,17 @@ void KDLegendWidget::clearLegend ( ) } -void KDLegendWidget::addLegendItem( KDGanttViewItem::Shape shape, const QColor& shapeColor, const QString& text ) +void KDLegendWidget::addLegendItem( KDGanttViewItem::Shape shape, const TQColor& shapeColor, const TQString& text ) { - QLabel * temp; - QPixmap p = KDGanttView::getPixmap( shape, shapeColor, Qt::white, 10); - QWidget *w = new QWidget( myLegend ); + TQLabel * temp; + TQPixmap p = KDGanttView::getPixmap( shape, shapeColor, Qt::white, 10); + TQWidget *w = new TQWidget( myLegend ); w->setBackgroundColor( Qt::white ); - QHBoxLayout *lay = new QHBoxLayout( w ,0, 6); - temp = new QLabel ( w ); + TQHBoxLayout *lay = new TQHBoxLayout( w ,0, 6); + temp = new TQLabel ( w ); lay->addWidget( temp, 0, Qt:: AlignRight); temp->setPixmap(p); - temp = new QLabel ( text, w ); + temp = new TQLabel ( text, w ); temp->setBackgroundColor( Qt::white ); lay->addWidget( temp, 0, Qt:: AlignLeft); lay->addStretch(); @@ -2688,7 +2688,7 @@ bool KDLegendWidget::isShown ( ) } -KDListView::KDListView(QWidget* parent, KDGanttView* gantView):QListView (parent) +KDListView::KDListView(TQWidget* parent, KDGanttView* gantView):TQListView (parent) { myGanttView = gantView; setAcceptDrops(true); @@ -2697,21 +2697,21 @@ KDListView::KDListView(QWidget* parent, KDGanttView* gantView):QListView (parent setAllColumnsShowFocus( true ); addColumn( i18n( "Task Name" ) ); setSorting( -1 ); - //setVScrollBarMode (QScrollView::AlwaysOn ); - setHScrollBarMode (QScrollView::AlwaysOn ); - setDefaultRenameAction(QListView::Accept); + //setVScrollBarMode (TQScrollView::AlwaysOn ); + setHScrollBarMode (TQScrollView::AlwaysOn ); + setDefaultRenameAction(TQListView::Accept); setColumnWidthMode ( 0,Maximum ); _calendarMode = false; - // QObject::connect(this, SIGNAL ( pressed ( QListViewItem * )) , this, SLOT( dragItem( QListViewItem *))) ; + // TQObject::connect(this, TQT_SIGNAL ( pressed ( TQListViewItem * )) , this, TQT_SLOT( dragItem( TQListViewItem *))) ; } -void KDListView::dragItem( QListViewItem * ) +void KDListView::dragItem( TQListViewItem * ) { // qDebug("drag "); // startDrag(); } -QString KDListView::getWhatsThisText(QPoint p) +TQString KDListView::getWhatsThisText(TQPoint p) { KDGanttViewItem* item = ( KDGanttViewItem* ) itemAt( p ); if ( item ) @@ -2725,18 +2725,18 @@ void KDListView::setCalendarMode( bool mode ) // setRootIsDecorated ( ! mode ); } -void KDListView::setOpen(QListViewItem * item, bool open ) +void KDListView::setOpen(TQListViewItem * item, bool open ) { if (! _calendarMode || ! open ) { (( KDGanttViewItem*)item)->setCallListViewOnSetOpen( false ); - QListView::setOpen ( item, open ); + TQListView::setOpen ( item, open ); (( KDGanttViewItem*)item)->setCallListViewOnSetOpen( true ); return; } // we are in calendarmode // in calendarmode only items can be opened which have subitems which have subitems - QListViewItem* temp; + TQListViewItem* temp; temp = item->firstChild(); bool openItem = false; while (temp) { @@ -2752,17 +2752,17 @@ void KDListView::setOpen(QListViewItem * item, bool open ) } if ( openItem ) { (( KDGanttViewItem*)item)->setCallListViewOnSetOpen( false ); - QListView::setOpen ( item, open ); + TQListView::setOpen ( item, open ); (( KDGanttViewItem*)item)->setCallListViewOnSetOpen( true ); } } -void KDListView::contentsMouseDoubleClickEvent ( QMouseEvent * e ) +void KDListView::contentsMouseDoubleClickEvent ( TQMouseEvent * e ) { - QListView::contentsMouseDoubleClickEvent ( e ); + TQListView::contentsMouseDoubleClickEvent ( e ); //if ( ! _calendarMode ) - // QListView::contentsMouseDoubleClickEvent ( e ); + // TQListView::contentsMouseDoubleClickEvent ( e ); // else { @@ -2773,7 +2773,7 @@ void KDListView::contentsMouseDoubleClickEvent ( QMouseEvent * e ) } -void KDListView::drawToPainter ( QPainter * p, bool drawHeader ) +void KDListView::drawToPainter ( TQPainter * p, bool drawHeader ) { // Draw list drawAllContents ( p, 0, 0, contentsWidth(), contentsHeight() ); @@ -2781,11 +2781,11 @@ void KDListView::drawToPainter ( QPainter * p, bool drawHeader ) return; } // Draw headers - QPen pen = QPen(Qt::lightGray, 1); + TQPen pen = TQPen(Qt::lightGray, 1); p->save(); - QHeader *h = header(); + TQHeader *h = header(); for (int s = 0; s < h->count(); ++s) { - QRect r = h->sectionRect(s); + TQRect r = h->sectionRect(s); if (s==0) { p->translate(0, -r.height()); } @@ -2800,7 +2800,7 @@ void KDListView::drawToPainter ( QPainter * p, bool drawHeader ) p->restore(); } -int KDListView::buildDrawables(QPtrList<KDListView::DrawableItem> &lst, int level, int ypos, QListViewItem *item, int ymin, int ymax) const { +int KDListView::buildDrawables(TQPtrList<KDListView::DrawableItem> &lst, int level, int ypos, TQListViewItem *item, int ymin, int ymax) const { int y = ypos; int ih = item->height(); if (y < ymin && y+ih > ymin) { @@ -2813,26 +2813,26 @@ int KDListView::buildDrawables(QPtrList<KDListView::DrawableItem> &lst, int leve } y += ih; if (item->isOpen()) { - QListViewItem *child = item->firstChild(); + TQListViewItem *child = item->firstChild(); for (; child; child = child->nextSibling()) { y = buildDrawables(lst, level+1, y, child, ymin, ymax); } } return y; } -// This is a copy of QListView::drawContentsOffset(), with a few changes +// This is a copy of TQListView::drawContentsOffset(), with a few changes // because drawContentsOffset() only draws *visible* items, // we want to draw *all* items. // FIXME: Haven't got paintBraches() to work, atm live without it. -void KDListView::drawAllContents(QPainter * p, int cx, int cy, int cw, int ch) { +void KDListView::drawAllContents(TQPainter * p, int cx, int cy, int cw, int ch) { if ( columns() == 0 ) { - paintEmptyArea( p, QRect( cx, cy, cw, ch ) ); + paintEmptyArea( p, TQRect( cx, cy, cw, ch ) ); return; } - //kdDebug()<<k_funcinfo<<QRect(cx, cy, cw, ch)<<endl; - QPtrList<KDListView::DrawableItem> drawables; + //kdDebug()<<k_funcinfo<<TQRect(cx, cy, cw, ch)<<endl; + TQPtrList<KDListView::DrawableItem> drawables; drawables.setAutoDelete(true); - QListViewItem *child = firstChild(); + TQListViewItem *child = firstChild(); int level = 0; int ypos = 0; for (; child; child = child->nextSibling()) { @@ -2841,9 +2841,9 @@ void KDListView::drawAllContents(QPainter * p, int cx, int cy, int cw, int ch) { p->setFont( font() ); - QPtrListIterator<KDListView::DrawableItem> it(drawables); + TQPtrListIterator<KDListView::DrawableItem> it(drawables); - QRect r; + TQRect r; int fx = -1, x, fc = 0, lc = 0; int tx = -1; KDListView::DrawableItem * current; @@ -2884,7 +2884,7 @@ void KDListView::drawAllContents(QPainter * p, int cx, int cy, int cw, int ch) { c = fc; // draw to last interesting column - const QColorGroup &cg = ( palette().inactive() ); + const TQColorGroup &cg = ( palette().inactive() ); while ( c < lc && !drawables.isEmpty() ) { int i = header()->mapToLogical( c ); @@ -2957,11 +2957,11 @@ void KDListView::drawAllContents(QPainter * p, int cx, int cy, int cw, int ch) { } } -void KDListView::resizeEvent(QResizeEvent *) +void KDListView::resizeEvent(TQResizeEvent *) { triggerUpdate (); } -void KDListView::dragEnterEvent ( QDragEnterEvent * e) +void KDListView::dragEnterEvent ( TQDragEnterEvent * e) { if ( !myGanttView->dropEnabled() ) { e->accept( false ); @@ -2971,7 +2971,7 @@ void KDListView::dragEnterEvent ( QDragEnterEvent * e) //e->accept(KDGanttViewItemDrag::canDecode(e) ); } -void KDListView::dragMoveEvent ( QDragMoveEvent * e) +void KDListView::dragMoveEvent ( TQDragMoveEvent * e) { if ( !myGanttView->dropEnabled() ) { e->accept( false ); @@ -3007,11 +3007,11 @@ void KDListView::dragMoveEvent ( QDragMoveEvent * e) e->accept( true ); } -void KDListView::dragLeaveEvent ( QDragLeaveEvent * ) +void KDListView::dragLeaveEvent ( TQDragLeaveEvent * ) { //qDebug("contentsDragLeaveEvent "); } -void KDListView::dropEvent ( QDropEvent *e ) +void KDListView::dropEvent ( TQDropEvent *e ) { if ( !myGanttView->dropEnabled() ) { e->accept( false ); @@ -3023,7 +3023,7 @@ void KDListView::dropEvent ( QDropEvent *e ) draggedItem = myGanttView->myCanvasView->lastClickedItem; if (myGanttView->lvDropEvent ( e, draggedItem, gItem )) return; - QString string; + TQString string; KDGanttViewItemDrag::decode( e, string ); KDGanttViewItem* newItem = 0; @@ -3032,22 +3032,22 @@ void KDListView::dropEvent ( QDropEvent *e ) return; } - QDomDocument doc( "GanttView" ); + TQDomDocument doc( "GanttView" ); doc.setContent( string ); - QDomElement docRoot = doc.documentElement(); // ChartParams element - QDomNode node = docRoot.firstChild(); + TQDomElement docRoot = doc.documentElement(); // ChartParams element + TQDomNode node = docRoot.firstChild(); bool enable = myGanttView->myTimeTable->blockUpdating( ); myGanttView->myTimeTable->setBlockUpdating( true ); while( !node.isNull() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); if( !element.isNull() ) { // was really an element - QString tagName = element.tagName(); + TQString tagName = element.tagName(); if( tagName == "Items" ) { - QDomNode node = element.firstChild(); + TQDomNode node = element.firstChild(); while( !node.isNull() ) { - QDomElement element = node.toElement(); + TQDomElement element = node.toElement(); if( !element.isNull() ) { // was really an element - QString tagName = element.tagName(); + TQString tagName = element.tagName(); if( tagName == "Item" ) { if ( gItem ) newItem = KDGanttViewItem::createFromDomElement( gItem, @@ -3076,9 +3076,9 @@ void KDListView::dropEvent ( QDropEvent *e ) return; } -QDragObject * KDListView::dragObject () +TQDragObject * KDListView::dragObject () { - return QListView::dragObject (); + return TQListView::dragObject (); } void KDListView::startDrag () @@ -3093,7 +3093,7 @@ void KDListView::startDrag () KDCanvasText::KDCanvasText( KDTimeTableWidget* canvas, void* parentItem, int type ) : - QCanvasText(canvas) + TQCanvasText(canvas) { myParentType = type; myParentItem = parentItem; @@ -3103,7 +3103,7 @@ KDCanvasText::KDCanvasText( KDTimeTableWidget* canvas, KDCanvasLine::KDCanvasLine( KDTimeTableWidget* canvas, void* parentItem, int type ) : - QCanvasLine(canvas) + TQCanvasLine(canvas) { myParentType = type; myParentItem = parentItem; @@ -3113,7 +3113,7 @@ KDCanvasLine::KDCanvasLine( KDTimeTableWidget* canvas, KDCanvasPolygonItem::KDCanvasPolygonItem( KDTimeTableWidget* canvas, void* parentItem, int type ) : - QCanvasPolygonalItem( canvas ) + TQCanvasPolygonalItem( canvas ) { myParentType = type; myParentItem = parentItem; @@ -3123,7 +3123,7 @@ KDCanvasPolygonItem::KDCanvasPolygonItem( KDTimeTableWidget* canvas, KDCanvasPolygon::KDCanvasPolygon( KDTimeTableWidget* canvas, void* parentItem, int type ) : - QCanvasPolygon( canvas ) + TQCanvasPolygon( canvas ) { myParentType = type; myParentItem = parentItem; @@ -3133,7 +3133,7 @@ KDCanvasPolygon::KDCanvasPolygon( KDTimeTableWidget* canvas, KDCanvasEllipse::KDCanvasEllipse( KDTimeTableWidget* canvas, void* parentItem, int type ) : - QCanvasEllipse( canvas ) + TQCanvasEllipse( canvas ) { myParentType = type; myParentItem = parentItem; @@ -3143,7 +3143,7 @@ KDCanvasEllipse::KDCanvasEllipse( KDTimeTableWidget* canvas, KDCanvasRectangle::KDCanvasRectangle( KDTimeTableWidget* canvas, void* parentItem, int type ) : - QCanvasRectangle( canvas ) + TQCanvasRectangle( canvas ) { myParentType = type; myParentItem = parentItem; @@ -3152,13 +3152,13 @@ KDCanvasRectangle::KDCanvasRectangle( KDTimeTableWidget* canvas, -KDGanttCanvasView::KDGanttCanvasView( KDGanttView* sender,QCanvas* canvas, QWidget* parent, const - char* name ) : QCanvasView ( canvas, parent, name ), +KDGanttCanvasView::KDGanttCanvasView( KDGanttView* sender,TQCanvas* canvas, TQWidget* parent, const + char* name ) : TQCanvasView ( canvas, parent, name ), movingGVItem( 0 ), scrollBarTimer( 0, "scrollBarTimer" ) { - setHScrollBarMode (QScrollView::AlwaysOn ); - setVScrollBarMode( QScrollView::AlwaysOn ); + setHScrollBarMode (TQScrollView::AlwaysOn ); + setVScrollBarMode( TQScrollView::AlwaysOn ); myToolTip = new KDCanvasToolTip(viewport(),this); mySignalSender = sender; currentItem = 0; @@ -3168,61 +3168,61 @@ KDGanttCanvasView::KDGanttCanvasView( KDGanttView* sender,QCanvas* canvas, QWidg fromArea = 0; linkItemsEnabled = false; mouseDown = false; - linkLine = new QCanvasLine(canvas); + linkLine = new TQCanvasLine(canvas); linkLine->hide(); linkLine->setZ(1000); set_Mouse_Tracking(true); // mouse cursor changes over KDIntervalColorRectangle borders new KDCanvasWhatsThis(viewport(),this); - onItem = new QPopupMenu( this ); - QPopupMenu * newMenu = new QPopupMenu( this ); - QPopupMenu * onView = new QPopupMenu( this ); + onItem = new TQPopupMenu( this ); + TQPopupMenu * newMenu = new TQPopupMenu( this ); + TQPopupMenu * onView = new TQPopupMenu( this ); onView->insertItem( i18n( "Summary" ), this, - SLOT ( newRootItem( int ) ), 0, 0 ); + TQT_SLOT ( newRootItem( int ) ), 0, 0 ); onView->insertItem( i18n( "Event" ), this, - SLOT ( newRootItem( int ) ), 0, 1); + TQT_SLOT ( newRootItem( int ) ), 0, 1); onView->insertItem( i18n( "Task" ), this, - SLOT ( newRootItem( int ) ), 0, 2 ); + TQT_SLOT ( newRootItem( int ) ), 0, 2 ); onItem->insertItem( i18n( "New Root" ), onView ); newMenu->insertItem( i18n( "Summary" ), - this, SLOT ( newChildItem( int) ), 0, 0 ); + this, TQT_SLOT ( newChildItem( int) ), 0, 0 ); newMenu->insertItem( i18n( "Event" ), - this, SLOT ( newChildItem( int ) ), 0, 1 ); + this, TQT_SLOT ( newChildItem( int ) ), 0, 1 ); newMenu->insertItem( i18n( "Task" ), - this, SLOT ( newChildItem( int ) ), 0, 2 ); + this, TQT_SLOT ( newChildItem( int ) ), 0, 2 ); onItem->insertItem( i18n( "New Child" ), newMenu ); - QPopupMenu * afterMenu = new QPopupMenu( this ); + TQPopupMenu * afterMenu = new TQPopupMenu( this ); afterMenu->insertItem( i18n( "Summary" ), - this, SLOT ( newChildItem( int) ), 0, 0+4 ); + this, TQT_SLOT ( newChildItem( int) ), 0, 0+4 ); afterMenu->insertItem( i18n( "Event" ), - this, SLOT ( newChildItem( int ) ), 0, 1+4 ); + this, TQT_SLOT ( newChildItem( int ) ), 0, 1+4 ); afterMenu->insertItem( i18n( "Task" ), - this, SLOT ( newChildItem( int ) ), 0, 2+4 ); + this, TQT_SLOT ( newChildItem( int ) ), 0, 2+4 ); onItem->insertItem( i18n( "New After" ), afterMenu ); - QPopupMenu *pasteMenu = new QPopupMenu( this ); + TQPopupMenu *pasteMenu = new TQPopupMenu( this ); pasteMenu->insertItem( i18n( "As Root" ), - this, SLOT ( pasteItem( int ) ), 0, 0 ); + this, TQT_SLOT ( pasteItem( int ) ), 0, 0 ); pasteMenu->insertItem( i18n( "As Child" ), - this, SLOT ( pasteItem( int ) ), 0, 1 ); + this, TQT_SLOT ( pasteItem( int ) ), 0, 1 ); pasteMenu->insertItem( i18n( "After" ), - this, SLOT ( pasteItem( int ) ), 0, 2 ); + this, TQT_SLOT ( pasteItem( int ) ), 0, 2 ); onItem->insertItem( i18n( "Paste" ), pasteMenu, 3 ); - onItem->insertItem( i18n( "Cut Item" ), this, SLOT ( cutItem() ) ); + onItem->insertItem( i18n( "Cut Item" ), this, TQT_SLOT ( cutItem() ) ); onItem->setItemEnabled( 3, false ); myMyContentsHeight = 0; _showItemAddPopupMenu = false; - QObject *scrollViewTimer = child( "scrollview scrollbar timer", "QTimer", false ); + TQObject *scrollViewTimer = child( "scrollview scrollbar timer", "TQTimer", false ); Q_ASSERT( scrollViewTimer ); if ( scrollViewTimer ) { - disconnect( scrollViewTimer, SIGNAL(timeout()), this, SLOT(updateScrollBars() ) ); + disconnect( scrollViewTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateScrollBars() ) ); } // If they needed a scrollbar timer in scrollview... - connect( &scrollBarTimer, SIGNAL(timeout()), this, SLOT(myUpdateScrollBars() ) ); + connect( &scrollBarTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(myUpdateScrollBars() ) ); - myScrollTimer = new QTimer( this, "myScrollTimer" ); - connect( myScrollTimer, SIGNAL( timeout() ), SLOT( slotScrollTimer() ) ); + myScrollTimer = new TQTimer( this, "myScrollTimer" ); + connect( myScrollTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotScrollTimer() ) ); autoScrollEnabled = false; } @@ -3248,22 +3248,22 @@ void KDGanttCanvasView::moveMyContent( int, int y) setContentsPos(contentsX(), y); } -void KDGanttCanvasView::resizeEvent ( QResizeEvent * e ) +void KDGanttCanvasView::resizeEvent ( TQResizeEvent * e ) { int ho = e->oldSize().height(); int wo = e->oldSize().width(); int hi = height(); int wi = width(); - //QScrollView::blockSignals( true ); + //TQScrollView::blockSignals( true ); verticalScrollBar()->setUpdatesEnabled( false ); - QScrollView::resizeEvent ( e ) ; + TQScrollView::resizeEvent ( e ) ; if ( ho != hi ) emit heightResized( viewport()->height()); if ( wo != wi ) emit widthResized( viewport()->width() ); //setMyContentsHeight( 0 ); // via timer - //QScrollView::blockSignals( false ); + //TQScrollView::blockSignals( false ); scrollBarTimer.start(0, true); } @@ -3444,14 +3444,14 @@ void KDGanttCanvasView::newChildItem( int type ) mySignalSender->editItem( temp ); } -void KDGanttCanvasView::drawToPainter ( QPainter * p ) +void KDGanttCanvasView::drawToPainter ( TQPainter * p ) { drawContents ( p, 0, 0, canvas()->width(), canvas()->height() ); } -QString KDGanttCanvasView::getToolTipText(QPoint p) +TQString KDGanttCanvasView::getToolTipText(TQPoint p) { - QCanvasItemList il = canvas()->collisions ( viewportToContents( p )); - QCanvasItemList::Iterator it; + TQCanvasItemList il = canvas()->collisions ( viewportToContents( p )); + TQCanvasItemList::Iterator it; for ( it = il.begin(); it != il.end(); ++it ) { switch (getType(*it)) { case Type_is_KDGanttViewItem: @@ -3467,10 +3467,10 @@ QString KDGanttCanvasView::getToolTipText(QPoint p) return ""; } -QString KDGanttCanvasView::getWhatsThisText(QPoint p) +TQString KDGanttCanvasView::getWhatsThisText(TQPoint p) { - QCanvasItemList il = canvas() ->collisions (viewportToContents( p )); - QCanvasItemList::Iterator it; + TQCanvasItemList il = canvas() ->collisions (viewportToContents( p )); + TQCanvasItemList::Iterator it; for ( it = il.begin(); it != il.end(); ++it ) { switch (getType(*it)) { case Type_is_KDGanttViewItem: @@ -3487,7 +3487,7 @@ QString KDGanttCanvasView::getWhatsThisText(QPoint p) } -KDGanttCanvasView::MovingOperation KDGanttCanvasView::gvItemHitTest( KDGanttViewItem *item, KDTimeHeaderWidget* timeHeader, const QPoint &pos ) +KDGanttCanvasView::MovingOperation KDGanttCanvasView::gvItemHitTest( KDGanttViewItem *item, KDTimeHeaderWidget* timeHeader, const TQPoint &pos ) { const int left = timeHeader->getCoordX( item->startTime() ); const int right = timeHeader->getCoordX( item->endTime() ); @@ -3507,7 +3507,7 @@ KDGanttCanvasView::MovingOperation KDGanttCanvasView::gvItemHitTest( KDGanttView */ -void KDGanttCanvasView::contentsMousePressEvent ( QMouseEvent * e ) +void KDGanttCanvasView::contentsMousePressEvent ( TQMouseEvent * e ) { //qDebug("mousepress! %d ", this); //qDebug("focus %d ",qApp->focusWidget()); @@ -3517,12 +3517,12 @@ void KDGanttCanvasView::contentsMousePressEvent ( QMouseEvent * e ) movingItem = 0; mouseDown = true; if (e->button() == RightButton && mySignalSender->editable()) { - lastClickedItem = (KDGanttViewItem*) mySignalSender->myListView->itemAt( QPoint(2,e->pos().y())); + lastClickedItem = (KDGanttViewItem*) mySignalSender->myListView->itemAt( TQPoint(2,e->pos().y())); if ( lastClickedItem ) { if ( lastClickedItem->displaySubitemsAsGroup() && ! lastClickedItem->isOpen() ) { // findSub subitem - QCanvasItemList il = canvas() ->collisions ( e->pos() ); - QCanvasItemList::Iterator it; + TQCanvasItemList il = canvas() ->collisions ( e->pos() ); + TQCanvasItemList::Iterator it; for ( it = il.begin(); it != il.end(); ++it ) { if ( getType(*it) == Type_is_KDGanttViewItem ) { lastClickedItem = getItem(*it); @@ -3533,8 +3533,8 @@ void KDGanttCanvasView::contentsMousePressEvent ( QMouseEvent * e ) onItem->popup(e->globalPos()); } } - QCanvasItemList il = canvas() ->collisions ( e->pos() ); - QCanvasItemList::Iterator it; + TQCanvasItemList il = canvas() ->collisions ( e->pos() ); + TQCanvasItemList::Iterator it; for ( it = il.begin(); it != il.end(); ++it ) { switch ( e->button() ) { case LeftButton: @@ -3577,7 +3577,7 @@ void KDGanttCanvasView::contentsMousePressEvent ( QMouseEvent * e ) if ( (*it)->rtti() == KDIntervalColorRectangle::RTTI ) { // Cleaner would be isMovable()/isResizeable() in an interface // implemented by all movable objects... - movingItem = static_cast<QCanvasRectangle *>(*it); + movingItem = static_cast<TQCanvasRectangle *>(*it); movingStart = e->pos(); KDIntervalColorRectangle* icr = static_cast<KDIntervalColorRectangle *>( movingItem ); KDIntervalColorRectangle::HitTest hitTest = icr->hitTest( mySignalSender->myTimeHeader, movingStart ); @@ -3632,7 +3632,7 @@ void KDGanttCanvasView::contentsMousePressEvent ( QMouseEvent * e ) */ -void KDGanttCanvasView::contentsMouseReleaseEvent ( QMouseEvent * e ) +void KDGanttCanvasView::contentsMouseReleaseEvent ( TQMouseEvent * e ) { mouseDown = false; static KDGanttViewItem* lastClicked = 0; @@ -3654,8 +3654,8 @@ void KDGanttCanvasView::contentsMouseReleaseEvent ( QMouseEvent * e ) if (linkItemsEnabled && fromItem) { linkLine->hide(); canvas()->update(); - QCanvasItemList il = canvas() ->collisions ( e->pos() ); - QCanvasItemList::Iterator it; + TQCanvasItemList il = canvas() ->collisions ( e->pos() ); + TQCanvasItemList::Iterator it; for ( it = il.begin(); it != il.end(); ++it ) { if (getType(*it) == Type_is_KDGanttViewItem) { KDGanttViewItem *toItem = getItem(*it); @@ -3709,9 +3709,9 @@ void KDGanttCanvasView::contentsMouseReleaseEvent ( QMouseEvent * e ) */ -void KDGanttCanvasView::contentsMouseDoubleClickEvent ( QMouseEvent * e ) +void KDGanttCanvasView::contentsMouseDoubleClickEvent ( TQMouseEvent * e ) { - QCanvasItemList il = canvas() ->collisions ( e->pos() ); + TQCanvasItemList il = canvas() ->collisions ( e->pos() ); if ( il.isEmpty() && e->button() == LeftButton ) { //not directly sending a signal here (encapsulation and whatnot) @@ -3719,7 +3719,7 @@ void KDGanttCanvasView::contentsMouseDoubleClickEvent ( QMouseEvent * e ) return; } - QCanvasItemList::Iterator it; + TQCanvasItemList::Iterator it; for ( it = il.begin(); it != il.end(); ++it ) { switch ( e->button() ) { case LeftButton: @@ -3776,13 +3776,13 @@ void KDGanttCanvasView::contentsMouseDoubleClickEvent ( QMouseEvent * e ) */ -void KDGanttCanvasView::contentsMouseMoveEvent ( QMouseEvent *e ) +void KDGanttCanvasView::contentsMouseMoveEvent ( TQMouseEvent *e ) { if ( !mouseDown ) { // Update cursor bool found = false; - QCanvasItemList il = canvas() ->collisions ( e->pos() ); - QCanvasItemList::Iterator it; + TQCanvasItemList il = canvas() ->collisions ( e->pos() ); + TQCanvasItemList::Iterator it; for ( it = il.begin(); it != il.end(); ++it ) { if ( (*it)->rtti() == KDIntervalColorRectangle::RTTI ) { found = true; @@ -3817,7 +3817,7 @@ void KDGanttCanvasView::contentsMouseMoveEvent ( QMouseEvent *e ) return; } - const QPoint p = e->pos(); + const TQPoint p = e->pos(); if ( movingItem ) { int x = qRound( movingItem->x() ); int width = movingItem->width(); @@ -3837,8 +3837,8 @@ void KDGanttCanvasView::contentsMouseMoveEvent ( QMouseEvent *e ) movingStart = p; if ( movingItem->rtti() == KDIntervalColorRectangle::RTTI ) { KDIntervalColorRectangle* icr = static_cast<KDIntervalColorRectangle *>(movingItem); - const QDateTime newStart = mySignalSender->myTimeHeader->getDateTimeForIndex(x); - const QDateTime newEnd = mySignalSender->myTimeHeader->getDateTimeForIndex(x + width); + const TQDateTime newStart = mySignalSender->myTimeHeader->getDateTimeForIndex(x); + const TQDateTime newEnd = mySignalSender->myTimeHeader->getDateTimeForIndex(x + width); icr->setDateTimes( newStart, newEnd ); emit mySignalSender->intervalColorRectangleMoved( newStart, newEnd ); mySignalSender->myTimeHeader->computeIntervals( movingItem->height() ); @@ -3849,7 +3849,7 @@ void KDGanttCanvasView::contentsMouseMoveEvent ( QMouseEvent *e ) if ( movingGVItem ) { int dx = movingStart.x() - e->pos().x(); int x = movingGVItem->middleLeft().x() - dx; - QDateTime dt = mySignalSender->getDateTimeForCoordX( x, false ); + TQDateTime dt = mySignalSender->getDateTimeForCoordX( x, false ); int duration = movingGVItem->startTime().secsTo( movingGVItem->endTime() ); if ( movingOperation == Moving ) { movingGVItem->setStartTime( dt ); @@ -3871,7 +3871,7 @@ void KDGanttCanvasView::contentsMouseMoveEvent ( QMouseEvent *e ) currentItem = 0; } if (autoScrollEnabled) - mousePos = e->pos()- QPoint(contentsX(),contentsY()); // make mousePos relative 0 + mousePos = e->pos()- TQPoint(contentsX(),contentsY()); // make mousePos relative 0 if (fromItem) { //qDebug("mousemove: linking %s: %d,%d ",fromItem->listViewText().latin1(), e->pos().x(), e->pos().y()); linkLine->setPoints(linkLine->startPoint().x(), linkLine->startPoint().y(), e->pos().x(), e->pos().y()); @@ -3879,46 +3879,46 @@ void KDGanttCanvasView::contentsMouseMoveEvent ( QMouseEvent *e ) } // no action implemented } -void KDGanttCanvasView::viewportPaintEvent ( QPaintEvent * pe ) +void KDGanttCanvasView::viewportPaintEvent ( TQPaintEvent * pe ) { - QCanvasView::viewportPaintEvent ( pe ); + TQCanvasView::viewportPaintEvent ( pe ); } void KDGanttCanvasView::set_Mouse_Tracking(bool on) { viewport()->setMouseTracking(on); } -int KDGanttCanvasView::getType(QCanvasItem* it) +int KDGanttCanvasView::getType(TQCanvasItem* it) { switch (it->rtti()) { - case QCanvasItem::Rtti_Line: return ((KDCanvasLine*)it)->myParentType; - case QCanvasItem::Rtti_Ellipse: return ((KDCanvasEllipse *)it)->myParentType; - case QCanvasItem::Rtti_Text: return ((KDCanvasText *)it)->myParentType; - case QCanvasItem::Rtti_Polygon: return ((KDCanvasPolygon *)it)->myParentType; - case QCanvasItem::Rtti_Rectangle: + case TQCanvasItem::Rtti_Line: return ((KDCanvasLine*)it)->myParentType; + case TQCanvasItem::Rtti_Ellipse: return ((KDCanvasEllipse *)it)->myParentType; + case TQCanvasItem::Rtti_Text: return ((KDCanvasText *)it)->myParentType; + case TQCanvasItem::Rtti_Polygon: return ((KDCanvasPolygon *)it)->myParentType; + case TQCanvasItem::Rtti_Rectangle: case KDIntervalColorRectangle::RTTI: return ((KDCanvasRectangle *)it)->myParentType; } return -1; } -KDGanttViewItem* KDGanttCanvasView::getItem(QCanvasItem* it) +KDGanttViewItem* KDGanttCanvasView::getItem(TQCanvasItem* it) { switch (it->rtti()) { - case QCanvasItem::Rtti_Line: return (KDGanttViewItem*) ((KDCanvasLine*)it)->myParentItem; - case QCanvasItem::Rtti_Ellipse: return (KDGanttViewItem*) ((KDCanvasEllipse *)it)->myParentItem; - case QCanvasItem::Rtti_Text: return (KDGanttViewItem*) ((KDCanvasText *)it)->myParentItem; - case QCanvasItem::Rtti_Polygon: return (KDGanttViewItem*) ((KDCanvasPolygon *)it)->myParentItem; - case QCanvasItem::Rtti_Rectangle: return (KDGanttViewItem*) ((KDCanvasRectangle *)it)->myParentItem; + case TQCanvasItem::Rtti_Line: return (KDGanttViewItem*) ((KDCanvasLine*)it)->myParentItem; + case TQCanvasItem::Rtti_Ellipse: return (KDGanttViewItem*) ((KDCanvasEllipse *)it)->myParentItem; + case TQCanvasItem::Rtti_Text: return (KDGanttViewItem*) ((KDCanvasText *)it)->myParentItem; + case TQCanvasItem::Rtti_Polygon: return (KDGanttViewItem*) ((KDCanvasPolygon *)it)->myParentItem; + case TQCanvasItem::Rtti_Rectangle: return (KDGanttViewItem*) ((KDCanvasRectangle *)it)->myParentItem; } return 0; } -KDGanttViewTaskLink* KDGanttCanvasView::getLink(QCanvasItem* it) +KDGanttViewTaskLink* KDGanttCanvasView::getLink(TQCanvasItem* it) { switch (it->rtti()) { - case QCanvasItem::Rtti_Line: return (KDGanttViewTaskLink*) ((KDCanvasLine*)it)->myParentItem; - case QCanvasItem::Rtti_Ellipse: return (KDGanttViewTaskLink*) ((KDCanvasEllipse *)it)->myParentItem; - case QCanvasItem::Rtti_Text: return (KDGanttViewTaskLink*) ((KDCanvasText *)it)->myParentItem; - case QCanvasItem::Rtti_Polygon: return (KDGanttViewTaskLink*) ((KDCanvasPolygon *)it)->myParentItem; + case TQCanvasItem::Rtti_Line: return (KDGanttViewTaskLink*) ((KDCanvasLine*)it)->myParentItem; + case TQCanvasItem::Rtti_Ellipse: return (KDGanttViewTaskLink*) ((KDCanvasEllipse *)it)->myParentItem; + case TQCanvasItem::Rtti_Text: return (KDGanttViewTaskLink*) ((KDCanvasText *)it)->myParentItem; + case TQCanvasItem::Rtti_Polygon: return (KDGanttViewTaskLink*) ((KDCanvasPolygon *)it)->myParentItem; } return 0; } @@ -3997,8 +3997,8 @@ KDIntervalColorRectangle::KDIntervalColorRectangle( KDGanttView* view ) \param start start datetime of the time interval \param end end datetime of the time interval */ -void KDIntervalColorRectangle::setDateTimes( const QDateTime& start, - const QDateTime& end ) +void KDIntervalColorRectangle::setDateTimes( const TQDateTime& start, + const TQDateTime& end ) { mStart = start; mEnd = end; @@ -4010,7 +4010,7 @@ void KDIntervalColorRectangle::setDateTimes( const QDateTime& start, Sets the background color \param color the background color */ -void KDIntervalColorRectangle::setColor( const QColor& color ) +void KDIntervalColorRectangle::setColor( const TQColor& color ) { mColor = color; } @@ -4024,8 +4024,8 @@ void KDIntervalColorRectangle::layout( KDTimeHeaderWidget* timeHeader, int heigh int right = timeHeader->getCoordX(mEnd); if ( right == left ) ++right; - setPen( QPen::NoPen ); - setBrush( QBrush(mColor, SolidPattern) ); + setPen( TQPen::NoPen ); + setBrush( TQBrush(mColor, SolidPattern) ); setSize( right - left, height ); move( left, 0 ); show(); @@ -4034,7 +4034,7 @@ void KDIntervalColorRectangle::layout( KDTimeHeaderWidget* timeHeader, int heigh /*! \internal */ -KDIntervalColorRectangle::HitTest KDIntervalColorRectangle::hitTest( KDTimeHeaderWidget* timeHeader, const QPoint& pos ) const +KDIntervalColorRectangle::HitTest KDIntervalColorRectangle::hitTest( KDTimeHeaderWidget* timeHeader, const TQPoint& pos ) const { const int left = timeHeader->getCoordX(mStart); const int right = timeHeader->getCoordX(mEnd); |