summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/linepath.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'umbrello/umbrello/linepath.cpp')
-rw-r--r--umbrello/umbrello/linepath.cpp248
1 files changed, 124 insertions, 124 deletions
diff --git a/umbrello/umbrello/linepath.cpp b/umbrello/umbrello/linepath.cpp
index 59cf105f..b79ed8ac 100644
--- a/umbrello/umbrello/linepath.cpp
+++ b/umbrello/umbrello/linepath.cpp
@@ -17,9 +17,9 @@
#include <cmath>
// qt includes
-#include <qcanvas.h>
-#include <qdatastream.h>
-#include <qdom.h>
+#include <tqcanvas.h>
+#include <tqdatastream.h>
+#include <tqdom.h>
// kde includes
#include <kdebug.h>
@@ -32,27 +32,27 @@
#include "umldoc.h"
#include "uml.h"
-LinePath::Circle::Circle(QCanvas * canvas, int radius /* = 0 */)
- : QCanvasEllipse(radius * 2, radius * 2, canvas) {
+LinePath::Circle::Circle(TQCanvas * canvas, int radius /* = 0 */)
+ : TQCanvasEllipse(radius * 2, radius * 2, canvas) {
}
void LinePath::Circle::setX(int x) {
- QCanvasItem::setX( (double) x );
+ TQCanvasItem::setX( (double) x );
}
void LinePath::Circle::setY(int y) {
- QCanvasItem::setY( (double) y );
+ TQCanvasItem::setY( (double) y );
}
void LinePath::Circle::setRadius(int radius) {
- QCanvasEllipse::setSize(radius * 2, radius * 2);
+ TQCanvasEllipse::setSize(radius * 2, radius * 2);
}
int LinePath::Circle::getRadius() const {
- return (QCanvasEllipse::height() / 2);
+ return (TQCanvasEllipse::height() / 2);
}
-void LinePath::Circle::drawShape(QPainter& p) {
+void LinePath::Circle::drawShape(TQPainter& p) {
int diameter = height();
int radius = diameter / 2;
p.drawEllipse( (int)x() - radius, (int)y() - radius, diameter, diameter);
@@ -85,24 +85,24 @@ void LinePath::setAssociation(AssociationWidget * association ) {
if( getAssocType() == Uml::at_Coll_Message )
setupParallelLine();
UMLView * view = (UMLView *)m_pAssociation -> parent();
- connect( view, SIGNAL( sigColorChanged( Uml::IDType ) ), this, SLOT( slotLineColorChanged( Uml::IDType ) ) );
- connect( view, SIGNAL( sigLineWidthChanged( Uml::IDType ) ), this, SLOT( slotLineWidthChanged( Uml::IDType ) ) );
+ connect( view, TQT_SIGNAL( sigColorChanged( Uml::IDType ) ), this, TQT_SLOT( slotLineColorChanged( Uml::IDType ) ) );
+ connect( view, TQT_SIGNAL( sigLineWidthChanged( Uml::IDType ) ), this, TQT_SLOT( slotLineWidthChanged( Uml::IDType ) ) );
}
-QPoint LinePath::getPoint( int pointIndex ) {
+TQPoint LinePath::getPoint( int pointIndex ) {
int count = m_LineList.count();
if( count == 0 || pointIndex > count || pointIndex < 0)
- return QPoint( -1, -1 );
+ return TQPoint( -1, -1 );
if( pointIndex == count ) {
- QCanvasLine * line = m_LineList.last();
+ TQCanvasLine * line = m_LineList.last();
return line -> endPoint();
}
- QCanvasLine * line = m_LineList.at( pointIndex );
+ TQCanvasLine * line = m_LineList.at( pointIndex );
return line -> startPoint();
}
-bool LinePath::setPoint( int pointIndex, const QPoint &point ) {
+bool LinePath::setPoint( int pointIndex, const TQPoint &point ) {
int count = m_LineList.count();
if( count == 0 || pointIndex > count || pointIndex < 0)
return false;
@@ -112,23 +112,23 @@ bool LinePath::setPoint( int pointIndex, const QPoint &point ) {
}
if( pointIndex == count) {
- QCanvasLine * line = m_LineList.last();
- QPoint p = line -> startPoint();
+ TQCanvasLine * line = m_LineList.last();
+ TQPoint p = line -> startPoint();
line -> setPoints( p.x(), p.y(), point.x(), point.y() );
moveSelected( pointIndex );
update();
return true;
}
if( pointIndex == 0 ) {
- QCanvasLine * line = m_LineList.first();
- QPoint p = line -> endPoint();
+ TQCanvasLine * line = m_LineList.first();
+ TQPoint p = line -> endPoint();
line -> setPoints( point.x(), point.y(), p.x(), p.y() );
moveSelected( pointIndex );
update();
return true;
}
- QCanvasLine * line = m_LineList.at( pointIndex );
- QPoint p = line -> endPoint();
+ TQCanvasLine * line = m_LineList.at( pointIndex );
+ TQPoint p = line -> endPoint();
line -> setPoints( point.x(), point.y(), p.x(), p.y() );
line = m_LineList.at( pointIndex - 1 );
p = line -> startPoint();
@@ -138,12 +138,12 @@ bool LinePath::setPoint( int pointIndex, const QPoint &point ) {
return true;
}
-bool LinePath::isPoint( int pointIndex, const QPoint &point, unsigned short delta) {
+bool LinePath::isPoint( int pointIndex, const TQPoint &point, unsigned short delta) {
int count = m_LineList.count();
if ( pointIndex >= count )
return false;
- QCanvasLine * line = m_LineList.at( pointIndex );
+ TQCanvasLine * line = m_LineList.at( pointIndex );
/* check if the given point is the start or end point of the line */
if ( (
@@ -161,18 +161,18 @@ bool LinePath::isPoint( int pointIndex, const QPoint &point, unsigned short delt
return false;
}
-bool LinePath::insertPoint( int pointIndex, const QPoint &point ) {
+bool LinePath::insertPoint( int pointIndex, const TQPoint &point ) {
int count = m_LineList.count();
if( count == 0 )
return false;
const bool bLoading = UMLApp::app()->getDocument()->loading();
if( count == 1 || pointIndex == 1) {
- QCanvasLine * first = m_LineList.first();
- QPoint sp = first -> startPoint();
- QPoint ep = first -> endPoint();
+ TQCanvasLine * first = m_LineList.first();
+ TQPoint sp = first -> startPoint();
+ TQPoint ep = first -> endPoint();
first -> setPoints( sp.x(), sp.y(), point.x(), point.y() );
- QCanvasLine * line = new QCanvasLine( getCanvas() );
+ TQCanvasLine * line = new TQCanvasLine( getCanvas() );
line -> setZ( -2 );
line -> setPoints( point.x(), point.y(), ep.x(), ep.y() );
line -> setPen( getPen() );
@@ -183,11 +183,11 @@ bool LinePath::insertPoint( int pointIndex, const QPoint &point ) {
return true;
}
if( count + 1 == pointIndex ) {
- QCanvasLine * before = m_LineList.last();
- QPoint sp = before -> startPoint();
- QPoint ep = before -> endPoint();
+ TQCanvasLine * before = m_LineList.last();
+ TQPoint sp = before -> startPoint();
+ TQPoint ep = before -> endPoint();
before -> setPoints( sp.x(), sp.y(), point.x(), point.y() );
- QCanvasLine * line = new QCanvasLine( getCanvas() );
+ TQCanvasLine * line = new TQCanvasLine( getCanvas() );
line -> setPoints( point.x(), point.y(), ep.x(), ep.y() );
line -> setZ( -2 );
line -> setPen( getPen() );
@@ -197,11 +197,11 @@ bool LinePath::insertPoint( int pointIndex, const QPoint &point ) {
setupSelected();
return true;
}
- QCanvasLine * before = m_LineList.at( pointIndex - 1 );
- QPoint sp = before -> startPoint();
- QPoint ep = before -> endPoint();
+ TQCanvasLine * before = m_LineList.at( pointIndex - 1 );
+ TQPoint sp = before -> startPoint();
+ TQPoint ep = before -> endPoint();
before -> setPoints( sp.x(), sp.y(), point.x(), point.y() );
- QCanvasLine * line = new QCanvasLine(getCanvas() );
+ TQCanvasLine * line = new TQCanvasLine(getCanvas() );
line -> setPoints( point.x(), point.y(), ep.x(), ep.y() );
line -> setZ( -2 );
line -> setPen( getPen() );
@@ -212,7 +212,7 @@ bool LinePath::insertPoint( int pointIndex, const QPoint &point ) {
return true;
}
-bool LinePath::removePoint( int pointIndex, const QPoint &point, unsigned short delta )
+bool LinePath::removePoint( int pointIndex, const TQPoint &point, unsigned short delta )
{
/* get the number of line segments */
int count = m_LineList.count();
@@ -221,7 +221,7 @@ bool LinePath::removePoint( int pointIndex, const QPoint &point, unsigned short
/* we don't know if the user clicked on the start- or endpoint of a
* line segment */
- QCanvasLine * current_line = m_LineList.at( pointIndex );
+ TQCanvasLine * current_line = m_LineList.at( pointIndex );
if (abs( current_line -> endPoint().x() - point.x() ) <= delta
&&
abs( current_line -> endPoint().y() - point.y() ) <= delta)
@@ -233,9 +233,9 @@ bool LinePath::removePoint( int pointIndex, const QPoint &point, unsigned short
/* the next segment will get the starting point from the current one,
* which is going to be removed */
- QCanvasLine * next_line = m_LineList.at( pointIndex + 1 );
- QPoint startPoint = current_line -> startPoint();
- QPoint endPoint = next_line -> endPoint();
+ TQCanvasLine * next_line = m_LineList.at( pointIndex + 1 );
+ TQPoint startPoint = current_line -> startPoint();
+ TQPoint endPoint = next_line -> endPoint();
next_line -> setPoints(startPoint.x(), startPoint.y(),
endPoint.x(), endPoint.y());
@@ -251,9 +251,9 @@ bool LinePath::removePoint( int pointIndex, const QPoint &point, unsigned short
/* the previous segment will get the end point from the current one,
* which is going to be removed */
- QCanvasLine * previous_line = m_LineList.at( pointIndex - 1 );
- QPoint startPoint = previous_line -> startPoint();
- QPoint endPoint = current_line -> endPoint();
+ TQCanvasLine * previous_line = m_LineList.at( pointIndex - 1 );
+ TQPoint startPoint = previous_line -> startPoint();
+ TQPoint endPoint = current_line -> endPoint();
previous_line -> setPoints(startPoint.x(), startPoint.y(),
endPoint.x(), endPoint.y());
} else {
@@ -269,11 +269,11 @@ bool LinePath::removePoint( int pointIndex, const QPoint &point, unsigned short
return true;
}
-bool LinePath::setStartEndPoints( const QPoint &start, const QPoint &end ) {
+bool LinePath::setStartEndPoints( const TQPoint &start, const TQPoint &end ) {
int count = m_LineList.count();
if( count == 0 ) {
- QCanvasLine * line = new QCanvasLine(getCanvas() );
+ TQCanvasLine * line = new TQCanvasLine(getCanvas() );
line -> setPoints( start.x(), start.y(), end.x(), end.y() );
line -> setZ( -2 );
line -> setPen( getPen() );
@@ -291,13 +291,13 @@ int LinePath::count() {
return m_LineList.count() + 1;
}
-int LinePath::onLinePath( const QPoint &position ) {
- QCanvasItemList list = getCanvas() -> collisions( position );
+int LinePath::onLinePath( const TQPoint &position ) {
+ TQCanvasItemList list = getCanvas() -> collisions( position );
int index = -1;
- QCanvasItemList::iterator end(list.end());
- for(QCanvasItemList::iterator item_it(list.begin()); item_it != end; ++item_it ) {
- if( ( index = m_LineList.findRef( (QCanvasLine*)*item_it ) ) != -1 )
+ TQCanvasItemList::iterator end(list.end());
+ for(TQCanvasItemList::iterator item_it(list.begin()); item_it != end; ++item_it ) {
+ if( ( index = m_LineList.findRef( (TQCanvasLine*)*item_it ) ) != -1 )
break;
}//end for
return index;
@@ -312,7 +312,7 @@ void LinePath::setSelected( bool select ) {
void LinePath::setAssocType( Uml::Association_Type type ) {
LineListIt it( m_LineList );
- QCanvasLine * line = 0;
+ TQCanvasLine * line = 0;
while( ( line = it.current() ) ) {
line -> setPen( getPen() );
++it;
@@ -351,36 +351,36 @@ void LinePath::slotLineColorChanged( Uml::IDType viewID ) {
}
-void LinePath::setLineColor( const QColor &color ) {
- QCanvasLine * line = 0;
+void LinePath::setLineColor( const TQColor &color ) {
+ TQCanvasLine * line = 0;
uint linewidth = 0;
LineListIt it( m_LineList );
while( ( line = it.current() ) ) {
linewidth = line->pen().width();
- line -> setPen( QPen( color, linewidth ) );
+ line -> setPen( TQPen( color, linewidth ) );
++it;
}
LineListIt hit( m_HeadList );
while( ( line = hit.current() ) ) {
linewidth = line->pen().width();
- line -> setPen( QPen( color, linewidth ) );
+ line -> setPen( TQPen( color, linewidth ) );
++hit;
}
LineListIt pit( m_ParallelList );
while( ( line = pit.current() ) ) {
linewidth = line->pen().width();
- line -> setPen( QPen( color, linewidth ) );
+ line -> setPen( TQPen( color, linewidth ) );
++pit;
}
if( getAssocType() == Uml::at_Aggregation )
- if (m_pClearPoly) m_pClearPoly -> setBrush( QBrush( Qt::white ) );
+ if (m_pClearPoly) m_pClearPoly -> setBrush( TQBrush( Qt::white ) );
else if( getAssocType() == Uml::at_Composition )
- if (m_pClearPoly) m_pClearPoly -> setBrush( QBrush( color ) );
+ if (m_pClearPoly) m_pClearPoly -> setBrush( TQBrush( color ) );
if( m_pCircle ) {
linewidth = m_pCircle->pen().width();
- m_pCircle->setPen( QPen(color, linewidth) );
+ m_pCircle->setPen( TQPen(color, linewidth) );
}
}
@@ -392,30 +392,30 @@ void LinePath::slotLineWidthChanged( Uml::IDType viewID ) {
}
void LinePath::setLineWidth( uint width ) {
- QCanvasLine * line = 0;
- QColor linecolor;
+ TQCanvasLine * line = 0;
+ TQColor linecolor;
LineListIt it( m_LineList );
while( ( line = it.current() ) ) {
linecolor = line->pen().color();
- line -> setPen( QPen( linecolor, width ) );
+ line -> setPen( TQPen( linecolor, width ) );
++it;
}
LineListIt hit( m_HeadList );
while( ( line = hit.current() ) ) {
linecolor = line->pen().color();
- line -> setPen( QPen( linecolor, width ) );
+ line -> setPen( TQPen( linecolor, width ) );
++hit;
}
LineListIt pit( m_ParallelList );
while( ( line = pit.current() ) ) {
linecolor = line->pen().color();
- line -> setPen( QPen( linecolor, width ) );
+ line -> setPen( TQPen( linecolor, width ) );
++pit;
}
if( m_pCircle ) {
linecolor = m_pCircle->pen().color();
- m_pCircle->setPen( QPen(linecolor, width) );
+ m_pCircle->setPen( TQPen(linecolor, width) );
}
}
@@ -427,11 +427,11 @@ void LinePath::moveSelected( int pointIndex ) {
}
if( (int)m_RectList.count() + 1 != lineCount )
setupSelected();
- QCanvasRectangle * rect = 0;
- QCanvasLine * line = 0;
+ TQCanvasRectangle * rect = 0;
+ TQCanvasLine * line = 0;
if( pointIndex == lineCount || lineCount == 1) {
line = m_LineList.last();
- QPoint p = line -> endPoint();
+ TQPoint p = line -> endPoint();
rect = m_RectList.last();
rect -> setX( p.x() );
rect -> setY( p.y() );
@@ -439,7 +439,7 @@ void LinePath::moveSelected( int pointIndex ) {
return;
}
line = m_LineList.at( pointIndex );
- QPoint p = line -> startPoint();
+ TQPoint p = line -> startPoint();
rect = m_RectList.at( pointIndex );
rect -> setX( p.x() );
rect -> setY( p.y() );
@@ -448,32 +448,32 @@ void LinePath::moveSelected( int pointIndex ) {
void LinePath::setupSelected() {
m_RectList.clear();
- QCanvasLine * line = 0;
+ TQCanvasLine * line = 0;
LineListIt it( m_LineList );
while( ( line = it.current() ) ) {
- QPoint sp = line -> startPoint();
- QCanvasRectangle *rect = Widget_Utils::decoratePoint(sp);
+ TQPoint sp = line -> startPoint();
+ TQCanvasRectangle *rect = Widget_Utils::decoratePoint(sp);
m_RectList.append( rect );
++it;
}
//special case for last point
line = m_LineList.last();
- QPoint p = line -> endPoint();
- QCanvasRectangle *rect = Widget_Utils::decoratePoint(p);
+ TQPoint p = line -> endPoint();
+ TQCanvasRectangle *rect = Widget_Utils::decoratePoint(p);
m_RectList.append( rect );
update();
}
-QPen LinePath::getPen() {
+TQPen LinePath::getPen() {
Uml::Association_Type type = getAssocType();
if( type == Uml::at_Dependency || type == Uml::at_Realization || type == Uml::at_Anchor )
- return QPen( getLineColor(), getLineWidth(), Qt::DashLine );
- return QPen( getLineColor(), getLineWidth() );
+ return TQPen( getLineColor(), getLineWidth(), Qt::DashLine );
+ return TQPen( getLineColor(), getLineWidth() );
}
void LinePath::calculateHead() {
uint size = m_LineList.count();
- QPoint farPoint;
+ TQPoint farPoint;
int halfLength = 10;
double arrowAngle = 0.2618; // 0.5 * atan(sqrt(3.0) / 3.0) = 0.2618
Uml::Association_Type at = getAssocType();
@@ -544,7 +544,7 @@ void LinePath::calculateHead() {
m_PointArray.setPoint( 2, m_ArrowPointB );
m_PointArray.setPoint( 3, m_EgdePoint );
} else {
- QPoint diamondFarPoint;
+ TQPoint diamondFarPoint;
diamondFarPoint.setX( (int)rint(xb + cosx * 2) );
diamondFarPoint.setY( (int)rint(yb + siny * 2) );
m_PointArray.setPoint(2, diamondFarPoint);
@@ -555,7 +555,7 @@ void LinePath::calculateHead() {
void LinePath::updateHead() {
int count = m_HeadList.count();
- QCanvasLine * line = 0;
+ TQCanvasLine * line = 0;
switch( getAssocType() ) {
case Uml::at_State:
@@ -639,9 +639,9 @@ void LinePath::updateHead() {
}
void LinePath::growList(LineList &list, int by) {
- QPen pen( getLineColor(), getLineWidth() );
+ TQPen pen( getLineColor(), getLineWidth() );
for (int i = 0; i < by; i++) {
- QCanvasLine * line = new QCanvasLine( getCanvas() );
+ TQCanvasLine * line = new TQCanvasLine( getCanvas() );
line -> setZ( 0 );
line -> setPen( pen );
line -> setVisible( true );
@@ -651,7 +651,7 @@ void LinePath::growList(LineList &list, int by) {
void LinePath::createHeadLines() {
m_HeadList.clear();
- QCanvas * canvas = getCanvas();
+ TQCanvas * canvas = getCanvas();
switch( getAssocType() ) {
case Uml::at_Activity:
case Uml::at_State:
@@ -664,21 +664,21 @@ void LinePath::createHeadLines() {
case Uml::at_Generalization:
case Uml::at_Realization:
growList(m_HeadList, 3);
- m_pClearPoly = new QCanvasPolygon( canvas );
+ m_pClearPoly = new TQCanvasPolygon( canvas );
m_pClearPoly -> setVisible( true );
- m_pClearPoly -> setBrush( QBrush( Qt::white ) );
+ m_pClearPoly -> setBrush( TQBrush( Qt::white ) );
m_pClearPoly -> setZ( -1 );
break;
case Uml::at_Composition:
case Uml::at_Aggregation:
growList(m_HeadList, 4);
- m_pClearPoly = new QCanvasPolygon( canvas );
+ m_pClearPoly = new TQCanvasPolygon( canvas );
m_pClearPoly -> setVisible( true );
if( getAssocType() == Uml::at_Aggregation )
- m_pClearPoly -> setBrush( QBrush( Qt::white ) );
+ m_pClearPoly -> setBrush( TQBrush( Qt::white ) );
else
- m_pClearPoly -> setBrush( QBrush( getLineColor() ) );
+ m_pClearPoly -> setBrush( TQBrush( getLineColor() ) );
m_pClearPoly -> setZ( -1 );
break;
@@ -687,7 +687,7 @@ void LinePath::createHeadLines() {
if (!m_pCircle) {
m_pCircle = new Circle( canvas, 6 );
m_pCircle->show();
- m_pCircle->setPen( QPen( getLineColor(), getLineWidth() ) );
+ m_pCircle->setPen( TQPen( getLineColor(), getLineWidth() ) );
}
break;
default:
@@ -701,8 +701,8 @@ void LinePath::calculateParallelLine() {
double ATAN = atan(1.0);
int lineDist = 10;
//get 1/8(M) and 7/8(T) point
- QPoint a = getPoint( midCount - 1 );
- QPoint b = getPoint( midCount );
+ TQPoint a = getPoint( midCount - 1 );
+ TQPoint b = getPoint( midCount );
int mx = ( a.x() + b.x() ) / 2;
int my = ( a.y() + b.y() ) / 2;
int tx = ( mx + b.x() ) / 2;
@@ -717,7 +717,7 @@ void LinePath::calculateParallelLine() {
//find point from M to start line from.
double cosx = cos( angle ) * lineDist;
double siny = sin( angle ) * lineDist;
- QPoint pointM( mx + (int)cosx, my + (int)siny );
+ TQPoint pointM( mx + (int)cosx, my + (int)siny );
//find dist between P(xb, yb)
distX = ( tx - b.x() );
distX *= distX;
@@ -727,7 +727,7 @@ void LinePath::calculateParallelLine() {
//find point from T to end line
cosx = cos( angle ) * lineDist;
siny = sin( angle ) * lineDist;
- QPoint pointT( tx + (int)cosx, ty + (int)siny );
+ TQPoint pointT( tx + (int)cosx, ty + (int)siny );
m_ParallelLines[ 1 ] = pointM;
m_ParallelLines[ 0 ] = pointT;
@@ -737,11 +737,11 @@ void LinePath::calculateParallelLine() {
double arrowSlope = angle + ATAN;
cosx = ( cos( arrowSlope ) ) * arrowDist;
siny = ( sin( arrowSlope ) ) * arrowDist;
- m_ParallelLines[ 2 ] = QPoint( pointT.x() - (int)cosx, pointT.y() - (int)siny );
+ m_ParallelLines[ 2 ] = TQPoint( pointT.x() - (int)cosx, pointT.y() - (int)siny );
arrowSlope = angle - ATAN;
cosx = ( cos( arrowSlope ) ) * arrowDist;
siny = ( sin( arrowSlope ) ) * arrowDist;
- m_ParallelLines[ 3 ] = QPoint( pointT.x() - (int)cosx, pointT.y() - (int)siny );
+ m_ParallelLines[ 3 ] = TQPoint( pointT.x() - (int)cosx, pointT.y() - (int)siny );
}
void LinePath::setupParallelLine() {
@@ -753,9 +753,9 @@ void LinePath::setupParallelLine() {
void LinePath::updateParallelLine() {
if( !m_bParallelLineCreated )
return;
- QCanvasLine * line = 0;
- QPoint common = m_ParallelLines.at( 0 );
- QPoint p = m_ParallelLines.at( 1 );
+ TQCanvasLine * line = 0;
+ TQPoint common = m_ParallelLines.at( 0 );
+ TQPoint p = m_ParallelLines.at( 1 );
line = m_ParallelList.at( 0 );
line -> setPoints( common.x(), common.y(), p.x(), p.y() );
@@ -800,7 +800,7 @@ LinePath & LinePath::operator=( LinePath & rhs ) {
return *this;
}
-QCanvas * LinePath::getCanvas() {
+TQCanvas * LinePath::getCanvas() {
if( !m_pAssociation )
return 0;
const UMLView * view = m_pAssociation->getUMLView();
@@ -813,7 +813,7 @@ Uml::Association_Type LinePath::getAssocType() {
return Uml::at_Association;
}
-QColor LinePath::getLineColor() {
+TQColor LinePath::getLineColor() {
if( !m_pAssociation )
return Qt::black;
return m_pAssociation -> getLineColor();
@@ -849,8 +849,8 @@ void LinePath::cleanup() {
if( m_pAssociation ) {
UMLView * view = (UMLView *)m_pAssociation -> parent();
if(view) {
- disconnect( view, SIGNAL( sigColorChanged( Uml::IDType ) ), this, SLOT( slotLineColorChanged( Uml::IDType ) ) );
- disconnect( view, SIGNAL( sigLineWidthChanged( Uml::IDType ) ), this, SLOT( slotLineWidthChanged( Uml::IDType ) ) );
+ disconnect( view, TQT_SIGNAL( sigColorChanged( Uml::IDType ) ), this, TQT_SLOT( slotLineColorChanged( Uml::IDType ) ) );
+ disconnect( view, TQT_SIGNAL( sigLineWidthChanged( Uml::IDType ) ), this, TQT_SLOT( slotLineWidthChanged( Uml::IDType ) ) );
}
m_pAssociation = NULL;
}
@@ -869,26 +869,26 @@ bool LinePath::hasPoints () {
void LinePath::dumpPoints () {
int count = m_LineList.count();
for( int i = 1; i < count; i++ ) {
- QPoint point = getPoint( i );
+ TQPoint point = getPoint( i );
kDebug()<<" * point x:"<<point.x()<<" y:"<<point.y()<<endl;
}
}
-void LinePath::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) {
+void LinePath::saveToXMI( TQDomDocument & qDoc, TQDomElement & qElement ) {
int count = m_LineList.count();
- QPoint point = getPoint( 0 );
- QDomElement lineElement = qDoc.createElement( "linepath" );
- QDomElement startElement = qDoc.createElement( "startpoint" );
+ TQPoint point = getPoint( 0 );
+ TQDomElement lineElement = qDoc.createElement( "linepath" );
+ TQDomElement startElement = qDoc.createElement( "startpoint" );
startElement.setAttribute( "startx", point.x() );
startElement.setAttribute( "starty", point.y() );
lineElement.appendChild( startElement );
- QDomElement endElement = qDoc.createElement( "endpoint" );
+ TQDomElement endElement = qDoc.createElement( "endpoint" );
point = getPoint( count );
endElement.setAttribute( "endx", point.x() );
endElement.setAttribute( "endy", point.y() );
lineElement.appendChild( endElement );
for( int i = 1; i < count; i++ ) {
- QDomElement pointElement = qDoc.createElement( "point" );
+ TQDomElement pointElement = qDoc.createElement( "point" );
point = getPoint( i );
pointElement.setAttribute( "x", point.x() );
pointElement.setAttribute( "y", point.y() );
@@ -897,30 +897,30 @@ void LinePath::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) {
qElement.appendChild( lineElement );
}
-bool LinePath::loadFromXMI( QDomElement & qElement ) {
- QDomNode node = qElement.firstChild();
- QDomElement startElement = node.toElement();
+bool LinePath::loadFromXMI( TQDomElement & qElement ) {
+ TQDomNode node = qElement.firstChild();
+ TQDomElement startElement = node.toElement();
if( startElement.isNull() || startElement.tagName() != "startpoint" )
return false;
- QString x = startElement.attribute( "startx", "0" );
+ TQString x = startElement.attribute( "startx", "0" );
int nX = x.toInt();
- QString y = startElement.attribute( "starty", "0" );
+ TQString y = startElement.attribute( "starty", "0" );
int nY = y.toInt();
- QPoint startPoint( nX, nY );
+ TQPoint startPoint( nX, nY );
node = startElement.nextSibling();
- QDomElement endElement = node.toElement();
+ TQDomElement endElement = node.toElement();
if( endElement.isNull() || endElement.tagName() != "endpoint" )
return false;
x = endElement.attribute( "endx", "0" );
nX = x.toInt();
y = endElement.attribute( "endy", "0" );
nY = y.toInt();
- QPoint endPoint( nX, nY );
+ TQPoint endPoint( nX, nY );
setStartEndPoints( startPoint, endPoint );
- QPoint point;
+ TQPoint point;
node = endElement.nextSibling();
- QDomElement element = node.toElement();
+ TQDomElement element = node.toElement();
int i = 1;
while( !element.isNull() ) {
if( element.tagName() == "point" ) {
@@ -942,11 +942,11 @@ void LinePath::activate() {
int count = m_LineList.count();
if (count == 0)
return;
- QCanvas * canvas = getCanvas();
+ TQCanvas * canvas = getCanvas();
if (canvas == NULL)
return;
for (int i = 0; i < count ; i++) {
- QCanvasLine *line = m_LineList.at(i);
+ TQCanvasLine *line = m_LineList.at(i);
line -> setCanvas( canvas );
line -> setPen( getPen() );
}