summaryrefslogtreecommitdiffstats
path: root/src/cnitem.h
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.h
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.h')
-rw-r--r--src/cnitem.h61
1 files changed, 31 insertions, 30 deletions
diff --git a/src/cnitem.h b/src/cnitem.h
index 7a5f55a..eb8f80a 100644
--- a/src/cnitem.h
+++ b/src/cnitem.h
@@ -22,10 +22,10 @@ class Connector;
class DoubleSpinBox;
class LibraryItem;
class Node;
-class QSlider;
-class QString;
-class QToolButton;
-class QWMatrix;
+class TQSlider;
+class TQString;
+class TQToolButton;
+class TQWMatrix;
class Slider;
class Text;
@@ -35,17 +35,17 @@ class NodeInfo
public:
NodeInfo();
- QString id; // External id (ICNDocument scope)
+ TQString id; // External id (ICNDocument scope)
Node *node; //Pointer to the node
double x; // X position relative to item
double y; // Y position relative to item
- int orientation; // Orientation relative to item
+ int orientation; // Qt::Orientation relative to item
};
-typedef QMap<QString, QString> StringMap;
-typedef QMap<QString, NodeInfo> NodeMap; // Internal id, node info
-typedef QValueList<QGuardedPtr<Connector> > ConnectorList;
-typedef QMap<QString, QGuardedPtr<Text> > TextMap;
+typedef TQMap<TQString, TQString> StringMap;
+typedef TQMap<TQString, NodeInfo> NodeMap; // Internal id, node info
+typedef TQValueList<TQGuardedPtr<Connector> > ConnectorList;
+typedef TQMap<TQString, TQGuardedPtr<Text> > TextMap;
/**
Essentially, all items that live on ICNDocument should inherit from this class.
@@ -58,8 +58,9 @@ saving and editing of associated data, cutting / copying, etc)
class CNItem : public Item, public CIWidgetMgr
{
Q_OBJECT
+ TQ_OBJECT
public:
- CNItem( ICNDocument *_icnView, bool newItem, const QString &id );
+ CNItem( ICNDocument *_icnView, bool newItem, const TQString &id );
virtual ~CNItem();
/**
@@ -72,16 +73,16 @@ public:
* coordinates of the node are relative to the upper left corner of the item.
* @param type See Node::node_type
*/
- Node* createNode( double _x, double _y, int orientation, const QString &name, uint type );
+ Node* createNode( double _x, double _y, int orientation, const TQString &name, uint type );
/**
* Removes a child node. You should use this function if you want to remove
* any nodes during the lifetime of the CNItem.
*/
- bool removeNode( const QString &name );
+ bool removeNode( const TQString &name );
/**
* Sets the mouse click point when moving this item
*/
- void setInitialPos( const QPoint &pos );
+ void setInitialPos( const TQPoint &pos );
/**
* Snaps the component to the grid.
*/
@@ -89,12 +90,12 @@ public:
/**
* Returns the closest node that is associated with the CNItem
*/
- Node *getClosestNode( const QPoint &pos );
+ Node *getClosestNode( const TQPoint &pos );
/**
* Returns a list of connectors associated with the CNItem
*/
ConnectorList connectorList();
- virtual bool preResize( QRect sizeRect );
+ virtual bool preResize( TQRect sizeRect );
virtual bool mousePressEvent( const EventInfo &eventInfo );
virtual bool mouseReleaseEvent( const EventInfo &eventInfo );
virtual bool mouseDoubleClickEvent ( const EventInfo &eventInfo );
@@ -113,14 +114,14 @@ public:
* Converts the id used to internally identify a node to the global
* ICNDocument node id. eg "vss" might return "node__13".
*/
- QString nodeId( const QString &internalNodeId );
+ TQString nodeId( const TQString &internalNodeId );
/**
* Returns a pointer to the node with the given internal (child) id
*/
- Node *childNode( const QString &childId );
+ Node *childNode( const TQString &childId );
/**
* Returns the node map used:
- * QMap<QString, NodeInfo> NodeMap
+ * TQMap<TQString, NodeInfo> NodeMap
* It's probably best to cache this data
*/
NodeMap nodeMap() const { return m_nodeMap; }
@@ -156,7 +157,7 @@ public slots:
protected:
virtual void reparented( Item *oldParent, Item *newParent );
- virtual void drawShape( QPainter &p );
+ virtual void drawShape( TQPainter &p );
virtual void postResize();
/**
* CNItem handles drawing of text associated with the CNItem.
@@ -164,28 +165,28 @@ protected:
* @param pos is the position that the text occupies relative to the top left corner of the CNItem.
* @param display is the actual text to be displayed.
* @param internal is used to determine the z-level of the text - whether it should be below or above the item
- * @param flags Text alignment flags - Qt::AlignmentFlags and Qt::TextFlags OR'd together.
+ * @param flags Text tqalignment flags - TQt::AlignmentFlags and TQt::TextFlags OR'd together.
*/
- Text* addDisplayText( const QString &id, const QRect & pos, const QString &display, bool internal = true, int flags = Qt::AlignHCenter | Qt::AlignVCenter );
- void setDisplayText( const QString &id, const QString &display );
+ Text* addDisplayText( const TQString &id, const TQRect & pos, const TQString &display, bool internal = true, int flags = TQt::AlignHCenter | TQt::AlignVCenter );
+ void setDisplayText( const TQString &id, const TQString &display );
/**
* Remove the display text with the given id
*/
- void removeDisplayText( const QString &id );
+ void removeDisplayText( const TQString &id );
/**
* Sets the right colour if selected, transforms the matrix of the painter
*/
- virtual void initPainter( QPainter &p );
+ virtual void initPainter( TQPainter &p );
- QPoint m_offset;
- QGuardedPtr<ICNDocument> p_icnDocument;
+ TQPoint m_offset;
+ TQGuardedPtr<ICNDocument> p_icnDocument;
TextMap m_textMap;
NodeMap m_nodeMap;
- QColor m_selectedCol;
- QColor m_brushCol;
+ TQColor m_selectedCol;
+ TQColor m_brushCol;
bool b_pointsAdded;
};
-typedef QValueList<CNItem*> CNItemList;
+typedef TQValueList<CNItem*> CNItemList;
#endif