summaryrefslogtreecommitdiffstats
path: root/kplato/kptcanvasitem.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kplato/kptcanvasitem.cc')
-rw-r--r--kplato/kptcanvasitem.cc446
1 files changed, 223 insertions, 223 deletions
diff --git a/kplato/kptcanvasitem.cc b/kplato/kptcanvasitem.cc
index c2aff602..95bf6888 100644
--- a/kplato/kptcanvasitem.cc
+++ b/kplato/kptcanvasitem.cc
@@ -24,10 +24,10 @@
#include "kptganttview.h"
#include <klocale.h>
-#include <qpainter.h>
-#include <qpointarray.h>
-#include <qptrlist.h>
-#include <qpoint.h>
+#include <tqpainter.h>
+#include <tqpointarray.h>
+#include <tqptrlist.h>
+#include <tqpoint.h>
#include <kdebug.h>
@@ -35,7 +35,7 @@ namespace KPlato
{
PertNodeItem::PertNodeItem( PertCanvas *view, Node &node, int row, int col )
- : QCanvasPolygon(view->canvas()),
+ : TQCanvasPolygon(view->canvas()),
m_node(node),
m_row(row),
m_col(col)
@@ -46,14 +46,14 @@ PertNodeItem::PertNodeItem( PertCanvas *view, Node &node, int row, int col )
m_width = view->itemSize().width();
m_height = view->itemSize().height();
- m_name = new QCanvasText(node.name(), view->canvas());
+ m_name = new TQCanvasText(node.name(), view->canvas());
m_childRelations.setAutoDelete(true);
}
PertNodeItem::~PertNodeItem()
{
- QCanvasItemList list = canvas()->allItems();
- QCanvasItemList::Iterator it = list.begin();
+ TQCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList::Iterator it = list.begin();
for (; it != list.end(); ++it)
{
if ( *it == m_name )
@@ -70,15 +70,15 @@ int PertNodeItem::RTTI = 2000;
void PertNodeItem::setVisible(bool yes)
{
//kdDebug()<<k_funcinfo<<m_node.name()<<endl;
- QCanvasPolygon::setVisible(yes);
- QCanvasItemList list = canvas()->allItems();
- QCanvasItemList::Iterator it = list.begin();
+ TQCanvasPolygon::tqsetVisible(yes);
+ TQCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList::Iterator it = list.begin();
for (; it != list.end(); ++it)
{
if ( *it == m_name )
- m_name->setVisible(yes);
+ m_name->tqsetVisible(yes);
if ( *it == m_leader )
- m_leader->setVisible(yes);
+ m_leader->tqsetVisible(yes);
}
}
@@ -88,8 +88,8 @@ void PertNodeItem::move(PertCanvas *view, int row, int col)
m_row = row; m_col = col;
view->mapNode(this);
- // Now map my children
- QPtrListIterator<PertNodeRelation> it(m_childRelations);
+ // Now map my tqchildren
+ TQPtrListIterator<PertNodeRelation> it(m_childRelations);
for (; it.current(); ++it)
{
view->mapChildNode(this, it.current()->childItem, it.current()->relation->type());
@@ -97,9 +97,9 @@ void PertNodeItem::move(PertCanvas *view, int row, int col)
// now move the item on the canvas
m_x = x(col); m_y = y(row);
- m_left = QPoint(m_x, m_y + m_height/2);
- m_right = QPoint(m_x + m_width, m_y + m_height/2);
- QCanvasPolygon::move(m_x, m_y);
+ m_left = TQPoint(m_x, m_y + m_height/2);
+ m_right = TQPoint(m_x + m_width, m_y + m_height/2);
+ TQCanvasPolygon::move(m_x, m_y);
if (m_name)
m_name->move(m_x+5, m_y+2);
@@ -107,12 +107,12 @@ void PertNodeItem::move(PertCanvas *view, int row, int col)
//kdDebug()<<k_funcinfo<<m_node.name()<<" moved to row,col=("<<m_row<<","<<m_col<<")"<<endl;
}
-void PertNodeItem::drawShape(QPainter &p)
+void PertNodeItem::drawShape(TQPainter &p)
{
- //QPen pen(pen());
+ //TQPen pen(pen());
if (isSelected())
- p.setPen(QPen(Qt::red, 2));
- QPointArray a = poly;
+ p.setPen(TQPen(TQt::red, 2));
+ TQPointArray a = poly;
int size = a.size()-1;
for(int i = 0; i < size; ++i)
{
@@ -122,35 +122,35 @@ void PertNodeItem::drawShape(QPainter &p)
//setPen(pen);
}
-QPoint PertNodeItem::exitPoint(Relation::Type type) const
+TQPoint PertNodeItem::exitPoint(Relation::Type type) const
{
- QPoint ret;
+ TQPoint ret;
switch(type)
{
case Relation::FinishStart:
case Relation::FinishFinish:
- ret = m_right + QPoint(pen().width(), 0);
+ ret = m_right + TQPoint(pen().width(), 0);
break;
case Relation::StartStart:
- ret = m_left + QPoint(0, 4);
+ ret = m_left + TQPoint(0, 4);
break;
}
return ret;
}
-QPoint PertNodeItem::entryPoint(Relation::Type type) const
+TQPoint PertNodeItem::entryPoint(Relation::Type type) const
{
- QPoint ret;
+ TQPoint ret;
switch(type)
{
case Relation::FinishStart:
- ret = m_left - QPoint(pen().width(), 0);
+ ret = m_left - TQPoint(pen().width(), 0);
break;
case Relation::FinishFinish:
- ret = m_right - QPoint(pen().width(), 4);
+ ret = m_right - TQPoint(pen().width(), 4);
break;
case Relation::StartStart:
- ret = m_left - QPoint(pen().width(), 0);
+ ret = m_left - TQPoint(pen().width(), 0);
break;
}
return ret;
@@ -169,12 +169,12 @@ PertProjectItem::PertProjectItem(PertCanvas *view, Node &node, int row, int col)
{
//kdDebug()<<k_funcinfo<<"Node="<<node.name()<<" ("<<row<<","<<col<<")"<<endl;
- QPointArray a;
+ TQPointArray a;
a.putPoints(0, 5,
m_x+6, m_y, m_x+m_width, m_y, m_x+m_width-6, m_y+m_height, m_x, m_y+m_height, m_x+6, m_y);
setPoints(a);
- setPen(QPen(Qt::cyan, 2));
+ setPen(TQPen(TQt::cyan, 2));
}
PertProjectItem::~PertProjectItem()
@@ -197,16 +197,16 @@ PertTaskItem::PertTaskItem(PertCanvas *view, Node &node, int row, int col)
: PertNodeItem(view, node, row, col)
{
//kdDebug()<<k_funcinfo<<"Node="<<node.name()<<" ("<<row<<","<<col<<")"<<endl;
- QPointArray a;
+ TQPointArray a;
if (node.type() == Node::Type_Summarytask)
{
a.putPoints(0, 5, m_x+6, m_y, m_x+m_width, m_y, m_x+m_width-6, m_y+m_height, m_x, m_y+m_height, m_x+6, m_y);
- setPen(QPen(Qt::cyan, 2));
+ setPen(TQPen(TQt::cyan, 2));
}
else
{
a.putPoints(0, 5, m_x, m_y, m_x+m_width, m_y, m_x+m_width, m_y+m_height, m_x, m_y+m_height, m_x, m_y);
- setPen(QPen(Qt::green, 2));
+ setPen(TQPen(TQt::green, 2));
}
setPoints(a);
@@ -234,7 +234,7 @@ PertMilestoneItem::PertMilestoneItem(PertCanvas *view, Node &node, int row, int
{
//kdDebug()<<k_funcinfo<<"Node="<<node.name()<<" ("<<row<<","<<col<<")"<<endl;
- QPointArray a;
+ TQPointArray a;
a.putPoints(0, 7,
m_x, m_y+m_height/2,
m_x+6, m_y,
@@ -246,7 +246,7 @@ PertMilestoneItem::PertMilestoneItem(PertCanvas *view, Node &node, int row, int
setPoints(a);
- setPen(QPen(Qt::blue, 2));
+ setPen(TQPen(TQt::blue, 2));
}
PertMilestoneItem::~PertMilestoneItem()
@@ -265,16 +265,16 @@ void PertMilestoneItem::printDebug( int /*info*/ )
//////////////////// PertRelationItem //////////////////////////
-PertRelationItem::PertRelationItem( PertCanvas *view, PertNodeItem *parent, PertNodeItem *child, Relation *rel)
- : QCanvasPolygon(view->canvas()),
+PertRelationItem::PertRelationItem( PertCanvas *view, PertNodeItem *tqparent, PertNodeItem *child, Relation *rel)
+ : TQCanvasPolygon(view->canvas()),
m_view(view),
m_rel(rel),
- m_parentItem(parent),
+ m_parentItem(tqparent),
m_childItem(child)
{
- //kdDebug()<<k_funcinfo<<"Parent="<<parent->node().name()<<" Child="<<child->node().name()<<endl;
+ //kdDebug()<<k_funcinfo<<"Parent="<<tqparent->node().name()<<" Child="<<child->node().name()<<endl;
draw();
- setVisible(true);
+ tqsetVisible(true);
}
PertRelationItem::~PertRelationItem()
@@ -289,24 +289,24 @@ void PertRelationItem::draw()
{
//kdDebug()<<k_funcinfo<<endl;
// Some "rules":
- // a) Relation::FinishStart: child column > parent column
- // b) Relation::FinishFinish: child column >= parent column
- // c) Relation::StartStart: child column >= parent column
- // d) Child row can be >= parent row
+ // a) Relation::FinishStart: child column > tqparent column
+ // b) Relation::FinishFinish: child column >= tqparent column
+ // c) Relation::StartStart: child column >= tqparent column
+ // d) Child row can be >= tqparent row
wgap = m_view->verticalGap();
hgap = m_view->horizontalGap();
// could not use ...rect() here, don't know why
- parentTop = (int)(m_parentItem->y());
- parentBottom = parentTop + (int)(m_parentItem->height());
+ tqparentTop = (int)(m_parentItem->y());
+ tqparentBottom = tqparentTop + (int)(m_parentItem->height());
childTop = (int)(m_childItem->y());
childRow = m_childItem->row();
childCol = m_childItem->column();
- parentRow = m_parentItem->row();
- parentCol = m_parentItem->column();
- //kdDebug()<<k_funcinfo<<"Parent="<<m_parentItem->node().name()<<" ("<<parentRow<<","<<parentCol<<") Child="<<m_childItem->node().name()<<" ("<<childRow<<","<<childCol<<")"<<endl;
+ tqparentRow = m_parentItem->row();
+ tqparentCol = m_parentItem->column();
+ //kdDebug()<<k_funcinfo<<"Parent="<<m_parentItem->node().name()<<" ("<<tqparentRow<<","<<tqparentCol<<") Child="<<m_childItem->node().name()<<" ("<<childRow<<","<<childCol<<")"<<endl;
switch (type())
{
@@ -320,25 +320,25 @@ void PertRelationItem::draw()
setStartStartPoints();
break;
}
- QPointArray a = poly;
+ TQPointArray a = poly;
left = right = a[0].x();
top = bottom = a[0].y();
for (uint i = 0; i < a.size(); i++)
{
- left = QMIN(a[i].x(), left);
- top = QMIN(a[i].y(), top);
- right = QMAX(a[i].x(), right);
- bottom = QMAX(a[i].y(), bottom);
+ left = TQMIN(a[i].x(), left);
+ top = TQMIN(a[i].y(), top);
+ right = TQMAX(a[i].x(), right);
+ bottom = TQMAX(a[i].y(), bottom);
}
top -= 3;
bottom += 3;
- setPen(Qt::black);
+ setPen(TQt::black);
setZ(45);
/*#ifndef NDEBUG
- kdDebug()<<" PertNodeRelation from parent: "<<m_rel->parent()->name()<<" to child: "<<m_rel->child()->name()<<endl;
- QPointArray pa = poly;
+ kdDebug()<<" PertNodeRelation from tqparent: "<<m_rel->tqparent()->name()<<" to child: "<<m_rel->child()->name()<<endl;
+ TQPointArray pa = poly;
for (int i = 0; i < pa.size(); ++i)
kdDebug()<<" pa["<<i<<"]="<<pa[i].x()<<","<<pa[i].y()<<endl;
#endif*/
@@ -347,76 +347,76 @@ void PertRelationItem::draw()
void PertRelationItem::setFinishStartPoints()
{
- QPoint parentPoint = m_parentItem->exitPoint(Relation::FinishStart);
- QPoint childPoint = m_childItem->entryPoint(Relation::FinishStart);
+ TQPoint tqparentPoint = m_parentItem->exitPoint(Relation::FinishStart);
+ TQPoint childPoint = m_childItem->entryPoint(Relation::FinishStart);
- QPointArray a;
- a.putPoints(0, 1, parentPoint.x(), parentPoint.y());
+ TQPointArray a;
+ a.putPoints(0, 1, tqparentPoint.x(), tqparentPoint.y());
- if ( parentRow == childRow )
+ if ( tqparentRow == childRow )
{
- if (parentCol == childCol - 1 || rowFree(parentRow, parentCol+1, childCol-1))
+ if (tqparentCol == childCol - 1 || rowFree(tqparentRow, tqparentCol+1, childCol-1))
{
a.putPoints(1, 1, childPoint.x(), childPoint.y());
}
else // go around below
{
a.putPoints(1, 9,
- parentPoint.x()+(wgap/2)-3, parentPoint.y(), // stop short
- parentPoint.x()+(wgap/2), parentPoint.y()+3, // right/down
- parentPoint.x()+(wgap/2), parentBottom+(hgap/2)-3, // stop short
- parentPoint.x()+(wgap/2)+3, parentBottom+(hgap/2), // right/down
- childPoint.x()-(wgap/2)-3, parentBottom+(hgap/2), // stop short
- childPoint.x()-(wgap/2), parentBottom+(hgap/2)-3, // right/up
+ tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(), // stop short
+ tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3, // right/down
+ tqparentPoint.x()+(wgap/2), tqparentBottom+(hgap/2)-3, // stop short
+ tqparentPoint.x()+(wgap/2)+3, tqparentBottom+(hgap/2), // right/down
+ childPoint.x()-(wgap/2)-3, tqparentBottom+(hgap/2), // stop short
+ childPoint.x()-(wgap/2), tqparentBottom+(hgap/2)-3, // right/up
childPoint.x()-(wgap/2), childPoint.y()+3, // stop short
childPoint.x()-(wgap/2)+3, childPoint.y(), // right/up
childPoint.x(), childPoint.y());
}
}
- else if ( parentRow > childRow )
+ else if ( tqparentRow > childRow )
{
- if (parentCol == childCol - 1)
+ if (tqparentCol == childCol - 1)
{
a.putPoints(1, 5,
- parentPoint.x()+(wgap/2)-3, parentPoint.y(),
- parentPoint.x()+(wgap/2), parentPoint.y()-3,
- parentPoint.x()+wgap/2, childPoint.y()+3,
- parentPoint.x()+(wgap/2)+3, childPoint.y(),
+ tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(),
+ tqparentPoint.x()+(wgap/2), tqparentPoint.y()-3,
+ tqparentPoint.x()+wgap/2, childPoint.y()+3,
+ tqparentPoint.x()+(wgap/2)+3, childPoint.y(),
childPoint.x(), childPoint.y());
}
else // go around above
{
a.putPoints(1, 9,
- parentPoint.x()+(wgap/2)-3, parentPoint.y(),
- parentPoint.x()+(wgap/2), parentPoint.y()-3,
- parentPoint.x()+wgap/2, parentTop-(hgap/2)+3,
- parentPoint.x()+(wgap/2)+3, parentTop-(hgap/2),
- childPoint.x()-(wgap/2)-3, parentTop-hgap/2,
- childPoint.x()-(wgap/2), parentTop-(hgap/2)-3,
+ tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(),
+ tqparentPoint.x()+(wgap/2), tqparentPoint.y()-3,
+ tqparentPoint.x()+wgap/2, tqparentTop-(hgap/2)+3,
+ tqparentPoint.x()+(wgap/2)+3, tqparentTop-(hgap/2),
+ childPoint.x()-(wgap/2)-3, tqparentTop-hgap/2,
+ childPoint.x()-(wgap/2), tqparentTop-(hgap/2)-3,
childPoint.x()-wgap/2, childPoint.y()+3,
childPoint.x()-(wgap/2)+3, childPoint.y(),
childPoint.x(), childPoint.y());
}
}
- else if ( parentRow < childRow )
+ else if ( tqparentRow < childRow )
{
- if (parentCol == childCol - 1)
+ if (tqparentCol == childCol - 1)
{
a.putPoints(1, 5,
- parentPoint.x()+(wgap/2)-3, parentPoint.y(),
- parentPoint.x()+(wgap/2), parentPoint.y()+3,
- parentPoint.x()+wgap/2, childPoint.y()-3,
- parentPoint.x()+(wgap/2)+3, childPoint.y(),
+ tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(),
+ tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3,
+ tqparentPoint.x()+wgap/2, childPoint.y()-3,
+ tqparentPoint.x()+(wgap/2)+3, childPoint.y(),
childPoint.x(), childPoint.y());
}
else
{
a.putPoints(1, 9,
- parentPoint.x()+(wgap/2)-3, parentPoint.y(),
- parentPoint.x()+(wgap/2), parentPoint.y()+3,
- parentPoint.x()+wgap/2, childTop-(hgap/2)-3,
- parentPoint.x()+(wgap/2)+3, childTop-(hgap/2),
+ tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(),
+ tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3,
+ tqparentPoint.x()+wgap/2, childTop-(hgap/2)-3,
+ tqparentPoint.x()+(wgap/2)+3, childTop-(hgap/2),
childPoint.x()-(wgap/2)-3, childTop-(hgap/2),
childPoint.x()-(wgap/2), childTop-(hgap/2)+3,
childPoint.x()-wgap/2, childPoint.y()-3,
@@ -430,64 +430,64 @@ void PertRelationItem::setFinishStartPoints()
void PertRelationItem::setFinishFinishPoints()
{
//kdDebug()<<k_funcinfo<<endl;
- QPoint parentPoint = m_parentItem->exitPoint(Relation::FinishFinish);
- QPoint childPoint = m_childItem->entryPoint(Relation::FinishFinish);
+ TQPoint tqparentPoint = m_parentItem->exitPoint(Relation::FinishFinish);
+ TQPoint childPoint = m_childItem->entryPoint(Relation::FinishFinish);
- QPointArray a;
- a.putPoints(0, 1, parentPoint.x(), parentPoint.y());
+ TQPointArray a;
+ a.putPoints(0, 1, tqparentPoint.x(), tqparentPoint.y());
- if ( parentRow >= childRow )
+ if ( tqparentRow >= childRow )
{
- if (parentCol == childCol)
+ if (tqparentCol == childCol)
{
a.putPoints(1, 5,
- childPoint.x()+(wgap/2)-3, parentPoint.y(),
- childPoint.x()+(wgap/2), parentPoint.y()-3,
+ childPoint.x()+(wgap/2)-3, tqparentPoint.y(),
+ childPoint.x()+(wgap/2), tqparentPoint.y()-3,
childPoint.x()+wgap/2, childPoint.y()+3,
childPoint.x()+(wgap/2)-3, childPoint.y(),
childPoint.x(), childPoint.y());
}
- else if (parentCol < childCol)
+ else if (tqparentCol < childCol)
{
a.putPoints(1, 9,
- parentPoint.x()+(wgap/2)-3, parentPoint.y(), // stop short
- parentPoint.x()+(wgap/2), parentPoint.y()+3, // right/down
- parentPoint.x()+(wgap/2), parentBottom+(hgap/2)-3, // stop short
- parentPoint.x()+(wgap/2)+3, parentBottom+(hgap/2), // right/down
- childPoint.x()+(wgap/2)-3, parentBottom+(hgap/2), // stop short
- childPoint.x()+(wgap/2), parentBottom+(hgap/2)-3, // right/up
+ tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(), // stop short
+ tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3, // right/down
+ tqparentPoint.x()+(wgap/2), tqparentBottom+(hgap/2)-3, // stop short
+ tqparentPoint.x()+(wgap/2)+3, tqparentBottom+(hgap/2), // right/down
+ childPoint.x()+(wgap/2)-3, tqparentBottom+(hgap/2), // stop short
+ childPoint.x()+(wgap/2), tqparentBottom+(hgap/2)-3, // right/up
childPoint.x()+(wgap/2), childPoint.y()+3, // stop short
childPoint.x()+(wgap/2)-3, childPoint.y(), // left/up
childPoint.x(), childPoint.y());
}
}
- else // parentRow < choldRow
+ else // tqparentRow < choldRow
{
- if (parentCol == childCol)
+ if (tqparentCol == childCol)
{
a.putPoints(1, 5,
- parentPoint.x()+(wgap/2)-3, parentPoint.y(),
- parentPoint.x()+(wgap/2), parentPoint.y()+3,
- parentPoint.x()+wgap/2, childPoint.y()-3,
- parentPoint.x()+(wgap/2)-3, childPoint.y(),
+ tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(),
+ tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3,
+ tqparentPoint.x()+wgap/2, childPoint.y()-3,
+ tqparentPoint.x()+(wgap/2)-3, childPoint.y(),
childPoint.x(), childPoint.y());
}
- else if (parentCol < childCol)
+ else if (tqparentCol < childCol)
{
- if (rowFree(parentRow, parentCol+1, childCol))
+ if (rowFree(tqparentRow, tqparentCol+1, childCol))
a.putPoints(1, 5,
- childPoint.x()+(wgap/2)-3, parentPoint.y(),
- childPoint.x()+(wgap/2), parentPoint.y()+3,
+ childPoint.x()+(wgap/2)-3, tqparentPoint.y(),
+ childPoint.x()+(wgap/2), tqparentPoint.y()+3,
childPoint.x()+(wgap/2), childPoint.y()-3,
childPoint.x()+(wgap/2)-3, childPoint.y(),
childPoint.x(), childPoint.y());
else
a.putPoints(1, 9,
- parentPoint.x()+(wgap/2)-3, parentPoint.y(),
- parentPoint.x()+(wgap/2), parentPoint.y()+3,
- parentPoint.x()+wgap/2, childTop-(hgap/2)-3,
- parentPoint.x()+(wgap/2)+3, childTop-(hgap/2),
+ tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(),
+ tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3,
+ tqparentPoint.x()+wgap/2, childTop-(hgap/2)-3,
+ tqparentPoint.x()+(wgap/2)+3, childTop-(hgap/2),
childPoint.x()+(wgap/2)-3, childTop-(hgap/2),
childPoint.x()+(wgap/2), childTop-(hgap/2)+3,
childPoint.x()+(wgap/2), childPoint.y()-3,
@@ -497,10 +497,10 @@ void PertRelationItem::setFinishFinishPoints()
else
{
a.putPoints(1, 9,
- parentPoint.x()+(wgap/2)-3, parentPoint.y(),
- parentPoint.x()+(wgap/2), parentPoint.y()+3,
- parentPoint.x()+wgap/2, childTop-(hgap/2)-3,
- parentPoint.x()+(wgap/2)+3, childTop-(hgap/2),
+ tqparentPoint.x()+(wgap/2)-3, tqparentPoint.y(),
+ tqparentPoint.x()+(wgap/2), tqparentPoint.y()+3,
+ tqparentPoint.x()+wgap/2, childTop-(hgap/2)-3,
+ tqparentPoint.x()+(wgap/2)+3, childTop-(hgap/2),
childPoint.x()+(wgap/2)-3, childTop-(hgap/2),
childPoint.x()+(wgap/2), childTop-(hgap/2)+3,
childPoint.x()+wgap/2, childPoint.y()-3,
@@ -514,31 +514,31 @@ void PertRelationItem::setFinishFinishPoints()
void PertRelationItem::setStartStartPoints()
{
//kdDebug()<<k_funcinfo<<endl;
- QPoint parentPoint = m_parentItem->exitPoint(Relation::StartStart);
- QPoint childPoint = m_childItem->entryPoint(Relation::StartStart);
+ TQPoint tqparentPoint = m_parentItem->exitPoint(Relation::StartStart);
+ TQPoint childPoint = m_childItem->entryPoint(Relation::StartStart);
- QPointArray a;
- a.putPoints(0, 1, parentPoint.x(), parentPoint.y());
+ TQPointArray a;
+ a.putPoints(0, 1, tqparentPoint.x(), tqparentPoint.y());
- if ( parentRow > childRow )
+ if ( tqparentRow > childRow )
{
- if (parentCol == childCol) // go up
+ if (tqparentCol == childCol) // go up
{
a.putPoints(1, 4,
- parentPoint.x()-(wgap/2)+3, parentPoint.y(),
- parentPoint.x()-(wgap/2), parentPoint.y()-3,
- parentPoint.x()-(wgap/2), childPoint.y()+3,
- parentPoint.x()-(wgap/2)+3, childPoint.y());
+ tqparentPoint.x()-(wgap/2)+3, tqparentPoint.y(),
+ tqparentPoint.x()-(wgap/2), tqparentPoint.y()-3,
+ tqparentPoint.x()-(wgap/2), childPoint.y()+3,
+ tqparentPoint.x()-(wgap/2)+3, childPoint.y());
}
else // go above myself
{
a.putPoints(1, 8,
- parentPoint.x()-(wgap/2)+3, parentPoint.y(),
- parentPoint.x()-(wgap/2), parentPoint.y()-3,
- parentPoint.x()-(wgap/2), parentTop-(hgap/2)+3,
- parentPoint.x()-(wgap/2)+3, parentTop-(hgap/2),
- childPoint.x()-(wgap/2)-3, parentTop-(hgap/2),
- childPoint.x()-(wgap/2), parentTop-(hgap/2)-3,
+ tqparentPoint.x()-(wgap/2)+3, tqparentPoint.y(),
+ tqparentPoint.x()-(wgap/2), tqparentPoint.y()-3,
+ tqparentPoint.x()-(wgap/2), tqparentTop-(hgap/2)+3,
+ tqparentPoint.x()-(wgap/2)+3, tqparentTop-(hgap/2),
+ childPoint.x()-(wgap/2)-3, tqparentTop-(hgap/2),
+ childPoint.x()-(wgap/2), tqparentTop-(hgap/2)-3,
childPoint.x()-(wgap/2), childPoint.y()+3,
childPoint.x()-(wgap/2)+3, childPoint.y());
}
@@ -546,32 +546,32 @@ void PertRelationItem::setStartStartPoints()
else // go left/down
{
a.putPoints(1, 2,
- parentPoint.x()-(wgap/2)+3, parentPoint.y(),
- parentPoint.x()-(wgap/2), parentPoint.y()+3);
+ tqparentPoint.x()-(wgap/2)+3, tqparentPoint.y(),
+ tqparentPoint.x()-(wgap/2), tqparentPoint.y()+3);
- if (parentCol == childCol)
+ if (tqparentCol == childCol)
{
a.putPoints(3, 2,
- parentPoint.x()-(wgap/2), childPoint.y()-3,
- parentPoint.x()-(wgap/2)+3, childPoint.y());
+ tqparentPoint.x()-(wgap/2), childPoint.y()-3,
+ tqparentPoint.x()-(wgap/2)+3, childPoint.y());
}
else // go below myself
{
- if (parentRow == childRow) // go up
+ if (tqparentRow == childRow) // go up
{
a.putPoints(3, 6,
- parentPoint.x()-(wgap/2), parentBottom+hgap/2-3,
- parentPoint.x()-(wgap/2)+3, parentBottom+hgap/2,
- childPoint.x()-(wgap/2)-3, parentBottom+hgap/2,
- childPoint.x()-(wgap/2), parentBottom+hgap/2-3,
+ tqparentPoint.x()-(wgap/2), tqparentBottom+hgap/2-3,
+ tqparentPoint.x()-(wgap/2)+3, tqparentBottom+hgap/2,
+ childPoint.x()-(wgap/2)-3, tqparentBottom+hgap/2,
+ childPoint.x()-(wgap/2), tqparentBottom+hgap/2-3,
childPoint.x()-(wgap/2), childPoint.y()+3,
childPoint.x()-(wgap/2)+3, childPoint.y());
}
else // go down
{
a.putPoints(3, 6,
- parentPoint.x()-(wgap/2), childTop-(hgap/2)-3,
- parentPoint.x()-(wgap/2)+3, childTop-hgap/2,
+ tqparentPoint.x()-(wgap/2), childTop-(hgap/2)-3,
+ tqparentPoint.x()-(wgap/2)+3, childTop-hgap/2,
childPoint.x()-(wgap/2)-3, childTop-hgap/2,
childPoint.x()-(wgap/2), childTop-(hgap/2)+3,
childPoint.x()-(wgap/2), childPoint.y()-3,
@@ -583,12 +583,12 @@ void PertRelationItem::setStartStartPoints()
setPoints(a);
}
-void PertRelationItem::drawShape(QPainter &p)
+void PertRelationItem::drawShape(TQPainter &p)
{
- //kdDebug()<<k_funcinfo<<" "<<m_rel->parent()->name()<<" to "<<m_rel->child()->name()<<endl;
+ //kdDebug()<<k_funcinfo<<" "<<m_rel->tqparent()->name()<<" to "<<m_rel->child()->name()<<endl;
// cannot use polygon's drawShape() as it doesn't use the pen
setBrush(Qt::NoBrush);
- QPointArray a = poly;
+ TQPointArray a = poly;
int size = a.size()-1;
for(int i = 0; i < size; ++i)
{
@@ -600,23 +600,23 @@ void PertRelationItem::drawShape(QPainter &p)
int xoffset = -3;
if ( pos > 1&& a[pos-1].x() > a[pos].x())
xoffset = 3;
- QPoint pnt(a[pos].x()+xoffset, a[pos].y()-3);
+ TQPoint pnt(a[pos].x()+xoffset, a[pos].y()-3);
p.drawLine(a[pos], pnt);
pnt.setY(a[pos].y()+3);
p.drawLine(a[pos], pnt);
}
-QPointArray PertRelationItem::areaPoints () const
+TQPointArray PertRelationItem::areaPoints () const
{
- QPointArray pa(4);
+ TQPointArray pa(4);
int pw = (pen().width()+1)/2;
if ( pw < 1 ) pw = 1;
- if ( pen() == NoPen ) pw = 0;
- pa[0] = QPoint(left-pw,top-pw);
- pa[1] = pa[0] + QPoint(right-left+pw*2,0);
- pa[2] = pa[1] + QPoint(0,bottom-top+pw*2);
- pa[3] = pa[0] + QPoint(0,bottom-top+pw*2);
-/* kdDebug()<<k_funcinfo<<" areaPoints: "<<m_rel->parent()->name()<<" to "<<m_rel->child()->name()<<endl;
+ if ( pen() == Qt::NoPen ) pw = 0;
+ pa[0] = TQPoint(left-pw,top-pw);
+ pa[1] = pa[0] + TQPoint(right-left+pw*2,0);
+ pa[2] = pa[1] + TQPoint(0,bottom-top+pw*2);
+ pa[3] = pa[0] + TQPoint(0,bottom-top+pw*2);
+/* kdDebug()<<k_funcinfo<<" areaPoints: "<<m_rel->tqparent()->name()<<" to "<<m_rel->child()->name()<<endl;
kdDebug()<<" "<<pa[0].x()<<","<<pa[0].y()<<" "<<pa[1].x()<<","<<pa[1].y()<<endl;
kdDebug()<<" "<<pa[2].x()<<","<<pa[2].y()<<" "<<pa[3].x()<<","<<pa[3].y()<<endl;*/
return pa;
@@ -624,8 +624,8 @@ QPointArray PertRelationItem::areaPoints () const
bool PertRelationItem::rowFree(int row, int startCol, int endCol)
{
- QCanvasItemList list = canvas()->allItems();
- QCanvasItemList::Iterator it = list.begin();
+ TQCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList::Iterator it = list.begin();
for (; it != list.end(); ++it)
{
if ( (*it)->rtti() == PertProjectItem::RTTI ||
@@ -674,22 +674,22 @@ KDGanttViewTaskLink::LinkType ItemBase::kdLinkType(int relationType) {
//////////////////// GanttViewSummaryItem //////////////////////////
-GanttViewSummaryItem::GanttViewSummaryItem(KDGanttView *parent, Node *node)
- : KDGanttViewSummaryItem(parent, node->name()),
+GanttViewSummaryItem::GanttViewSummaryItem(KDGanttView *tqparent, Node *node)
+ : KDGanttViewSummaryItem(tqparent, node->name()),
m_node(node),
- m_view(parent)
+ m_view(tqparent)
{
setExpandable(true);
setOpen(true);
}
-GanttViewSummaryItem::GanttViewSummaryItem(KDGanttViewItem *parent, Node *node)
- : KDGanttViewSummaryItem(parent, node->name()),
+GanttViewSummaryItem::GanttViewSummaryItem(KDGanttViewItem *tqparent, Node *node)
+ : KDGanttViewSummaryItem(tqparent, node->name()),
m_node(node),
m_view(0)
{
m_drawn = false;
- GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(parent);
+ GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(tqparent);
if (p)
m_view = p->ganttView();
setExpandable(true);
@@ -700,18 +700,18 @@ void GanttViewSummaryItem::insertRelations(GanttView *view)
{
//kdDebug()<<k_funcinfo<<endl;
- QPtrListIterator<Relation> it(m_node->dependChildNodes());
+ TQPtrListIterator<Relation> it(m_node->dependChildNodes());
for (; it.current(); ++it)
{
- KDGanttViewItem *child = find(m_view->firstChild(), it.current()->child());
+ KDGanttViewItem *child = tqfind(m_view->firstChild(), it.current()->child());
if (child)
{
KDGanttViewTaskLink *link = new KDGanttViewTaskLink(this, child, kdLinkType(it.current()->type()));
//TODO i18n
- QString t = i18n("From: %1").arg(this->listViewText(0));
- t += "\n" + i18n("To: %1").arg(child->listViewText(0));
+ TQString t = i18n("From: %1").tqarg(this->listViewText(0));
+ t += "\n" + i18n("To: %1").tqarg(child->listViewText(0));
if (it.current()->lag() > Duration::zeroDuration) {
- t += "\n" + i18n("Lag: %1").arg(it.current()->lag().toString(Duration::Format_i18nDayTime));
+ t += "\n" + i18n("Lag: %1").tqarg(it.current()->lag().toString(Duration::Format_i18nDayTime));
}
link->setTooltipText(t);
view->addTaskLink(link);
@@ -719,21 +719,21 @@ void GanttViewSummaryItem::insertRelations(GanttView *view)
}
}
-KDGanttViewItem *GanttViewSummaryItem::find(Node *node)
+KDGanttViewItem *GanttViewSummaryItem::tqfind(Node *node)
{
//kdDebug()<<k_funcinfo<<endl;
if (m_node == node)
return this;
- KDGanttViewItem *item = find(firstChild(), node);
+ KDGanttViewItem *item = tqfind(firstChild(), node);
if (item)
return item;
- return find(nextSibling(), node);
+ return tqfind(nextSibling(), node);
}
-KDGanttViewItem *GanttViewSummaryItem::find(KDGanttViewItem *item, Node *node)
+KDGanttViewItem *GanttViewSummaryItem::tqfind(KDGanttViewItem *item, Node *node)
{
if (!item)
return 0;
@@ -741,17 +741,17 @@ KDGanttViewItem *GanttViewSummaryItem::find(KDGanttViewItem *item, Node *node)
if (item->type() == Event)
{
GanttViewEventItem *i = static_cast<GanttViewEventItem *>(item);
- return i->find(node);
+ return i->tqfind(node);
}
else if (item->type() == Task)
{
GanttViewTaskItem *i = static_cast<GanttViewTaskItem *>(item);
- return i->find(node);
+ return i->tqfind(node);
}
else if (item->type() == Summary)
{
GanttViewSummaryItem *i = static_cast<GanttViewSummaryItem *>(item);
- return i->find(node);
+ return i->tqfind(node);
}
return 0;
}
@@ -759,20 +759,20 @@ KDGanttViewItem *GanttViewSummaryItem::find(KDGanttViewItem *item, Node *node)
//////////////////// GanttViewTaskItem //////////////////////////
-GanttViewTaskItem::GanttViewTaskItem(KDGanttView *parent, KPlato::Task *task)
- : KDGanttViewTaskItem(parent, task->name()),
+GanttViewTaskItem::GanttViewTaskItem(KDGanttView *tqparent, KPlato::Task *task)
+ : KDGanttViewTaskItem(tqparent, task->name()),
m_task(task),
- m_view(parent)
+ m_view(tqparent)
{
}
-GanttViewTaskItem::GanttViewTaskItem(KDGanttViewItem *parent, KPlato::Task *task)
- : KDGanttViewTaskItem(parent, task->name()),
+GanttViewTaskItem::GanttViewTaskItem(KDGanttViewItem *tqparent, KPlato::Task *task)
+ : KDGanttViewTaskItem(tqparent, task->name()),
m_task(task),
m_view()
{
m_drawn = false;
- GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(parent);
+ GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(tqparent);
if (p)
m_view = p->ganttView();
}
@@ -781,18 +781,18 @@ void GanttViewTaskItem::insertRelations(GanttView *view)
{
//kdDebug()<<k_funcinfo<<endl;
- QPtrListIterator<Relation> it(m_task->dependChildNodes());
+ TQPtrListIterator<Relation> it(m_task->dependChildNodes());
for (; it.current(); ++it)
{
- KDGanttViewItem *child = find(m_view->firstChild(), it.current()->child());
+ KDGanttViewItem *child = tqfind(m_view->firstChild(), it.current()->child());
if (child)
{
KDGanttViewTaskLink *link = new KDGanttViewTaskLink(this, child, kdLinkType(it.current()->type()));
//TODO i18n
- QString t = i18n("From: %1").arg(this->listViewText(0));
- t += "\n" + i18n("To: %1").arg(child->listViewText(0));
+ TQString t = i18n("From: %1").tqarg(this->listViewText(0));
+ t += "\n" + i18n("To: %1").tqarg(child->listViewText(0));
if (it.current()->lag() > Duration::zeroDuration) {
- t += "\n" + i18n("Lag: %1").arg(it.current()->lag().toString(Duration::Format_i18nDayTime));
+ t += "\n" + i18n("Lag: %1").tqarg(it.current()->lag().toString(Duration::Format_i18nDayTime));
}
link->setTooltipText(t);
view->addTaskLink(link);
@@ -800,21 +800,21 @@ void GanttViewTaskItem::insertRelations(GanttView *view)
}
}
-KDGanttViewItem *GanttViewTaskItem::find(Node *node)
+KDGanttViewItem *GanttViewTaskItem::tqfind(Node *node)
{
//kdDebug()<<k_funcinfo<<endl;
if (m_task == node)
return this;
- KDGanttViewItem *item = find(firstChild(), node);
+ KDGanttViewItem *item = tqfind(firstChild(), node);
if (item)
return item;
- return find(nextSibling(), node);
+ return tqfind(nextSibling(), node);
}
-KDGanttViewItem *GanttViewTaskItem::find(KDGanttViewItem *item, Node *node)
+KDGanttViewItem *GanttViewTaskItem::tqfind(KDGanttViewItem *item, Node *node)
{
if (!item)
return 0;
@@ -822,17 +822,17 @@ KDGanttViewItem *GanttViewTaskItem::find(KDGanttViewItem *item, Node *node)
if (item->type() == Event)
{
GanttViewEventItem *i = static_cast<GanttViewEventItem *>(item);
- return i->find(node);
+ return i->tqfind(node);
}
else if (item->type() == Task)
{
GanttViewTaskItem *i= static_cast<GanttViewTaskItem *>(item);
- return i->find(node);
+ return i->tqfind(node);
}
else if (item->type() == Summary)
{
GanttViewSummaryItem *i = static_cast<GanttViewSummaryItem *>(item);
- return i->find(node);
+ return i->tqfind(node);
}
return 0; // avoid warning
}
@@ -840,20 +840,20 @@ KDGanttViewItem *GanttViewTaskItem::find(KDGanttViewItem *item, Node *node)
//////////////////// GanttViewEventItem //////////////////////////
-GanttViewEventItem::GanttViewEventItem(KDGanttView *parent, KPlato::Task *task)
- : KDGanttViewEventItem(parent, task->name()),
+GanttViewEventItem::GanttViewEventItem(KDGanttView *tqparent, KPlato::Task *task)
+ : KDGanttViewEventItem(tqparent, task->name()),
m_task(task),
- m_view(parent)
+ m_view(tqparent)
{
}
-GanttViewEventItem::GanttViewEventItem(KDGanttViewItem *parent, KPlato::Task *task)
- : KDGanttViewEventItem(parent, task->name()),
+GanttViewEventItem::GanttViewEventItem(KDGanttViewItem *tqparent, KPlato::Task *task)
+ : KDGanttViewEventItem(tqparent, task->name()),
m_task(task),
m_view()
{
m_drawn = false;
- GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(parent);
+ GanttViewSummaryItem *p = dynamic_cast<GanttViewSummaryItem*>(tqparent);
if (p)
m_view = p->ganttView();
}
@@ -863,18 +863,18 @@ void GanttViewEventItem::insertRelations(GanttView *view)
{
//kdDebug()<<k_funcinfo<<endl;
- QPtrListIterator<Relation> it(m_task->dependChildNodes());
+ TQPtrListIterator<Relation> it(m_task->dependChildNodes());
for (; it.current(); ++it)
{
- KDGanttViewItem *child = find(m_view->firstChild(), it.current()->child());
+ KDGanttViewItem *child = tqfind(m_view->firstChild(), it.current()->child());
if (child)
{
KDGanttViewTaskLink *link = new KDGanttViewTaskLink(this, child, kdLinkType(it.current()->type()));
- QString t = i18n("From: %1").arg(this->listViewText(0));
- t += "\n" + i18n("To: %1").arg(child->listViewText(0));
+ TQString t = i18n("From: %1").tqarg(this->listViewText(0));
+ t += "\n" + i18n("To: %1").tqarg(child->listViewText(0));
if (it.current()->lag() > Duration::zeroDuration) {
- t += "\n" + i18n("Lag: %1").arg(it.current()->lag().toString(Duration::Format_i18nDayTime));
+ t += "\n" + i18n("Lag: %1").tqarg(it.current()->lag().toString(Duration::Format_i18nDayTime));
}
link->setTooltipText(t);
view->addTaskLink(link);
@@ -882,21 +882,21 @@ void GanttViewEventItem::insertRelations(GanttView *view)
}
}
-KDGanttViewItem *GanttViewEventItem::find(Node *node)
+KDGanttViewItem *GanttViewEventItem::tqfind(Node *node)
{
//kdDebug()<<k_funcinfo<<endl;
if (m_task == node)
return this;
- KDGanttViewItem *item = find(firstChild(), node);
+ KDGanttViewItem *item = tqfind(firstChild(), node);
if (item)
return item;
- return find(nextSibling(), node);
+ return tqfind(nextSibling(), node);
}
-KDGanttViewItem *GanttViewEventItem::find(KDGanttViewItem *item, Node *node)
+KDGanttViewItem *GanttViewEventItem::tqfind(KDGanttViewItem *item, Node *node)
{
if (!item)
return 0;
@@ -904,17 +904,17 @@ KDGanttViewItem *GanttViewEventItem::find(KDGanttViewItem *item, Node *node)
if (item->type() == Event)
{
GanttViewEventItem *i = static_cast<GanttViewEventItem *>(item);
- return i->find(node);
+ return i->tqfind(node);
}
else if (item->type() == Task)
{
GanttViewTaskItem *i = static_cast<GanttViewTaskItem *>(item);
- return i->find(node);
+ return i->tqfind(node);
}
else if (item->type() == Summary)
{
GanttViewSummaryItem *i = static_cast<GanttViewSummaryItem *>(item);
- return i->find(node);
+ return i->tqfind(node);
}
return 0;
}