diff --git a/src/app/puzzle/layout/vppiece.cpp b/src/app/puzzle/layout/vppiece.cpp index c46d0d056..8a1997c43 100644 --- a/src/app/puzzle/layout/vppiece.cpp +++ b/src/app/puzzle/layout/vppiece.cpp @@ -491,10 +491,10 @@ auto VPPiece::StickyPosition(qreal &dx, qreal &dy) const -> bool auto VPPiece::PathsSuperposition(const QVector &path1, const QVector &path2) -> bool { const QRectF path1Rect = VLayoutPiece::BoundingRect(path1); - const QPainterPath path1Path = VAbstractPiece::PainterPath(path1); + const QPainterPath path1Path = VGObject::PainterPath(path1); const QRectF path2Rect = VLayoutPiece::BoundingRect(path2); - const QPainterPath path2Path = VAbstractPiece::PainterPath(path2); + const QPainterPath path2Path = VGObject::PainterPath(path2); if (path1Rect.intersects(path2Rect) || path2Rect.contains(path1Rect) || path1Rect.contains(path2Rect)) { diff --git a/src/app/puzzle/scene/vpgraphicspiececontrols.cpp b/src/app/puzzle/scene/vpgraphicspiececontrols.cpp index 4d2ef940e..67296fa3d 100644 --- a/src/app/puzzle/scene/vpgraphicspiececontrols.cpp +++ b/src/app/puzzle/scene/vpgraphicspiececontrols.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include "../vmisc/compatibility.h" #include "../vwidgets/global.h" diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index 56707b7fe..860d5c9b0 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -584,6 +584,7 @@ void MainWindowsNoGUI::ExportDetailsAsFlatLayout(const QVector &li QScopedPointer scene(new QGraphicsScene()); QList list; + list.reserve(listDetails.count()); for (auto piece : listDetails) { QGraphicsItem *item = piece.GetItem(m_dialogSaveLayout->IsTextAsPaths()); @@ -607,7 +608,7 @@ void MainWindowsNoGUI::ExportDetailsAsFlatLayout(const QVector &li list.append(item); } - for (auto item : list) + for (auto *item : list) { scene->addItem(item); } @@ -621,7 +622,7 @@ void MainWindowsNoGUI::ExportDetailsAsFlatLayout(const QVector &li QTransform matrix; matrix = matrix.translate(-mx, -my); - for (auto item : list) + for (auto *item : list) { item->setTransform(matrix); } @@ -770,6 +771,7 @@ void MainWindowsNoGUI::ExportDetailsAsApparelLayout(QVector listDe QScopedPointer scene(new QGraphicsScene()); QList list; + list.reserve(listDetails.count()); for (int i=0; i < listDetails.count(); ++i) { VLayoutPiece piece = listDetails.at(i); @@ -799,7 +801,7 @@ void MainWindowsNoGUI::ExportDetailsAsApparelLayout(QVector listDe list.append(item); } - for (auto item : list) + for (auto *item : list) { scene->addItem(item); } @@ -812,7 +814,7 @@ void MainWindowsNoGUI::ExportDetailsAsApparelLayout(QVector listDe QTransform matrix; matrix = matrix.translate(-mx, -my); - for (auto item : list) + for (auto *item : list) { item->setTransform(matrix); } @@ -862,7 +864,7 @@ void MainWindowsNoGUI::PrintPreviewTiled() else { VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings(); - m_layoutSettings->SetTiledMargins(QMarginsF(settings->GetTiledPDFMargins(Unit::Mm))); + m_layoutSettings->SetTiledMargins(settings->GetTiledPDFMargins(Unit::Mm)); m_layoutSettings->SetTiledPDFOrientation(settings->GetTiledPDFOrientation()); m_layoutSettings->SetTiledPDFPaperSize(QSizeF(settings->GetTiledPDFPaperWidth(Unit::Mm), settings->GetTiledPDFPaperHeight(Unit::Mm))); @@ -896,7 +898,7 @@ void MainWindowsNoGUI::PrintTiled() else { VValentinaSettings *settings = VAbstractValApplication::VApp()->ValentinaSettings(); - m_layoutSettings->SetTiledMargins(QMarginsF(settings->GetTiledPDFMargins(Unit::Mm))); + m_layoutSettings->SetTiledMargins(settings->GetTiledPDFMargins(Unit::Mm)); m_layoutSettings->SetTiledPDFOrientation(settings->GetTiledPDFOrientation()); m_layoutSettings->SetTiledPDFPaperSize(QSizeF(settings->GetTiledPDFPaperWidth(Unit::Mm), settings->GetTiledPDFPaperHeight(Unit::Mm))); @@ -912,12 +914,12 @@ QVector MainWindowsNoGUI::PrepareDetailsForLayout(const QVector(); + return {}; } - std::function PrepareDetail = [](const DetailForLayout &data) + std::function PrepareDetail = [](const DetailForLayout &data) { - VAbstractTool *tool = qobject_cast(VAbstractPattern::getTool(data.id)); + auto *tool = qobject_cast(VAbstractPattern::getTool(data.id)); SCASSERT(tool != nullptr) return VLayoutPiece::Create(data.piece, data.id, tool->getData()); }; @@ -1054,8 +1056,8 @@ QList MainWindowsNoGUI::CreateScenes(const QListaddItem(shadows.at(i)); scene->addItem(papers.at(i)); - const QList paperDetails = details.at(i); - for (auto &detail : paperDetails) + const QList &paperDetails = details.at(i); + for (const auto &detail : paperDetails) { scene->addItem(detail); } diff --git a/src/libs/qmuparser/qmuparsercallback_p.h b/src/libs/qmuparser/qmuparsercallback_p.h index 9a86ee28b..9ea8aeba7 100644 --- a/src/libs/qmuparser/qmuparsercallback_p.h +++ b/src/libs/qmuparser/qmuparsercallback_p.h @@ -91,7 +91,7 @@ public: bool m_bAllowOpti; ///< Flag indication optimizeability private: - Q_DISABLE_ASSIGN(QmuParserCallbackData) + Q_DISABLE_ASSIGN_MOVE(QmuParserCallbackData) // NOLINT }; QT_WARNING_POP diff --git a/src/libs/vdxf/vdxfengine.cpp b/src/libs/vdxf/vdxfengine.cpp index bafaef9cd..3ab383328 100644 --- a/src/libs/vdxf/vdxfengine.cpp +++ b/src/libs/vdxf/vdxfengine.cpp @@ -28,6 +28,7 @@ #include "vdxfengine.h" +#include #include #include #include diff --git a/src/libs/vgeometry/vabstractarc_p.h b/src/libs/vgeometry/vabstractarc_p.h index ca4d23c0d..632af9e77 100644 --- a/src/libs/vgeometry/vabstractarc_p.h +++ b/src/libs/vgeometry/vabstractarc_p.h @@ -70,7 +70,7 @@ public: QString formulaLength; private: - Q_DISABLE_ASSIGN(VAbstractArcData) + Q_DISABLE_ASSIGN_MOVE(VAbstractArcData) // NOLINT }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vgeometry/vabstractcurve.h b/src/libs/vgeometry/vabstractcurve.h index 71cd2365c..594b60424 100644 --- a/src/libs/vgeometry/vabstractcurve.h +++ b/src/libs/vgeometry/vabstractcurve.h @@ -39,6 +39,7 @@ #include "vgeometrydef.h" #include "vgobject.h" +#include "../vmisc/typedef.h" using DirectionArrow = QPair; diff --git a/src/libs/vgeometry/vabstractcurve_p.h b/src/libs/vgeometry/vabstractcurve_p.h index 60fbb1f4d..149374f32 100644 --- a/src/libs/vgeometry/vabstractcurve_p.h +++ b/src/libs/vgeometry/vabstractcurve_p.h @@ -70,7 +70,7 @@ public: qreal approximationScale; private: - Q_DISABLE_ASSIGN(VAbstractCurveData) + Q_DISABLE_ASSIGN_MOVE(VAbstractCurveData) // NOLINT }; VAbstractCurveData::~VAbstractCurveData() diff --git a/src/libs/vgeometry/varc_p.h b/src/libs/vgeometry/varc_p.h index 1f8a21822..17d2ef465 100644 --- a/src/libs/vgeometry/varc_p.h +++ b/src/libs/vgeometry/varc_p.h @@ -56,7 +56,7 @@ public: QString formulaRadius; private: - Q_DISABLE_ASSIGN(VArcData) + Q_DISABLE_ASSIGN_MOVE(VArcData) // NOLINT }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vgeometry/vcubicbezier_p.h b/src/libs/vgeometry/vcubicbezier_p.h index f8c6340b9..ed33b8e97 100644 --- a/src/libs/vgeometry/vcubicbezier_p.h +++ b/src/libs/vgeometry/vcubicbezier_p.h @@ -62,7 +62,7 @@ public: VPointF p4; private: - Q_DISABLE_ASSIGN(VCubicBezierData) + Q_DISABLE_ASSIGN_MOVE(VCubicBezierData) // NOLINT }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vgeometry/vcubicbezierpath_p.h b/src/libs/vgeometry/vcubicbezierpath_p.h index e7ca77a69..88ae1be7e 100644 --- a/src/libs/vgeometry/vcubicbezierpath_p.h +++ b/src/libs/vgeometry/vcubicbezierpath_p.h @@ -59,7 +59,7 @@ public: QVector path; private: - Q_DISABLE_ASSIGN(VCubicBezierPathData) + Q_DISABLE_ASSIGN_MOVE(VCubicBezierPathData) // NOLINT }; VCubicBezierPathData::~VCubicBezierPathData() diff --git a/src/libs/vgeometry/vellipticalarc_p.h b/src/libs/vgeometry/vellipticalarc_p.h index 8ff56ace9..9d0ddca18 100644 --- a/src/libs/vgeometry/vellipticalarc_p.h +++ b/src/libs/vgeometry/vellipticalarc_p.h @@ -2,9 +2,11 @@ #define VELLIPTICALARC_P #include +#include #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include "../vmisc/diagnostic.h" #endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) +#include "../vmisc/defglobal.h" QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") @@ -36,7 +38,7 @@ public: QTransform m_transform; private: - Q_DISABLE_ASSIGN(VEllipticalArcData) + Q_DISABLE_ASSIGN_MOVE(VEllipticalArcData) // NOLINT }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vgeometry/vgeometrydef.h b/src/libs/vgeometry/vgeometrydef.h index 2f7832d32..afd4dc05e 100644 --- a/src/libs/vgeometry/vgeometrydef.h +++ b/src/libs/vgeometry/vgeometrydef.h @@ -33,7 +33,7 @@ #include #include -#include "../ifc/ifcdef.h" +#include "../vmisc/def.h" enum class GOType : qint8 { @@ -71,25 +71,25 @@ struct VLayoutPassmark QLineF baseLine{}; bool isBuiltIn{false}; - friend QDataStream& operator<<(QDataStream& dataStream, const VLayoutPassmark& data); - friend QDataStream& operator>>(QDataStream& dataStream, VLayoutPassmark& data); + friend auto operator<<(QDataStream& dataStream, const VLayoutPassmark& data) -> QDataStream&; + friend auto operator>>(QDataStream& dataStream, VLayoutPassmark& data) -> QDataStream&; private: static const quint32 streamHeader; static const quint16 classVersion; }; -Q_DECLARE_METATYPE(VLayoutPassmark) +Q_DECLARE_METATYPE(VLayoutPassmark) // NOLINT constexpr qreal accuracyPointOnLine = MmToPixel(0.1555); -Q_REQUIRED_RESULT static inline bool VFuzzyComparePoints(const QPointF &p1, const QPointF &p2, - qreal accuracy = accuracyPointOnLine); -static inline bool VFuzzyComparePoints(const QPointF &p1, const QPointF &p2, qreal accuracy) +Q_REQUIRED_RESULT static inline auto VFuzzyComparePoints(const QPointF &p1, const QPointF &p2, + qreal accuracy = accuracyPointOnLine) -> bool; +static inline auto VFuzzyComparePoints(const QPointF &p1, const QPointF &p2, qreal accuracy) -> bool { return QLineF(p1, p2).length() <= accuracy; } -Q_REQUIRED_RESULT static inline bool VFuzzyOnAxis(qreal v1, qreal v2, qreal accuracy = accuracyPointOnLine); -static inline bool VFuzzyOnAxis(qreal v1, qreal v2, qreal accuracy) +Q_REQUIRED_RESULT static inline auto VFuzzyOnAxis(qreal v1, qreal v2, qreal accuracy = accuracyPointOnLine) -> bool; +static inline auto VFuzzyOnAxis(qreal v1, qreal v2, qreal accuracy) -> bool { return qAbs(v1 - v2) <= accuracy; } diff --git a/src/libs/vgeometry/vgobject.cpp b/src/libs/vgeometry/vgobject.cpp index 38679617e..b45dc7834 100644 --- a/src/libs/vgeometry/vgobject.cpp +++ b/src/libs/vgeometry/vgobject.cpp @@ -37,9 +37,7 @@ #include #include "../vmisc/def.h" -#include "../vmisc/vmath.h" #include "../vmisc/compatibility.h" -#include "../ifc/ifcdef.h" #include "vgobject_p.h" #include "../vmisc/vabstractapplication.h" @@ -51,7 +49,7 @@ namespace * This is actually the same as the area of the triangle defined by the three points, multiplied by 2. * @return 2 * triangleArea(a,b,c) */ -double PerpDotProduct(const QPointF &p1, const QPointF &p2, const QPointF &t) +auto PerpDotProduct(const QPointF &p1, const QPointF &p2, const QPointF &t) -> double { return (p1.x() - t.x()) * (p2.y() - t.y()) - (p1.y() - t.y()) * (p2.x() - t.x()); } @@ -66,7 +64,7 @@ double PerpDotProduct(const QPointF &p1, const QPointF &p2, const QPointF &t) * line e1=(p1, p2), e.g. the minimal area calucalted with PerpDotProduc() if point still not on the line. This distance * is controled by variable accuracyPointOnLine */ -double GetEpsilon(const QPointF &t, QPointF p1, QPointF p2, qreal accuracy) +auto GetEpsilon(const QPointF &t, QPointF p1, QPointF p2, qreal accuracy) -> double { QLineF edge1(p1, p2); QLineF edge2(p1, t); @@ -83,7 +81,7 @@ double GetEpsilon(const QPointF &t, QPointF p1, QPointF p2, qreal accuracy) return qAbs(PerpDotProduct(p1, p2, line.p2())); } -} +} // namespace //--------------------------------------------------------------------------------------------------------------------- /** @@ -109,7 +107,7 @@ VGObject::VGObject(const GOType &type, const quint32 &idObject, const Draw &mode * @brief VGObject copy constructor. * @param obj object. */ -VGObject::VGObject(const VGObject &obj) +VGObject::VGObject(const VGObject &obj) // NOLINT(modernize-use-equals-default) :d (obj.d) {} @@ -119,7 +117,7 @@ VGObject::VGObject(const VGObject &obj) * @param obj object * @return object */ -VGObject &VGObject::operator=(const VGObject &obj) +auto VGObject::operator=(const VGObject &obj) -> VGObject & { if ( &obj == this ) { @@ -136,7 +134,7 @@ VGObject::VGObject(VGObject &&obj) Q_DECL_NOTHROW {} //--------------------------------------------------------------------------------------------------------------------- -VGObject &VGObject::operator=(VGObject &&obj) Q_DECL_NOTHROW +auto VGObject::operator=(VGObject &&obj) Q_DECL_NOTHROW -> VGObject & { std::swap(d, obj.d); return *this; @@ -144,7 +142,7 @@ VGObject &VGObject::operator=(VGObject &&obj) Q_DECL_NOTHROW #endif //--------------------------------------------------------------------------------------------------------------------- -VGObject::~VGObject() +VGObject::~VGObject() // NOLINT(modernize-use-equals-default) {} //--------------------------------------------------------------------------------------------------------------------- @@ -152,7 +150,7 @@ VGObject::~VGObject() * @brief getIdObject return parent id. * @return parent id or 0 if object don't have parent. */ -quint32 VGObject::getIdObject() const +auto VGObject::getIdObject() const -> quint32 { return d->idObject; } @@ -172,7 +170,7 @@ void VGObject::setIdObject(const quint32 &value) * @brief name return name graphical object. * @return name */ -QString VGObject::name() const +auto VGObject::name() const -> QString { return d->_name; } @@ -192,7 +190,7 @@ void VGObject::setName(const QString &name) * @brief getMode return mode creation. * @return mode. */ -Draw VGObject::getMode() const +auto VGObject::getMode() const -> Draw { return d->mode; } @@ -212,7 +210,7 @@ void VGObject::setMode(const Draw &value) * @brief getType return object type. * @return type. */ -GOType VGObject::getType() const +auto VGObject::getType() const -> GOType { return d->type; } @@ -229,7 +227,7 @@ void VGObject::setType(const GOType &type) * @brief id return id object. * @return id */ -quint32 VGObject::id() const +auto VGObject::id() const -> quint32 { return d->_id; } @@ -251,7 +249,7 @@ void VGObject::SetAlias(const QString &alias) } //--------------------------------------------------------------------------------------------------------------------- -QString VGObject::GetAlias() const +auto VGObject::GetAlias() const -> QString { return d->m_alias; } @@ -263,21 +261,21 @@ void VGObject::SetAliasSuffix(const QString &aliasSuffix) } //--------------------------------------------------------------------------------------------------------------------- -QString VGObject::GetAliasSuffix() const +auto VGObject::GetAliasSuffix() const -> QString { return d->m_aliasSuffix; } //--------------------------------------------------------------------------------------------------------------------- -QString VGObject::ObjectName() const +auto VGObject::ObjectName() const -> QString { const QString alias = VAbstractApplication::VApp()->TrVars()->VarToUser(d->m_alias); const QString name = VAbstractApplication::VApp()->TrVars()->VarToUser(d->_name); - return not d->m_alias.isEmpty() ? QString("%1 (%2)").arg(alias, name) : name; + return not d->m_alias.isEmpty() ? QStringLiteral("%1 (%2)").arg(alias, name) : name; } //--------------------------------------------------------------------------------------------------------------------- -quint32 VGObject::getIdTool() const +auto VGObject::getIdTool() const -> quint32 { if (d->mode == Draw::Calculation) { @@ -285,19 +283,14 @@ quint32 VGObject::getIdTool() const { return d->idObject; } - else - { - return d->_id; - } - } - else - { return d->_id; } + + return d->_id; } //--------------------------------------------------------------------------------------------------------------------- -QJsonObject VGObject::ToJson() const +auto VGObject::ToJson() const -> QJsonObject { QJsonObject object { @@ -309,7 +302,7 @@ QJsonObject VGObject::ToJson() const } //--------------------------------------------------------------------------------------------------------------------- -QLineF VGObject::BuildLine(const QPointF &p1, const qreal &length, const qreal &angle) +auto VGObject::BuildLine(const QPointF &p1, const qreal &length, const qreal &angle) -> QLineF { QLineF line = QLineF(); line.setP1(p1); @@ -319,14 +312,15 @@ QLineF VGObject::BuildLine(const QPointF &p1, const qreal &length, const qreal & } //--------------------------------------------------------------------------------------------------------------------- -QPointF VGObject::BuildRay(const QPointF &firstPoint, const qreal &angle, const QRectF &scRect) +auto VGObject::BuildRay(const QPointF &firstPoint, const qreal &angle, const QRectF &scRect) -> QPointF { QRectF rect = scRect; - if (rect.isValid() == false) + if (not rect.isValid()) { rect = QRectF(0, 0, 1200, 700); } - if (rect.contains(firstPoint) == false) + + if (not rect.contains(firstPoint)) { // If point outside of scene rect create one around point and unite two rects. QRectF rectangle(firstPoint.x()-rect.width()/2, firstPoint.y()-rect.height()/2, rect.width(), rect.height()); @@ -339,22 +333,21 @@ QPointF VGObject::BuildRay(const QPointF &firstPoint, const qreal &angle, const } //--------------------------------------------------------------------------------------------------------------------- -QLineF VGObject::BuildAxis(const QPointF &p, const qreal &angle, const QRectF &scRect) +auto VGObject::BuildAxis(const QPointF &p, const qreal &angle, const QRectF &scRect) -> QLineF { const QPointF endP1 = BuildRay(p, angle+180, scRect); const QPointF endP2 = BuildRay(p, angle, scRect); - return QLineF(endP1, endP2); + return {endP1, endP2}; } //--------------------------------------------------------------------------------------------------------------------- -QLineF VGObject::BuildAxis(const QPointF &p1, const QPointF &p2, const QRectF &scRect) +auto VGObject::BuildAxis(const QPointF &p1, const QPointF &p2, const QRectF &scRect) -> QLineF { - QLineF line(p1, p2); - return BuildAxis(p1, line.angle(), scRect); + return BuildAxis(p1, QLineF(p1, p2).angle(), scRect); } //--------------------------------------------------------------------------------------------------------------------- -int VGObject::ContactPoints(const QPointF &p, const QPointF ¢er, qreal radius, QPointF &p1, QPointF &p2) +auto VGObject::ContactPoints(const QPointF &p, const QPointF ¢er, qreal radius, QPointF &p1, QPointF &p2) -> int { const int flag = PointInCircle(p, center, radius); @@ -381,7 +374,7 @@ int VGObject::ContactPoints(const QPointF &p, const QPointF ¢er, qreal radiu * @param line line. * @return point intersection. */ -QPointF VGObject::LineIntersectRect(const QRectF &rec, const QLineF &line) +auto VGObject::LineIntersectRect(const QRectF &rec, const QLineF &line) -> QPointF { qreal x1, y1, x2, y2; rec.getCoords(&x1, &y1, &x2, &y2); @@ -417,7 +410,7 @@ QPointF VGObject::LineIntersectRect(const QRectF &rec, const QLineF &line) } //--------------------------------------------------------------------------------------------------------------------- -int VGObject::IntersectionCircles(const QPointF &c1, double r1, const QPointF &c2, double r2, QPointF &p1, QPointF &p2) +auto VGObject::IntersectionCircles(const QPointF &c1, double r1, const QPointF &c2, double r2, QPointF &p1, QPointF &p2) -> int { if (VFuzzyComparePossibleNulls(c1.x(), c2.x()) && VFuzzyComparePossibleNulls(c1.y(), c2.y()) && VFuzzyComparePossibleNulls(r1, r2)) @@ -435,25 +428,24 @@ int VGObject::IntersectionCircles(const QPointF &c1, double r1, const QPointF &c { return 0; } - else if (VFuzzyComparePossibleNulls(c*c, r1*r1*(a*a+b*b))) + + if (VFuzzyComparePossibleNulls(c*c, r1*r1*(a*a+b*b))) { p1 = QPointF(x0 + c1.x(), y0 + c1.y()); return 1; } - else - { - const double d = r1*r1 - c*c/(a*a+b*b); - const double mult = sqrt (d / (a*a+b*b)); - const double ax = x0 + b * mult; - const double bx = x0 - b * mult; - const double ay = y0 - a * mult; - const double by = y0 + a * mult; + const double d = r1*r1 - c*c/(a*a+b*b); + const double mult = sqrt (d / (a*a+b*b)); - p1 = QPointF(ax + c1.x(), ay + c1.y()); - p2 = QPointF(bx + c1.x(), by + c1.y()); - return 2; - } + const double ax = x0 + b * mult; + const double bx = x0 - b * mult; + const double ay = y0 - a * mult; + const double by = y0 + a * mult; + + p1 = QPointF(ax + c1.x(), ay + c1.y()); + p2 = QPointF(bx + c1.x(), by + c1.y()); + return 2; } //--------------------------------------------------------------------------------------------------------------------- @@ -466,7 +458,8 @@ int VGObject::IntersectionCircles(const QPointF &c1, double r1, const QPointF &c * @param p2 second intersection point. * @return 0 - intersection doesn't exist, 1 - one intersection point, 2 - two intersection points. */ -qint32 VGObject::LineIntersectCircle(const QPointF ¢er, qreal radius, const QLineF &line, QPointF &p1, QPointF &p2) +auto VGObject::LineIntersectCircle(const QPointF ¢er, qreal radius, const QLineF &line, QPointF &p1, + QPointF &p2) -> qint32 { // Fix for issue #485. https://bitbucket.org/dismine/valentina/issues/485/error-when-drawing-a-curved-path if (qFuzzyIsNull(line.length())) @@ -512,7 +505,7 @@ qint32 VGObject::LineIntersectCircle(const QPointF ¢er, qreal radius, const * @param line line. * @return point on line or extended line if origin size too small. */ -QPointF VGObject::ClosestPoint(const QLineF &line, const QPointF &point) +auto VGObject::ClosestPoint(const QLineF &line, const QPointF &point) -> QPointF { qreal a = 0, b = 0, c = 0; LineCoefficients(line, &a, &b, &c); @@ -526,16 +519,14 @@ QPointF VGObject::ClosestPoint(const QLineF &line, const QPointF &point) { return p; } - else - { - return point; - } + + return point; } //--------------------------------------------------------------------------------------------------------------------- -QPointF VGObject::addVector(const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k) +auto VGObject::addVector(const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k) -> QPointF { - return QPointF (p.x() + (p2.x() - p1.x()) * k, p.y() + (p2.y() - p1.y()) * k); + return {p.x() + (p2.x() - p1.x()) * k, p.y() + (p2.y() - p1.y()) * k}; } //--------------------------------------------------------------------------------------------------------------------- @@ -617,7 +608,7 @@ auto VGObject::IsPointOnLineSegment(const QPointF &t, const QPointF &p1, const Q } //--------------------------------------------------------------------------------------------------------------------- -bool VGObject::IsLineSegmentOnLineSegment(const QLineF &seg1, const QLineF &seg2, qreal accuracy) +auto VGObject::IsLineSegmentOnLineSegment(const QLineF &seg1, const QLineF &seg2, qreal accuracy) -> bool { const bool onLine = IsPointOnLineviaPDP(seg1.p1(), seg2.p1(), seg2.p2(), accuracy) && IsPointOnLineviaPDP(seg1.p2(), seg2.p1(), seg2.p2(), accuracy); @@ -628,23 +619,19 @@ bool VGObject::IsLineSegmentOnLineSegment(const QLineF &seg1, const QLineF &seg2 IsPointOnLineSegment(seg2.p1(), seg1.p1(), seg1.p2(), accuracy) || IsPointOnLineSegment(seg2.p2(), seg1.p1(), seg1.p2(), accuracy); } - else - { - return onLine; - } + + return onLine; } //--------------------------------------------------------------------------------------------------------------------- -QPointF VGObject::CorrectDistortion(const QPointF &t, const QPointF &p1, const QPointF &p2) +auto VGObject::CorrectDistortion(const QPointF &t, const QPointF &p1, const QPointF &p2) -> QPointF { if (not VFuzzyComparePoints(p1, p2)) { return VGObject::ClosestPoint(QLineF(p1, p2), t); } - else - { - return t; - } + + return t; } //--------------------------------------------------------------------------------------------------------------------- @@ -654,7 +641,7 @@ QPointF VGObject::CorrectDistortion(const QPointF &t, const QPointF &p1, const Q * The pdp is zero only if the t lies on the line e1 = vector from p1 to p2. * @return true if point is on line */ -bool VGObject::IsPointOnLineviaPDP(const QPointF &t, const QPointF &p1, const QPointF &p2, qreal accuracy) +auto VGObject::IsPointOnLineviaPDP(const QPointF &t, const QPointF &p1, const QPointF &p2, qreal accuracy) -> bool { const double p = qAbs(PerpDotProduct(p1, p2, t)); const double e = GetEpsilon(t, p1, p2, accuracy); @@ -664,17 +651,19 @@ bool VGObject::IsPointOnLineviaPDP(const QPointF &t, const QPointF &p1, const QP } //--------------------------------------------------------------------------------------------------------------------- -int VGObject::PointInCircle(const QPointF &p, const QPointF ¢er, qreal radius) +auto VGObject::PointInCircle(const QPointF &p, const QPointF ¢er, qreal radius) -> int { const double d = QLineF (p, center).length(); if (VFuzzyComparePossibleNulls(radius, d)) { return 1; // on circle } + if (radius > d) { return 0; // outside circle } + return 2; // inside circle } @@ -686,7 +675,7 @@ int VGObject::PointInCircle(const QPointF &p, const QPointF ¢er, qreal radiu * @return length length of contour. */ // cppcheck-suppress unusedFunction -int VGObject::GetLengthContour(const QVector &contour, const QVector &newPoints) +auto VGObject::GetLengthContour(const QVector &contour, const QVector &newPoints) -> int { qreal length = 0; QVector points; @@ -700,7 +689,7 @@ int VGObject::GetLengthContour(const QVector &contour, const QVector QTransform { QTransform matrix; diff --git a/src/libs/vgeometry/vgobject.h b/src/libs/vgeometry/vgobject.h index bba4d64f7..b0afe9cd6 100644 --- a/src/libs/vgeometry/vgobject.h +++ b/src/libs/vgeometry/vgobject.h @@ -29,6 +29,7 @@ #ifndef VGOBJECT_H #define VGOBJECT_H +#include #include #include #include @@ -61,71 +62,95 @@ public: virtual ~VGObject(); - VGObject& operator= (const VGObject &obj); + auto operator= (const VGObject &obj) -> VGObject&; #ifdef Q_COMPILER_RVALUE_REFS VGObject(VGObject &&obj) Q_DECL_NOTHROW; - VGObject &operator=(VGObject &&obj) Q_DECL_NOTHROW; + auto operator=(VGObject &&obj) Q_DECL_NOTHROW -> VGObject &; #endif - quint32 getIdObject() const; - void setIdObject(const quint32 &value); + auto getIdObject() const -> quint32; + void setIdObject(const quint32 &value); - virtual QString name() const; - void setName(const QString &name); + virtual auto name() const -> QString; + void setName(const QString &name); - Draw getMode() const; - void setMode(const Draw &value); + auto getMode() const -> Draw; + void setMode(const Draw &value); - GOType getType() const; - void setType(const GOType &type); + auto getType() const -> GOType; + void setType(const GOType &type); - quint32 id() const; - virtual void setId(const quint32 &id); + auto id() const -> quint32; + virtual void setId(const quint32 &id); - virtual void SetAlias(const QString &alias); - QString GetAlias() const; + virtual void SetAlias(const QString &alias); + auto GetAlias() const -> QString; - virtual void SetAliasSuffix(const QString &aliasSuffix); - QString GetAliasSuffix() const; + virtual void SetAliasSuffix(const QString &aliasSuffix); + auto GetAliasSuffix() const -> QString; - QString ObjectName() const; + auto ObjectName() const -> QString; - quint32 getIdTool() const; + auto getIdTool() const -> quint32; - virtual QJsonObject ToJson() const; + virtual auto ToJson() const -> QJsonObject; - static QLineF BuildLine(const QPointF &p1, const qreal& length, const qreal &angle); - static QPointF BuildRay(const QPointF &firstPoint, const qreal &angle, const QRectF &scRect); - static QLineF BuildAxis(const QPointF &p, const qreal &angle, const QRectF &scRect); - static QLineF BuildAxis(const QPointF &p1, const QPointF &p2, const QRectF &scRect); + static auto BuildLine(const QPointF &p1, const qreal& length, const qreal &angle) -> QLineF; + static auto BuildRay(const QPointF &firstPoint, const qreal &angle, const QRectF &scRect) -> QPointF; + static auto BuildAxis(const QPointF &p, const qreal &angle, const QRectF &scRect) -> QLineF; + static auto BuildAxis(const QPointF &p1, const QPointF &p2, const QRectF &scRect) -> QLineF; + + static auto ContactPoints (const QPointF &p, const QPointF ¢er, qreal radius, QPointF &p1, QPointF &p2) -> int; + static auto LineIntersectRect(const QRectF &rec, const QLineF &line) -> QPointF; + static auto IntersectionCircles(const QPointF &c1, double r1, const QPointF &c2, double r2, QPointF &p1, + QPointF &p2) -> int; + static auto LineIntersectCircle(const QPointF ¢er, qreal radius, const QLineF &line, QPointF &p1, + QPointF &p2) -> qint32; + static auto ClosestPoint(const QLineF &line, const QPointF &point) -> QPointF; + static auto addVector (const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k) -> QPointF; + static void LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c); + static auto IsPointOnLineSegment (const QPointF &t, const QPointF &p1, const QPointF &p2, + qreal accuracy = accuracyPointOnLine) -> bool; + static auto IsLineSegmentOnLineSegment (const QLineF &seg1, const QLineF &seg2, + qreal accuracy = accuracyPointOnLine) -> bool; + static auto CorrectDistortion(const QPointF &t, const QPointF &p1, const QPointF &p2) -> QPointF; + static auto IsPointOnLineviaPDP(const QPointF &t, const QPointF &p1, const QPointF &p2, + qreal accuracy = accuracyPointOnLine) -> bool; + static auto GetLengthContour(const QVector &contour, const QVector &newPoints) -> int; + + template + static auto PainterPath(const QVector &points) -> QPainterPath; - static int ContactPoints (const QPointF &p, const QPointF ¢er, qreal radius, QPointF &p1, QPointF &p2); - static QPointF LineIntersectRect(const QRectF &rec, const QLineF &line); - static int IntersectionCircles(const QPointF &c1, double r1, const QPointF &c2, double r2, QPointF &p1, - QPointF &p2); - static qint32 LineIntersectCircle(const QPointF ¢er, qreal radius, const QLineF &line, QPointF &p1, - QPointF &p2); - static QPointF ClosestPoint(const QLineF &line, const QPointF &point); - static QPointF addVector (const QPointF &p, const QPointF &p1, const QPointF &p2, qreal k); - static void LineCoefficients(const QLineF &line, qreal *a, qreal *b, qreal *c); - static bool IsPointOnLineSegment (const QPointF &t, const QPointF &p1, const QPointF &p2, - qreal accuracy = accuracyPointOnLine); - static bool IsLineSegmentOnLineSegment (const QLineF &seg1, const QLineF &seg2, - qreal accuracy = accuracyPointOnLine); - static QPointF CorrectDistortion(const QPointF &t, const QPointF &p1, const QPointF &p2); - static bool IsPointOnLineviaPDP(const QPointF &t, const QPointF &p1, const QPointF &p2, - qreal accuracy = accuracyPointOnLine); - static int GetLengthContour(const QVector &contour, const QVector &newPoints); protected: - static QTransform FlippingMatrix(const QLineF &axis); + static auto FlippingMatrix(const QLineF &axis) -> QTransform; private: QSharedDataPointer d; - static int PointInCircle (const QPointF &p, const QPointF ¢er, qreal radius); + static auto PointInCircle (const QPointF &p, const QPointF ¢er, qreal radius) -> int; }; QT_WARNING_POP Q_DECLARE_TYPEINFO(VGObject, Q_MOVABLE_TYPE); // NOLINT +//--------------------------------------------------------------------------------------------------------------------- +template +inline auto VGObject::PainterPath(const QVector &points) -> QPainterPath +{ + QPainterPath path; + path.setFillRule(Qt::WindingFill); + + if (not points.isEmpty()) + { + path.moveTo(points.at(0)); + for (qint32 i = 1; i < points.count(); ++i) + { + path.lineTo(points.at(i)); + } + path.lineTo(points.at(0)); + } + + return path; +} + #endif // VGOBJECT_H diff --git a/src/libs/vgeometry/vgobject_p.h b/src/libs/vgeometry/vgobject_p.h index 53cf22e0b..7f0a66e28 100644 --- a/src/libs/vgeometry/vgobject_p.h +++ b/src/libs/vgeometry/vgobject_p.h @@ -35,6 +35,8 @@ #include "../vmisc/diagnostic.h" #endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) +#include "../vmisc/typedef.h" + QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor") @@ -42,53 +44,38 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor") class VGObjectData final : public QSharedData { public: - VGObjectData() - {} - + VGObjectData() = default; VGObjectData(const GOType &type, const quint32 &idObject, const Draw &mode) :type(type), idObject(idObject), mode(mode) {} - VGObjectData(const VGObjectData &obj) - :QSharedData(obj), - _id(obj._id), - type(obj.type), - idObject(obj.idObject), - _name(obj._name), - mode(obj.mode), - m_alias(obj.m_alias), - m_aliasSuffix(obj.m_aliasSuffix) - {} - - virtual ~VGObjectData(); + VGObjectData(const VGObjectData &obj) = default; + virtual ~VGObjectData() = default; /** @brief _id id in container. Ned for arcs, spline and spline paths. */ - quint32 _id{NULL_ID}; + quint32 _id{NULL_ID}; // NOLINT(misc-non-private-member-variables-in-classes) /** @brief type type of graphical object */ - GOType type{GOType::Unknown}; + GOType type{GOType::Unknown}; // NOLINT(misc-non-private-member-variables-in-classes) /** @brief idObject id of parent object. */ - quint32 idObject{NULL_ID}; + quint32 idObject{NULL_ID}; // NOLINT(misc-non-private-member-variables-in-classes) /** @brief _name object name */ - QString _name{}; + QString _name{}; // NOLINT(misc-non-private-member-variables-in-classes) /** @brief mode object created in calculation or drawing mode */ - Draw mode{Draw::Calculation}; + Draw mode{Draw::Calculation}; // NOLINT(misc-non-private-member-variables-in-classes) - QString m_alias{}; - QString m_aliasSuffix{}; + QString m_alias{}; // NOLINT(misc-non-private-member-variables-in-classes) + QString m_aliasSuffix{}; // NOLINT(misc-non-private-member-variables-in-classes) private: - Q_DISABLE_ASSIGN(VGObjectData) + Q_DISABLE_ASSIGN_MOVE(VGObjectData) // NOLINT }; -VGObjectData::~VGObjectData() -{} - QT_WARNING_POP #endif // VGOBJECT_P_H diff --git a/src/libs/vgeometry/vplacelabelitem_p.h b/src/libs/vgeometry/vplacelabelitem_p.h index b09d5c53b..15ea2da48 100644 --- a/src/libs/vgeometry/vplacelabelitem_p.h +++ b/src/libs/vgeometry/vplacelabelitem_p.h @@ -75,7 +75,7 @@ public: qreal isVisible{1}; private: - Q_DISABLE_ASSIGN(VPlaceLabelItemData) + Q_DISABLE_ASSIGN_MOVE(VPlaceLabelItemData) // NOLINT }; VPlaceLabelItemData::~VPlaceLabelItemData() diff --git a/src/libs/vgeometry/vpointf_p.h b/src/libs/vgeometry/vpointf_p.h index 5aff8fd63..645396158 100644 --- a/src/libs/vgeometry/vpointf_p.h +++ b/src/libs/vgeometry/vpointf_p.h @@ -34,6 +34,7 @@ #include "../vmisc/diagnostic.h" #endif // QT_VERSION < QT_VERSION_CHECK(5, 5, 0) #include +#include "../vmisc/defglobal.h" QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") @@ -81,7 +82,7 @@ public: bool m_showLabel; private: - Q_DISABLE_ASSIGN(VPointFData) + Q_DISABLE_ASSIGN_MOVE(VPointFData) // NOLINT }; VPointFData::~VPointFData() diff --git a/src/libs/vgeometry/vspline_p.h b/src/libs/vgeometry/vspline_p.h index 633d72643..614a9626e 100644 --- a/src/libs/vgeometry/vspline_p.h +++ b/src/libs/vgeometry/vspline_p.h @@ -86,7 +86,7 @@ public: qreal kCurve; private: - Q_DISABLE_ASSIGN(VSplineData) + Q_DISABLE_ASSIGN_MOVE(VSplineData) // NOLINT }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vgeometry/vsplinepath_p.h b/src/libs/vgeometry/vsplinepath_p.h index f6ffde66e..b3e5adc67 100644 --- a/src/libs/vgeometry/vsplinepath_p.h +++ b/src/libs/vgeometry/vsplinepath_p.h @@ -55,7 +55,7 @@ public: QVector path{}; private: - Q_DISABLE_ASSIGN(VSplinePathData) + Q_DISABLE_ASSIGN_MOVE(VSplinePathData) // NOLINT }; VSplinePathData::~VSplinePathData() diff --git a/src/libs/vgeometry/vsplinepoint_p.h b/src/libs/vgeometry/vsplinepoint_p.h index 0e14ec87c..fa21594d4 100644 --- a/src/libs/vgeometry/vsplinepoint_p.h +++ b/src/libs/vgeometry/vsplinepoint_p.h @@ -93,7 +93,7 @@ public: qreal kAsm2; private: - Q_DISABLE_ASSIGN(VFSplinePointData) + Q_DISABLE_ASSIGN_MOVE(VFSplinePointData) // NOLINT }; VFSplinePointData::~VFSplinePointData() @@ -164,7 +164,7 @@ public: QString length2F; private: - Q_DISABLE_ASSIGN(VSplinePointData) + Q_DISABLE_ASSIGN_MOVE(VSplinePointData) // NOLINT }; //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vlayout/vabstractpiece.h b/src/libs/vlayout/vabstractpiece.h index 2c3fc52fc..4661e799a 100644 --- a/src/libs/vlayout/vabstractpiece.h +++ b/src/libs/vlayout/vabstractpiece.h @@ -40,7 +40,6 @@ #include "../vgeometry/vgobject.h" #include "vsapoint.h" #include "vrawsapoint.h" -#include "../vmisc/testpath.h" class VAbstractPieceData; class QPainterPath; @@ -130,9 +129,6 @@ public: static auto GrainlinePoints(const VGrainlineData &geom, const VContainer *pattern, const QRectF &boundingRect, qreal &dAng) -> QVector; - template - static auto PainterPath(const QVector &points) -> QPainterPath; - friend auto operator<< (QDataStream& dataStream, const VAbstractPiece& piece) -> QDataStream&; friend auto operator>> (QDataStream& dataStream, VAbstractPiece& piece) -> QDataStream&; @@ -552,26 +548,6 @@ inline auto VAbstractPiece::IsInsidePolygon(const QVector &path, const QVecto { return allowancePolygon.containsPoint(point, Qt::WindingFill); }); } -//--------------------------------------------------------------------------------------------------------------------- -template -inline auto VAbstractPiece::PainterPath(const QVector &points) -> QPainterPath -{ - QPainterPath path; - path.setFillRule(Qt::WindingFill); - - if (not points.isEmpty()) - { - path.moveTo(points.at(0)); - for (qint32 i = 1; i < points.count(); ++i) - { - path.lineTo(points.at(i)); - } - path.lineTo(points.at(0)); - } - - return path; -} - //--------------------------------------------------------------------------------------------------------------------- /** * @brief CheckLoops seek and delete loops in equidistant. diff --git a/src/libs/vlayout/vbestsquare_p.h b/src/libs/vlayout/vbestsquare_p.h index f34710175..1ca2e07df 100644 --- a/src/libs/vlayout/vbestsquare_p.h +++ b/src/libs/vlayout/vbestsquare_p.h @@ -80,7 +80,7 @@ public: QString exceptionReason{}; private: - Q_DISABLE_ASSIGN(VBestSquareData) + Q_DISABLE_ASSIGN_MOVE(VBestSquareData) // NOLINT }; QT_WARNING_POP diff --git a/src/libs/vlayout/vcontour_p.h b/src/libs/vlayout/vcontour_p.h index 2f068cab4..f2d7cd689 100644 --- a/src/libs/vlayout/vcontour_p.h +++ b/src/libs/vlayout/vcontour_p.h @@ -84,7 +84,7 @@ public: vsizetype m_emptySheetEdgesCount{0}; private: - Q_DISABLE_ASSIGN(VContourData) + Q_DISABLE_ASSIGN_MOVE(VContourData) // NOLINT }; // cppcheck-suppress unknownMacro diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp index 557cd6620..9b9b7e314 100644 --- a/src/libs/vlayout/vlayoutgenerator.cpp +++ b/src/libs/vlayout/vlayoutgenerator.cpp @@ -306,7 +306,8 @@ vsizetype VLayoutGenerator::PapersCount() const QList VLayoutGenerator::GetPapersItems() const { QList list; - for (auto &paper : papers) + list.reserve(papers.count()); + for (const auto &paper : papers) { list.append(paper.GetPaperItem(autoCropLength, autoCropWidth, IsTestAsPaths())); } @@ -317,7 +318,8 @@ QList VLayoutGenerator::GetPapersItems() const QList VLayoutGenerator::GetGlobalContours() const { QList list; - for (auto &paper : papers) + list.reserve(papers.count()); + for (const auto &paper : papers) { list.append(paper.GetGlobalContour()); } @@ -328,7 +330,8 @@ QList VLayoutGenerator::GetGlobalContours() const QList > VLayoutGenerator::GetAllDetailsItems() const { QList > list; - for (auto &paper : papers) + list.reserve(papers.count()); + for (const auto &paper : papers) { list.append(paper.GetItemDetails(IsTestAsPaths())); } @@ -339,7 +342,8 @@ QList > VLayoutGenerator::GetAllDetailsItems() const QVector > VLayoutGenerator::GetAllDetails() const { QVector > list; - for (auto &paper : papers) + list.reserve(papers.count()); + for (const auto &paper : papers) { list.append(paper.GetDetails()); } diff --git a/src/libs/vlayout/vlayoutpaper.cpp b/src/libs/vlayout/vlayoutpaper.cpp index b153cac44..b2b829a71 100644 --- a/src/libs/vlayout/vlayoutpaper.cpp +++ b/src/libs/vlayout/vlayoutpaper.cpp @@ -305,7 +305,7 @@ bool VLayoutPaper::SaveResult(const VBestSquare &bestResult, const VLayoutPiece VCachedPositions positionChache; QVector layoutPoints = workDetail.GetMappedLayoutAllowancePoints(); positionChache.boundingRect = VLayoutPiece::BoundingRect(layoutPoints); - positionChache.layoutAllowancePath = VAbstractPiece::PainterPath(layoutPoints); + positionChache.layoutAllowancePath = VGObject::PainterPath(layoutPoints); d->positionsCache.append(positionChache); #ifdef LAYOUT_DEBUG @@ -422,6 +422,7 @@ QGraphicsPathItem *VLayoutPaper::GetGlobalContour() const QList VLayoutPaper::GetItemDetails(bool textAsPaths) const { QList list; + list.reserve(d->details.count()); for (auto &detail : d->details) { list.append(detail.GetItem(textAsPaths)); diff --git a/src/libs/vlayout/vlayoutpaper_p.h b/src/libs/vlayout/vlayoutpaper_p.h index 353aaf593..e1fc0f3e9 100644 --- a/src/libs/vlayout/vlayoutpaper_p.h +++ b/src/libs/vlayout/vlayoutpaper_p.h @@ -88,7 +88,7 @@ public: bool originPaperOrientation{true}; private: - Q_DISABLE_ASSIGN(VLayoutPaperData) + Q_DISABLE_ASSIGN_MOVE(VLayoutPaperData) // NOLINT }; QT_WARNING_POP diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index 3e673b36d..9de02d710 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -1377,7 +1377,7 @@ auto VLayoutPiece::ContourPath() const -> QPainterPath // contour if (not IsHideMainPath() || not IsSeamAllowance() || IsSeamAllowanceBuiltIn()) { - path = PainterPath(GetContourPoints()); + path = VGObject::PainterPath(GetContourPoints()); } // seam allowance @@ -1425,7 +1425,7 @@ auto VLayoutPiece::ContourPath() const -> QPainterPath //--------------------------------------------------------------------------------------------------------------------- auto VLayoutPiece::MappedLayoutAllowancePath() const -> QPainterPath { - return PainterPath(GetMappedLayoutAllowancePoints()); + return VGObject::PainterPath(GetMappedLayoutAllowancePoints()); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vlayout/vlayoutpiecepath_p.h b/src/libs/vlayout/vlayoutpiecepath_p.h index a0181d69f..07ee45111 100644 --- a/src/libs/vlayout/vlayoutpiecepath_p.h +++ b/src/libs/vlayout/vlayoutpiecepath_p.h @@ -50,8 +50,7 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor") class VLayoutPiecePathData : public QSharedData { public: - VLayoutPiecePathData() - {} + VLayoutPiecePathData(){} // NOLINT(modernize-use-equals-default) explicit VLayoutPiecePathData(const QVector &points) : m_points(points) @@ -72,7 +71,7 @@ public: bool m_cut{false}; private: - Q_DISABLE_ASSIGN(VLayoutPiecePathData) + Q_DISABLE_ASSIGN_MOVE(VLayoutPiecePathData) // NOLINT static constexpr quint32 streamHeader = 0xA53F0225; // CRC-32Q string "VLayoutPiecePathData" static constexpr quint16 classVersion = 2; diff --git a/src/libs/vlayout/vposition.cpp b/src/libs/vlayout/vposition.cpp index 9911721c3..6c196ea91 100644 --- a/src/libs/vlayout/vposition.cpp +++ b/src/libs/vlayout/vposition.cpp @@ -463,13 +463,13 @@ auto VPosition::Crossing(const VLayoutPiece &detail) const -> VPosition::Crossin const QVector layoutPoints = detail.GetMappedLayoutAllowancePoints(); const QRectF layoutBoundingRect = VLayoutPiece::BoundingRect(layoutPoints); - const QPainterPath layoutAllowancePath = VAbstractPiece::PainterPath(layoutPoints); + const QPainterPath layoutAllowancePath = VGObject::PainterPath(layoutPoints); QVector contourPoints; CastTo(detail.IsSeamAllowance() && not detail.IsSeamAllowanceBuiltIn() ? detail.GetMappedSeamAllowancePoints() : detail.GetMappedContourPoints(), contourPoints); const QRectF detailBoundingRect = VLayoutPiece::BoundingRect(contourPoints); - const QPainterPath contourPath = VAbstractPiece::PainterPath(contourPoints); + const QPainterPath contourPath = VGObject::PainterPath(contourPoints); for(const auto &position : m_data.positionsCache) { diff --git a/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata_p.h b/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata_p.h index 8fedb189b..67eb3e8e4 100644 --- a/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata_p.h +++ b/src/libs/vpatterndb/floatItemData/vabstractfloatitemdata_p.h @@ -63,7 +63,7 @@ public: bool m_bVisible; private: - Q_DISABLE_ASSIGN(VAbstractFloatItemDataPrivate) + Q_DISABLE_ASSIGN_MOVE(VAbstractFloatItemDataPrivate) // NOLINT }; QT_WARNING_POP diff --git a/src/libs/vpatterndb/floatItemData/vgrainlinedata_p.h b/src/libs/vpatterndb/floatItemData/vgrainlinedata_p.h index 3d9376b5d..ee67fa65a 100644 --- a/src/libs/vpatterndb/floatItemData/vgrainlinedata_p.h +++ b/src/libs/vpatterndb/floatItemData/vgrainlinedata_p.h @@ -46,42 +46,30 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor") class VGrainlineDataPrivate : public QSharedData { public: - VGrainlineDataPrivate() - : m_qsLength(), - m_dRotation(), - m_eArrowType(GrainlineArrowDirection::atBoth), - m_centerPin(NULL_ID), - m_topPin(NULL_ID), - m_bottomPin(NULL_ID) - {} - - VGrainlineDataPrivate(const VGrainlineDataPrivate &data) - : QSharedData(data), - m_qsLength(data.m_qsLength), - m_dRotation(data.m_dRotation), - m_eArrowType(data.m_eArrowType), - m_centerPin(data.m_centerPin), - m_topPin(data.m_topPin), - m_bottomPin(data.m_bottomPin) - {} - + VGrainlineDataPrivate() {} // NOLINT(modernize-use-equals-default) + VGrainlineDataPrivate(const VGrainlineDataPrivate &data) = default; ~VGrainlineDataPrivate() = default; /** @brief m_dLength formula to calculate the length of grainline */ - QString m_qsLength; + QString m_qsLength{}; // NOLINT(misc-non-private-member-variables-in-classes) + /** @brief m_dRotation formula to calculate the rotation of grainline in [degrees] */ - QString m_dRotation; + QString m_dRotation{}; // NOLINT(misc-non-private-member-variables-in-classes) + /** @brief m_eArrowType type of arrow on the grainline */ - GrainlineArrowDirection m_eArrowType; + GrainlineArrowDirection m_eArrowType{GrainlineArrowDirection::twoWaysUpDown}; // NOLINT(misc-non-private-member-variables-in-classes) + /** @brief m_centerPin center pin id */ - quint32 m_centerPin; + quint32 m_centerPin{NULL_ID}; // NOLINT(misc-non-private-member-variables-in-classes) + /** @brief m_topPin top pin id */ - quint32 m_topPin; + quint32 m_topPin{NULL_ID}; // NOLINT(misc-non-private-member-variables-in-classes) + /** @brief m_bottomPin bottom pin id */ - quint32 m_bottomPin; + quint32 m_bottomPin{NULL_ID}; // NOLINT(misc-non-private-member-variables-in-classes) private: - Q_DISABLE_ASSIGN(VGrainlineDataPrivate) + Q_DISABLE_ASSIGN_MOVE(VGrainlineDataPrivate) // NOLINT }; QT_WARNING_POP diff --git a/src/libs/vpatterndb/floatItemData/vpatternlabeldata_p.h b/src/libs/vpatterndb/floatItemData/vpatternlabeldata_p.h index 17cd598a6..1be55312d 100644 --- a/src/libs/vpatterndb/floatItemData/vpatternlabeldata_p.h +++ b/src/libs/vpatterndb/floatItemData/vpatternlabeldata_p.h @@ -85,7 +85,7 @@ public: quint32 m_bottomRightPin; private: - Q_DISABLE_ASSIGN(VPatternLabelDataPrivate) + Q_DISABLE_ASSIGN_MOVE(VPatternLabelDataPrivate) // NOLINT }; QT_WARNING_POP diff --git a/src/libs/vpatterndb/floatItemData/vpiecelabeldata_p.h b/src/libs/vpatterndb/floatItemData/vpiecelabeldata_p.h index bbd56c799..9367aebfe 100644 --- a/src/libs/vpatterndb/floatItemData/vpiecelabeldata_p.h +++ b/src/libs/vpatterndb/floatItemData/vpiecelabeldata_p.h @@ -43,7 +43,7 @@ QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor") class VPieceLabelDataPrivate : public QSharedData { public: - VPieceLabelDataPrivate() = default; + VPieceLabelDataPrivate(){} // NOLINT(modernize-use-equals-default) VPieceLabelDataPrivate(const VPieceLabelDataPrivate &data) = default; ~VPieceLabelDataPrivate() = default; diff --git a/src/libs/vpatterndb/testpassmark.cpp b/src/libs/vpatterndb/testpassmark.cpp index b43597bbc..07baeae39 100644 --- a/src/libs/vpatterndb/testpassmark.cpp +++ b/src/libs/vpatterndb/testpassmark.cpp @@ -29,7 +29,13 @@ #include "testpassmark.h" #include "vpassmark.h" +#include #include +#include +#include +#include + +#include "../vmisc/testpath.h" #if !defined(V_NO_ASSERT) namespace diff --git a/src/libs/vpatterndb/variables/varcradius_p.h b/src/libs/vpatterndb/variables/varcradius_p.h index c06c2fce4..15581d944 100644 --- a/src/libs/vpatterndb/variables/varcradius_p.h +++ b/src/libs/vpatterndb/variables/varcradius_p.h @@ -59,7 +59,7 @@ public: quint32 arcId; private: - Q_DISABLE_ASSIGN(VArcRadiusData) + Q_DISABLE_ASSIGN_MOVE(VArcRadiusData) // NOLINT }; VArcRadiusData::~VArcRadiusData() diff --git a/src/libs/vpatterndb/variables/vcurvevariable_p.h b/src/libs/vpatterndb/variables/vcurvevariable_p.h index 4ab280332..a705beb57 100644 --- a/src/libs/vpatterndb/variables/vcurvevariable_p.h +++ b/src/libs/vpatterndb/variables/vcurvevariable_p.h @@ -60,7 +60,7 @@ public: quint32 parentId{NULL_ID}; private: - Q_DISABLE_ASSIGN(VCurveVariableData) + Q_DISABLE_ASSIGN_MOVE(VCurveVariableData) // NOLINT }; VCurveVariableData::~VCurveVariableData() diff --git a/src/libs/vpatterndb/variables/vincrement_p.h b/src/libs/vpatterndb/variables/vincrement_p.h index e939471a3..ae4cb795e 100644 --- a/src/libs/vpatterndb/variables/vincrement_p.h +++ b/src/libs/vpatterndb/variables/vincrement_p.h @@ -88,7 +88,7 @@ public: bool specialUnits{false}; private: - Q_DISABLE_ASSIGN(VIncrementData) + Q_DISABLE_ASSIGN_MOVE(VIncrementData) // NOLINT }; VIncrementData::~VIncrementData() diff --git a/src/libs/vpatterndb/variables/vinternalvariable_p.h b/src/libs/vpatterndb/variables/vinternalvariable_p.h index f77bed0ab..8831c96cf 100644 --- a/src/libs/vpatterndb/variables/vinternalvariable_p.h +++ b/src/libs/vpatterndb/variables/vinternalvariable_p.h @@ -62,7 +62,7 @@ public: QString alias{}; private: - Q_DISABLE_ASSIGN(VInternalVariableData) + Q_DISABLE_ASSIGN_MOVE(VInternalVariableData) // NOLINT }; VInternalVariableData::~VInternalVariableData() diff --git a/src/libs/vpatterndb/variables/vlineangle_p.h b/src/libs/vpatterndb/variables/vlineangle_p.h index f2bb8fbfe..f1d681dde 100644 --- a/src/libs/vpatterndb/variables/vlineangle_p.h +++ b/src/libs/vpatterndb/variables/vlineangle_p.h @@ -60,7 +60,7 @@ public: quint32 p2Id; private: - Q_DISABLE_ASSIGN(VLineAngleData) + Q_DISABLE_ASSIGN_MOVE(VLineAngleData) // NOLINT }; VLineAngleData::~VLineAngleData() diff --git a/src/libs/vpatterndb/variables/vlinelength_p.h b/src/libs/vpatterndb/variables/vlinelength_p.h index c93f1d991..c6554f086 100644 --- a/src/libs/vpatterndb/variables/vlinelength_p.h +++ b/src/libs/vpatterndb/variables/vlinelength_p.h @@ -61,7 +61,7 @@ public: Unit patternUnit; private: - Q_DISABLE_ASSIGN(VLengthLineData) + Q_DISABLE_ASSIGN_MOVE(VLengthLineData) // NOLINT }; VLengthLineData::~VLengthLineData() diff --git a/src/libs/vpatterndb/variables/vmeasurement_p.h b/src/libs/vpatterndb/variables/vmeasurement_p.h index ec63d7311..809abbb89 100644 --- a/src/libs/vpatterndb/variables/vmeasurement_p.h +++ b/src/libs/vpatterndb/variables/vmeasurement_p.h @@ -126,7 +126,7 @@ public: MeasurementType varType{MeasurementType::Measurement}; private: - Q_DISABLE_ASSIGN(VMeasurementData) + Q_DISABLE_ASSIGN_MOVE(VMeasurementData) // NOLINT }; VMeasurementData::~VMeasurementData() diff --git a/src/libs/vpatterndb/variables/vvariable_p.h b/src/libs/vpatterndb/variables/vvariable_p.h index 66744aec1..20e7e2591 100644 --- a/src/libs/vpatterndb/variables/vvariable_p.h +++ b/src/libs/vpatterndb/variables/vvariable_p.h @@ -60,7 +60,7 @@ public: QString description; private: - Q_DISABLE_ASSIGN(VVariableData) + Q_DISABLE_ASSIGN_MOVE(VVariableData) // NOLINT }; VVariableData::~VVariableData() diff --git a/src/libs/vpatterndb/vcontainer.h b/src/libs/vpatterndb/vcontainer.h index d445a8320..b0511d81a 100644 --- a/src/libs/vpatterndb/vcontainer.h +++ b/src/libs/vpatterndb/vcontainer.h @@ -120,7 +120,7 @@ public: QString nspace; private: - Q_DISABLE_ASSIGN(VContainerData) + Q_DISABLE_ASSIGN_MOVE(VContainerData) // NOLINT }; QT_WARNING_POP diff --git a/src/libs/vpatterndb/vformula_p.h b/src/libs/vpatterndb/vformula_p.h index ef65b9f4a..da17a82a3 100644 --- a/src/libs/vpatterndb/vformula_p.h +++ b/src/libs/vpatterndb/vformula_p.h @@ -85,7 +85,7 @@ public: QString reason{tr("Formula is empty")}; private: - Q_DISABLE_ASSIGN(VFormulaData) + Q_DISABLE_ASSIGN_MOVE(VFormulaData) // NOLINT }; QT_WARNING_POP diff --git a/src/libs/vpatterndb/vnodedetail_p.h b/src/libs/vpatterndb/vnodedetail_p.h index 421c303a0..c1658dd64 100644 --- a/src/libs/vpatterndb/vnodedetail_p.h +++ b/src/libs/vpatterndb/vnodedetail_p.h @@ -83,7 +83,7 @@ public: bool reverse; private: - Q_DISABLE_ASSIGN(VNodeDetailData) + Q_DISABLE_ASSIGN_MOVE(VNodeDetailData) // NOLINT }; QT_WARNING_POP diff --git a/src/libs/vpatterndb/vpassmark.cpp b/src/libs/vpatterndb/vpassmark.cpp index b21bd25a1..79bb74177 100644 --- a/src/libs/vpatterndb/vpassmark.cpp +++ b/src/libs/vpatterndb/vpassmark.cpp @@ -34,7 +34,8 @@ #include "../vgeometry/vabstractcurve.h" #include "../vgeometry/varc.h" #include "../vlayout/vrawsapoint.h" -#include "../vpatterndb/testpassmark.h" + +#include const qreal VPassmark::passmarkRadiusFactor = 0.45; diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index 5bab2863a..0e916e95f 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -1297,7 +1297,7 @@ void VPiece::TestInternalPathCuttingPathIntersection(const VContainer *data) con SCASSERT(data != nullptr) const QVector cuttingPoints = CuttingPathPoints(data); - const QPainterPath contourPath = VAbstractPiece::PainterPath(cuttingPoints); + const QPainterPath contourPath = VGObject::PainterPath(cuttingPoints); // Internal path for cutting must not intersect cutting contour and be inside of it. const QVector pathsId = GetInternalPaths(); @@ -1317,7 +1317,7 @@ void VPiece::TestInternalPathCuttingPathIntersection(const VContainer *data) con continue; } - const QPainterPath internalPath = VAbstractPiece::PainterPath(points); + const QPainterPath internalPath = VGObject::PainterPath(points); if (internalPath.intersects(contourPath)) { @@ -1371,7 +1371,7 @@ void VPiece::TestInternalPathsIntersections(const VContainer *data) const continue; } - const QPainterPath painterPath1 = VAbstractPiece::PainterPath(pointsPath1); + const QPainterPath painterPath1 = VGObject::PainterPath(pointsPath1); for (int i=0; i < pathsId.size(); ++i) { @@ -1395,7 +1395,7 @@ void VPiece::TestInternalPathsIntersections(const VContainer *data) const continue; } - const QPainterPath painterPath2 = VAbstractPiece::PainterPath(pointsPath2); + const QPainterPath painterPath2 = VGObject::PainterPath(pointsPath2); pairs.insert(qMakePair(k, i)); pairs.insert(qMakePair(i, k)); diff --git a/src/libs/vpatterndb/vpiecenode_p.h b/src/libs/vpatterndb/vpiecenode_p.h index 34c23efef..09762f029 100644 --- a/src/libs/vpatterndb/vpiecenode_p.h +++ b/src/libs/vpatterndb/vpiecenode_p.h @@ -110,7 +110,7 @@ public: bool m_turnPoint{true}; private: - Q_DISABLE_ASSIGN(VPieceNodeData) + Q_DISABLE_ASSIGN_MOVE(VPieceNodeData) // NOLINT static constexpr quint32 streamHeader = 0x2198CBC8; // CRC-32Q string "VPieceNodeData" static constexpr quint16 classVersion = 2; diff --git a/src/libs/vpatterndb/vpiecepath_p.h b/src/libs/vpatterndb/vpiecepath_p.h index bd246b9bd..7692995ff 100644 --- a/src/libs/vpatterndb/vpiecepath_p.h +++ b/src/libs/vpatterndb/vpiecepath_p.h @@ -75,7 +75,7 @@ public: bool m_lastToCuttingContour{false}; private: - Q_DISABLE_ASSIGN(VPiecePathData) + Q_DISABLE_ASSIGN_MOVE(VPiecePathData) // NOLINT }; VPiecePathData::~VPiecePathData() diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp index e5b56a959..1e0b4539a 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp @@ -65,7 +65,7 @@ template class QSharedPointer; const QString VToolFlippingByAxis::ToolType = QStringLiteral("flippingByAxis"); //--------------------------------------------------------------------------------------------------------------------- -void VToolFlippingByAxis::setDialog() +void VToolFlippingByAxis::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.h b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.h index b1c6e3672..e83d32595 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.h +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.h @@ -50,7 +50,7 @@ class VToolFlippingByAxis : public VAbstractFlipping Q_OBJECT // NOLINT public: virtual ~VToolFlippingByAxis() = default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolFlippingByAxis* Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolFlippingByAxis* Create(VToolFlippingByAxisInitData initData); diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp index b696c5895..5c5207fef 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.cpp @@ -65,7 +65,7 @@ template class QSharedPointer; const QString VToolFlippingByLine::ToolType = QStringLiteral("flippingByLine"); //--------------------------------------------------------------------------------------------------------------------- -void VToolFlippingByLine::setDialog() +void VToolFlippingByLine::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.h b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.h index 14dd3ea59..e79101bf8 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.h +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyline.h @@ -51,7 +51,7 @@ class VToolFlippingByLine : public VAbstractFlipping Q_OBJECT // NOLINT public: virtual ~VToolFlippingByLine() = default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolFlippingByLine* Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolFlippingByLine* Create(VToolFlippingByLineInitData initData); diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp index b8a408f04..f6bf05b08 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp @@ -117,7 +117,7 @@ QT_WARNING_POP } //--------------------------------------------------------------------------------------------------------------------- -void VToolMove::setDialog() +void VToolMove::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolmove.h b/src/libs/vtools/tools/drawTools/operation/vtoolmove.h index cd18be747..3f6400bb0 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolmove.h +++ b/src/libs/vtools/tools/drawTools/operation/vtoolmove.h @@ -66,7 +66,7 @@ class VToolMove : public VAbstractOperation Q_OBJECT // NOLINT public: virtual ~VToolMove() = default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolMove* Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolMove* Create(VToolMoveInitData &initData); diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index a51f957e6..c2a0c5823 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -88,7 +88,7 @@ VToolRotation::VToolRotation(const VToolRotationInitData &initData, QGraphicsIte } //--------------------------------------------------------------------------------------------------------------------- -void VToolRotation::setDialog() +void VToolRotation::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.h b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.h index f40889735..6d7dee698 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.h +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.h @@ -62,7 +62,7 @@ class VToolRotation : public VAbstractOperation Q_OBJECT // NOLINT public: virtual ~VToolRotation() = default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolRotation* Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolRotation* Create(VToolRotationInitData &initData); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp index e965c1220..c2e4aab49 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.cpp @@ -74,7 +74,7 @@ VToolArc::VToolArc(const VToolArcInitData &initData, QGraphicsItem *parent) /** * @brief setDialog set dialog when user want change tool option. */ -void VToolArc::setDialog() +void VToolArc::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h index 6a7e0c727..22af5e170 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h @@ -66,7 +66,7 @@ class VToolArc :public VToolAbstractArc { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolArc* Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolArc* Create(VToolArcInitData &initData); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp index 83e762a6b..c1547b6e8 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.cpp @@ -67,7 +67,7 @@ VToolArcWithLength::VToolArcWithLength(const VToolArcWithLengthInitData &initDat } //--------------------------------------------------------------------------------------------------------------------- -void VToolArcWithLength::setDialog() +void VToolArcWithLength::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h index 9da963a6a..c97e34ee6 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h @@ -63,7 +63,7 @@ class VToolArcWithLength : public VToolAbstractArc { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolArcWithLength* Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolArcWithLength* Create(VToolArcWithLengthInitData &initData); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp index 33d73b545..341a7f304 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.cpp @@ -64,7 +64,7 @@ VToolCubicBezier::VToolCubicBezier(const VToolCubicBezierInitData &initData, QGr } //--------------------------------------------------------------------------------------------------------------------- -void VToolCubicBezier::setDialog() +void VToolCubicBezier::SetDialog() { SCASSERT(not m_dialog.isNull()) auto dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h index aa75985df..20947b2f7 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezier.h @@ -63,7 +63,7 @@ class VToolCubicBezier : public VAbstractSpline Q_OBJECT // NOLINT public: virtual ~VToolCubicBezier() = default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolCubicBezier *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolCubicBezier *Create(VToolCubicBezierInitData initData); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp index d22adef17..7803e617b 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.cpp @@ -67,7 +67,7 @@ VToolCubicBezierPath::VToolCubicBezierPath(const VToolCubicBezierPathInitData &i } //--------------------------------------------------------------------------------------------------------------------- -void VToolCubicBezierPath::setDialog() +void VToolCubicBezierPath::SetDialog() { SCASSERT(not m_dialog.isNull()) auto dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.h index 81814bcc5..4e32c1a86 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolcubicbezierpath.h @@ -63,7 +63,7 @@ class VToolCubicBezierPath:public VAbstractSpline Q_OBJECT // NOLINT public: virtual ~VToolCubicBezierPath() = default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolCubicBezierPath *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolCubicBezierPath *Create(VToolCubicBezierPathInitData initData); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp index b246f38ad..85126303e 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp @@ -75,7 +75,7 @@ VToolEllipticalArc::VToolEllipticalArc(const VToolEllipticalArcInitData &initDat /** * @brief setDialog set dialog when user want change tool option. */ -void VToolEllipticalArc::setDialog() +void VToolEllipticalArc::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h index 46ff7ebdc..27598e977 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h @@ -70,7 +70,7 @@ class VToolEllipticalArc : public VToolAbstractArc { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolEllipticalArc* Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolEllipticalArc* Create(VToolEllipticalArcInitData &initData); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp index 7df874d8e..618ae2848 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.cpp @@ -124,7 +124,7 @@ VToolSpline::VToolSpline(const VToolSplineInitData &initData, QGraphicsItem *par /** * @brief setDialog set dialog when user want change tool option. */ -void VToolSpline::setDialog() +void VToolSpline::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.h index a6b082f14..1e56d9a53 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolspline.h @@ -75,7 +75,7 @@ class VToolSpline:public VAbstractSpline Q_OBJECT // NOLINT public: virtual ~VToolSpline() =default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolSpline *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolSpline *Create(VToolSplineInitData &initData, VSpline *spline); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp index 8803f0258..212759cc2 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.cpp @@ -159,7 +159,7 @@ VToolSplinePath::VToolSplinePath(const VToolSplinePathInitData &initData, QGraph /** * @brief setDialog set dialog when user want change tool option. */ -void VToolSplinePath::setDialog() +void VToolSplinePath::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.h index 693057c43..169780a82 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolsplinepath.h @@ -74,7 +74,7 @@ class VToolSplinePath:public VAbstractSpline Q_OBJECT // NOLINT public: virtual ~VToolSplinePath() =default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolSplinePath *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolSplinePath *Create(VToolSplinePathInitData &initData, VSplinePath *path); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp index 80ae932f2..e8587c5ff 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.cpp @@ -89,7 +89,7 @@ void VToolTrueDarts::FindPoint(const QPointF &baseLineP1, const QPointF &baseLin } //--------------------------------------------------------------------------------------------------------------------- -void VToolTrueDarts::setDialog() +void VToolTrueDarts::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h index 91b500131..e9a8ce83a 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/tooldoublepoint/vtooltruedarts.h @@ -88,7 +88,7 @@ class VToolTrueDarts : public VToolDoublePoint public: static void FindPoint(const QPointF &baseLineP1, const QPointF &baseLineP2, const QPointF &dartP1, const QPointF &dartP2, const QPointF &dartP3, QPointF &p1, QPointF &p2); - virtual void setDialog() override; + virtual void SetDialog() override; static VToolTrueDarts* Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolTrueDarts* Create(VToolTrueDartsInitData initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp index 587f563f0..746685096 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp @@ -70,7 +70,7 @@ VToolCutArc::VToolCutArc(const VToolCutInitData &initData, QGraphicsItem * paren /** * @brief setDialog set dialog when user want change tool option. */ -void VToolCutArc::setDialog() +void VToolCutArc::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h index 8871bcebe..e40d4bcdf 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.h @@ -50,7 +50,7 @@ class VToolCutArc : public VToolCut { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolCutArc* Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolCutArc* Create(VToolCutInitData &initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp index ce57f3799..c049619fd 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.cpp @@ -73,7 +73,7 @@ VToolCutSpline::VToolCutSpline(const VToolCutInitData &initData, QGraphicsItem * /** * @brief setDialog set dialog when user want change tool option. */ -void VToolCutSpline::setDialog() +void VToolCutSpline::SetDialog() { SCASSERT(not m_dialog.isNull()) QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.h index 56af11a24..d845c6cf3 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutspline.h @@ -51,7 +51,7 @@ class VToolCutSpline : public VToolCut Q_OBJECT // NOLINT public: ~VToolCutSpline() override =default; - void setDialog() override; + void SetDialog() override; static auto Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) -> VToolCutSpline *; static auto Create(VToolCutInitData &initData) -> VToolCutSpline *; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp index 784a80242..9eac57882 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.cpp @@ -76,7 +76,7 @@ VToolCutSplinePath::VToolCutSplinePath(const VToolCutInitData &initData, QGraphi /** * @brief setDialog set dialog when user want change tool option. */ -void VToolCutSplinePath::setDialog() +void VToolCutSplinePath::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h index f9b8627e9..7a51b024f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutsplinepath.h @@ -52,7 +52,7 @@ class VToolCutSplinePath : public VToolCut { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolCutSplinePath *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolCutSplinePath *Create(VToolCutInitData &initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp index 80bb56b8b..5d1c00e26 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.cpp @@ -200,7 +200,7 @@ void VToolAlongLine::ShowContextMenu(QGraphicsSceneContextMenuEvent *event, quin /** * @brief setDialog set dialog when user want change tool option. */ -void VToolAlongLine::setDialog() +void VToolAlongLine::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.h index 72895eeb3..5785e5dd6 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolalongline.h @@ -60,8 +60,8 @@ class VToolAlongLine : public VToolLinePoint Q_OBJECT // NOLINT public: ~VToolAlongLine() override = default; - - void setDialog() override; + + void SetDialog() override; static auto Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data) -> VToolAlongLine*; static auto Create(VToolAlongLineInitData &initData) -> VToolAlongLine*; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp index 1e4bf1951..1d8abc0b5 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.cpp @@ -106,7 +106,7 @@ QPointF VToolBisector::FindPoint(const QPointF &firstPoint, const QPointF &secon /** * @brief setDialog set dialog when user want change tool option. */ -void VToolBisector::setDialog() +void VToolBisector::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h index 3daceeb83..3bd2c5d5e 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolbisector.h @@ -70,7 +70,7 @@ public: static qreal BisectorAngle(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint); static QPointF FindPoint(const QPointF &firstPoint, const QPointF &secondPoint, const QPointF &thirdPoint, const qreal& length); - virtual void setDialog() override; + virtual void SetDialog() override; static VToolBisector* Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolBisector* Create(VToolBisectorInitData &initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp index 03ae0c6a9..d42443e0d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.cpp @@ -82,7 +82,7 @@ VToolCurveIntersectAxis::VToolCurveIntersectAxis(const VToolCurveIntersectAxisIn } //--------------------------------------------------------------------------------------------------------------------- -void VToolCurveIntersectAxis::setDialog() +void VToolCurveIntersectAxis::SetDialog() { SCASSERT(not m_dialog.isNull()) m_dialog->setModal(true); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h index de3565b27..e943fd721 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h @@ -61,7 +61,7 @@ class VToolCurveIntersectAxis : public VToolLinePoint Q_OBJECT // NOLINT public: virtual ~VToolCurveIntersectAxis() = default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolCurveIntersectAxis *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp index ab9bcaca3..bd322748f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.cpp @@ -71,7 +71,7 @@ VToolEndLine::VToolEndLine(const VToolEndLineInitData &initData, QGraphicsItem * /** * @brief setDialog set dialog when user want change tool option. */ -void VToolEndLine::setDialog() +void VToolEndLine::SetDialog() { SCASSERT(not m_dialog.isNull()) m_dialog->setModal(true); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.h index 811342f74..9b2e39995 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolendline.h @@ -66,7 +66,7 @@ class VToolEndLine : public VToolLinePoint Q_OBJECT // NOLINT public: virtual ~VToolEndLine() = default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolEndLine *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolEndLine *Create(VToolEndLineInitData &initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp index 18db5b715..1ec903fbc 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.cpp @@ -68,7 +68,7 @@ VToolHeight::VToolHeight(const VToolHeightInitData &initData, QGraphicsItem * pa /** * @brief setDialog set dialog when user want change tool option. */ -void VToolHeight::setDialog() +void VToolHeight::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h index be3ec1f70..daafef305 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolheight.h @@ -66,7 +66,7 @@ class VToolHeight: public VToolLinePoint { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolHeight *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolHeight *Create(VToolHeightInitData initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp index e046da09f..aa5a5ac56 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.cpp @@ -66,7 +66,7 @@ VToolLineIntersectAxis::VToolLineIntersectAxis(const VToolLineIntersectAxisInitD } //--------------------------------------------------------------------------------------------------------------------- -void VToolLineIntersectAxis::setDialog() +void VToolLineIntersectAxis::SetDialog() { SCASSERT(not m_dialog.isNull()) m_dialog->setModal(true); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h index b2c2ae433..3f74d3016 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h @@ -67,7 +67,7 @@ class VToolLineIntersectAxis : public VToolLinePoint Q_OBJECT // NOLINT public: virtual ~VToolLineIntersectAxis() = default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolLineIntersectAxis *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp index 410a6f2d1..60c5336b4 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp @@ -72,7 +72,7 @@ VToolNormal::VToolNormal(const VToolNormalInitData &initData, QGraphicsItem *par /** * @brief setDialog set dialog when user want change tool option. */ -void VToolNormal::setDialog() +void VToolNormal::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h index 2dc5b61d5..40b348d74 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.h @@ -67,7 +67,7 @@ class VToolNormal : public VToolLinePoint { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolNormal* Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolNormal* Create(VToolNormalInitData initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp index 7d5cb5791..d12b0d680 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.cpp @@ -74,7 +74,7 @@ VToolShoulderPoint::VToolShoulderPoint(const VToolShoulderPointInitData &initDat /** * @brief setDialog set dialog when user want change tool option. */ -void VToolShoulderPoint::setDialog() +void VToolShoulderPoint::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h index 7af948ad2..8e438249e 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolshoulderpoint.h @@ -68,7 +68,7 @@ class VToolShoulderPoint : public VToolLinePoint { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static QPointF FindPoint(const QPointF &p1Line, const QPointF &p2Line, const QPointF &pShoulder, const qreal &length); static VToolShoulderPoint* Create(const QPointer &dialog, VMainGraphicsScene *scene, diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp index 05b0811ee..f49de73c0 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.cpp @@ -87,7 +87,7 @@ VToolBasePoint::VToolBasePoint (const VToolBasePointInitData &initData, QGraphic /** * @brief setDialog set dialog when user want change tool option. */ -void VToolBasePoint::setDialog() +void VToolBasePoint::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.h index 1a7b5aefc..2e003670c 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolbasepoint.h @@ -68,7 +68,7 @@ class VToolBasePoint : public VToolSinglePoint Q_OBJECT // NOLINT public: virtual ~VToolBasePoint() =default; - virtual void setDialog() override; + virtual void SetDialog() override; static VToolBasePoint *Create(VToolBasePointInitData initData); static const QString ToolType; virtual int type() const override {return Type;} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp index 90b1b09ba..92bea9781 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.cpp @@ -74,7 +74,7 @@ VToolLineIntersect::VToolLineIntersect(const VToolLineIntersectInitData &initDat /** * @brief setDialog set dialog when user want change tool option. */ -void VToolLineIntersect::setDialog() +void VToolLineIntersect::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h index 178ba084b..600ae9558 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoollineintersect.h @@ -66,7 +66,7 @@ class VToolLineIntersect:public VToolSinglePoint { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolLineIntersect *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolLineIntersect *Create(VToolLineIntersectInitData initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp index 563cbf0a9..3833097bb 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp @@ -64,7 +64,7 @@ VToolPointFromArcAndTangent::VToolPointFromArcAndTangent(const VToolPointFromArc } //--------------------------------------------------------------------------------------------------------------------- -void VToolPointFromArcAndTangent::setDialog() +void VToolPointFromArcAndTangent::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h index 7491ccf71..0cd4e9567 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.h @@ -63,7 +63,7 @@ class VToolPointFromArcAndTangent : public VToolSinglePoint { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolPointFromArcAndTangent *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolPointFromArcAndTangent *Create(VToolPointFromArcAndTangentInitData initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp index c235deb02..9a9c9f82e 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp @@ -66,7 +66,7 @@ VToolPointFromCircleAndTangent::VToolPointFromCircleAndTangent(const VToolPointF } //--------------------------------------------------------------------------------------------------------------------- -void VToolPointFromCircleAndTangent::setDialog() +void VToolPointFromCircleAndTangent::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h index 2865b225d..f40030c6d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h @@ -65,7 +65,7 @@ class VToolPointFromCircleAndTangent : public VToolSinglePoint { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolPointFromCircleAndTangent *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolPointFromCircleAndTangent *Create(VToolPointFromCircleAndTangentInitData &initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp index e8bc4d53a..6ac66280f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.cpp @@ -78,7 +78,7 @@ VToolPointOfContact::VToolPointOfContact(const VToolPointOfContactInitData &init /** * @brief setDialog set dialog when user want change tool option. */ -void VToolPointOfContact::setDialog() +void VToolPointOfContact::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h index 608c5c447..95426a1d3 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h @@ -68,7 +68,7 @@ class VToolPointOfContact : public VToolSinglePoint { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static bool FindPoint(qreal radius, const QPointF ¢er, const QPointF &firstPoint, const QPointF &secondPoint, QPointF *intersectionPoint); static VToolPointOfContact* Create(const QPointer &dialog, VMainGraphicsScene *scene, diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp index 0e8efb80c..efed2873f 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.cpp @@ -69,7 +69,7 @@ VToolPointOfIntersection::VToolPointOfIntersection(const VToolPointOfIntersectio /** * @brief setDialog set dialog when user want change tool option. */ -void VToolPointOfIntersection::setDialog() +void VToolPointOfIntersection::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h index eb1ea6ae7..a730ae0eb 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersection.h @@ -62,7 +62,7 @@ class VToolPointOfIntersection : public VToolSinglePoint { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolPointOfIntersection *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolPointOfIntersection *Create(VToolPointOfIntersectionInitData initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp index 24c0dd484..27438f6a1 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp @@ -64,7 +64,7 @@ VToolPointOfIntersectionArcs::VToolPointOfIntersectionArcs(const VToolPointOfInt } //--------------------------------------------------------------------------------------------------------------------- -void VToolPointOfIntersectionArcs::setDialog() +void VToolPointOfIntersectionArcs::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h index 4ed4639a4..9aa066bef 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.h @@ -64,7 +64,7 @@ class VToolPointOfIntersectionArcs : public VToolSinglePoint Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolPointOfIntersectionArcs *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolPointOfIntersectionArcs *Create(VToolPointOfIntersectionArcsInitData initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp index 78224ac0a..8a7b3c144 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp @@ -67,7 +67,7 @@ VToolPointOfIntersectionCircles::VToolPointOfIntersectionCircles( } //--------------------------------------------------------------------------------------------------------------------- -void VToolPointOfIntersectionCircles::setDialog() +void VToolPointOfIntersectionCircles::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h index 4428f2497..32915dfdf 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h @@ -67,7 +67,7 @@ class VToolPointOfIntersectionCircles : public VToolSinglePoint { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolPointOfIntersectionCircles *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolPointOfIntersectionCircles *Create(VToolPointOfIntersectionCirclesInitData &initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp index f88d1e1be..7aba65cdd 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp @@ -71,7 +71,7 @@ VToolPointOfIntersectionCurves::VToolPointOfIntersectionCurves(const VToolPointO } //--------------------------------------------------------------------------------------------------------------------- -void VToolPointOfIntersectionCurves::setDialog() +void VToolPointOfIntersectionCurves::SetDialog() { SCASSERT(not m_dialog.isNull()) auto dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h index 4f729034b..0da1afddc 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.h @@ -63,7 +63,7 @@ class VToolPointOfIntersectionCurves : public VToolSinglePoint { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolPointOfIntersectionCurves *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolPointOfIntersectionCurves *Create(VToolPointOfIntersectionCurvesInitData initData); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp index d1fc63f91..e0f631cc4 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.cpp @@ -74,7 +74,7 @@ VToolTriangle::VToolTriangle(const VToolTriangleInitData &initData, QGraphicsIte /** * @brief setDialog set dialog when user want change tool option. */ -void VToolTriangle::setDialog() +void VToolTriangle::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h index a5ca2978b..4271dd808 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtooltriangle.h @@ -68,7 +68,7 @@ class VToolTriangle : public VToolSinglePoint { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolTriangle *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolTriangle *Create(VToolTriangleInitData initData); diff --git a/src/libs/vtools/tools/drawTools/vdrawtool.h b/src/libs/vtools/tools/drawTools/vdrawtool.h index 9c20b0f51..77b44d3e0 100644 --- a/src/libs/vtools/tools/drawTools/vdrawtool.h +++ b/src/libs/vtools/tools/drawTools/vdrawtool.h @@ -290,8 +290,8 @@ void VDrawTool::ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemI connect(m_dialog.data(), &DialogTool::DialogClosed, this, &VDrawTool::FullUpdateFromGuiOk); connect(m_dialog.data(), &DialogTool::DialogApplied, this, &VDrawTool::FullUpdateFromGuiApply); - - this->setDialog(); + + this->SetDialog(); m_dialog->show(); } diff --git a/src/libs/vtools/tools/drawTools/vtoolline.cpp b/src/libs/vtools/tools/drawTools/vtoolline.cpp index b13f93a87..3909eb221 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.cpp +++ b/src/libs/vtools/tools/drawTools/vtoolline.cpp @@ -82,7 +82,7 @@ VToolLine::VToolLine(const VToolLineInitData &initData, QGraphicsItem *parent) /** * @brief setDialog set dialog when user want change tool option. */ -void VToolLine::setDialog() +void VToolLine::SetDialog() { SCASSERT(not m_dialog.isNull()) const QPointer dialogTool = qobject_cast(m_dialog); diff --git a/src/libs/vtools/tools/drawTools/vtoolline.h b/src/libs/vtools/tools/drawTools/vtoolline.h index b2f79ea74..d3c57d82c 100644 --- a/src/libs/vtools/tools/drawTools/vtoolline.h +++ b/src/libs/vtools/tools/drawTools/vtoolline.h @@ -67,7 +67,7 @@ class VToolLine: public VDrawTool, public VScaledLine { Q_OBJECT // NOLINT public: - virtual void setDialog() override; + virtual void SetDialog() override; static VToolLine *Create(const QPointer &dialog, VMainGraphicsScene *scene, VAbstractPattern *doc, VContainer *data); static VToolLine *Create(VToolLineInitData initData); diff --git a/src/libs/vtools/tools/vinteractivetool.h b/src/libs/vtools/tools/vinteractivetool.h index efb59ae40..9d60c45c8 100644 --- a/src/libs/vtools/tools/vinteractivetool.h +++ b/src/libs/vtools/tools/vinteractivetool.h @@ -39,7 +39,7 @@ class VInteractiveTool : public VAbstractTool Q_OBJECT // NOLINT public: VInteractiveTool(VAbstractPattern *doc, VContainer *data, quint32 id, QObject *parent = nullptr); - virtual ~VInteractiveTool() = default; + ~VInteractiveTool() override = default; void DialogLinkDestroy(); @@ -49,10 +49,12 @@ public slots: protected: /** @brief m_dialog tool's dialog options.*/ - QPointer m_dialog; + QPointer m_dialog; // NOLINT(cppcoreguidelines-non-private-member-variables-in-classes) /** @brief setDialog set dialog when user want change tool option. */ - virtual void setDialog() {/*do nothing by default*/} + virtual void SetDialog() + { /*do nothing by default*/ + } virtual void SaveDialogChange(const QString &undoText = QString())=0; private: diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index 5e90b17d0..979d47f7e 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -93,23 +93,24 @@ using namespace bpstd::literals::chrono_literals; // Current version of seam allowance tag need for backward compatibility const quint8 VToolSeamAllowance::pieceVersion = 2; -const QString VToolSeamAllowance::TagCSA = QStringLiteral("csa"); -const QString VToolSeamAllowance::TagRecord = QStringLiteral("record"); -const QString VToolSeamAllowance::TagIPaths = QStringLiteral("iPaths"); -const QString VToolSeamAllowance::TagPins = QStringLiteral("pins"); -const QString VToolSeamAllowance::TagPlaceLabels = QStringLiteral("placeLabels"); +const QString VToolSeamAllowance::TagCSA = QStringLiteral("csa"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::TagRecord = QStringLiteral("record"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::TagIPaths = QStringLiteral("iPaths"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::TagPins = QStringLiteral("pins"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::TagPlaceLabels = QStringLiteral("placeLabels"); // NOLINT(cert-err58-cpp) -const QString VToolSeamAllowance::AttrSeamAllowance = QStringLiteral("seamAllowance"); -const QString VToolSeamAllowance::AttrHideMainPath = QStringLiteral("hideMainPath"); -const QString VToolSeamAllowance::AttrSeamAllowanceBuiltIn = QStringLiteral("seamAllowanceBuiltIn"); -const QString VToolSeamAllowance::AttrUnited = QStringLiteral("united"); -const QString VToolSeamAllowance::AttrFont = QStringLiteral("fontSize"); -const QString VToolSeamAllowance::AttrTopLeftPin = QStringLiteral("topLeftPin"); -const QString VToolSeamAllowance::AttrBottomRightPin = QStringLiteral("bottomRightPin"); -const QString VToolSeamAllowance::AttrCenterPin = QStringLiteral("centerPin"); -const QString VToolSeamAllowance::AttrTopPin = QStringLiteral("topPin"); -const QString VToolSeamAllowance::AttrBottomPin = QStringLiteral("bottomPin"); -const QString VToolSeamAllowance::AttrPiecePriority = QStringLiteral("priority"); +const QString VToolSeamAllowance::AttrSeamAllowance = QStringLiteral("seamAllowance"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::AttrHideMainPath = QStringLiteral("hideMainPath"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::AttrSeamAllowanceBuiltIn = // NOLINT(cert-err58-cpp) + QStringLiteral("seamAllowanceBuiltIn"); +const QString VToolSeamAllowance::AttrUnited = QStringLiteral("united"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::AttrFont = QStringLiteral("fontSize"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::AttrTopLeftPin = QStringLiteral("topLeftPin"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::AttrBottomRightPin = QStringLiteral("bottomRightPin"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::AttrCenterPin = QStringLiteral("centerPin"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::AttrTopPin = QStringLiteral("topPin"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::AttrBottomPin = QStringLiteral("bottomPin"); // NOLINT(cert-err58-cpp) +const QString VToolSeamAllowance::AttrPiecePriority = QStringLiteral("priority"); // NOLINT(cert-err58-cpp) namespace { @@ -160,11 +161,36 @@ auto DuplicatePins(const QVector &pins, const VToolSeamAllowanceInitDat } return newPins; } + +//--------------------------------------------------------------------------------------------------------------------- +void UpdateLabelItem(VTextGraphicsItem *labelItem, QPointF pos, qreal labelAngle) +{ + SCASSERT(labelItem != nullptr) + + QRectF rectBB; + rectBB.setTopLeft(pos); + rectBB.setWidth(labelItem->boundingRect().width()); + rectBB.setHeight(labelItem->boundingRect().height()); + qreal dX; + qreal dY; + if (labelItem->IsContained(rectBB, labelAngle, dX, dY) == false) + { + pos.setX(pos.x() + dX); + pos.setY(pos.y() + dY); + } + + labelItem->setPos(pos); + labelItem->setRotation(-labelAngle); // expects clockwise direction + labelItem->Update(); + labelItem->GetTextLines() > 0 ? labelItem->show() : labelItem->hide(); +} } // namespace //--------------------------------------------------------------------------------------------------------------------- -VToolSeamAllowance *VToolSeamAllowance::Create(const QPointer &dialog, VMainGraphicsScene *scene, - VAbstractPattern *doc, VContainer *data) +auto VToolSeamAllowance::Create(const QPointer &dialog, + VMainGraphicsScene *scene, + VAbstractPattern *doc, + VContainer *data) -> VToolSeamAllowance * { SCASSERT(not dialog.isNull()); const QPointer dialogTool = qobject_cast(dialog); @@ -215,11 +241,11 @@ VToolSeamAllowance *VToolSeamAllowance::Create(const QPointer &dialo } //--------------------------------------------------------------------------------------------------------------------- -VToolSeamAllowance *VToolSeamAllowance::Create(VToolSeamAllowanceInitData &initData) +auto VToolSeamAllowance::Create(VToolSeamAllowanceInitData &initData) -> VToolSeamAllowance * { if (initData.typeCreation == Source::FromGui || initData.typeCreation == Source::FromTool) { - auto currentSA = new VIncrement(initData.data, currentSeamAllowance); + auto *currentSA = new VIncrement(initData.data, currentSeamAllowance); currentSA->SetFormula(initData.detail.GetSAWidth(), initData.width, true); currentSA->SetDescription(tr("Current seam allowance")); @@ -231,7 +257,7 @@ VToolSeamAllowance *VToolSeamAllowance::Create(VToolSeamAllowanceInitData &initD const qreal calcWidth = CheckFormula(initData.id, initData.width, initData.data); initData.detail.SetFormulaSAWidth(initData.width, calcWidth); - auto currentSA = new VIncrement(initData.data, currentSeamAllowance); + auto *currentSA = new VIncrement(initData.data, currentSeamAllowance); currentSA->SetFormula(calcWidth, initData.width, true); currentSA->SetDescription(tr("Current seam allowance")); @@ -259,8 +285,9 @@ VToolSeamAllowance *VToolSeamAllowance::Create(VToolSeamAllowanceInitData &initD } //--------------------------------------------------------------------------------------------------------------------- -VToolSeamAllowance *VToolSeamAllowance::Duplicate(const QPointer &dialog, VMainGraphicsScene *scene, - VAbstractPattern *doc) +auto VToolSeamAllowance::Duplicate(const QPointer &dialog, + VMainGraphicsScene *scene, + VAbstractPattern *doc) -> VToolSeamAllowance * { SCASSERT(not dialog.isNull()); const QPointer dialogTool = qobject_cast(dialog); @@ -421,7 +448,7 @@ void VToolSeamAllowance::AddCSARecord(VAbstractPattern *doc, QDomElement &domEle void VToolSeamAllowance::AddCSARecords(VAbstractPattern *doc, QDomElement &domElement, const QVector &records) { - if (records.size() > 0) + if (not records.empty()) { QDomElement csaRecordsElement = doc->createElement(VToolSeamAllowance::TagCSA); for (auto record : records) @@ -435,7 +462,7 @@ void VToolSeamAllowance::AddCSARecords(VAbstractPattern *doc, QDomElement &domEl //--------------------------------------------------------------------------------------------------------------------- void VToolSeamAllowance::AddInternalPaths(VAbstractPattern *doc, QDomElement &domElement, const QVector &paths) { - if (paths.size() > 0) + if (not paths.empty()) { QDomElement iPathsElement = doc->createElement(VToolSeamAllowance::TagIPaths); for (auto path : paths) @@ -525,7 +552,7 @@ void VToolSeamAllowance::AddGrainline(VAbstractPattern *doc, QDomElement &domEle doc->SetAttribute(domData, AttrMy, glGeom.GetPos().y()); doc->SetAttribute(domData, AttrLength, glGeom.GetLength()); doc->SetAttribute(domData, VAbstractPattern::AttrRotation, glGeom.GetRotation()); - doc->SetAttribute(domData, VAbstractPattern::AttrArrows, int(glGeom.GetArrowType())); + doc->SetAttribute(domData, VAbstractPattern::AttrArrows, static_cast(glGeom.GetArrowType())); doc->SetAttributeOrRemoveIf(domData, AttrCenterPin, glGeom.CenterPin(), [](quint32 pin) noexcept {return pin <= NULL_ID;}); doc->SetAttributeOrRemoveIf(domData, AttrTopPin, glGeom.TopPin(), @@ -619,10 +646,7 @@ void VToolSeamAllowance::ReinitInternals(const VPiece &detail, VMainGraphicsScen } //--------------------------------------------------------------------------------------------------------------------- -QString VToolSeamAllowance::getTagName() const -{ - return VAbstractPattern::TagDetail; -} +auto VToolSeamAllowance::getTagName() const -> QString { return VAbstractPattern::TagDetail; } //--------------------------------------------------------------------------------------------------------------------- void VToolSeamAllowance::ShowVisualization(bool show) @@ -675,7 +699,7 @@ void VToolSeamAllowance::ResetChildren(QGraphicsItem *pItem) { const bool selected = isSelected(); const VPiece detail = VAbstractTool::data.GetPiece(m_id); - VTextGraphicsItem* pVGI = qgraphicsitem_cast(pItem); + auto *pVGI = qgraphicsitem_cast(pItem); if (pVGI != m_dataLabel) { if (detail.GetPieceLabelData().IsVisible()) @@ -690,7 +714,7 @@ void VToolSeamAllowance::ResetChildren(QGraphicsItem *pItem) m_patternInfo->Reset(); } } - VGrainlineItem* pGLI = qgraphicsitem_cast(pItem); + auto *pGLI = qgraphicsitem_cast(pItem); if (pGLI != m_grainLine) { if (detail.GetGrainlineGeometry().IsVisible()) @@ -733,7 +757,7 @@ void VToolSeamAllowance::UpdateDetailLabel() const VPieceLabelData& labelData = detail.GetPieceLabelData(); const QVector &pins = detail.GetPins(); - if (labelData.IsVisible() == true) + if (labelData.IsVisible()) { QPointF pos; qreal labelAngle = 0; @@ -760,7 +784,7 @@ void VToolSeamAllowance::UpdatePatternInfo() const VPatternLabelData& geom = detail.GetPatternLabelData(); const QVector &pins = detail.GetPins(); - if (geom.IsVisible() == true) + if (geom.IsVisible()) { QPointF pos; qreal labelAngle = 0; @@ -836,7 +860,7 @@ void VToolSeamAllowance::SaveMoveDetail(const QPointF& ptPos) VPiece newDet = oldDet; newDet.GetPieceLabelData().SetPos(ptPos); - SavePieceOptions* moveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); + auto *moveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); moveCommand->setText(tr("move pattern piece label")); VAbstractApplication::VApp()->getUndoStack()->push(moveCommand); } @@ -856,7 +880,7 @@ void VToolSeamAllowance::SaveResizeDetail(qreal dLabelW, int iFontSize) newDet.GetPieceLabelData().SetLabelHeight(QString().setNum(height)); newDet.GetPieceLabelData().SetFontSize(iFontSize); - SavePieceOptions* resizeCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); + auto *resizeCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); resizeCommand->setText(tr("resize pattern piece label")); VAbstractApplication::VApp()->getUndoStack()->push(resizeCommand); } @@ -877,7 +901,7 @@ void VToolSeamAllowance::SaveRotationDetail(qreal dRot) line.setAngle(-dRot); newDet.GetPieceLabelData().SetRotation(QString().setNum(line.angle())); - SavePieceOptions* rotateCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); + auto *rotateCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); rotateCommand->setText(tr("rotate pattern piece label")); VAbstractApplication::VApp()->getUndoStack()->push(rotateCommand); } @@ -893,7 +917,7 @@ void VToolSeamAllowance::SaveMovePattern(const QPointF &ptPos) VPiece newDet = oldDet; newDet.GetPatternLabelData().SetPos(ptPos); - SavePieceOptions* moveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); + auto *moveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); moveCommand->setText(tr("move pattern info label")); VAbstractApplication::VApp()->getUndoStack()->push(moveCommand); } @@ -913,7 +937,7 @@ void VToolSeamAllowance::SaveResizePattern(qreal dLabelW, int iFontSize) newDet.GetPatternLabelData().SetLabelHeight(QString().setNum(height)); newDet.GetPatternLabelData().SetFontSize(iFontSize); - SavePieceOptions* resizeCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); + auto *resizeCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); resizeCommand->setText(tr("resize pattern info label")); VAbstractApplication::VApp()->getUndoStack()->push(resizeCommand); } @@ -932,7 +956,7 @@ void VToolSeamAllowance::SaveRotationPattern(qreal dRot) line.setAngle(-dRot); newDet.GetPatternLabelData().SetRotation(QString().setNum(line.angle())); - SavePieceOptions* rotateCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); + auto *rotateCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); rotateCommand->setText(tr("rotate pattern info label")); VAbstractApplication::VApp()->getUndoStack()->push(rotateCommand); } @@ -946,7 +970,7 @@ void VToolSeamAllowance::SaveMoveGrainline(const QPointF& ptPos) newDet.GetGrainlineGeometry().SetPos(ptPos); qDebug() << "******* new grainline pos" << ptPos; - SavePieceOptions* moveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); + auto* moveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); moveCommand->setText(tr("move grainline")); VAbstractApplication::VApp()->getUndoStack()->push(moveCommand); } @@ -961,7 +985,7 @@ void VToolSeamAllowance::SaveResizeGrainline(qreal dLength) newDet.GetGrainlineGeometry().SetPos(m_grainLine->pos()); newDet.GetGrainlineGeometry().SetLength(QString().setNum(dLength)); - SavePieceOptions* resizeCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); + auto* resizeCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); resizeCommand->setText(tr("resize grainline")); VAbstractApplication::VApp()->getUndoStack()->push(resizeCommand); } @@ -975,7 +999,7 @@ void VToolSeamAllowance::SaveRotateGrainline(qreal dRot, const QPointF& ptPos) newDet.GetGrainlineGeometry().SetRotation(QString().setNum(qRadiansToDegrees(dRot))); newDet.GetGrainlineGeometry().SetPos(ptPos); - SavePieceOptions* rotateCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); + auto *rotateCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); rotateCommand->setText(tr("rotate grainline")); VAbstractApplication::VApp()->getUndoStack()->push(rotateCommand); } @@ -994,9 +1018,7 @@ void VToolSeamAllowance::paint(QPainter *painter, const QStyleOptionGraphicsItem m_passmarks->setPen(toolPen); m_placeLabels->setPen(toolPen); - if ((m_dataLabel->IsIdle() == false - || m_patternInfo->IsIdle() == false - || m_grainLine->IsIdle() == false) && not isSelected()) + if ((not m_dataLabel->IsIdle() || not m_patternInfo->IsIdle() || not m_grainLine->IsIdle()) && not isSelected()) { setSelected(true); } @@ -1004,7 +1026,7 @@ void VToolSeamAllowance::paint(QPainter *painter, const QStyleOptionGraphicsItem } //--------------------------------------------------------------------------------------------------------------------- -QRectF VToolSeamAllowance::boundingRect() const +auto VToolSeamAllowance::boundingRect() const -> QRectF { if (m_pieceBoundingRect.isNull()) { @@ -1015,16 +1037,14 @@ QRectF VToolSeamAllowance::boundingRect() const } //--------------------------------------------------------------------------------------------------------------------- -QPainterPath VToolSeamAllowance::shape() const +auto VToolSeamAllowance::shape() const -> QPainterPath { if (m_mainPath == QPainterPath()) { return QGraphicsPathItem::shape(); } - else - { - return ItemShapeFromPath(m_mainPath, pen()); - } + + return ItemShapeFromPath(m_mainPath, pen()); } //--------------------------------------------------------------------------------------------------------------------- @@ -1044,7 +1064,7 @@ void VToolSeamAllowance::AddToFile() const VPiece piece = VAbstractTool::data.GetPiece(m_id); - QDomElement domElement = doc->createElement(getTagName()); + QDomElement domElement = doc->createElement(VToolSeamAllowance::getTagName()); AddAttributes(doc, domElement, m_id, piece); AddPatternPieceData(doc, domElement, piece); @@ -1066,7 +1086,7 @@ void VToolSeamAllowance::AddToFile() //--------------------------------------------------------------------------------------------------------------------- void VToolSeamAllowance::RefreshDataInFile() { - QDomElement domElement = doc->elementById(m_id, getTagName()); + QDomElement domElement = doc->elementById(m_id, VToolSeamAllowance::getTagName()); if (domElement.isElement()) { // Refresh only parts that we possibly need to update @@ -1075,14 +1095,14 @@ void VToolSeamAllowance::RefreshDataInFile() Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < FormatVersion(0, 4, 0), "Time to refactor the code."); - const uint version = doc->GetParametrUInt(domElement, AttrVersion, QChar('1')); + const uint version = VAbstractPattern::GetParametrUInt(domElement, AttrVersion, QChar('1')); if (version == 1) { const VPiece piece = VAbstractTool::data.GetPiece(m_id); doc->SetAttribute(domElement, AttrVersion, QString().setNum(pieceVersion)); - doc->RemoveAllChildren(domElement);//Very important to clear before rewrite + VAbstractPattern::RemoveAllChildren(domElement); // Very important to clear before rewrite AddPatternPieceData(doc, domElement, piece); AddPatternInfo(doc, domElement, piece); AddGrainline(doc, domElement, piece); @@ -1096,7 +1116,7 @@ void VToolSeamAllowance::RefreshDataInFile() } //--------------------------------------------------------------------------------------------------------------------- -QVariant VToolSeamAllowance::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) +auto VToolSeamAllowance::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) -> QVariant { if (change == ItemPositionChange && scene()) { @@ -1116,7 +1136,7 @@ QVariant VToolSeamAllowance::itemChange(QGraphicsItem::GraphicsItemChange change const QList viewList = scene()->views(); if (not viewList.isEmpty()) { - if (VMainGraphicsView *view = qobject_cast(viewList.at(0))) + if (auto *view = qobject_cast(viewList.at(0))) { view->EnsureItemVisibleWithDelay(this, VMainGraphicsView::scrollDelay); } @@ -1309,7 +1329,7 @@ void VToolSeamAllowance::keyReleaseEvent(QKeyEvent *event) { VAbstractApplication::VApp()->getUndoStack()->beginMacro(tr("multi deletion")); - for(auto tool : toolList) + for (auto *tool : toolList) { tool->RemoveWithConfirm(false); } @@ -1346,29 +1366,27 @@ void VToolSeamAllowance::SetDialog() //--------------------------------------------------------------------------------------------------------------------- VToolSeamAllowance::VToolSeamAllowance(const VToolSeamAllowanceInitData &initData, QGraphicsItem *parent) - : VInteractiveTool(initData.doc, initData.data, initData.id), - QGraphicsPathItem(parent), - m_mainPath(), - m_sceneDetails(initData.scene), - m_drawName(initData.drawName), - m_seamAllowance(new VNoBrushScalePathItem(this)), - m_dataLabel(new VTextGraphicsItem(this)), - m_patternInfo(new VTextGraphicsItem(this)), - m_grainLine(new VGrainlineItem(this)), - m_passmarks(new QGraphicsPathItem(this)), - m_placeLabels(new QGraphicsPathItem(this)), - m_acceptHoverEvents(true) + : VInteractiveTool(initData.doc, initData.data, initData.id), + QGraphicsPathItem(parent), + m_sceneDetails(initData.scene), + m_drawName(initData.drawName), + m_seamAllowance(new VNoBrushScalePathItem(this)), + m_dataLabel(new VTextGraphicsItem(this)), + m_patternInfo(new VTextGraphicsItem(this)), + m_grainLine(new VGrainlineItem(this)), + m_passmarks(new QGraphicsPathItem(this)), + m_placeLabels(new QGraphicsPathItem(this)) { VPiece detail = initData.data->GetPiece(initData.id); ReinitInternals(detail, m_sceneDetails); - AllowSelecting(true); + VToolSeamAllowance::AllowSelecting(true); EnableToolMove(true); - AllowHover(true); + VToolSeamAllowance::AllowHover(true); this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true); this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus - ToolCreation(initData.typeCreation); + VToolSeamAllowance::ToolCreation(initData.typeCreation); setAcceptHoverEvents(m_acceptHoverEvents); connect(this, &VToolSeamAllowance::ChoosedTool, m_sceneDetails, &VMainGraphicsScene::ChoosedItem); @@ -1532,9 +1550,8 @@ void VToolSeamAllowance::SaveDialogChange(const QString &undoText) QVector> &undocommands = dialogTool->UndoStack(); const bool groupChange = not undocommands.isEmpty(); - SavePieceOptions *saveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); - if (VAbstractMainWindow *window = - qobject_cast(VAbstractValApplication::VApp()->getMainWindow())) + auto *saveCommand = new SavePieceOptions(oldDet, newDet, doc, m_id); + if (auto *window = qobject_cast(VAbstractValApplication::VApp()->getMainWindow())) { // Better not to crash here, just silently do not update list. connect(saveCommand, &SavePieceOptions::UpdateGroups, window, &VAbstractMainWindow::UpdateDetailsList); } @@ -1576,7 +1593,7 @@ void VToolSeamAllowance::ShowOptions() //--------------------------------------------------------------------------------------------------------------------- void VToolSeamAllowance::ToggleInLayout(bool checked) { - auto togglePrint = new TogglePieceInLayout(m_id, checked, &(VAbstractTool::data), doc); + auto *togglePrint = new TogglePieceInLayout(m_id, checked, &(VAbstractTool::data), doc); connect(togglePrint, &TogglePieceInLayout::Toggled, doc, &VAbstractPattern::CheckInLayoutList); VAbstractApplication::VApp()->getUndoStack()->push(togglePrint); } @@ -1752,9 +1769,12 @@ void VToolSeamAllowance::ResetPieceLabelTemplate() } //--------------------------------------------------------------------------------------------------------------------- -VPieceItem::MoveTypes VToolSeamAllowance::FindLabelGeometry(const VPatternLabelData& labelData, - const QVector &pins, qreal &rotationAngle, - qreal &labelWidth, qreal &labelHeight, QPointF &pos) +auto VToolSeamAllowance::FindLabelGeometry(const VPatternLabelData &labelData, + const QVector &pins, + qreal &rotationAngle, + qreal &labelWidth, + qreal &labelHeight, + QPointF &pos) -> VPieceItem::MoveTypes { VPieceItem::MoveTypes restrictions = VPieceItem::AllModifications; @@ -1853,9 +1873,11 @@ VPieceItem::MoveTypes VToolSeamAllowance::FindLabelGeometry(const VPatternLabelD } //--------------------------------------------------------------------------------------------------------------------- -VPieceItem::MoveTypes VToolSeamAllowance::FindGrainlineGeometry(const VGrainlineData& geom, - const QVector &pins, qreal &length, - qreal &rotationAngle, QPointF &pos) +auto VToolSeamAllowance::FindGrainlineGeometry(const VGrainlineData &geom, + const QVector &pins, + qreal &length, + qreal &rotationAngle, + QPointF &pos) -> VPieceItem::MoveTypes { const quint32 topPin = geom.TopPin(); const quint32 bottomPin = geom.BottomPin(); @@ -2063,8 +2085,7 @@ void VToolSeamAllowance::DeleteToolWithConfirm(bool ask) VAbstractApplication::VApp()->getUndoStack()->push(delDet.release()); // Throw exception, this will help prevent case when we forget to immediately quit function. - VExceptionToolWasDeleted e(tr("Tool was used after deleting.")); - throw e; + throw VExceptionToolWasDeleted(tr("Tool was used after deleting.")); } //--------------------------------------------------------------------------------------------------------------------- @@ -2072,17 +2093,17 @@ void VToolSeamAllowance::ToolCreation(const Source &typeCreation) { if (typeCreation == Source::FromGui || typeCreation == Source::FromTool) { - AddToFile(); + VToolSeamAllowance::AddToFile(); } else { - RefreshDataInFile(); + VToolSeamAllowance::RefreshDataInFile(); } } //--------------------------------------------------------------------------------------------------------------------- -bool VToolSeamAllowance::PrepareLabelData(const VPatternLabelData &labelData, const QVector &pins, - VTextGraphicsItem *labelItem, QPointF &pos, qreal &labelAngle) +auto VToolSeamAllowance::PrepareLabelData(const VPatternLabelData &labelData, const QVector &pins, + VTextGraphicsItem *labelItem, QPointF &pos, qreal &labelAngle) -> bool { SCASSERT(labelItem != nullptr) @@ -2110,30 +2131,7 @@ bool VToolSeamAllowance::PrepareLabelData(const VPatternLabelData &labelData, co } //--------------------------------------------------------------------------------------------------------------------- -void VToolSeamAllowance::UpdateLabelItem(VTextGraphicsItem *labelItem, QPointF pos, qreal labelAngle) -{ - SCASSERT(labelItem != nullptr) - - QRectF rectBB; - rectBB.setTopLeft(pos); - rectBB.setWidth(labelItem->boundingRect().width()); - rectBB.setHeight(labelItem->boundingRect().height()); - qreal dX; - qreal dY; - if (labelItem->IsContained(rectBB, labelAngle, dX, dY) == false) - { - pos.setX(pos.x() + dX); - pos.setY(pos.y() + dY); - } - - labelItem->setPos(pos); - labelItem->setRotation(-labelAngle);// expects clockwise direction - labelItem->Update(); - labelItem->GetTextLines() > 0 ? labelItem->show() : labelItem->hide(); -} - -//--------------------------------------------------------------------------------------------------------------------- -QList VToolSeamAllowance::SelectedTools() const +auto VToolSeamAllowance::SelectedTools() const -> QList { QList tools; if(m_sceneDetails) @@ -2143,9 +2141,9 @@ QList VToolSeamAllowance::SelectedTools() const if (not list.isEmpty()) { tools.reserve(list.size()); - for(auto item : list) + for(auto *item : list) { - VToolSeamAllowance *tool = qgraphicsitem_cast(item); + auto *tool = qgraphicsitem_cast(item); if (tool != nullptr && tool->getId() != m_id) { tools.append(tool); @@ -2160,39 +2158,39 @@ QList VToolSeamAllowance::SelectedTools() const //--------------------------------------------------------------------------------------------------------------------- auto VToolSeamAllowance::IsGrainlinePositionValid() const -> bool { - QLineF grainLine = m_grainLine->Grainline(); + QVector grainLine = m_grainLine->Grainline(); const VPiece detail = VAbstractTool::data.GetPiece(m_id); QVector contourPoints; detail.IsSeamAllowance() && not detail.IsSeamAllowanceBuiltIn() ? CastTo(detail.SeamAllowancePoints(getData()), contourPoints) : CastTo(detail.MainPathPoints(getData()), contourPoints); - QVector points = VAbstractCurve::CurveIntersectLine(contourPoints, grainLine); - if (not points.isEmpty()) + for (auto line : grainLine) { + QVector points = VAbstractCurve::CurveIntersectLine(contourPoints, line); for (auto &point : points) { - if (not VFuzzyComparePoints(grainLine.p1(), point) && not VFuzzyComparePoints(grainLine.p2(), point)) + if (not VFuzzyComparePoints(line.p1(), point) && not VFuzzyComparePoints(line.p2(), point)) { return false; } } } - else - { - QPainterPath grainLinePath = VAbstractPiece::PainterPath(QVector{grainLine.p1(), grainLine.p2()}); - const QPainterPath contourPath = VAbstractPiece::PainterPath(contourPoints); - return contourPath.contains(grainLinePath); - } - return true; + QPainterPath grainLinePath; + for (auto line : grainLine) + { + grainLinePath.addPath(VGObject::PainterPath(QVector{line.p1(), line.p2()})); + } + const QPainterPath contourPath = VGObject::PainterPath(contourPoints); + return contourPath.contains(grainLinePath); } //--------------------------------------------------------------------------------------------------------------------- void VToolSeamAllowance::AddPointRecords(VAbstractPattern *doc, QDomElement &domElement, const QVector &records, const QString &tag) { - if (records.size() > 0) + if (not records.empty()) { QDomElement pinsElement = doc->createElement(tag); for (auto record : records) @@ -2205,14 +2203,14 @@ void VToolSeamAllowance::AddPointRecords(VAbstractPattern *doc, QDomElement &dom } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolSeamAllowance::DuplicateNode(const VPieceNode &node, const VToolSeamAllowanceInitData &initData) +auto VToolSeamAllowance::DuplicateNode(const VPieceNode &node, const VToolSeamAllowanceInitData &initData) -> quint32 { SCASSERT(initData.scene != nullptr) SCASSERT(initData.doc != nullptr) SCASSERT(initData.data != nullptr) const QSharedPointer gobj = initData.data->GetGObject(node.GetId()); - VAbstractNode *tool = qobject_cast(VAbstractPattern::getTool(node.GetId())); + auto *tool = qobject_cast(VAbstractPattern::getTool(node.GetId())); SCASSERT(tool != nullptr) VAbstractNodeInitData initNodeData; @@ -2258,7 +2256,7 @@ quint32 VToolSeamAllowance::DuplicateNode(const VPieceNode &node, const VToolSea } //--------------------------------------------------------------------------------------------------------------------- -quint32 VToolSeamAllowance::DuplicatePiecePath(quint32 id, const VToolSeamAllowanceInitData &initData) +auto VToolSeamAllowance::DuplicatePiecePath(quint32 id, const VToolSeamAllowanceInitData &initData) -> quint32 { const VPiecePath path = initData.data->GetPiecePath(id); VPiecePath newPath = path; @@ -2267,7 +2265,7 @@ quint32 VToolSeamAllowance::DuplicatePiecePath(quint32 id, const VToolSeamAllowa const quint32 idPath = initData.data->AddPiecePath(newPath); - VAbstractNode *tool = qobject_cast(VAbstractPattern::getTool(id)); + auto *tool = qobject_cast(VAbstractPattern::getTool(id)); SCASSERT(tool != nullptr) VToolPiecePathInitData initNodeData; @@ -2287,9 +2285,9 @@ quint32 VToolSeamAllowance::DuplicatePiecePath(quint32 id, const VToolSeamAllowa } //--------------------------------------------------------------------------------------------------------------------- -QVector VToolSeamAllowance::DuplicateCustomSARecords(const QVector &records, - const VToolSeamAllowanceInitData &initData, - const QMap &replacements) +auto VToolSeamAllowance::DuplicateCustomSARecords(const QVector &records, + const VToolSeamAllowanceInitData &initData, + const QMap &replacements) -> QVector { QVector newRecords; newRecords.reserve(records.size()); @@ -2304,8 +2302,8 @@ QVector VToolSeamAllowance::DuplicateCustomSARecords(const QVect } //--------------------------------------------------------------------------------------------------------------------- -QVector VToolSeamAllowance::DuplicateInternalPaths(const QVector &iPaths, - const VToolSeamAllowanceInitData &initData) +auto VToolSeamAllowance::DuplicateInternalPaths(const QVector &iPaths, + const VToolSeamAllowanceInitData &initData) -> QVector { QVector newPaths; newPaths.reserve(iPaths.size()); @@ -2317,15 +2315,15 @@ QVector VToolSeamAllowance::DuplicateInternalPaths(const QVector VToolSeamAllowance::DuplicatePlaceLabels(const QVector &placeLabels, - const VToolSeamAllowanceInitData &initData) +auto VToolSeamAllowance::DuplicatePlaceLabels(const QVector &placeLabels, + const VToolSeamAllowanceInitData &initData) -> QVector { QVector newPlaceLabels; newPlaceLabels.reserve(placeLabels.size()); for(auto placeLabel : placeLabels) { QSharedPointer label = initData.data->GeometricObject(placeLabel); - VAbstractNode *tool = qobject_cast(VAbstractPattern::getTool(placeLabel)); + auto *tool = qobject_cast(VAbstractPattern::getTool(placeLabel)); SCASSERT(tool != nullptr) VToolPlaceLabelInitData initNodeData; @@ -2351,9 +2349,8 @@ QVector VToolSeamAllowance::DuplicatePlaceLabels(const QVector } //--------------------------------------------------------------------------------------------------------------------- -QVector VToolSeamAllowance::DuplicateNodes(const VPiecePath &path, - const VToolSeamAllowanceInitData &initData, - QMap &replacements) +auto VToolSeamAllowance::DuplicateNodes(const VPiecePath &path, const VToolSeamAllowanceInitData &initData, + QMap &replacements) -> QVector { QVector nodes; nodes.reserve(path.CountNodes()); diff --git a/src/libs/vtools/tools/vtoolseamallowance.h b/src/libs/vtools/tools/vtoolseamallowance.h index 18f565408..939f5846f 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.h +++ b/src/libs/vtools/tools/vtoolseamallowance.h @@ -29,43 +29,42 @@ #ifndef VTOOLSEAMALLOWANCE_H #define VTOOLSEAMALLOWANCE_H -#include #include -#include -#include -#include "vinteractivetool.h" -#include "../vwidgets/vtextgraphicsitem.h" +#include +#include +#include + #include "../vwidgets/vgrainlineitem.h" +#include "../vwidgets/vtextgraphicsitem.h" +#include "vinteractivetool.h" class DialogTool; class VNoBrushScalePathItem; struct VToolSeamAllowanceInitData : VAbstractToolInitData { - VToolSeamAllowanceInitData() - : VAbstractToolInitData(), - detail(), - width('0'), - drawName() - {} + VToolSeamAllowanceInitData() = default; - VPiece detail; - QString width; - QString drawName; + VPiece detail{}; // NOLINT(misc-non-private-member-variables-in-classes) + QString width{'0'}; // NOLINT(misc-non-private-member-variables-in-classes) + QString drawName{}; // NOLINT(misc-non-private-member-variables-in-classes) }; class VToolSeamAllowance : public VInteractiveTool, public QGraphicsPathItem { Q_OBJECT // NOLINT public: - virtual ~VToolSeamAllowance() = default; + ~VToolSeamAllowance() override = default; - static VToolSeamAllowance* Create(const QPointer &dialog, VMainGraphicsScene *scene, - VAbstractPattern *doc, VContainer *data); - static VToolSeamAllowance* Create(VToolSeamAllowanceInitData &initData); - static VToolSeamAllowance* Duplicate(const QPointer &dialog, VMainGraphicsScene *scene, - VAbstractPattern *doc); + static auto Create(const QPointer &dialog, + VMainGraphicsScene *scene, + VAbstractPattern *doc, + VContainer *data) -> VToolSeamAllowance *; + static auto Create(VToolSeamAllowanceInitData &initData) -> VToolSeamAllowance *; + static auto Duplicate(const QPointer &dialog, + VMainGraphicsScene *scene, + VAbstractPattern *doc) -> VToolSeamAllowance *; static auto Duplicate(VToolSeamAllowanceInitData &initData) -> VToolSeamAllowance *; static const quint8 pieceVersion; @@ -76,7 +75,6 @@ public: static const QString TagPins; static const QString TagPlaceLabels; - static const QString AttrSeamAllowance; static const QString AttrHideMainPath; static const QString AttrSeamAllowanceBuiltIn; @@ -91,16 +89,32 @@ public: void RemoveWithConfirm(bool ask); - static void InsertNodes(const QVector &nodes, quint32 pieceId, VMainGraphicsScene *scene, - VContainer *data, VAbstractPattern *doc); + static void InsertNodes(const QVector &nodes, + quint32 pieceId, + VMainGraphicsScene *scene, + VContainer *data, + VAbstractPattern *doc); - static void AddAttributes(VAbstractPattern *doc, QDomElement &domElement, quint32 id, const VPiece &piece); + static void AddAttributes(VAbstractPattern *doc, + QDomElement &domElement, + quint32 id, + const VPiece &piece); static void AddCSARecord(VAbstractPattern *doc, QDomElement &domElement, CustomSARecord record); - static void AddCSARecords(VAbstractPattern *doc, QDomElement &domElement, const QVector &records); - static void AddInternalPaths(VAbstractPattern *doc, QDomElement &domElement, const QVector &paths); - static void AddPins(VAbstractPattern *doc, QDomElement &domElement, const QVector &pins); - static void AddPlaceLabels(VAbstractPattern *doc, QDomElement &domElement, const QVector &placeLabels); - static void AddPatternPieceData(VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece); + static void AddCSARecords(VAbstractPattern *doc, + QDomElement &domElement, + const QVector &records); + static void AddInternalPaths(VAbstractPattern *doc, + QDomElement &domElement, + const QVector &paths); + static void AddPins(VAbstractPattern *doc, + QDomElement &domElement, + const QVector &pins); + static void AddPlaceLabels(VAbstractPattern *doc, + QDomElement &domElement, + const QVector &placeLabels); + static void AddPatternPieceData(VAbstractPattern *doc, + QDomElement &domElement, + const VPiece &piece); static void AddPatternInfo(VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece); static void AddGrainline(VAbstractPattern *doc, QDomElement &domElement, const VPiece &piece); @@ -111,57 +125,57 @@ public: void ReinitInternals(const VPiece &detail, VMainGraphicsScene *scene); void RefreshGeometry(bool updateChildren = true); - virtual int type() const override {return Type;} - enum { Type = UserType + static_cast(Tool::Piece)}; + auto type() const -> int override { return Type; } + enum { Type = UserType + static_cast(Tool::Piece) }; - virtual QString getTagName() const override; - virtual void ShowVisualization(bool show) override; - virtual void GroupVisibility(quint32 object, bool visible) override; - virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget) override; - virtual QRectF boundingRect() const override; - virtual QPainterPath shape() const override; + auto getTagName() const -> QString override; + void ShowVisualization(bool show) override; + void GroupVisibility(quint32 object, bool visible) override; + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override; + auto boundingRect() const -> QRectF override; + auto shape() const -> QPainterPath override; public slots: - virtual void FullUpdateFromGuiApply() override; - virtual void FullUpdateFromFile () override; - void EnableToolMove(bool move); - virtual void AllowHover(bool enabled) override; - virtual void AllowSelecting(bool enabled) override; - virtual void ResetChildren(QGraphicsItem* pItem); + void FullUpdateFromGuiApply() override; + void FullUpdateFromFile() override; + void EnableToolMove(bool move); + void AllowHover(bool enabled) override; + void AllowSelecting(bool enabled) override; + virtual void ResetChildren(QGraphicsItem *pItem); virtual void UpdateAll(); virtual void retranslateUi(); - void Highlight(quint32 id); - void UpdateDetailLabel(); - void UpdatePatternInfo(); - void UpdatePassmarks(); - void ShowOptions(); - void DeleteFromMenu(); + void Highlight(quint32 id); + void UpdateDetailLabel(); + void UpdatePatternInfo(); + void UpdatePassmarks(); + void ShowOptions(); + void DeleteFromMenu(); protected slots: void UpdateGrainline(); void SaveMoveDetail(const QPointF &ptPos); void SaveResizeDetail(qreal dLabelW, int iFontSize); void SaveRotationDetail(qreal dRot); - void SaveMovePattern(const QPointF& ptPos); + void SaveMovePattern(const QPointF &ptPos); void SaveResizePattern(qreal dLabelW, int iFontSize); void SaveRotationPattern(qreal dRot); - void SaveMoveGrainline(const QPointF& ptPos); + void SaveMoveGrainline(const QPointF &ptPos); void SaveResizeGrainline(qreal dLength); - void SaveRotateGrainline(qreal dRot, const QPointF& ptPos); + void SaveRotateGrainline(qreal dRot, const QPointF &ptPos); + protected: - virtual void AddToFile () override; - virtual void RefreshDataInFile() override; - virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value ) override; - virtual void mousePressEvent( QGraphicsSceneMouseEvent * event) override; - virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) override; - virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) override; - virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) override; - virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ) override; - virtual void keyReleaseEvent(QKeyEvent * event) override; - virtual void SetVisualization() override {} - virtual void DeleteToolWithConfirm(bool ask = true) override; - virtual void ToolCreation(const Source &typeCreation) override; - virtual void SetDialog() final; - virtual void SaveDialogChange(const QString &undoText = QString()) final; + void AddToFile() override; + void RefreshDataInFile() override; + auto itemChange(GraphicsItemChange change, const QVariant &value) -> QVariant override; + void mousePressEvent(QGraphicsSceneMouseEvent *event) override; + void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override; + void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override; + void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override; + void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override; + void keyReleaseEvent(QKeyEvent *event) override; + void SetVisualization() override {} + void DeleteToolWithConfirm(bool ask = true) override; + void ToolCreation(const Source &typeCreation) override; + void SetDialog() final; + void SaveDialogChange(const QString &undoText = QString()) final; private slots: void ToggleInLayout(bool checked); @@ -178,66 +192,86 @@ private slots: private: Q_DISABLE_COPY_MOVE(VToolSeamAllowance) // NOLINT - QPainterPath m_mainPath; // Must be first to prevent crash - QRectF m_pieceBoundingRect{}; + QPainterPath m_mainPath{}; // Must be first to prevent crash + QRectF m_pieceBoundingRect{}; /** @brief sceneDetails pointer to the scene. */ VMainGraphicsScene *m_sceneDetails; - QString m_drawName; + QString m_drawName; VNoBrushScalePathItem *m_seamAllowance; - VTextGraphicsItem *m_dataLabel; - VTextGraphicsItem *m_patternInfo; - VGrainlineItem *m_grainLine; - QGraphicsPathItem *m_passmarks; - QGraphicsPathItem *m_placeLabels; + VTextGraphicsItem *m_dataLabel; + VTextGraphicsItem *m_patternInfo; + VGrainlineItem *m_grainLine; + QGraphicsPathItem *m_passmarks; + QGraphicsPathItem *m_placeLabels; - bool m_acceptHoverEvents; + bool m_acceptHoverEvents{true}; /** @brief m_geometryIsReady is true when a piece's geometry is ready and checks for validity can be enabled. */ bool m_geometryIsReady{false}; - explicit VToolSeamAllowance(const VToolSeamAllowanceInitData &initData, QGraphicsItem * parent = nullptr); + explicit VToolSeamAllowance(const VToolSeamAllowanceInitData &initData, + QGraphicsItem *parent = nullptr); void UpdateExcludeState(); void UpdateInternalPaths(); - VPieceItem::MoveTypes FindLabelGeometry(const VPatternLabelData &labelData, const QVector &pins, - qreal &rotationAngle, qreal &labelWidth, qreal &labelHeight, QPointF &pos); - VPieceItem::MoveTypes FindGrainlineGeometry(const VGrainlineData &geom, const QVector &pins, qreal &length, - qreal &rotationAngle, QPointF &pos); + auto FindLabelGeometry(const VPatternLabelData &labelData, + const QVector &pins, + qreal &rotationAngle, + qreal &labelWidth, + qreal &labelHeight, + QPointF &pos) -> VPieceItem::MoveTypes; + auto FindGrainlineGeometry(const VGrainlineData &geom, + const QVector &pins, + qreal &length, + qreal &rotationAngle, + QPointF &pos) -> VPieceItem::MoveTypes; void InitNodes(const VPiece &detail, VMainGraphicsScene *scene); - static void InitNode(const VPieceNode &node, VMainGraphicsScene *scene, VToolSeamAllowance *parent); + static void InitNode(const VPieceNode &node, + VMainGraphicsScene *scene, + VToolSeamAllowance *parent); void InitCSAPaths(const VPiece &detail) const; void InitInternalPaths(const VPiece &detail); void InitSpecialPoints(const QVector &points) const; - bool PrepareLabelData(const VPatternLabelData &labelData, const QVector &pins, - VTextGraphicsItem *labelItem, QPointF &pos, qreal &labelAngle); - void UpdateLabelItem(VTextGraphicsItem *labelItem, QPointF pos, qreal labelAngle); + auto PrepareLabelData(const VPatternLabelData &labelData, + const QVector &pins, + VTextGraphicsItem *labelItem, + QPointF &pos, + qreal &labelAngle) -> bool; - QList SelectedTools() const; + auto SelectedTools() const -> QList; - bool IsGrainlinePositionValid() const; + auto IsGrainlinePositionValid() const -> bool; - static void AddPointRecords(VAbstractPattern *doc, QDomElement &domElement, const QVector &records, + static void AddPointRecords(VAbstractPattern *doc, + QDomElement &domElement, + const QVector &records, const QString &tag); - static QVector DuplicateNodes(const VPiecePath &path, const VToolSeamAllowanceInitData &initData, - QMap &replacements); - static quint32 DuplicateNode(const VPieceNode &node, const VToolSeamAllowanceInitData &initData); + static auto DuplicateNodes(const VPiecePath &path, + const VToolSeamAllowanceInitData &initData, + QMap &replacements) -> QVector; + static auto DuplicateNode(const VPieceNode &node, const VToolSeamAllowanceInitData &initData) + -> quint32; - static quint32 DuplicatePiecePath(quint32 id, const VToolSeamAllowanceInitData &initData); + static auto DuplicatePiecePath(quint32 id, const VToolSeamAllowanceInitData &initData) + -> quint32; - static QVector DuplicateCustomSARecords(const QVector &records, - const VToolSeamAllowanceInitData &initData, - const QMap &replacements); + static auto DuplicateCustomSARecords(const QVector &records, + const VToolSeamAllowanceInitData &initData, + const QMap &replacements) + -> QVector; - static QVector DuplicateInternalPaths(const QVector &iPaths, - const VToolSeamAllowanceInitData &initData); - static QVector DuplicatePlaceLabels(const QVector &placeLabels, - const VToolSeamAllowanceInitData &initData); + static auto DuplicateInternalPaths(const QVector &iPaths, + const VToolSeamAllowanceInitData &initData) + -> QVector; + static auto DuplicatePlaceLabels(const QVector &placeLabels, + const VToolSeamAllowanceInitData &initData) + -> QVector; }; #endif // VTOOLSEAMALLOWANCE_H