From a1417fc127e4bc714ddce901c100334db60aaa46 Mon Sep 17 00:00:00 2001 From: Valentina Zhuravska Date: Fri, 11 Dec 2015 13:35:48 +0200 Subject: [PATCH] We don't need to change pen inside RefreshLine method --HG-- branch : feature --- .../toolpoint/toolsinglepoint/vtoolsinglepoint.cpp | 6 ++---- src/libs/vtools/tools/nodeDetails/vnodepoint.cpp | 2 +- src/libs/vtools/tools/vabstracttool.cpp | 3 +-- src/libs/vtools/tools/vabstracttool.h | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp index 9ae9d08f8..c8c4fcb81 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolsinglepoint.cpp @@ -247,10 +247,8 @@ void VToolSinglePoint::RefreshPointGeometry(const VPointF &point) void VToolSinglePoint::RefreshLine(quint32 id) { Q_UNUSED(id) - QPen pen(CorrectColor(Qt::black)); - pen.setWidthF(qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor); - - VAbstractTool::RefreshLine(this, namePoint, lineName, radius, pen); + VAbstractTool::RefreshLine(this, namePoint, lineName, radius); + lineName->setPen(QPen(CorrectColor(Qt::black), qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor)); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp index 68428f1da..fba04fa1c 100644 --- a/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp +++ b/src/libs/vtools/tools/nodeDetails/vnodepoint.cpp @@ -279,5 +279,5 @@ void VNodePoint::RefreshPointGeometry(const VPointF &point) */ void VNodePoint::RefreshLine() { - VAbstractTool::RefreshLine(this, namePoint, lineName, radius, QPen(Qt::black)); + VAbstractTool::RefreshLine(this, namePoint, lineName, radius); } diff --git a/src/libs/vtools/tools/vabstracttool.cpp b/src/libs/vtools/tools/vabstracttool.cpp index 37026468d..bfee484a6 100644 --- a/src/libs/vtools/tools/vabstracttool.cpp +++ b/src/libs/vtools/tools/vabstracttool.cpp @@ -321,7 +321,7 @@ void VAbstractTool::AddRecord(const quint32 id, const Tool &toolType, VAbstractP * @brief RefreshLine refresh line to label on scene. */ void VAbstractTool::RefreshLine(QGraphicsEllipseItem *point, VGraphicsSimpleTextItem *namePoint, QGraphicsLineItem *lineName, - const qreal radius, const QPen pen) + const qreal radius) { QRectF nRec = namePoint->sceneBoundingRect(); nRec.translate(- point->scenePos()); @@ -332,7 +332,6 @@ void VAbstractTool::RefreshLine(QGraphicsEllipseItem *point, VGraphicsSimpleText VGObject::LineIntersectCircle(QPointF(), radius, QLineF(QPointF(), nameRec.center() - point->scenePos()), p1, p2); const QPointF pRec = VGObject::LineIntersectRect(nameRec, QLineF(point->scenePos(), nameRec.center())); lineName->setLine(QLineF(p1, pRec - point->scenePos())); - lineName->setPen(pen); if (QLineF(p1, pRec - point->scenePos()).length() <= ToPixel(4, Unit::Mm)) { diff --git a/src/libs/vtools/tools/vabstracttool.h b/src/libs/vtools/tools/vabstracttool.h index e0dd8358c..b4a897c96 100644 --- a/src/libs/vtools/tools/vabstracttool.h +++ b/src/libs/vtools/tools/vabstracttool.h @@ -124,7 +124,7 @@ protected: void ToolCreation(const Source &typeCreation); static void RefreshLine(QGraphicsEllipseItem *point, VGraphicsSimpleTextItem *namePoint, QGraphicsLineItem *lineName, - const qreal radius, const QPen pen); + const qreal radius); private: Q_DISABLE_COPY(VAbstractTool) };