summaryrefslogtreecommitdiffstats
path: root/src/cnitem.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/cnitem.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/cnitem.cpp')
-rw-r--r--src/cnitem.cpp82
1 files changed, 41 insertions, 41 deletions
diff --git a/src/cnitem.cpp b/src/cnitem.cpp
index 9d949f0..02e7881 100644
--- a/src/cnitem.cpp
+++ b/src/cnitem.cpp
@@ -17,8 +17,8 @@
#include "itemdocumentdata.h"
#include <kdebug.h>
-#include <qbitarray.h>
-#include <qpainter.h>
+#include <tqbitarray.h>
+#include <tqpainter.h>
#include <cmath>
@@ -26,7 +26,7 @@
const double DPR = 57.29577951308232087665461840231273527024;
-CNItem::CNItem( ICNDocument *icnDocument, bool newItem, const QString &id )
+CNItem::CNItem( ICNDocument *icnDocument, bool newItem, const TQString &id )
: Item( icnDocument, newItem, id ),
CIWidgetMgr( icnDocument->canvas(), this ),
p_icnDocument(icnDocument),
@@ -35,11 +35,11 @@ CNItem::CNItem( ICNDocument *icnDocument, bool newItem, const QString &id )
setZ( ICNDocument::Z::Item );
setSelected(false);
- m_brushCol = QColor( 0xf7, 0xf7, 0xff );
- m_selectedCol = QColor( 101, 134, 192 );
+ m_brushCol = TQColor( 0xf7, 0xf7, 0xff );
+ m_selectedCol = TQColor( 101, 134, 192 );
setBrush(m_brushCol);
- setPen( Qt::black );
+ setPen( TQt::black );
}
CNItem::~CNItem()
@@ -63,10 +63,10 @@ int CNItem::rtti() const
}
-bool CNItem::preResize( QRect sizeRect )
+bool CNItem::preResize( TQRect sizeRect )
{
- if ( (std::abs((double)sizeRect.width()) < minimumSize().width()) ||
- (std::abs((double)sizeRect.height()) < minimumSize().height()) )
+ if ( (std::abs((double)sizeRect.width()) < tqminimumSize().width()) ||
+ (std::abs((double)sizeRect.height()) < tqminimumSize().height()) )
return false;
updateConnectorPoints(false);
@@ -84,16 +84,16 @@ void CNItem::setVisible( bool yes )
{
if (b_deleted)
{
- Item::setVisible(false);
+ Item::tqsetVisible(false);
return;
}
- Item::setVisible(yes);
+ Item::tqsetVisible(yes);
const TextMap::iterator textMapEnd = m_textMap.end();
for ( TextMap::iterator it = m_textMap.begin(); it != textMapEnd; ++it )
{
- it.data()->setVisible(yes);
+ it.data()->tqsetVisible(yes);
}
const NodeMap::iterator nodeMapEnd = m_nodeMap.end();
@@ -109,9 +109,9 @@ void CNItem::setVisible( bool yes )
}
-void CNItem::setInitialPos( const QPoint &pos )
+void CNItem::setInitialPos( const TQPoint &pos )
{
- m_offset = pos - QPoint( (int)x(), (int)y() );
+ m_offset = pos - TQPoint( (int)x(), (int)y() );
}
@@ -133,8 +133,8 @@ void CNItem::updateNodeLevels()
it.data().node->setLevel(l);
}
- const ItemList::iterator end = m_children.end();
- for ( ItemList::iterator it = m_children.begin(); it != end; ++it )
+ const ItemList::iterator end = m_tqchildren.end();
+ for ( ItemList::iterator it = m_tqchildren.begin(); it != end; ++it )
{
if ( CNItem *cnItem = dynamic_cast<CNItem*>((Item*)*it) )
cnItem->updateNodeLevels();
@@ -156,7 +156,7 @@ ConnectorList CNItem::connectorList()
ConnectorList::iterator end = nodeList.end();
for ( ConnectorList::iterator it = nodeList.begin(); it != end; ++it )
{
- if ( *it && !list.contains(*it) )
+ if ( *it && !list.tqcontains(*it) )
{
list.append(*it);
}
@@ -165,7 +165,7 @@ ConnectorList CNItem::connectorList()
end = nodeList.end();
for ( ConnectorList::iterator it = nodeList.begin(); it != end; ++it )
{
- if ( *it && !list.contains(*it) )
+ if ( *it && !list.tqcontains(*it) )
{
list.append(*it);
}
@@ -237,7 +237,7 @@ ItemData CNItem::itemData() const
}
-Node* CNItem::createNode( double _x, double _y, int orientation, const QString &name, uint type )
+Node* CNItem::createNode( double _x, double _y, int orientation, const TQString &name, uint type )
{
orientation %= 360;
if ( orientation < 0 )
@@ -258,11 +258,11 @@ Node* CNItem::createNode( double _x, double _y, int orientation, const QString &
Node *node;
if ( (type == Node::ec_pin) || (type == Node::ec_junction) )
{
- node = new ECNode( p_icnDocument, Node::node_type(type), dir, QPoint( 0, 0 ) );
+ node = new ECNode( p_icnDocument, Node::node_type(type), dir, TQPoint( 0, 0 ) );
}
else
{
- node = new FPNode( p_icnDocument, Node::node_type(type), dir, QPoint( 0, 0 ) );
+ node = new FPNode( p_icnDocument, Node::node_type(type), dir, TQPoint( 0, 0 ) );
}
node->setLevel( level() );
@@ -284,9 +284,9 @@ Node* CNItem::createNode( double _x, double _y, int orientation, const QString &
}
-bool CNItem::removeNode( const QString &name )
+bool CNItem::removeNode( const TQString &name )
{
- NodeMap::iterator it = m_nodeMap.find(name);
+ NodeMap::iterator it = m_nodeMap.tqfind(name);
if ( it == m_nodeMap.end() ) {
return false;
}
@@ -297,7 +297,7 @@ bool CNItem::removeNode( const QString &name )
}
-Node *CNItem::getClosestNode( const QPoint &pos )
+Node *CNItem::getClosestNode( const TQPoint &pos )
{
// Work through the nodes, finding the one closest to the (x, y) position
Node *shortestNode = 0L;
@@ -368,7 +368,7 @@ void CNItem::moveBy( double dx, double dy )
updateConnectorPoints(false);
Item::moveBy( dx, dy );
- setWidgetsPos( QPoint( int(x()), int(y()) ) );
+ setWidgetsPos( TQPoint( int(x()), int(y()) ) );
}
@@ -443,7 +443,7 @@ void CNItem::leaveEvent()
}
-void CNItem::drawShape( QPainter &p )
+void CNItem::drawShape( TQPainter &p )
{
if (!isVisible())
return;
@@ -458,7 +458,7 @@ void CNItem::drawShape( QPainter &p )
}
-void CNItem::initPainter( QPainter &p )
+void CNItem::initPainter( TQPainter &p )
{
if ( isSelected() )
p.setPen(m_selectedCol);
@@ -487,17 +487,17 @@ void CNItem::updateConnectorPoints( bool add )
// Get translation matrix
// Hackish...
- QWMatrix m;
+ TQWMatrix m;
if ( Component *c = dynamic_cast<Component*>(this) )
m = c->transMatrix( c->angleDegrees(), c->flipped(), int(x()), int(y()), false );
// Convention used here: _UM = unmapped by both matrix and cell reference, _M = mapped
- const QPoint start_UM = QPoint( int(x()+offsetX())-cellSize, int(y()+offsetY())-cellSize );
- const QPoint end_UM = start_UM + QPoint( width()+2*cellSize, height()+2*cellSize );
+ const TQPoint start_UM = TQPoint( int(x()+offsetX())-cellSize, int(y()+offsetY())-cellSize );
+ const TQPoint end_UM = start_UM + TQPoint( width()+2*cellSize, height()+2*cellSize );
- const QPoint start_M = m.map(start_UM)/cellSize;
- const QPoint end_M = m.map(end_UM)/cellSize;
+ const TQPoint start_M = m.map(start_UM)/cellSize;
+ const TQPoint end_M = m.map(end_UM)/cellSize;
int sx_M = start_M.x();
@@ -571,10 +571,10 @@ void CNItem::updateConnectorPoints( bool add )
}
-Text* CNItem::addDisplayText( const QString &id, const QRect & pos, const QString &display, bool internal, int flags )
+Text* CNItem::addDisplayText( const TQString &id, const TQRect & pos, const TQString &display, bool internal, int flags )
{
Text *text = 0l;
- TextMap::iterator it = m_textMap.find(id);
+ TextMap::iterator it = m_textMap.tqfind(id);
if ( it != m_textMap.end() )
{
// kdWarning() << "CNItem::addDisplayText: removing old text"<<endl;
@@ -594,9 +594,9 @@ Text* CNItem::addDisplayText( const QString &id, const QRect & pos, const QStrin
}
-void CNItem::setDisplayText( const QString &id, const QString &display )
+void CNItem::setDisplayText( const TQString &id, const TQString &display )
{
- TextMap::iterator it = m_textMap.find(id);
+ TextMap::iterator it = m_textMap.tqfind(id);
if ( it == m_textMap.end() )
{
kdError() << "CNItem::setDisplayText: Could not find text with id \""<<id<<"\""<<endl;
@@ -607,9 +607,9 @@ void CNItem::setDisplayText( const QString &id, const QString &display )
}
-void CNItem::removeDisplayText( const QString &id )
+void CNItem::removeDisplayText( const TQString &id )
{
- TextMap::iterator it = m_textMap.find(id);
+ TextMap::iterator it = m_textMap.tqfind(id);
if ( it == m_textMap.end() )
{
// kdError() << "CNItem::removeDisplayText: Could not find text with id \""<<id<<"\""<<endl;
@@ -621,15 +621,15 @@ void CNItem::removeDisplayText( const QString &id )
}
-QString CNItem::nodeId( const QString &internalNodeId )
+TQString CNItem::nodeId( const TQString &internalNodeId )
{
- NodeMap::iterator it = m_nodeMap.find(internalNodeId);
+ NodeMap::iterator it = m_nodeMap.tqfind(internalNodeId);
if ( it == m_nodeMap.end() ) return "";
else return it.data().id;
}
-Node *CNItem::childNode( const QString &childId )
+Node *CNItem::childNode( const TQString &childId )
{
return p_icnDocument->nodeWithID( nodeId(childId) );
}