From 84f5a315c3429b47a7eff15e626e2efdbe4f6e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 8 Oct 2013 00:13:25 +0200 Subject: Initial TQt conversion --- src/graphedge.cpp | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'src/graphedge.cpp') diff --git a/src/graphedge.cpp b/src/graphedge.cpp index 283a5fe..33ac306 100644 --- a/src/graphedge.cpp +++ b/src/graphedge.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include "graphedge.h" #include "graphnode.h" @@ -46,24 +46,24 @@ typedef int (*CompFunc)(const void*, const void*); /** - * An array of QPoint objects that can compute the convex hull surrounding all + * An array of TQPoint objects that can compute the convex hull surrounding all * points in the array. * @author Elad Lahav */ -class ConvexHull : public QPointArray +class ConvexHull : public TQPointArray { public: /** * Class constructor. */ - ConvexHull() : QPointArray() {} + ConvexHull() : TQPointArray() {} /** * Computes the convex hull of the points stored in the array, using * Graham's scan. * @param arrHull Holds the coordinates of the convex hull, upon return */ - void compute(QPointArray& arrHull) { + void compute(TQPointArray& arrHull) { uint i, nPivot, nTop; // Find the pivot point @@ -82,7 +82,7 @@ public: s_ptPivot = (*this)[nPivot]; (*this)[nPivot] = (*this)[0]; (*this)[0] = s_ptPivot; - qsort(&(*this).data()[1], (*this).size() - 1, sizeof(QPoint), + qsort(&(*this).data()[1], (*this).size() - 1, sizeof(TQPoint), (CompFunc)compRadial); // Initialise Graham's scan algorithm @@ -112,7 +112,7 @@ public: private: /** The current pivot point, required by compRadial. */ - static QPoint s_ptPivot; + static TQPoint s_ptPivot; /** * Compares two points based on their angle relative to the current @@ -122,7 +122,7 @@ private: * @param pPt2 A pointer to the second point * @return >0 if the first point is to the left of the second, <0 otherwise */ - static int compRadial(const QPoint* pPt1, const QPoint* pPt2) { + static int compRadial(const TQPoint* pPt1, const TQPoint* pPt2) { int nResult; // Determine which point is to the left of the other. If the angle is @@ -135,7 +135,7 @@ private: } }; -QPoint ConvexHull::s_ptPivot; +TQPoint ConvexHull::s_ptPivot; /** * Class constructor. @@ -143,8 +143,8 @@ QPoint ConvexHull::s_ptPivot; * @param pHead The edge's starting point * @param pTail The edge's end point */ -GraphEdge::GraphEdge(QCanvas* pCanvas, GraphNode* pHead, GraphNode* pTail) : - QCanvasPolygonalItem(pCanvas), +GraphEdge::GraphEdge(TQCanvas* pCanvas, GraphNode* pHead, GraphNode* pTail) : + TQCanvasPolygonalItem(pCanvas), m_pHead(pHead), m_pTail(pTail), m_arrPoly(4) @@ -156,8 +156,8 @@ GraphEdge::GraphEdge(QCanvas* pCanvas, GraphNode* pHead, GraphNode* pTail) : */ GraphEdge::~GraphEdge() { - // Classes derived from QCanvasPolygonalItem must call hide() in their - // detructor (according to the Qt documentation) + // Classes derived from TQCanvasPolygonalItem must call hide() in their + // detructor (according to the TQt documentation) hide(); } @@ -165,14 +165,14 @@ GraphEdge::~GraphEdge() * Calculates the area surrounding the edge, and the bounding rectangle of * the edge's polygonal head. * The calculated area is used to find items on the canvas and to display - * tips. The bounding rectangle defines the tip's region (@see QToolTip). + * tips. The bounding rectangle defines the tip's region (@see TQToolTip). * TODO: The function assumes that the we can simply append the polygon's * array to that of the splines. Is this always the case, or should we sort * the points of the polygon in radial order? * @param arrCurve The control points of the edge's spline * @param ai Used to calculate the arrow head polygon */ -void GraphEdge::setPoints(const QPointArray& arrCurve, const ArrowInfo& ai) +void GraphEdge::setPoints(const TQPointArray& arrCurve, const ArrowInfo& ai) { ConvexHull ch; uint i; @@ -195,7 +195,7 @@ void GraphEdge::setPoints(const QPointArray& arrCurve, const ArrowInfo& ai) ch.compute(m_arrArea); // Calculate the head's bounding rectangle - m_rcTip = QRect(m_arrPoly[0], m_arrPoly[0]); + m_rcTip = TQRect(m_arrPoly[0], m_arrPoly[0]); for (i = 1; i < m_arrPoly.size(); i++) { nXpos = m_arrPoly[i].x(); if (nXpos < m_rcTip.left()) @@ -217,8 +217,8 @@ void GraphEdge::setPoints(const QPointArray& arrCurve, const ArrowInfo& ai) * @param sLine The call's line number * @param sText The call's text */ -void GraphEdge::setCallInfo(const QString& sFile, const QString& sLine, - const QString& sText) +void GraphEdge::setCallInfo(const TQString& sFile, const TQString& sLine, + const TQString& sText) { m_sFile = sFile; m_sLine = sLine; @@ -229,9 +229,9 @@ void GraphEdge::setCallInfo(const QString& sFile, const QString& sLine, * Constructs a tool-tip string for this edge. * @return The tool-tip text */ -QString GraphEdge::getTip() const +TQString GraphEdge::getTip() const { - QString sTip; + TQString sTip; sTip = m_sText + "
" + m_sFile + ":" + m_sLine; return sTip; @@ -241,7 +241,7 @@ QString GraphEdge::getTip() const * Draws the spline as a sequence of cubic Bezier curves. * @param painter Used for drawing the item on the canvas view */ -void GraphEdge::drawShape(QPainter& painter) +void GraphEdge::drawShape(TQPainter& painter) { uint i; @@ -254,10 +254,10 @@ void GraphEdge::drawShape(QPainter& painter) #if 0 // Draws the convex hull of the edge - QPen pen = painter.pen(); - QBrush br = painter.brush(); - painter.setPen(QPen(QColor(255, 0, 0))); - painter.setBrush(QBrush()); + TQPen pen = painter.pen(); + TQBrush br = painter.brush(); + painter.setPen(TQPen(TQColor(255, 0, 0))); + painter.setBrush(TQBrush()); painter.drawPolygon(m_arrArea); painter.setPen(pen); painter.setBrush(br); @@ -270,7 +270,7 @@ void GraphEdge::drawShape(QPainter& painter) */ void GraphEdge::makeArrowhead(const ArrowInfo& ai) { - QPoint ptLast, ptPrev; + TQPoint ptLast, ptPrev; double dX1, dY1, dX0, dY0, dX, dY, dDeltaX, dDeltaY, dNormLen; // The arrowhead follows the line from the second last to the last points -- cgit v1.2.1