summaryrefslogtreecommitdiffstats
path: root/src/nodegroup.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-29 16:05:55 +0000
commit87a016680e3677da3993f333561e79eb0cead7d5 (patch)
treecbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /src/nodegroup.cpp
parent6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff)
downloadktechlab-87a016680e3677da3993f333561e79eb0cead7d5.tar.gz
ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.zip
TQt4 port ktechlab
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/nodegroup.cpp')
-rw-r--r--src/nodegroup.cpp48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/nodegroup.cpp b/src/nodegroup.cpp
index fe55293..903a20f 100644
--- a/src/nodegroup.cpp
+++ b/src/nodegroup.cpp
@@ -19,7 +19,7 @@
#include <cmath>
NodeGroup::NodeGroup( ICNDocument *icnDocument, const char *name )
- : QObject( icnDocument, name )
+ : TQObject( icnDocument, name )
{
p_icnDocument = icnDocument;
b_visible = true;
@@ -60,7 +60,7 @@ void NodeGroup::setVisible( bool visible )
void NodeGroup::addNode( Node *node, bool checkSurrouding )
{
- if ( !node || node->isChildNode() || m_nodeList.contains(node) ) {
+ if ( !node || node->isChildNode() || m_nodeList.tqcontains(node) ) {
return;
}
@@ -143,20 +143,20 @@ void NodeGroup::updateRoutes()
ConRouter cr(p_icnDocument);
cr.mapRoute( (int)n1->x(), (int)n1->y(), (int)n2->x(), (int)n2->y() );
- QPointListList pl = cr.dividePoints( route.size()+1 );
+ TQPointListList pl = cr.dividePoints( route.size()+1 );
const NodeList::iterator routeEnd = route.end();
- const QPointListList::iterator plEnd = pl.end();
+ const TQPointListList::iterator plEnd = pl.end();
Node *prev = n1;
NodeList::iterator routeIt = route.begin();
- for ( QPointListList::iterator it = pl.begin(); it != plEnd; ++it )
+ for ( TQPointListList::iterator it = pl.begin(); it != plEnd; ++it )
{
Node *next = (routeIt == routeEnd) ? n2 : (Node*)*(routeIt++);
removeRoutedNodes( &currentList, prev, next );
- QPointList pointList = *it;
+ TQPointList pointList = *it;
if ( prev != n1 )
{
- QPoint first = pointList.first();
+ TQPoint first = pointList.first();
prev->moveBy( first.x() - prev->x(), first.y() - prev->y() );
}
Connector *con = findCommonConnector( prev, next );
@@ -209,7 +209,7 @@ IntList NodeGroup::findRoute( IntList used, int currentNode, int endNode, bool *
}
*success = false;
- if ( !used.contains(currentNode) ) {
+ if ( !used.tqcontains(currentNode) ) {
used.append(currentNode);
}
@@ -221,7 +221,7 @@ IntList NodeGroup::findRoute( IntList used, int currentNode, int endNode, bool *
const uint n = m_nodeList.size()+m_extNodeList.size();
for ( uint i=0; i<n; ++i )
{
- if ( b_routedMap[i*n+currentNode] && !used.contains(i) )
+ if ( b_routedMap[i*n+currentNode] && !used.tqcontains(i) )
{
IntList il = findRoute( used, i, endNode, success );
if (*success) {
@@ -247,7 +247,7 @@ Connector* NodeGroup::findCommonConnector( Node *n1, Node *n2 )
const ConnectorList::iterator end = n1Con.end();
for ( ConnectorList::iterator it = n1Con.begin(); it != end; ++it )
{
- if ( n2Con.contains(*it) ) {
+ if ( n2Con.tqcontains(*it) ) {
return *it;
}
}
@@ -346,13 +346,13 @@ bool NodeGroup::canRoute( Node *n1, Node *n2 )
IntList reachable;
getReachable( &reachable, getNodePos(n1) );
- return reachable.contains(getNodePos(n2));
+ return reachable.tqcontains(getNodePos(n2));
}
void NodeGroup::getReachable( IntList *reachable, int node )
{
- if ( !reachable || reachable->contains(node) ) {
+ if ( !reachable || reachable->tqcontains(node) ) {
return;
}
reachable->append(node);
@@ -402,7 +402,7 @@ void NodeGroup::removeRoutedNodes( NodeList *nodes, Node *n1, Node *n2 )
const NodeList::iterator end = nodes->end();
for ( NodeList::iterator it = nodes->begin(); it != end; ++it )
{
- if ( nodes->contains(*it) > 1 ) {
+ if ( nodes->tqcontains(*it) > 1 ) {
*it = 0l;
}
}
@@ -442,11 +442,11 @@ int NodeGroup::getNodePos( Node *n )
if (!n) {
return -1;
}
- int pos = m_nodeList.findIndex(n);
+ int pos = m_nodeList.tqfindIndex(n);
if ( pos != -1 ) {
return pos;
}
- pos = m_extNodeList.findIndex(n);
+ pos = m_extNodeList.tqfindIndex(n);
if ( pos != -1 ) {
return pos+m_nodeList.size();
}
@@ -480,7 +480,7 @@ void NodeGroup::clearConList()
if (con)
{
con->setNodeGroup(0l);
- disconnect( con, SIGNAL(removed(Connector*)), this, SLOT(connectorRemoved(Connector*)) );
+ disconnect( con, TQT_SIGNAL(removed(Connector*)), this, TQT_SLOT(connectorRemoved(Connector*)) );
}
}
m_conList.clear();
@@ -511,11 +511,11 @@ void NodeGroup::init()
{
Connector *con = *conIt;
addExtNode(con->startNode());
- if ( !m_conList.contains(con) ) {
+ if ( !m_conList.tqcontains(con) ) {
m_conList += con;
con->setNodeGroup(this);
}
- connect( con, SIGNAL(removed(Connector*)), this, SLOT(connectorRemoved(Connector*)) );
+ connect( con, TQT_SIGNAL(removed(Connector*)), this, TQT_SLOT(connectorRemoved(Connector*)) );
}
conEnd = outCon.end();
@@ -523,23 +523,23 @@ void NodeGroup::init()
{
Connector *con = *conIt;
addExtNode(con->endNode());
- if ( !m_conList.contains(con) ) {
+ if ( !m_conList.tqcontains(con) ) {
m_conList += con;
con->setNodeGroup(this);
}
- connect( con, SIGNAL(removed(Connector*)), this, SLOT(connectorRemoved(Connector*)) );
+ connect( con, TQT_SIGNAL(removed(Connector*)), this, TQT_SLOT(connectorRemoved(Connector*)) );
}
// Connect the node up to us
- connect( *nodeIt, SIGNAL(removed(Node*)), this, SLOT(nodeRemoved(Node*)) );
+ connect( *nodeIt, TQT_SIGNAL(removed(Node*)), this, TQT_SLOT(nodeRemoved(Node*)) );
}
// And connect up our external nodes
xnEnd = m_extNodeList.end();
for ( NodeList::iterator it = m_extNodeList.begin(); it != xnEnd; ++it )
{
-// connect( *it, SIGNAL(moved(Node*)), this, SLOT(extNodeMoved()) );
- connect( *it, SIGNAL(removed(Node*)), this, SLOT(nodeRemoved(Node*)) );
+// connect( *it, TQT_SIGNAL(moved(Node*)), this, TQT_SLOT(extNodeMoved()) );
+ connect( *it, TQT_SIGNAL(removed(Node*)), this, TQT_SLOT(nodeRemoved(Node*)) );
}
}
@@ -562,7 +562,7 @@ void NodeGroup::connectorRemoved( Connector *connector )
void NodeGroup::addExtNode( Node *node )
{
- if ( !m_extNodeList.contains(node) && !m_nodeList.contains(node) )
+ if ( !m_extNodeList.tqcontains(node) && !m_nodeList.tqcontains(node) )
{
m_extNodeList.append(node);
node->setNodeGroup(this);