summaryrefslogtreecommitdiffstats
path: root/kdgantt/KDGanttViewSubwidgets.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdgantt/KDGanttViewSubwidgets.cpp')
-rw-r--r--kdgantt/KDGanttViewSubwidgets.cpp856
1 files changed, 428 insertions, 428 deletions
diff --git a/kdgantt/KDGanttViewSubwidgets.cpp b/kdgantt/KDGanttViewSubwidgets.cpp
index 0760a70f..c07e1e6f 100644
--- a/kdgantt/KDGanttViewSubwidgets.cpp
+++ b/kdgantt/KDGanttViewSubwidgets.cpp
@@ -27,8 +27,8 @@
** licensing are not clear to you.
**
** As a special exception, permission is given to link this program
- ** with any edition of Qt, and distribute the resulting executable,
- ** without including the source code for Qt in the source distribution.
+ ** with any edition of TQt, and distribute the resulting executable,
+ ** without including the source code for TQt in the source distribution.
**
**********************************************************************/
@@ -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* tqparent,KDGanttView* myGantt)
+ : TQCanvas (TQT_TQOBJECT(tqparent))
{
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 ), TQt::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();
+ item->tqinvalidateHeight () ;
+ //tqApp->processEvents();
updateMyContent();
}
-void KDTimeTableWidget::collapseItem( QListViewItem * item)
+void KDTimeTableWidget::collapseItem( TQListViewItem * item)
{
- item->invalidateHeight () ;
- //qApp->processEvents();
+ item->tqinvalidateHeight () ;
+ //tqApp->processEvents();
updateMyContent();
}
-void KDTimeTableWidget::highlightItem( QListViewItem * item )
+void KDTimeTableWidget::highlightItem( TQListViewItem * item )
{
static bool itemwashighlighted;
static KDGanttViewItem* highlightedItem = 0;
@@ -160,7 +160,7 @@ void KDTimeTableWidget::highlightItem( QListViewItem * item )
highlightedItem = ( KDGanttViewItem*)item;
itemwashighlighted = highlightedItem->highlight();
highlightedItem->setHighlight(true);
- item->invalidateHeight () ;
+ item->tqinvalidateHeight () ;
myGanttView->myListView->contentsY();
updateMyContent();
}
@@ -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( Qt::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( Qt::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( Qt::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( Qt::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( Qt::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( Qt::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( Qt::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( Qt::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( TQt::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( TQt::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);
@@ -620,7 +620,7 @@ void KDTimeTableWidget::updateMyContent()
maximumComputedGridHeight = hei;
// compute the background interval lines
myGanttView->myTimeHeader->computeIntervals( hei );
- //compute VerticalGrid and column color
+ //computeQt::VerticalGrid and column color
computeVerticalGrid();
}
computeTaskLinks();
@@ -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* tqparent,KDGanttView* gant )
+ : TQWidget (tqparent)
{
myToolTip = new KDTimeHeaderToolTip(this,this);
mySizeHint = 0;
myGanttView = gant;
flagDoNotRecomputeAfterChange = true;
- QDateTime start = (QDateTime::currentDateTime ()).addSecs(-3600);
+ TQDateTime start = (TQDateTime::tqcurrentDateTime ()).addSecs(-3600);
setHorizonStart(start);
setHorizonEnd( start.addSecs(3600*2));
flagStartTimeSet = false;
flagEndTimeSet = false;
- myCenterDateTime = QDateTime::currentDateTime ();
+ myCenterDateTime = TQDateTime::tqcurrentDateTime ();
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;
@@ -770,7 +770,7 @@ KDTimeHeaderWidget:: KDTimeHeaderWidget( QWidget* parent,KDGanttView* gant )
flagDoNotRepaintAfterChange = false;
setShowPopupMenu(false,false,false,false,false,false,false);
for (int j =1;j<8;++j)
- weekdayColor[j] = Qt::white;
+ weekdayColor[j] = TQt::white;
myMinimumWidth = 0;
mouseDown = false;
beginMouseDown = 0;
@@ -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)").tqarg( 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()));
}
@@ -830,14 +830,14 @@ void KDTimeHeaderWidget::addTickRight( int num )
{
int secs = ((num*getTickTime())-30);
setHorizonEnd(getDateTimeForIndex(width()).addSecs(secs));
- //qApp->processEvents();
+ //tqApp->processEvents();
}
void KDTimeHeaderWidget::addTickLeft( int num )
{
int secs = ((num*getTickTime())-30);
setHorizonStart(getDateTimeForIndex(0).addSecs(-secs));
- //qApp->processEvents();
+ //tqApp->processEvents();
}
// the time in secs of one minor grid tick
int KDTimeHeaderWidget::getTickTime()
@@ -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;
@@ -1140,7 +1140,7 @@ void KDTimeHeaderWidget::zoomToSelection( QDateTime start, QDateTime end)
}
flagDoNotRepaintAfterChange = false;
updateTimeTable();
- repaint();
+ tqrepaint();
moveTimeLineTo((getCoordX(start)-(viewWid-timeWid)/2));
// Since we have disconnected autoupdate of scrollbars, we must do it ourselves
if (myGanttView && myGanttView->myCanvasView)
@@ -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;
}
@@ -1436,7 +1436,7 @@ void KDTimeHeaderWidget::setShowMinorTicks( bool show )
flagShowMinorTicks = show;
if (show)
setShowMajorTicks(false );
- //repaintMe();
+ //tqrepaintMe();
updateTimeTable();
}
@@ -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;
@@ -1494,15 +1494,15 @@ void KDTimeHeaderWidget::computeIntervals( int height )
right = getCoordX((*it).end);
if ( right == left )
++right;
- (*it).canvasRect->setPen( QPen::NoPen );
- (*it).canvasRect->setBrush( QBrush( (*it).color, SolidPattern) );
+ (*it).canvasRect->setPen( Qt::NoPen );
+ (*it).canvasRect->setBrush( TQBrush( (*it).color, SolidPattern) );
(*it).canvasRect->setSize( right - left ,height );
(*it).canvasRect->move( left,0 );
(*it).canvasRect->show();
} else {
(*it).canvasRect->hide();
/*
- (*it).canvasLine->setPen( QPen( (*it).color, right - left ) );
+ (*it).canvasLine->setPen( TQPen( (*it).color, right - left ) );
(*it).canvasLine->setPoints( mid ,0 ,mid ,height );
(*it).canvasLine->show();
} else {
@@ -1511,10 +1511,10 @@ void KDTimeHeaderWidget::computeIntervals( int height )
}
}
}
-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 ) {
@@ -1532,8 +1532,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 ) {
@@ -1548,9 +1548,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 )
{
@@ -1593,11 +1593,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();
}
@@ -1614,11 +1614,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;
@@ -1648,7 +1648,7 @@ bool KDTimeHeaderWidget::getColumnColor(QColor& col,int coordLow, int coordHigh)
start = getDateTimeForIndex((coordLow+coordHigh)/2);
int day = start.date().dayOfWeek ();
//checkweekdaycolor
- if (weekdayColor[day] != Qt::white) {
+ if (weekdayColor[day] != TQt::white) {
col = weekdayColor[day];
return true;
}
@@ -1675,9 +1675,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 ) {
@@ -1697,7 +1697,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();
@@ -1710,7 +1710,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;
}
@@ -1725,7 +1725,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();
@@ -1739,7 +1739,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];
}
@@ -1829,7 +1829,7 @@ int KDTimeHeaderWidget::minorScaleCount() const
}
-void KDTimeHeaderWidget::resizeEvent ( QResizeEvent * )
+void KDTimeHeaderWidget::resizeEvent ( TQResizeEvent * )
{
// qDebug("KDTimeHeaderWidget:: resizeEvent ");
paintPix.resize( 800, height () );
@@ -1843,7 +1843,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;
@@ -1873,22 +1873,22 @@ int KDTimeHeaderWidget::autoScaleMinorTickCount()
}
-void KDTimeHeaderWidget::repaintMe(int left,int paintwid, QPainter* painter)
+void KDTimeHeaderWidget::tqrepaintMe(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 ) {
@@ -1898,13 +1898,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,
@@ -1913,8 +1913,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)) {
@@ -1927,7 +1927,7 @@ void KDTimeHeaderWidget::repaintMe(int left,int paintwid, QPainter* painter)
for ( it = minorText.begin(); it != minorText.end(); ++it ) {
if (i*wid1 >= left-wid1 && i*wid1 <= left+paintwid) {
qDrawShadeLine ( p,i*wid1-offsetLeft ,hei1-1, i*wid1-offsetLeft, hei2, qcg, true, lwid, 1 );
- p->drawText(i*wid1+1-offsetLeft,hei1+1,wid1-1,hei2-hei1,Qt::AlignCenter,(*it));
+ p->drawText(i*wid1+1-offsetLeft,hei1+1,wid1-1,hei2-hei1,TQt::AlignCenter,(*it));
}
++i;
}
@@ -1945,9 +1945,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)
@@ -1958,24 +1958,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();
@@ -1983,7 +1983,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:
@@ -1993,7 +1993,7 @@ QDateTime KDTimeHeaderWidget::getEvenTimeDate(QDateTime tempdatetime ,Scale sc)
}
-void KDTimeHeaderWidget::computeRealScale(QDateTime start)
+void KDTimeHeaderWidget::computeRealScale(TQDateTime start)
{
if (myScale ==KDGanttView::Auto) {
@@ -2095,11 +2095,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 tqitemRectMinor, tqitemRectMajor;
+ TQDate tempDate = myRealStart.date();
myRealEnd = myRealStart;
// preparing the testtext for the differennt scales
switch (myRealScale)
@@ -2121,25 +2121,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::tqcurrentDate());
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::tqcurrentDate());
minorPerMajor = 700;
break;
case KDGanttView::Week:
minorItems = minorItems/(60*24*7);
testTextMinor = "88";
- testTextMajor = "Aug x"+getYear(QDate::currentDate());
+ testTextMajor = "Aug x"+getYear(TQDate::tqcurrentDate());
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::tqcurrentDate());
minorPerMajor = 1200;
break;
case KDGanttView::Auto:
@@ -2147,12 +2147,12 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale)
qDebug(" RealScale == Auto : This may not be! ");
break;
}
- itemRectMinor = p.boundingRect ( 10, 10, 2, 2, Qt::AlignLeft,testTextMinor);
- itemRectMajor = p.boundingRect ( 10, 10, 2, 2, Qt::AlignLeft,testTextMajor);
+ tqitemRectMinor = p.boundingRect ( 10, 10, 2, 2, TQt::AlignLeft,testTextMinor);
+ tqitemRectMajor = p.boundingRect ( 10, 10, 2, 2, TQt::AlignLeft,testTextMajor);
p.end();
//qDebug(" tempMinorScaleCount %d ", tempMinorScaleCount);
- Height = itemRectMinor.height()+itemRectMajor.height()+11;
- Width = (itemRectMinor.width()+5);
+ Height = tqitemRectMinor.height()+tqitemRectMajor.height()+11;
+ Width = (tqitemRectMinor.width()+5);
if (Width < minimumColumnWidth()) Width = minimumColumnWidth();
// if the desired width is greater than the maximum width of this widget
// increase the minorscalecount
@@ -2209,7 +2209,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale)
// checking, if enough space for majorscale
// if not, increasing MajorScaleCount
- while ((minorPerMajor*Width)/100 < itemRectMajor.width()) {
+ while ((minorPerMajor*Width)/100 < tqitemRectMajor.width()) {
minorPerMajor = minorPerMajor/tempMajorScaleCount;
++tempMajorScaleCount;
minorPerMajor = minorPerMajor*tempMajorScaleCount;
@@ -2219,15 +2219,15 @@ 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 geometry
+ // if size changed, reset tqgeometry
if (width() != Width || height() != Height )
{
resize( Width, Height );
emit sizeChanged( Width );
}
- myMajorGridHeight = itemRectMajor.height()+5;
- QTime tempTime = myRealStart.time();
- QDateTime tempDateTime;
+ myMajorGridHeight = tqitemRectMajor.height()+5;
+ TQTime tempTime = myRealStart.time();
+ TQDateTime tempDateTime;
int i;
const KCalendarSystem * calendar = KGlobal::locale()->calendar();
switch (myRealScale)
@@ -2292,7 +2292,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();
@@ -2355,7 +2355,7 @@ void KDTimeHeaderWidget::computeTicks(bool doNotComputeRealScale)
myGanttView->myTimeTable->setBlockUpdating( block );
updateTimeTable();
centerDateTime(myCenterDateTime);
- repaint();
+ tqrepaint();
}
@@ -2373,7 +2373,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) );
@@ -2381,23 +2381,23 @@ void KDTimeHeaderWidget::centerDateTime( const QDateTime& center )
}
-void KDTimeHeaderWidget::paintEvent(QPaintEvent *p)
+void KDTimeHeaderWidget::paintEvent(TQPaintEvent *p)
{
- repaintMe(p->rect().x(),p->rect().width());
+ tqrepaintMe(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 );
@@ -2407,9 +2407,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:
@@ -2429,9 +2429,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) {
@@ -2455,20 +2455,20 @@ QString KDTimeHeaderWidget::getHour(QTime time)
}
-void KDTimeHeaderWidget::mousePressEvent ( QMouseEvent * e )
+void KDTimeHeaderWidget::mousePressEvent ( TQMouseEvent * e )
{
mouseDown = false;
switch ( e->button() ) {
- case LeftButton:
+ case Qt::LeftButton:
mouseDown = true;
beginMouseDown = e->pos().x();
endMouseDown = e->pos().x();
break;
- case RightButton:
+ case Qt::RightButton:
if (flagShowPopupMenu)
myPopupMenu->popup(e->globalPos());
break;
- case MidButton:
+ case Qt::MidButton:
break;
default:
break;
@@ -2477,7 +2477,7 @@ void KDTimeHeaderWidget::mousePressEvent ( QMouseEvent * e )
}
-void KDTimeHeaderWidget::mouseReleaseEvent ( QMouseEvent * )
+void KDTimeHeaderWidget::mouseReleaseEvent ( TQMouseEvent * )
{
if ( mouseDown ) {
mouseDown = false;
@@ -2501,26 +2501,26 @@ void KDTimeHeaderWidget::mouseReleaseEvent ( QMouseEvent * )
//zoomToSelection( getDateTimeForIndex(start),getDateTimeForIndex(end) );
}
mouseDown = false;
- repaint();
+ tqrepaint();
}
-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() ) {
mouseDown = false;
- repaint();
+ tqrepaint();
return;
}
endMouseDown = e->pos().x();
- //repaint;
+ //tqrepaint;
int val = -1;
if (endMouseDown < -x() ) {
val = myGanttView->myCanvasView->horizontalScrollBar()->value() -
@@ -2529,19 +2529,19 @@ void KDTimeHeaderWidget::mouseMoveEvent ( QMouseEvent * e )
val = 0;
}
}
- if (endMouseDown > -x() +parentWidget()->width() ) {
+ if (endMouseDown > -x() +tqparentWidget()->width() ) {
val = myGanttView->myCanvasView->horizontalScrollBar()->value() +
myGanttView->myCanvasView->horizontalScrollBar()->lineStep();
}
- repaintMe(-x(),parentWidget()->width());
+ tqrepaintMe(-x(),tqparentWidget()->width());
if ( val > -1 ) {
if ( val > myGanttView->myCanvasView->horizontalScrollBar()->maxValue() ) {
val = myGanttView->myCanvasView->horizontalScrollBar()->maxValue();
}
myGanttView->myCanvasView->horizontalScrollBar()->setValue( val );
}
- //qDebug("mousemove %d %d %d %d",endMouseDown, -x(),parentWidget()->width() , e->pos().y());
+ //qDebug("mousemove %d %d %d %d",endMouseDown, -x(),tqparentWidget()->width() , e->pos().y());
}
}
@@ -2549,17 +2549,17 @@ void KDTimeHeaderWidget::mouseMoveEvent ( QMouseEvent * e )
/* ***************************************************************
KDLegendWidget:: KDLegendWidget
***************************************************************** */
-KDLegendWidget:: KDLegendWidget( QWidget* parent,
+KDLegendWidget:: KDLegendWidget( TQWidget* tqparent,
KDGanttMinimizeSplitter* legendParent ) :
- KDGanttSemiSizingControl ( KDGanttSemiSizingControl::Before, Vertical,
- parent)
+ KDGanttSemiSizingControl ( KDGanttSemiSizingControl::Before,Qt::Vertical,
+ tqparent)
{
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();
@@ -2574,7 +2574,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 );
@@ -2583,7 +2583,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 );
@@ -2597,7 +2597,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 );
@@ -2614,36 +2614,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->tqsizeHint().width(), myLegend->tqsizeHint().height()+scroll->horizontalScrollBar()->height());
}
@@ -2657,15 +2657,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->setBackgroundColor( Qt::white );
+ myLegend = new TQGroupBox( 1, Qt::Horizontal, i18n( "Legend" ), scroll->viewport() );
+ myLegend->setBackgroundColor( TQt::white );
myLegend->setFont( font() );
scroll->addChild( myLegend );
- scroll->setResizePolicy( QScrollView::AutoOneFit );
- myLegend->layout()->setMargin( 11 );
- myLegend->setFrameStyle( QFrame::NoFrame );
+ scroll->setResizePolicy( TQScrollView::AutoOneFit );
+ myLegend->tqlayout()->setMargin( 11 );
+ myLegend->setFrameStyle( TQFrame::NoFrame );
if ( dock )
scroll->setMaximumHeight( 32000 );
else
@@ -2673,19 +2673,19 @@ void KDLegendWidget::clearLegend ( )
}
-void KDLegendWidget::addLegendItem( KDGanttViewItem::Shape shape, const QColor& shapeColor, const QString& text )
+void KDLegendWidget::addLegendItem( KDGanttViewItem::Shape tqshape, const TQColor& tqshapeColor, const TQString& text )
{
- QLabel * temp;
- QPixmap p = KDGanttView::getPixmap( shape, shapeColor, Qt::white, 10);
- QWidget *w = new QWidget( myLegend );
- w->setBackgroundColor( Qt::white );
- QHBoxLayout *lay = new QHBoxLayout( w ,0, 6);
- temp = new QLabel ( w );
- lay->addWidget( temp, 0, Qt:: AlignRight);
+ TQLabel * temp;
+ TQPixmap p = KDGanttView::getPixmap( tqshape, tqshapeColor, TQt::white, 10);
+ TQWidget *w = new TQWidget( myLegend );
+ w->setBackgroundColor( TQt::white );
+ TQHBoxLayout *lay = new TQHBoxLayout( w ,0, 6);
+ temp = new TQLabel ( w );
+ lay->addWidget( temp, 0, TQt:: AlignRight);
temp->setPixmap(p);
- temp = new QLabel ( text, w );
- temp->setBackgroundColor( Qt::white );
- lay->addWidget( temp, 0, Qt:: AlignLeft);
+ temp = new TQLabel ( text, w );
+ temp->setBackgroundColor( TQt::white );
+ lay->addWidget( temp, 0, TQt:: AlignLeft);
lay->addStretch();
if ( dock )
scroll->setMaximumHeight( 32000 );
@@ -2700,7 +2700,7 @@ bool KDLegendWidget::isShown ( )
}
-KDListView::KDListView(QWidget* parent, KDGanttView* gantView):QListView (parent)
+KDListView::KDListView(TQWidget* tqparent, KDGanttView* gantView):TQListView (tqparent)
{
myGanttView = gantView;
setAcceptDrops(true);
@@ -2709,21 +2709,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 )
@@ -2737,18 +2737,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) {
@@ -2764,17 +2764,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
{
@@ -2785,7 +2785,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() );
@@ -2793,16 +2793,16 @@ void KDListView::drawToPainter ( QPainter * p, bool drawHeader )
return;
}
// Draw headers
- QPen pen = QPen(Qt::lightGray, 1);
+ TQPen pen = TQPen(TQt::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());
}
//kdDebug()<<s<<": "<<h->label(s)<<" "<<r<<endl;
- p->drawText(r.x()+2, r.y(), r.width()-2, r.height(), columnAlignment(s)|Qt::AlignVCenter, h->label(s), -1);
+ p->drawText(r.x()+2, r.y(), r.width()-2, r.height(), columnAlignment(s)|TQt::AlignVCenter, h->label(s), -1);
p->save();
p->setPen(pen);
p->drawRect(r.x(), r.y()+1, r.width(), r.height()-2);
@@ -2812,7 +2812,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) {
@@ -2825,26 +2825,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()) {
@@ -2853,9 +2853,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;
@@ -2896,7 +2896,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 = ( tqpalette().inactive() );
while ( c < lc && !drawables.isEmpty() ) {
int i = header()->mapToLogical( c );
@@ -2933,7 +2933,7 @@ void KDListView::drawAllContents(QPainter * p, int cx, int cy, int cw, int ch) {
if ( tx < 0 )
tx = header()->cellPos( cell );
- // do any children of current need to be painted?
+ // do any tqchildren of current need to be painted?
/* FIXME: painting branches doesn't work for some reason...
if ( ih != ith &&
rootIsDecorated() &&
@@ -2948,10 +2948,10 @@ void KDListView::drawAllContents(QPainter * p, int cx, int cy, int cw, int ch) {
int rleft = tx + current->l*treeStepSize();
int rright = rleft + treeStepSize();
- int crtop = QMAX( rtop, cy );
- int crbottom = QMIN( rbottom, cy+ch );
- int crleft = QMAX( rleft, cx );
- int crright = QMIN( rright, cx+cw );
+ int crtop = TQMAX( rtop, cy );
+ int crbottom = TQMIN( rbottom, cy+ch );
+ int crleft = TQMAX( rleft, cx );
+ int crright = TQMIN( rright, cx+cw );
r.setRect( crleft, crtop,
crright-crleft, crbottom-crtop );
@@ -2961,7 +2961,7 @@ void KDListView::drawAllContents(QPainter * p, int cx, int cy, int cw, int ch) {
p->translate( rleft, crtop );
//kdDebug()<<k_funcinfo<<"paintBranches: "<<current->i->text(0)<<endl;
- current->i->paintBranches( p, colorGroup(), treeStepSize(),
+ current->i->paintBranches( p, tqcolorGroup(), treeStepSize(),
rtop - crtop, r.height() );
p->restore();
}
@@ -2969,11 +2969,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 );
@@ -2983,7 +2983,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 );
@@ -3003,13 +3003,13 @@ void KDListView::dragMoveEvent ( QDragMoveEvent * e)
}
if ( e->source() == myGanttView && gItem ){
// internal drag - do not allow to drag the item to a subitem of itself
- KDGanttViewItem* pItem = gItem->parent();
+ KDGanttViewItem* pItem = gItem->tqparent();
while ( pItem ) {
if ( pItem == myGanttView->myCanvasView->lastClickedItem ) {
e->accept( false );
return;
}
- pItem = pItem->parent();
+ pItem = pItem->tqparent();
}
if ( gItem == myGanttView->myCanvasView->lastClickedItem ) {
e->accept( false );
@@ -3019,11 +3019,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 );
@@ -3035,7 +3035,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;
@@ -3044,22 +3044,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,
@@ -3088,9 +3088,9 @@ void KDListView::dropEvent ( QDropEvent *e )
return;
}
-QDragObject * KDListView::dragObject ()
+TQDragObject * KDListView::dragObject ()
{
- return QListView::dragObject ();
+ return TQListView::dragObject ();
}
void KDListView::startDrag ()
@@ -3103,72 +3103,72 @@ void KDListView::startDrag ()
}
KDCanvasText::KDCanvasText( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
- QCanvasText(canvas)
+ TQCanvasText(canvas)
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
KDCanvasLine::KDCanvasLine( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
- QCanvasLine(canvas)
+ TQCanvasLine(canvas)
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
KDCanvasPolygonItem::KDCanvasPolygonItem( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
- QCanvasPolygonalItem( canvas )
+ TQCanvasPolygonalItem( canvas )
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
KDCanvasPolygon::KDCanvasPolygon( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
- QCanvasPolygon( canvas )
+ TQCanvasPolygon( canvas )
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
KDCanvasEllipse::KDCanvasEllipse( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
- QCanvasEllipse( canvas )
+ TQCanvasEllipse( canvas )
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
KDCanvasRectangle::KDCanvasRectangle( KDTimeTableWidget* canvas,
- void* parentItem,
+ void* tqparentItem,
int type ) :
- QCanvasRectangle( canvas )
+ TQCanvasRectangle( canvas )
{
myParentType = type;
- myParentItem = parentItem;
+ myParentItem = tqparentItem;
}
-KDGanttCanvasView::KDGanttCanvasView( KDGanttView* sender,QCanvas* canvas, QWidget* parent, const
- char* name ) : QCanvasView ( canvas, parent, name ), scrollBarTimer( 0, "scrollBarTimer" )
+KDGanttCanvasView::KDGanttCanvasView( KDGanttView* sender,TQCanvas* canvas, TQWidget* tqparent, const
+ char* name ) : TQCanvasView ( canvas, tqparent, name ), scrollBarTimer( 0, "scrollBarTimer" )
{
- setHScrollBarMode (QScrollView::AlwaysOn );
- setVScrollBarMode( QScrollView::AlwaysOn );
+ setHScrollBarMode (TQScrollView::AlwaysOn );
+ setVScrollBarMode( TQScrollView::AlwaysOn );
myToolTip = new KDCanvasToolTip(viewport(),this);
mySignalSender = sender;
currentItem = 0;
@@ -3177,61 +3177,61 @@ KDGanttCanvasView::KDGanttCanvasView( KDGanttView* sender,QCanvas* canvas, QWidg
fromItem = 0;
fromArea = 0;
linkItemsEnabled = false;
- linkLine = new QCanvasLine(canvas);
+ linkLine = new TQCanvasLine(canvas);
linkLine->hide();
linkLine->setZ(1000);
//set_Mouse_Tracking(true);
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_OBJECT_NAME_STRING, 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;
}
@@ -3257,22 +3257,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);
}
@@ -3320,20 +3320,20 @@ void KDGanttCanvasView::insertItemAsRoot( KDGanttViewItem* item )
if ( item == cuttedItem )
cuttedItem = 0;
}
-void KDGanttCanvasView::insertItemAsChild( KDGanttViewItem* parent, KDGanttViewItem* item )
+void KDGanttCanvasView::insertItemAsChild( KDGanttViewItem* tqparent, KDGanttViewItem* item )
{
- parent->insertItem( cuttedItem );
+ tqparent->insertItem( cuttedItem );
if ( item == cuttedItem )
cuttedItem = 0;
}
-void KDGanttCanvasView::insertItemAfter( KDGanttViewItem* parent , KDGanttViewItem* item )
+void KDGanttCanvasView::insertItemAfter( KDGanttViewItem* tqparent , KDGanttViewItem* item )
{
- if ( parent->parent() ) {
- parent->parent()->insertItem( item );
+ if ( tqparent->tqparent() ) {
+ tqparent->tqparent()->insertItem( item );
}
else
mySignalSender->myListView->insertItem( item );
- item->moveItem( parent );
+ item->moveItem( tqparent );
if ( item == cuttedItem )
cuttedItem = 0;
}
@@ -3341,9 +3341,9 @@ void KDGanttCanvasView::insertItemAfter( KDGanttViewItem* parent , KDGanttViewI
void KDGanttCanvasView::cutItem()
{
lastClickedItem->hideSubtree();
- //qDebug("last clicked %d parent %d ", lastClickedItem , lastClickedItem->parent());
- if ( lastClickedItem->parent() )
- lastClickedItem->parent()->takeItem(lastClickedItem);
+ //qDebug("last clicked %d tqparent %d ", lastClickedItem , lastClickedItem->tqparent());
+ if ( lastClickedItem->tqparent() )
+ lastClickedItem->tqparent()->takeItem(lastClickedItem);
else
mySignalSender->myListView->takeItem( lastClickedItem );
mySignalSender->myTimeTable->updateMyContent();
@@ -3379,8 +3379,8 @@ void KDGanttCanvasView::pasteItem( int type )
lastClickedItem->insertItem( cuttedItem );
break;
case 2://after
- if ( lastClickedItem->parent() ) {
- lastClickedItem->parent()->insertItem( cuttedItem );
+ if ( lastClickedItem->tqparent() ) {
+ lastClickedItem->tqparent()->insertItem( cuttedItem );
}
else
mySignalSender->myListView->insertItem( cuttedItem );
@@ -3427,20 +3427,20 @@ void KDGanttCanvasView::newChildItem( int type )
temp = new KDGanttViewTaskItem( lastClickedItem, i18n( "New Task" ) );
break;
case 5:
- if ( lastClickedItem->parent() )
- temp = new KDGanttViewEventItem( lastClickedItem->parent(), lastClickedItem, i18n( "New Event" ) );
+ if ( lastClickedItem->tqparent() )
+ temp = new KDGanttViewEventItem( lastClickedItem->tqparent(), lastClickedItem, i18n( "New Event" ) );
else
temp = new KDGanttViewEventItem( mySignalSender, lastClickedItem, i18n( "New Event" ) );
break;
case 4:
- if ( lastClickedItem->parent() )
- temp = new KDGanttViewSummaryItem( lastClickedItem->parent(), lastClickedItem, i18n( "New Summary" ) );
+ if ( lastClickedItem->tqparent() )
+ temp = new KDGanttViewSummaryItem( lastClickedItem->tqparent(), lastClickedItem, i18n( "New Summary" ) );
else
temp = new KDGanttViewSummaryItem( mySignalSender, lastClickedItem, i18n( "New Summary" ) );
break;
case 6:
- if ( lastClickedItem->parent() )
- temp = new KDGanttViewTaskItem( lastClickedItem->parent(), lastClickedItem, i18n( "New Task" ) );
+ if ( lastClickedItem->tqparent() )
+ temp = new KDGanttViewTaskItem( lastClickedItem->tqparent(), lastClickedItem, i18n( "New Task" ) );
else
temp = new KDGanttViewTaskItem( mySignalSender, lastClickedItem, i18n( "New Task" ) );
break;
@@ -3453,14 +3453,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:
@@ -3476,10 +3476,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:
@@ -3503,20 +3503,20 @@ QString KDGanttCanvasView::getWhatsThisText(QPoint p)
*/
-void KDGanttCanvasView::contentsMousePressEvent ( QMouseEvent * e )
+void KDGanttCanvasView::contentsMousePressEvent ( TQMouseEvent * e )
{
//qDebug("mousepress! %d ", this);
- //qDebug("focus %d ",qApp->focusWidget());
+ //qDebug("focus %d ",tqApp->tqfocusWidget());
setFocus();
currentLink = 0;
currentItem = 0;
- if (e->button() == RightButton && mySignalSender->editable()) {
- lastClickedItem = (KDGanttViewItem*) mySignalSender->myListView->itemAt( QPoint(2,e->pos().y()));
+ if (e->button() == Qt::RightButton && mySignalSender->editable()) {
+ 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);
@@ -3527,11 +3527,11 @@ 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:
+ case Qt::LeftButton:
switch (getType(*it)) {
case Type_is_KDGanttViewItem:
currentItem = getItem(*it);
@@ -3554,7 +3554,7 @@ void KDGanttCanvasView::contentsMousePressEvent ( QMouseEvent * e )
break;
}
break;
- case RightButton:
+ case Qt::RightButton:
switch (getType(*it)) {
case Type_is_KDGanttViewItem:
currentItem = getItem(*it);
@@ -3566,7 +3566,7 @@ void KDGanttCanvasView::contentsMousePressEvent ( QMouseEvent * e )
break;
}
break;
- case MidButton:
+ case Qt::MidButton:
switch (getType(*it)) {
case Type_is_KDGanttViewItem:
currentItem = getItem(*it);
@@ -3582,10 +3582,10 @@ void KDGanttCanvasView::contentsMousePressEvent ( QMouseEvent * e )
break;
}
}
- if (e->button() == RightButton ) {
+ if (e->button() == Qt::RightButton ) {
mySignalSender->gvContextMenuRequested( currentItem, e->globalPos() );
}
- if (autoScrollEnabled && e->button() == LeftButton) {
+ if (autoScrollEnabled && e->button() == Qt::LeftButton) {
myScrollTimer->start(50);
}
}
@@ -3596,7 +3596,7 @@ void KDGanttCanvasView::contentsMousePressEvent ( QMouseEvent * e )
*/
-void KDGanttCanvasView::contentsMouseReleaseEvent ( QMouseEvent * e )
+void KDGanttCanvasView::contentsMouseReleaseEvent ( TQMouseEvent * e )
{
static KDGanttViewItem* lastClicked = 0;
mySignalSender->gvMouseButtonClicked( e->button(), currentItem , e->globalPos() );
@@ -3606,7 +3606,7 @@ void KDGanttCanvasView::contentsMouseReleaseEvent ( QMouseEvent * e )
// if ( currentLink || currentItem )
{
switch ( e->button() ) {
- case LeftButton:
+ case Qt::LeftButton:
myScrollTimer->stop();
{
mySignalSender->itemLeftClicked( currentItem );
@@ -3617,8 +3617,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);
@@ -3634,7 +3634,7 @@ void KDGanttCanvasView::contentsMouseReleaseEvent ( QMouseEvent * e )
}
fromItem = 0;
break;
- case RightButton:
+ case Qt::RightButton:
{
mySignalSender->itemRightClicked( currentItem );
mySignalSender->gvItemRightClicked( currentItem );
@@ -3643,7 +3643,7 @@ void KDGanttCanvasView::contentsMouseReleaseEvent ( QMouseEvent * e )
if ( currentLink )
mySignalSender->taskLinkRightClicked( currentLink );
break;
- case MidButton:
+ case Qt::MidButton:
{
mySignalSender->itemMidClicked( currentItem );
mySignalSender->gvItemMidClicked( currentItem );
@@ -3668,13 +3668,13 @@ void KDGanttCanvasView::contentsMouseReleaseEvent ( QMouseEvent * e )
*/
-void KDGanttCanvasView::contentsMouseDoubleClickEvent ( QMouseEvent * e )
+void KDGanttCanvasView::contentsMouseDoubleClickEvent ( TQMouseEvent * e )
{
- 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:
+ case Qt::LeftButton:
switch (getType(*it)) {
case Type_is_KDGanttViewItem:
if ( getItem(*it)->enabled() )
@@ -3728,7 +3728,7 @@ void KDGanttCanvasView::contentsMouseDoubleClickEvent ( QMouseEvent * e )
*/
-void KDGanttCanvasView::contentsMouseMoveEvent ( QMouseEvent *e )
+void KDGanttCanvasView::contentsMouseMoveEvent ( TQMouseEvent *e )
{
//qDebug("mousemove! ");
static int moves = 0;
@@ -3741,7 +3741,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());
@@ -3749,14 +3749,14 @@ void KDGanttCanvasView::contentsMouseMoveEvent ( QMouseEvent *e )
}
// no action implemented
//qDebug("mousemove ");
- //QToolTip::setGloballyEnabled (false);
- //QToolTip::remove(viewport());
- // QToolTip::add(viewport(), "hello");
- // QToolTip::setGloballyEnabled (true);
+ //TQToolTip::setGloballyEnabled (false);
+ //TQToolTip::remove(viewport());
+ // TQToolTip::add(viewport(), "hello");
+ // TQToolTip::setGloballyEnabled (true);
/*
- QCanvasItemList il = canvas() ->collisions ( e->pos() );
+ TQCanvasItemList il = canvas() ->collisions ( e->pos() );
- QCanvasItemList::Iterator it;
+ TQCanvasItemList::Iterator it;
KDGanttItem* mouseover = 0;
for ( it = il.begin(); it != il.end(); ++it ) {
@@ -3764,44 +3764,44 @@ void KDGanttCanvasView::contentsMouseMoveEvent ( QMouseEvent *e )
*/
}
-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: return ((KDCanvasRectangle *)it)->myParentType;
+ 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: 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;
}
@@ -3818,7 +3818,7 @@ void KDGanttCanvasView::slotScrollTimer() {
if (my < 0)
dy = -5;
else if (my > visibleHeight())
- dy = QMIN(5, verticalScrollBar()->maxValue()-verticalScrollBar()->value());
+ dy = TQMIN(5, verticalScrollBar()->maxValue()-verticalScrollBar()->value());
if (dx != 0 || dy != 0)
scrollBy(dx, dy);