diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
commit | 87a016680e3677da3993f333561e79eb0cead7d5 (patch) | |
tree | cbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /src/node.h | |
parent | 6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff) | |
download | ktechlab-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/node.h')
-rw-r--r-- | src/node.h | 45 |
1 files changed, 23 insertions, 22 deletions
@@ -11,8 +11,8 @@ #ifndef NODE_H #define NODE_H -#include <qcanvas.h> -#include <qguardedptr.h> +#include <tqcanvas.h> +#include <tqguardedptr.h> class CNItem; class Item; @@ -22,18 +22,19 @@ class Connector; class Node; class NodeData; class NodeGroup; -class QTimer; +class TQTimer; -typedef QValueList<QGuardedPtr<Connector> > ConnectorList; -typedef QValueList<QGuardedPtr<Node> > NodeList; +typedef TQValueList<TQGuardedPtr<Connector> > ConnectorList; +typedef TQValueList<TQGuardedPtr<Node> > NodeList; /** @short A standard node that can be associated with a Connector or a CNItem @author David Saxton */ -class Node : public QObject, public QCanvasPolygon +class Node : public TQObject, public TQCanvasPolygon { Q_OBJECT + TQ_OBJECT public: /** * Used for run-time identification of the node: @@ -56,7 +57,7 @@ public: dir_down = 90, dir_left = 180 }; - Node( ICNDocument *icnDocument, Node::node_type type, node_dir dir, const QPoint &pos, QString *id = 0L ); + Node( ICNDocument *icnDocument, Node::node_type type, node_dir dir, const TQPoint &pos, TQString *id = 0L ); virtual ~Node(); /** @@ -68,17 +69,17 @@ public: * Returns the global id, that is unique to the node * amongst all the nodes on the canvas */ - const QString id() const { return m_id; } + const TQString id() const { return m_id; } /** * Returns the id that is internal to the CNItem to which the - * node belongs to. Returns a null QString if no parentitem + * node belongs to. Returns a null TQString if no tqparentitem */ - const QString childId() const { return m_childId; } + const TQString childId() const { return m_childId; } /** * Use this function to set the child-id, that is unique to the node - * amongst the other nodes associated with its parent CNItem + * amongst the other nodes associated with its tqparent CNItem */ - void setChildId( const QString &id ) { m_childId = id; } + void setChildId( const TQString &id ) { m_childId = id; } /** * Returns the run-time-type-identifier of ICNDocument::RTTI::Node */ @@ -117,7 +118,7 @@ public: * Associates a CNItem with the node - ie the node belongs to the CNItem, * and hence gets deleted when the CNItem gets deleted.s */ - virtual void setParentItem( CNItem *parentItem ); + virtual void setParentItem( CNItem *tqparentItem ); /** * Returns true if the node is part of a CNItem * (i.e. not between multiple connectors) @@ -127,7 +128,7 @@ public: * Returns a pointer to the CNItem to which the node belongs, * or Null if it doesn't. */ - CNItem *parentItem() const { return p_parentItem; } + CNItem *tqparentItem() const { return p_parentItem; } /** * Remove a specific connector */ @@ -150,9 +151,9 @@ public: void addOutputConnector( Connector * const connector ); /** * Returns the total number of connections to the node. This is the number - * of input connectors, the number of output connectors, and the parent + * of input connectors, the number of output connectors, and the tqparent * item connector if it exists and is requested. - * @param includeParentItem Count the parent item as a connector if it exists + * @param includeParentItem Count the tqparent item as a connector if it exists * @param includeHiddenConnectors hidden connectors are those as e.g. part of a subcircuit */ int numCon( bool includeParentItem, bool includeHiddenConnectors ) const; @@ -176,9 +177,9 @@ public: void removeNullConnectors(); /** - * Draw shape. Note that this has to remain public. + * Draw tqshape. Note that this has to remain public. */ - virtual void drawShape( QPainter &p ) = 0; + virtual void drawShape( TQPainter &p ) = 0; public slots: void moveBy( double dx, double dy ); @@ -199,13 +200,13 @@ protected: /** If this node has precisely two connectors emerging from it, then this * function will trace thw two connectors until the point where they * diverge; this point is returned. */ - QPoint findConnectorDivergePoint( bool * found ); + TQPoint findConnectorDivergePoint( bool * found ); void initPoints(); bool handleNewConnector( Connector * newConnector ); node_type m_type; - QString m_id; - QString m_childId; + TQString m_id; + TQString m_childId; node_dir m_dir; ICNDocument *p_icnDocument; CNItem *p_parentItem; @@ -213,7 +214,7 @@ protected: ConnectorList m_outputConnectorList; int m_level; NodeGroup *p_nodeGroup; - QColor m_selectedColor; + TQColor m_selectedColor; private: bool b_deleted; |