summaryrefslogtreecommitdiffstats
path: root/src/electronics/ecnode.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/electronics/ecnode.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/electronics/ecnode.cpp')
-rw-r--r--src/electronics/ecnode.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/electronics/ecnode.cpp b/src/electronics/ecnode.cpp
index 0fb2801..b4079e8 100644
--- a/src/electronics/ecnode.cpp
+++ b/src/electronics/ecnode.cpp
@@ -16,7 +16,7 @@
#include "pin.h"
#include <kdebug.h>
-#include <qpainter.h>
+#include <tqpainter.h>
#include <cmath>
@@ -52,7 +52,7 @@ inline int calcLength( const double prop, const double v )
return (v>0) ? -int(vLength*prop) : int(vLength*prop);
}
-ECNode::ECNode( ICNDocument *icnDocument, Node::node_type _type, node_dir dir, const QPoint &pos, QString *_id )
+ECNode::ECNode( ICNDocument *icnDocument, Node::node_type _type, node_dir dir, const TQPoint &pos, TQString *_id )
: Node( icnDocument, _type, dir, pos, _id )
{
m_prevV = 0;
@@ -64,9 +64,9 @@ ECNode::ECNode( ICNDocument *icnDocument, Node::node_type _type, node_dir dir, c
if ( type() == ec_pin )
{
- m_pinPoint = new QCanvasRectangle( 0, 0, 3, 3, canvas() );
- m_pinPoint->setBrush(Qt::black);
- m_pinPoint->setPen(Qt::black);
+ m_pinPoint = new TQCanvasRectangle( 0, 0, 3, 3, canvas() );
+ m_pinPoint->setBrush(TQt::black);
+ m_pinPoint->setPen(TQt::black);
}
m_pins.resize(1);
@@ -123,7 +123,7 @@ void ECNode::setNodeChanged()
if ( v != m_prevV || i != m_prevI )
{
- QRect r = boundingRect();
+ TQRect r = boundingRect();
r.setCoords( r.left()+(r.width()/2)-1, r.top()+(r.height()/2)-1, r.right()-(r.width()/2)+1, r.bottom()-(r.height()/2)+1 );
canvas()->setChanged(r);
m_prevV = v;
@@ -132,14 +132,14 @@ void ECNode::setNodeChanged()
}
-void ECNode::setParentItem( CNItem * parentItem )
+void ECNode::setParentItem( CNItem * tqparentItem )
{
- Node::setParentItem(parentItem);
+ Node::setParentItem(tqparentItem);
- if ( Component * component = dynamic_cast<Component*>(parentItem) )
+ if ( Component * component = dynamic_cast<Component*>(tqparentItem) )
{
- connect( component, SIGNAL(elementDestroyed(Element* )), this, SLOT(removeElement(Element* )) );
- connect( component, SIGNAL(switchDestroyed( Switch* )), this, SLOT(removeSwitch( Switch* )) );
+ connect( component, TQT_SIGNAL(elementDestroyed(Element* )), this, TQT_SLOT(removeElement(Element* )) );
+ connect( component, TQT_SIGNAL(switchDestroyed( Switch* )), this, TQT_SLOT(removeSwitch( Switch* )) );
}
}
@@ -158,7 +158,7 @@ void ECNode::removeSwitch( Switch * sw )
}
-void ECNode::drawShape( QPainter &p )
+void ECNode::drawShape( TQPainter &p )
{
const int _x = int(x());
const int _y = int(y());
@@ -174,8 +174,8 @@ void ECNode::drawShape( QPainter &p )
if (m_pinPoint)
{
bool drawDivPoint;
- QPoint divPoint = findConnectorDivergePoint(&drawDivPoint);
- m_pinPoint->setVisible(drawDivPoint);
+ TQPoint divPoint = findConnectorDivergePoint(&drawDivPoint);
+ m_pinPoint->tqsetVisible(drawDivPoint);
m_pinPoint->move( divPoint.x()-1, divPoint.y()-1 );
}
@@ -191,17 +191,17 @@ void ECNode::drawShape( QPainter &p )
{
// we can assume that v != 0 as length != 0
- QPen oldPen = p.pen();
+ TQPen oldPen = p.pen();
double i = pin()->current();
double iProp = calcIProp(i);
int thickness = calcThickness(iProp);
if ( v > 0 )
- p.setPen( QPen( QColor( 255, 166, 0 ), thickness ) );
+ p.setPen( TQPen( TQColor( 255, 166, 0 ), thickness ) );
else
- p.setPen( QPen( QColor( 0, 136, 255 ), thickness ) );
+ p.setPen( TQPen( TQColor( 0, 136, 255 ), thickness ) );
// The node line (drawn at the end of this function) will overdraw
// some of the voltage bar, so we need to adapt the length
@@ -226,7 +226,7 @@ void ECNode::drawShape( QPainter &p )
}
}
- QPen pen( p.pen() );
+ TQPen pen( p.pen() );
pen.setWidth( (numPins() > 1) ? 2 : 1 );
p.setPen(pen);