summaryrefslogtreecommitdiffstats
path: root/kdgantt/KDGanttViewTaskLink.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kdgantt/KDGanttViewTaskLink.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdgantt/KDGanttViewTaskLink.cpp')
-rw-r--r--kdgantt/KDGanttViewTaskLink.cpp212
1 files changed, 106 insertions, 106 deletions
diff --git a/kdgantt/KDGanttViewTaskLink.cpp b/kdgantt/KDGanttViewTaskLink.cpp
index 155b83e2..8bbab48f 100644
--- a/kdgantt/KDGanttViewTaskLink.cpp
+++ b/kdgantt/KDGanttViewTaskLink.cpp
@@ -3,7 +3,7 @@
KDGantt - a multi-platform charting engine
*/
/****************************************************************************
- ** Copyright (C) 2002-2004 Klar�lvdalens Datakonsult AB. All rights reserved.
+ ** Copyright (C) 2002-2004 Klar�lvdalens Datakonsult AB. All rights reserved.
**
** This file is part of the KDGantt library.
**
@@ -26,8 +26,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.
**
**********************************************************************/
@@ -62,8 +62,8 @@
\param to the target items
\param type the link type for the connection
*/
-KDGanttViewTaskLink::KDGanttViewTaskLink( QPtrList<KDGanttViewItem> from,
- QPtrList<KDGanttViewItem> to,
+KDGanttViewTaskLink::KDGanttViewTaskLink( TQPtrList<KDGanttViewItem> from,
+ TQPtrList<KDGanttViewItem> to,
LinkType type )
{
fromList= from;
@@ -109,8 +109,8 @@ KDGanttViewTaskLink::KDGanttViewTaskLink( KDGanttViewItem* from,
*/
KDGanttViewTaskLink::KDGanttViewTaskLink( KDGanttViewTaskLinkGroup* group,
- QPtrList<KDGanttViewItem> from,
- QPtrList<KDGanttViewItem> to,
+ TQPtrList<KDGanttViewItem> from,
+ TQPtrList<KDGanttViewItem> to,
LinkType type )
{
fromList = from;
@@ -166,14 +166,14 @@ KDGanttViewTaskLink::~KDGanttViewTaskLink( )
void KDGanttViewTaskLink::initTaskLink()
{
- horLineList = new QPtrList<KDCanvasLine>;
- verLineList = new QPtrList<KDCanvasLine>;
- horLineList2 = new QPtrList<KDCanvasLine>;
- verLineList2 = new QPtrList<KDCanvasLine>;
- horLineList3 = new QPtrList<KDCanvasLine>;
- topList = new QPtrList<KDCanvasPolygon>;
- topLeftList = new QPtrList<KDCanvasPolygon>;
- topRightList = new QPtrList<KDCanvasPolygon>;
+ horLineList = new TQPtrList<KDCanvasLine>;
+ verLineList = new TQPtrList<KDCanvasLine>;
+ horLineList2 = new TQPtrList<KDCanvasLine>;
+ verLineList2 = new TQPtrList<KDCanvasLine>;
+ horLineList3 = new TQPtrList<KDCanvasLine>;
+ topList = new TQPtrList<KDCanvasPolygon>;
+ topLeftList = new TQPtrList<KDCanvasPolygon>;
+ topRightList = new TQPtrList<KDCanvasPolygon>;
horLineList->setAutoDelete( true );
verLineList->setAutoDelete( true );
horLineList2->setAutoDelete( true );
@@ -200,7 +200,7 @@ void KDGanttViewTaskLink::initTaskLink()
top = new KDCanvasPolygon(myTimeTable,this,Type_is_KDGanttTaskLink);
topLeft = new KDCanvasPolygon(myTimeTable,this,Type_is_KDGanttTaskLink);
topRight = new KDCanvasPolygon(myTimeTable,this,Type_is_KDGanttTaskLink);
- QPointArray arr = QPointArray(3);
+ TQPointArray arr = TQPointArray(3);
arr.setPoint(0,-4,-5);
arr.setPoint(1,4,-5);
arr.setPoint(2,0,0);
@@ -236,8 +236,8 @@ void KDGanttViewTaskLink::initTaskLink()
setWhatsThisText( "Tasklink" );
myTimeTable->myTaskLinkList.append(this);
setHighlight( false);
- setHighlightColor(Qt::red );
- setColor(Qt::black);
+ setHighlightColor(TQt::red );
+ setColor(TQt::black);
setVisible(true);
}
@@ -265,8 +265,8 @@ void KDGanttViewTaskLink::showMe( bool visible )
isvisible = visible;
int wid = 1;
- QPen p;
- QBrush b;
+ TQPen p;
+ TQBrush b;
p.setWidth(wid);
b.setStyle(Qt::SolidPattern);
if (ishighlighted) {
@@ -277,17 +277,17 @@ void KDGanttViewTaskLink::showMe( bool visible )
b.setColor(myColor);
p.setColor(myColor);
}
- QPoint start, end;
- QPtrListIterator<KDCanvasLine> horIt(*horLineList);
- QPtrListIterator<KDCanvasLine> verIt(*verLineList);
- QPtrListIterator<KDCanvasPolygon> topIt(*topList);
- QPtrListIterator<KDGanttViewItem> fromIt(fromList);
- QPtrListIterator<KDGanttViewItem> toIt(toList);
+ TQPoint start, end;
+ TQPtrListIterator<KDCanvasLine> horIt(*horLineList);
+ TQPtrListIterator<KDCanvasLine> verIt(*verLineList);
+ TQPtrListIterator<KDCanvasPolygon> topIt(*topList);
+ TQPtrListIterator<KDGanttViewItem> fromIt(fromList);
+ TQPtrListIterator<KDGanttViewItem> toIt(toList);
for ( ; fromIt.current(); ++fromIt ) {
- (*fromIt)->setTextOffset(QPoint(0,0));
+ (*fromIt)->setTextOffset(TQPoint(0,0));
toIt.toFirst();
for ( ; toIt.current(); ++toIt ) {
- (*toIt)->setTextOffset(QPoint(0,0));
+ (*toIt)->setTextOffset(TQPoint(0,0));
if (!isvisible || ! (*fromIt)->isVisibleInGanttView || !(*toIt)->isVisibleInGanttView || !myTimeTable->taskLinksVisible) {
(*horIt)->hide();
(*verIt)->hide();
@@ -330,8 +330,8 @@ void KDGanttViewTaskLink::showMeType( bool visible )
hide();
isvisible = visible;
int wid = 1;
- QPen p;
- QBrush b;
+ TQPen p;
+ TQBrush b;
p.setWidth(wid);
b.setStyle(Qt::SolidPattern);
if (ishighlighted) {
@@ -342,19 +342,19 @@ void KDGanttViewTaskLink::showMeType( bool visible )
b.setColor(myColor);
p.setColor(myColor);
}
- QPoint start, end;
- QPtrListIterator<KDCanvasLine> horIt(*horLineList);
- QPtrListIterator<KDCanvasLine> verIt(*verLineList);
- QPtrListIterator<KDCanvasLine> horIt2(*horLineList2);
- QPtrListIterator<KDCanvasLine> verIt2(*verLineList2);
- QPtrListIterator<KDCanvasLine> horIt3(*horLineList3);
- QPtrListIterator<KDCanvasPolygon> topIt(*topList);
- QPtrListIterator<KDCanvasPolygon> topLeftIt(*topLeftList);
- QPtrListIterator<KDCanvasPolygon> topRightIt(*topRightList);
- QPtrListIterator<KDGanttViewItem> fromIt(fromList);
- QPtrListIterator<KDGanttViewItem> toIt(toList);
+ TQPoint start, end;
+ TQPtrListIterator<KDCanvasLine> horIt(*horLineList);
+ TQPtrListIterator<KDCanvasLine> verIt(*verLineList);
+ TQPtrListIterator<KDCanvasLine> horIt2(*horLineList2);
+ TQPtrListIterator<KDCanvasLine> verIt2(*verLineList2);
+ TQPtrListIterator<KDCanvasLine> horIt3(*horLineList3);
+ TQPtrListIterator<KDCanvasPolygon> topIt(*topList);
+ TQPtrListIterator<KDCanvasPolygon> topLeftIt(*topLeftList);
+ TQPtrListIterator<KDCanvasPolygon> topRightIt(*topRightList);
+ TQPtrListIterator<KDGanttViewItem> fromIt(fromList);
+ TQPtrListIterator<KDGanttViewItem> toIt(toList);
for ( ; fromIt.current(); ++fromIt ) {
- (*fromIt)->setTextOffset(QPoint(30,0));
+ (*fromIt)->setTextOffset(TQPoint(30,0));
(*fromIt)->moveTextCanvas();
toIt.toFirst();
for ( ; toIt.current(); ++toIt ) {
@@ -368,12 +368,12 @@ void KDGanttViewTaskLink::showMeType( bool visible )
(*topIt)->setBrush(b);
(*topLeftIt)->setBrush(b);
(*topRightIt)->setBrush(b);
- (*toIt)->setTextOffset(QPoint(30,0));
+ (*toIt)->setTextOffset(TQPoint(30,0));
(*toIt)->moveTextCanvas();
switch (linkType()) {
case StartStart: {
start = (*fromIt)->middleLeft();
- end = (*toIt)->middleLeft()-QPoint(12,0);
+ end = (*toIt)->middleLeft()-TQPoint(12,0);
bool down = start.y() < end.y();
(*horIt)->setPoints(start.x()-xOffset(*fromIt),start.y(),
start.x()-10, start.y());
@@ -401,7 +401,7 @@ void KDGanttViewTaskLink::showMeType( bool visible )
}
case FinishFinish: {
start = (*fromIt)->middleRight();
- end = (*toIt)->middleRight()+QPoint(12,0);
+ end = (*toIt)->middleRight()+TQPoint(12,0);
bool down = start.y() < end.y();
(*horIt)->setPoints(start.x()+xOffset(*fromIt),start.y(),
start.x()+10, start.y());
@@ -429,7 +429,7 @@ void KDGanttViewTaskLink::showMeType( bool visible )
}
case FinishStart: {
start = (*fromIt)->middleRight();
- end = (*toIt)->middleLeft() - QPoint(12,0);
+ end = (*toIt)->middleLeft() - TQPoint(12,0);
bool down = start.y() < end.y();
(*horIt)->setPoints(start.x()+xOffset(*fromIt),start.y(),
start.x()+10,start.y());
@@ -459,7 +459,7 @@ void KDGanttViewTaskLink::showMeType( bool visible )
}
case StartFinish: {
start = (*fromIt)->middleRight();
- end = (*toIt)->middleRight()+QPoint(12,0);
+ end = (*toIt)->middleRight()+TQPoint(12,0);
bool down = start.y() < end.y();
(*horIt)->setPoints(start.x()+xOffset(*fromIt),start.y(),
start.x()+10, start.y());
@@ -589,7 +589,7 @@ bool KDGanttViewTaskLink::highlight() const
\param color the color to draw this task link in
\sa color()
*/
-void KDGanttViewTaskLink::setColor( const QColor& color )
+void KDGanttViewTaskLink::setColor( const TQColor& color )
{
myColor = color;
//if ( isvisible) setVisible(true );
@@ -603,7 +603,7 @@ void KDGanttViewTaskLink::setColor( const QColor& color )
\return the color in which this task link is drawn
\sa setColor()
*/
-QColor KDGanttViewTaskLink::color() const
+TQColor KDGanttViewTaskLink::color() const
{
return myColor;
}
@@ -615,7 +615,7 @@ QColor KDGanttViewTaskLink::color() const
\param color the highlight color to draw this task link in
\sa highlightColor()
*/
-void KDGanttViewTaskLink::setHighlightColor( const QColor& color )
+void KDGanttViewTaskLink::setHighlightColor( const TQColor& color )
{
myColorHL = color;
//if ( isvisible) setVisible(true );
@@ -629,7 +629,7 @@ void KDGanttViewTaskLink::setHighlightColor( const QColor& color )
\return the highlight color in which this task link is drawn
\sa setHighlightColor()
*/
-QColor KDGanttViewTaskLink::highlightColor() const
+TQColor KDGanttViewTaskLink::highlightColor() const
{
return myColorHL;
}
@@ -641,7 +641,7 @@ QColor KDGanttViewTaskLink::highlightColor() const
\param text the tooltip text
\sa tooltipText()
*/
-void KDGanttViewTaskLink::setTooltipText( const QString& text )
+void KDGanttViewTaskLink::setTooltipText( const TQString& text )
{
myToolTipText = text;
}
@@ -653,7 +653,7 @@ void KDGanttViewTaskLink::setTooltipText( const QString& text )
\return the tooltip text of this task link
\sa setTooltipText()
*/
-QString KDGanttViewTaskLink::tooltipText() const
+TQString KDGanttViewTaskLink::tooltipText() const
{
return myToolTipText;
}
@@ -665,7 +665,7 @@ QString KDGanttViewTaskLink::tooltipText() const
\param text the what's this text
\sa whatsThisText()
*/
-void KDGanttViewTaskLink::setWhatsThisText( const QString& text )
+void KDGanttViewTaskLink::setWhatsThisText( const TQString& text )
{
myWhatsThisText = text;
@@ -678,7 +678,7 @@ void KDGanttViewTaskLink::setWhatsThisText( const QString& text )
\return the what's this text of this task link
\sa setWhatsThisText()
*/
-QString KDGanttViewTaskLink::whatsThisText() const
+TQString KDGanttViewTaskLink::whatsThisText() const
{
return myWhatsThisText;
}
@@ -690,7 +690,7 @@ QString KDGanttViewTaskLink::whatsThisText() const
\return the ist of source item of this task link
\sa to()
*/
-QPtrList<KDGanttViewItem> KDGanttViewTaskLink::from() const
+TQPtrList<KDGanttViewItem> KDGanttViewTaskLink::from() const
{
return fromList;
}
@@ -722,7 +722,7 @@ void KDGanttViewTaskLink::removeItemFromList( KDGanttViewItem* item )
\return the list of target item of this task link
\sa from()
*/
-QPtrList<KDGanttViewItem> KDGanttViewTaskLink::to() const
+TQPtrList<KDGanttViewItem> KDGanttViewTaskLink::to() const
{
return toList;
}
@@ -732,25 +732,25 @@ QPtrList<KDGanttViewItem> KDGanttViewTaskLink::to() const
Creates a DOM node that describes this task link.
\param doc the DOM document to which the node belongs
- \param parentElement the element into which to insert this node
+ \param tqparentElement the element into which to insert this node
*/
-void KDGanttViewTaskLink::createNode( QDomDocument& doc,
- QDomElement& parentElement )
+void KDGanttViewTaskLink::createNode( TQDomDocument& doc,
+ TQDomElement& tqparentElement )
{
- QDomElement taskLinkElement = doc.createElement( "TaskLink" );
- parentElement.appendChild( taskLinkElement );
+ TQDomElement taskLinkElement = doc.createElement( "TaskLink" );
+ tqparentElement.appendChild( taskLinkElement );
- QDomElement fromItemsElement = doc.createElement( "FromItems" );
+ TQDomElement fromItemsElement = doc.createElement( "FromItems" );
taskLinkElement.appendChild( fromItemsElement );
- QPtrList<KDGanttViewItem> fromList = from();
+ TQPtrList<KDGanttViewItem> fromList = from();
KDGanttViewItem* item;
for( item = fromList.first(); item;
item = fromList.next() )
KDGanttXML::createStringNode( doc, fromItemsElement, "Item", item->name() );
- QDomElement toItemsElement = doc.createElement( "ToItems" );
+ TQDomElement toItemsElement = doc.createElement( "ToItems" );
taskLinkElement.appendChild( toItemsElement );
- QPtrList<KDGanttViewItem> toList = to();
+ TQPtrList<KDGanttViewItem> toList = to();
for( item = toList.first(); item;
item = toList.next() )
KDGanttXML::createStringNode( doc, toItemsElement, "Item", item->name() );
@@ -780,26 +780,26 @@ void KDGanttViewTaskLink::createNode( QDomDocument& doc,
\param element the DOM element from which to read the specification
\return the newly created task link
*/
-KDGanttViewTaskLink* KDGanttViewTaskLink::createFromDomElement( QDomElement& element )
+KDGanttViewTaskLink* KDGanttViewTaskLink::createFromDomElement( TQDomElement& element )
{
- QDomNode node = element.firstChild();
- QStringList fromList, toList;
+ TQDomNode node = element.firstChild();
+ TQStringList fromList, toList;
bool highlight = false, visible = false;
- QColor color, highlightColor;
- QString tooltipText, whatsThisText, group;
+ TQColor color, highlightColor;
+ TQString tooltipText, whatsThisText, group;
LinkType linktype=None;
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 == "FromItems" ) {
- 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" ) {
- QString value;
+ TQString value;
if( KDGanttXML::readStringNode( element, value ) )
fromList << value;
} else {
@@ -810,13 +810,13 @@ KDGanttViewTaskLink* KDGanttViewTaskLink::createFromDomElement( QDomElement& ele
node = node.nextSibling();
}
} else if( tagName == "ToItems" ) {
- 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" ) {
- QString value;
+ TQString value;
if( KDGanttXML::readStringNode( element, value ) )
toList << value;
} else {
@@ -835,27 +835,27 @@ KDGanttViewTaskLink* KDGanttViewTaskLink::createFromDomElement( QDomElement& ele
if( KDGanttXML::readBoolNode( element, value ) )
visible = value;
} else if( tagName == "Color" ) {
- QColor value;
+ TQColor value;
if( KDGanttXML::readColorNode( element, value ) )
color = value;
} else if( tagName == "HighlightColor" ) {
- QColor value;
+ TQColor value;
if( KDGanttXML::readColorNode( element, value ) )
highlightColor = value;
} else if( tagName == "TooltipText" ) {
- QString value;
+ TQString value;
if( KDGanttXML::readStringNode( element, value ) )
tooltipText = value;
} else if( tagName == "WhatsThisText" ) {
- QString value;
+ TQString value;
if( KDGanttXML::readStringNode( element, value ) )
whatsThisText = value;
} else if( tagName == "Group" ) {
- QString value;
+ TQString value;
if( KDGanttXML::readStringNode( element, value ) )
group = value;
} else if( tagName == "Linktype" ) {
- QString value;
+ TQString value;
if( KDGanttXML::readStringNode( element, value ) )
linktype = stringToLinkType( value );
} else {
@@ -866,17 +866,17 @@ KDGanttViewTaskLink* KDGanttViewTaskLink::createFromDomElement( QDomElement& ele
node = node.nextSibling();
}
- QPtrList<KDGanttViewItem> fromItemList;
- QPtrList<KDGanttViewItem> toItemList;
- for( QStringList::const_iterator fromIt = fromList.begin();
+ TQPtrList<KDGanttViewItem> fromItemList;
+ TQPtrList<KDGanttViewItem> toItemList;
+ for( TQStringList::const_iterator fromIt = fromList.begin();
fromIt != fromList.end(); ++fromIt ) {
- KDGanttViewItem* item = KDGanttViewItem::find( *fromIt );
+ KDGanttViewItem* item = KDGanttViewItem::tqfind( *fromIt );
if( item )
fromItemList.append( item );
}
- for( QStringList::const_iterator toIt = toList.begin();
+ for( TQStringList::const_iterator toIt = toList.begin();
toIt != toList.end(); ++toIt ) {
- KDGanttViewItem* item = KDGanttViewItem::find( *toIt );
+ KDGanttViewItem* item = KDGanttViewItem::tqfind( *toIt );
if( item )
toItemList.append( item );
}
@@ -898,7 +898,7 @@ KDGanttViewTaskLink* KDGanttViewTaskLink::createFromDomElement( QDomElement& ele
tl->setHighlightColor( highlightColor );
tl->setTooltipText( tooltipText );
tl->setWhatsThisText( whatsThisText );
- KDGanttViewTaskLinkGroup* gr = KDGanttViewTaskLinkGroup::find( group );
+ KDGanttViewTaskLinkGroup* gr = KDGanttViewTaskLinkGroup::tqfind( group );
if( gr )
tl->setGroup( gr );
@@ -935,16 +935,16 @@ int KDGanttViewTaskLink::xOffset(KDGanttViewItem *item)
void KDGanttViewTaskLink::hide()
{
- QPtrListIterator<KDCanvasLine> horIt(*horLineList);
- QPtrListIterator<KDCanvasLine> verIt(*verLineList);
- QPtrListIterator<KDCanvasLine> horIt2(*horLineList2);
- QPtrListIterator<KDCanvasLine> verIt2(*verLineList2);
- QPtrListIterator<KDCanvasLine> horIt3(*horLineList3);
- QPtrListIterator<KDCanvasPolygon> topIt(*topList);
- QPtrListIterator<KDCanvasPolygon> topLeftIt(*topLeftList);
- QPtrListIterator<KDCanvasPolygon> topRightIt(*topRightList);
- QPtrListIterator<KDGanttViewItem> fromIt(fromList);
- QPtrListIterator<KDGanttViewItem> toIt(toList);
+ TQPtrListIterator<KDCanvasLine> horIt(*horLineList);
+ TQPtrListIterator<KDCanvasLine> verIt(*verLineList);
+ TQPtrListIterator<KDCanvasLine> horIt2(*horLineList2);
+ TQPtrListIterator<KDCanvasLine> verIt2(*verLineList2);
+ TQPtrListIterator<KDCanvasLine> horIt3(*horLineList3);
+ TQPtrListIterator<KDCanvasPolygon> topIt(*topList);
+ TQPtrListIterator<KDCanvasPolygon> topLeftIt(*topLeftList);
+ TQPtrListIterator<KDCanvasPolygon> topRightIt(*topRightList);
+ TQPtrListIterator<KDGanttViewItem> fromIt(fromList);
+ TQPtrListIterator<KDGanttViewItem> toIt(toList);
for ( ; fromIt.current(); ++fromIt ) {
toIt.toFirst();
for ( ; toIt.current(); ++toIt ) {
@@ -968,7 +968,7 @@ void KDGanttViewTaskLink::hide()
}
}
-QString KDGanttViewTaskLink::linkTypeToString( LinkType type )
+TQString KDGanttViewTaskLink::linkTypeToString( LinkType type )
{
switch( type ) {
case None:
@@ -992,7 +992,7 @@ QString KDGanttViewTaskLink::linkTypeToString( LinkType type )
return "";
}
-KDGanttViewTaskLink::LinkType KDGanttViewTaskLink::stringToLinkType( const QString type )
+KDGanttViewTaskLink::LinkType KDGanttViewTaskLink::stringToLinkType( const TQString type )
{
if (type == "FinishStart")
return FinishStart;