From 20107a35f882bc5649266473ea7011b5de7e8e6d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 2 Mar 2017 11:16:02 +0200 Subject: [PATCH] Cppcheck warning. --HG-- branch : develop --- src/libs/vlayout/vlayoutpiece.cpp | 26 +++++++++++++------------- src/libs/vlayout/vlayoutpiece.h | 1 - 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index f99f17011..93463eed8 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -267,6 +267,19 @@ QPointF RotatePoint(const QPointF &ptCenter, const QPointF& pt, qreal dAng) return ptDest + ptCenter; } + +//--------------------------------------------------------------------------------------------------------------------- +void CreateLabel(QGraphicsItem *parent, const QPainterPath &path) +{ + SCASSERT(parent != nullptr) + + if (not path.isEmpty()) + { + QGraphicsPathItem* item = new QGraphicsPathItem(parent); + item->setPath(path); + item->setBrush(QBrush(Qt::black)); + } +} } //--------------------------------------------------------------------------------------------------------------------- @@ -789,19 +802,6 @@ void VLayoutPiece::CreateInternalPathItem(int i, QGraphicsItem *parent) const item->setPen(pen); } -//--------------------------------------------------------------------------------------------------------------------- -void VLayoutPiece::CreateLabel(QGraphicsItem *parent, const QPainterPath &path) const -{ - SCASSERT(parent != nullptr) - - if (not path.isEmpty()) - { - QGraphicsPathItem* item = new QGraphicsPathItem(parent); - item->setPath(path); - item->setBrush(QBrush(Qt::black)); - } -} - //--------------------------------------------------------------------------------------------------------------------- QPainterPath VLayoutPiece::LayoutAllowancePath() const { diff --git a/src/libs/vlayout/vlayoutpiece.h b/src/libs/vlayout/vlayoutpiece.h index 30caf6e7f..aac2b78f8 100644 --- a/src/libs/vlayout/vlayoutpiece.h +++ b/src/libs/vlayout/vlayoutpiece.h @@ -126,7 +126,6 @@ private: QPainterPath CreateLabelText(const QVector &labelShape, const VTextManager &tm) const; void CreateInternalPathItem(int i, QGraphicsItem *parent) const; - void CreateLabel(QGraphicsItem *parent, const QPainterPath &path) const; void CreateGrainlineItem(QGraphicsItem *parent) const; QVector Map(const QVector &points) const;