From d134e8b367e2c33b529314493e78da695cbf4cb6 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Tue, 1 Nov 2016 10:42:32 +0200 Subject: [PATCH] Clang warnings. --HG-- branch : develop --- src/app/valentina/mainwindow.h | 3 +- src/app/valentina/mainwindowsnogui.cpp | 2 +- src/app/valentina/mainwindowsnogui.h | 2 +- src/app/valentina/xml/vpattern.cpp | 6 +- src/libs/vlayout/vlayoutdetail.cpp | 12 +-- src/libs/vlayout/vposter.cpp | 10 +-- src/libs/vlayout/vtextmanager.cpp | 80 +++++++++++++------ src/libs/vlayout/vtextmanager.h | 44 ++++++---- src/libs/vmisc/qxtcsvmodel.cpp | 7 ++ src/libs/vobj/delaunay.cpp | 10 ++- src/libs/vobj/predicates.cpp | 5 ++ src/libs/vpatterndb/vgrainlinegeometry.cpp | 5 -- src/libs/vpatterndb/vgrainlinegeometry.h | 2 - src/libs/vpatterndb/vpatterninfogeometry.cpp | 4 - src/libs/vpatterndb/vpatterninfogeometry.h | 1 - src/libs/vpatterndb/vpatternpiecedata.cpp | 4 - src/libs/vpatterndb/vpatternpiecedata.h | 1 - src/libs/vtools/tools/vtextgraphicsitem.cpp | 10 +-- src/libs/vtools/tools/vtooluniondetails.cpp | 10 +-- .../line/operation/visoperation.cpp | 4 +- .../line/operation/visoperation.h | 4 +- .../line/operation/vistoolmove.cpp | 8 +- .../line/operation/vistoolrotation.cpp | 8 +- 23 files changed, 140 insertions(+), 102 deletions(-) diff --git a/src/app/valentina/mainwindow.h b/src/app/valentina/mainwindow.h index 198687e40..8bc530b0c 100644 --- a/src/app/valentina/mainwindow.h +++ b/src/app/valentina/mainwindow.h @@ -66,7 +66,8 @@ public: public slots: void ProcessCMD(); - void ShowToolTip(const QString &toolTip); + + virtual void ShowToolTip(const QString &toolTip) Q_DECL_OVERRIDE; signals: void RefreshHistory(); diff --git a/src/app/valentina/mainwindowsnogui.cpp b/src/app/valentina/mainwindowsnogui.cpp index b9e60f453..d02b112fe 100644 --- a/src/app/valentina/mainwindowsnogui.cpp +++ b/src/app/valentina/mainwindowsnogui.cpp @@ -367,7 +367,7 @@ void MainWindowsNoGUI::PrintPages(QPrinter *printer) } int paperIndex = -1; - isTiled ? paperIndex = poster->at(index).index : paperIndex = index; + isTiled ? paperIndex = static_cast(poster->at(index).index) : paperIndex = index; auto *paper = qgraphicsitem_cast(papers.at(paperIndex)); if (paper) diff --git a/src/app/valentina/mainwindowsnogui.h b/src/app/valentina/mainwindowsnogui.h index 5ef548a21..6febda374 100644 --- a/src/app/valentina/mainwindowsnogui.h +++ b/src/app/valentina/mainwindowsnogui.h @@ -42,7 +42,7 @@ class QGraphicsScene; class QPrinter; -class PosterData; +struct PosterData; class MainWindowsNoGUI : public VAbstractMainWindow { diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 6a6160e15..624f5ff2e 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -683,7 +683,7 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document detail.GetPatternPieceData().SetLabelWidth(dLW); qreal dLH = GetParametrDouble(element, VToolDetail::AttrHeight, "0"); detail.GetPatternPieceData().SetLabelHeight(dLH); - int iFS = GetParametrUInt(element, VToolDetail::AttrFont, "0"); + int iFS = static_cast(GetParametrUInt(element, VToolDetail::AttrFont, "0")); detail.GetPatternPieceData().SetFontSize(iFS); qreal dRot = GetParametrDouble(element, VToolDetail::AttrRotation, "0"); detail.GetPatternPieceData().SetRotation(dRot); @@ -698,7 +698,7 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document { mcp.m_qsMaterialUserDef = GetParametrString(domMCP, AttrUserDefined, ""); } - mcp.m_iCutNumber = GetParametrUInt(domMCP, AttrCutNumber, 0); + mcp.m_iCutNumber = static_cast(GetParametrUInt(domMCP, AttrCutNumber, 0)); mcp.m_ePlacement = PlacementType(GetParametrUInt(domMCP, AttrPlacement, 0)); detail.GetPatternPieceData().Append(mcp); } @@ -714,7 +714,7 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document detail.GetPatternInfo().SetLabelWidth(dLW); qreal dLH = GetParametrDouble(element, VToolDetail::AttrHeight, "0"); detail.GetPatternInfo().SetLabelHeight(dLH); - int iFS = GetParametrUInt(element, VToolDetail::AttrFont, "0"); + int iFS = static_cast(GetParametrUInt(element, VToolDetail::AttrFont, "0")); detail.GetPatternInfo().SetFontSize(iFS); qreal dRot = GetParametrDouble(element, VToolDetail::AttrRotation, "0"); detail.GetPatternInfo().SetRotation(dRot); diff --git a/src/libs/vlayout/vlayoutdetail.cpp b/src/libs/vlayout/vlayoutdetail.cpp index 8aadd1ea3..e5b929b94 100644 --- a/src/libs/vlayout/vlayoutdetail.cpp +++ b/src/libs/vlayout/vlayoutdetail.cpp @@ -589,9 +589,9 @@ void VLayoutDetail::CreateTextItems() mat.translate(points.at(0).x(), points.at(0).y()); mat.rotate(qRadiansToDegrees(dAng)); - for (int i = 0; i < d->m_tmDetail.GetCount(); ++i) + for (int i = 0; i < d->m_tmDetail.GetOutputLinesCount(); ++i) { - const TextLine& tl = d->m_tmDetail.GetLine(i); + const TextLine& tl = d->m_tmDetail.GetOutputLine(i); QFont fnt = d->m_tmDetail.GetFont(); fnt.setPixelSize(d->m_tmDetail.GetFont().pixelSize() + tl.m_iFontSize); fnt.setWeight(tl.m_eFontWeight); @@ -633,9 +633,9 @@ void VLayoutDetail::CreateTextItems() mat.translate(points.at(0).x(), points.at(0).y()); mat.rotate(qRadiansToDegrees(dAng)); - for (int i = 0; i < d->m_tmPattern.GetCount(); ++i) + for (int i = 0; i < d->m_tmPattern.GetOutputLinesCount(); ++i) { - const TextLine& tl = d->m_tmPattern.GetLine(i); + const TextLine& tl = d->m_tmPattern.GetOutputLine(i); QFont fnt = d->m_tmPattern.GetFont(); fnt.setPixelSize(d->m_tmPattern.GetFont().pixelSize() + tl.m_iFontSize); fnt.setWeight(tl.m_eFontWeight); @@ -685,7 +685,7 @@ QGraphicsItem* VLayoutDetail::GetTextItem(int i) const if (d->mirror == true) { QVector points; - if (i < d->m_tmDetail.GetCount()) + if (i < d->m_tmDetail.GetOutputLinesCount()) { points = Map(Mirror(d->detailLabel)); } @@ -796,7 +796,7 @@ QPointF VLayoutDetail::RotatePoint(const QPointF &ptCenter, const QPointF& pt, q /** * @brief VLayoutDetail::Mirror if the detail layout is rotated, this method will flip the * label points over vertical axis, which goes through the center of the label - * @param list of 4 label vertices + * @param points list of 4 label vertices * @return list of flipped points */ QVector VLayoutDetail::Mirror(const QVector &points) const diff --git a/src/libs/vlayout/vposter.cpp b/src/libs/vlayout/vposter.cpp index 34d05b03f..79f5d2fbf 100644 --- a/src/libs/vlayout/vposter.cpp +++ b/src/libs/vlayout/vposter.cpp @@ -66,9 +66,9 @@ QVector VPoster::Calc(const QRect &imageRect, int page) const for (int j=0; j< columns; j++) { PosterData data = Cut(i, j, imageRect); - data.index = page; - data.rows = rows; - data.columns = columns; + data.index = static_cast(page); + data.rows = static_cast(rows); + data.columns = static_cast(columns); poster.append(data); } } @@ -253,8 +253,8 @@ PosterData VPoster::Cut(int i, int j, const QRect &imageRect) const SCASSERT(y <= imageRect.height()); PosterData data; - data.row = i; - data.column = j; + data.row = static_cast(i); + data.column = static_cast(j); data.rect = QRect(x, y, PageRect().width(), PageRect().height()); return data; diff --git a/src/libs/vlayout/vtextmanager.cpp b/src/libs/vlayout/vtextmanager.cpp index b375e3c73..78e69c912 100644 --- a/src/libs/vlayout/vtextmanager.cpp +++ b/src/libs/vlayout/vtextmanager.cpp @@ -62,9 +62,27 @@ VTextManager::VTextManager() VTextManager::~VTextManager() {} +//--------------------------------------------------------------------------------------------------------------------- +VTextManager::VTextManager(const VTextManager &text) + : m_font(text.GetFont()), m_liLines(text.GetAllSourceLines()), m_liOutput(text.GetAllOutputLines()) +{} + +//--------------------------------------------------------------------------------------------------------------------- +VTextManager &VTextManager::operator=(const VTextManager &text) +{ + if ( &text == this ) + { + return *this; + } + m_font = text.GetFont(); + m_liLines = text.GetAllSourceLines(); + m_liOutput = text.GetAllOutputLines(); + return *this; +} + //--------------------------------------------------------------------------------------------------------------------- /** - * @brief VTextManager::GetSpacing returns the vertical spacing between the lines + * @brief GetSpacing returns the vertical spacing between the lines * @return */ int VTextManager::GetSpacing() const @@ -74,7 +92,7 @@ int VTextManager::GetSpacing() const //--------------------------------------------------------------------------------------------------------------------- /** - * @brief VTextManager::SetFont set the text base font + * @brief SetFont set the text base font * @param font text base font */ void VTextManager::SetFont(const QFont& font) @@ -84,7 +102,7 @@ void VTextManager::SetFont(const QFont& font) //--------------------------------------------------------------------------------------------------------------------- /** - * @brief VTextManager::GetFont returns the text base font + * @brief GetFont returns the text base font * @return text base font */ const QFont& VTextManager::GetFont() const @@ -94,7 +112,7 @@ const QFont& VTextManager::GetFont() const //--------------------------------------------------------------------------------------------------------------------- /** - * @brief VTextManager::SetFontSize sets the font size + * @brief SetFontSize sets the font size * @param iFS font size in pixels */ void VTextManager::SetFontSize(int iFS) @@ -102,52 +120,64 @@ void VTextManager::SetFontSize(int iFS) m_font.setPixelSize(iFS); } +//--------------------------------------------------------------------------------------------------------------------- +QList VTextManager::GetAllSourceLines() const +{ + return m_liLines; +} + //--------------------------------------------------------------------------------------------------------------------- /** - * @brief VTextManager::AddLine add new text line to the list + * @brief AddSourceLine add new text line to the list * @param tl text line object to be added */ -void VTextManager::AddLine(const TextLine& tl) +void VTextManager::AddSourceLine(const TextLine& tl) { m_liLines << tl; } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief VTextManager::Clear deletes the list of texts + * @brief ClearSourceLines deletes the list of texts */ -void VTextManager::Clear() +void VTextManager::ClearSourceLines() { m_liLines.clear(); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief VTextManager::GetCount returns the number of output text lines + * @brief VTextManager::GetOutputLinesCount returns the number of output text lines * @return number of output text lines */ -int VTextManager::GetCount() const +int VTextManager::GetOutputLinesCount() const { return m_liOutput.count(); } //--------------------------------------------------------------------------------------------------------------------- /** - * @brief VTextManager::GetSourceLineCount returns the number of input text lines + * @brief VTextManager::GetSourceLinesCount returns the number of input text lines * @return number of text lines that were added to the list by calling AddLine */ -int VTextManager::GetSourceLineCount() const +int VTextManager::GetSourceLinesCount() const { return m_liLines.count(); } +//--------------------------------------------------------------------------------------------------------------------- +QList VTextManager::GetAllOutputLines() const +{ + return m_liOutput; +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief VTextManager::GetLine returns the i-th output text line * @param i index of the output text line * @return i-th output text line */ -const TextLine& VTextManager::GetLine(int i) const +const TextLine& VTextManager::GetOutputLine(int i) const { return m_liOutput[i]; } @@ -232,7 +262,7 @@ void VTextManager::FitFontSize(qreal fW, qreal fH) */ void VTextManager::Update(const QString& qsName, const VPatternPieceData& data) { - Clear(); + ClearSourceLines(); TextLine tl; // all text must be centered and normal style! tl.m_eAlign = Qt::AlignCenter; @@ -244,7 +274,7 @@ void VTextManager::Update(const QString& qsName, const VPatternPieceData& data) { tl.m_eFontWeight = QFont::Bold; tl.m_iFontSize = 6; - AddLine(tl); + AddSourceLine(tl); } // name tl.m_qsText = qsName; @@ -252,7 +282,7 @@ void VTextManager::Update(const QString& qsName, const VPatternPieceData& data) { tl.m_eFontWeight = QFont::DemiBold; tl.m_iFontSize = 2; - AddLine(tl); + AddSourceLine(tl); } // MCP QStringList qslMaterials; @@ -281,7 +311,7 @@ void VTextManager::Update(const QString& qsName, const VPatternPieceData& data) } tl.m_qsText = qsText.arg(qsMat).arg(mcp.m_iCutNumber). arg(qslPlace[int(mcp.m_ePlacement)]); - AddLine(tl); + AddSourceLine(tl); } } } @@ -293,7 +323,7 @@ void VTextManager::Update(const QString& qsName, const VPatternPieceData& data) */ void VTextManager::Update(const VAbstractPattern *pDoc, qreal dSize, qreal dHeight) { - Clear(); + ClearSourceLines(); TextLine tl; // all information must be centered tl.m_eAlign = Qt::AlignCenter; @@ -305,7 +335,7 @@ void VTextManager::Update(const VAbstractPattern *pDoc, qreal dSize, qreal dHeig tl.m_eFontWeight = QFont::DemiBold; tl.m_eStyle = QFont::StyleNormal; tl.m_iFontSize = 4; - AddLine(tl); + AddSourceLine(tl); } // Pattern name tl.m_qsText = pDoc->GetPatternName(); @@ -314,7 +344,7 @@ void VTextManager::Update(const VAbstractPattern *pDoc, qreal dSize, qreal dHeig tl.m_eFontWeight = QFont::Normal; tl.m_eStyle = QFont::StyleNormal; tl.m_iFontSize = 2; - AddLine(tl); + AddSourceLine(tl); } // Pattern number tl.m_qsText = pDoc->GetPatternNumber(); @@ -323,7 +353,7 @@ void VTextManager::Update(const VAbstractPattern *pDoc, qreal dSize, qreal dHeig tl.m_eFontWeight = QFont::Normal; tl.m_eStyle = QFont::StyleNormal; tl.m_iFontSize = 0; - AddLine(tl); + AddSourceLine(tl); } // Customer name tl.m_qsText = pDoc->GetCustomerName(); @@ -332,7 +362,7 @@ void VTextManager::Update(const VAbstractPattern *pDoc, qreal dSize, qreal dHeig tl.m_eFontWeight = QFont::Normal; tl.m_eStyle = QFont::StyleItalic; tl.m_iFontSize = 0; - AddLine(tl); + AddSourceLine(tl); } // Size tl.m_qsText = pDoc->GetPatternSize(); @@ -349,7 +379,7 @@ void VTextManager::Update(const VAbstractPattern *pDoc, qreal dSize, qreal dHeig tl.m_eFontWeight = QFont::Normal; tl.m_eStyle = QFont::StyleNormal; tl.m_iFontSize = 0; - AddLine(tl); + AddSourceLine(tl); } // Measurements tl.m_qsText = QFileInfo(pDoc->MPath()).fileName(); @@ -358,7 +388,7 @@ void VTextManager::Update(const VAbstractPattern *pDoc, qreal dSize, qreal dHeig tl.m_eFontWeight = QFont::Normal; tl.m_eStyle = QFont::StyleNormal; tl.m_iFontSize = 0; - AddLine(tl); + AddSourceLine(tl); } // Date QDate date; @@ -372,7 +402,7 @@ void VTextManager::Update(const VAbstractPattern *pDoc, qreal dSize, qreal dHeig tl.m_eFontWeight = QFont::Normal; tl.m_eStyle = QFont::StyleNormal; tl.m_iFontSize = 0; - AddLine(tl); + AddSourceLine(tl); } } diff --git a/src/libs/vlayout/vtextmanager.h b/src/libs/vlayout/vtextmanager.h index 98d41aeb1..06227fb0b 100644 --- a/src/libs/vlayout/vtextmanager.h +++ b/src/libs/vlayout/vtextmanager.h @@ -73,27 +73,37 @@ public: VTextManager(); virtual ~VTextManager(); - virtual int GetSpacing() const; - void SetFont(const QFont& font); - const QFont& GetFont() const; - void SetFontSize(int iFS); - void AddLine(const TextLine& tl); - void Clear(); - int GetCount() const; - int GetSourceLineCount() const; - const TextLine& GetLine(int i) const; - bool IsBigEnough(qreal fW, qreal fH, int iFontSize, qreal& fMinW, qreal& fMinH); - void FitFontSize(qreal fW, qreal fH); - void Update(const QString& qsName, const VPatternPieceData& data); - void Update(const VAbstractPattern* pDoc, qreal dSize, qreal dHeight); + VTextManager(const VTextManager &text); + VTextManager &operator=(const VTextManager &text); + + virtual int GetSpacing() const; + + void SetFont(const QFont& font); + const QFont& GetFont() const; + void SetFontSize(int iFS); + void FitFontSize(qreal fW, qreal fH); + + QList GetAllSourceLines() const; + void AddSourceLine(const TextLine& tl); + void ClearSourceLines(); + int GetSourceLinesCount() const; + + int GetOutputLinesCount() const; + QList GetAllOutputLines() const; + const TextLine& GetOutputLine(int i) const; + + bool IsBigEnough(qreal fW, qreal fH, int iFontSize, qreal& fMinW, qreal& fMinH); + + void Update(const QString& qsName, const VPatternPieceData& data); + void Update(const VAbstractPattern* pDoc, qreal dSize, qreal dHeight); protected: - static QStringList SplitString(const QString& qs, qreal fW, const QFontMetrics& fm); + static QStringList SplitString(const QString& qs, qreal fW, const QFontMetrics& fm); private: - QFont m_font; - QList m_liLines; - QList m_liOutput; + QFont m_font; + QList m_liLines; + QList m_liOutput; }; #endif // VTEXTMANAGER_H diff --git a/src/libs/vmisc/qxtcsvmodel.cpp b/src/libs/vmisc/qxtcsvmodel.cpp index 05905799a..ac7b12061 100644 --- a/src/libs/vmisc/qxtcsvmodel.cpp +++ b/src/libs/vmisc/qxtcsvmodel.cpp @@ -50,13 +50,20 @@ public: QxtCsvModelPrivate() : csvData(), header(), maxColumn(0), quoteMode(QxtCsvModel::DefaultQuoteMode) {} QXT_DECLARE_PUBLIC(QxtCsvModel) + virtual ~QxtCsvModelPrivate(); QList csvData; QStringList header; int maxColumn; QxtCsvModel::QuoteMode quoteMode; + +private: + Q_DISABLE_COPY(QxtCsvModelPrivate) }; +QxtCsvModelPrivate::~QxtCsvModelPrivate() +{} + QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") diff --git a/src/libs/vobj/delaunay.cpp b/src/libs/vobj/delaunay.cpp index 1d203225a..15062a097 100644 --- a/src/libs/vobj/delaunay.cpp +++ b/src/libs/vobj/delaunay.cpp @@ -28,6 +28,7 @@ QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wold-style-cast") +QT_WARNING_DISABLE_CLANG("-Wold-style-cast") QT_WARNING_DISABLE_GCC("-Wcast-qual") #if PREDICATE == EXACT_PREDICATE @@ -452,8 +453,8 @@ static int del_init_seg( delaunay_t *del, int start ) point2d_t *pt0, *pt1; /* init delaunay */ - del->start_point = start; - del->end_point = start + 1; + del->start_point = static_cast(start); + del->end_point = static_cast(start + 1); /* setup pt0 and pt1 */ pt0 = del->points[start]; @@ -491,8 +492,8 @@ static int del_init_tri( delaunay_t *del, int start ) point2d_t *pt0, *pt1, *pt2; /* initiate delaunay */ - del->start_point = start; - del->end_point = start + 2; + del->start_point = static_cast(start); + del->end_point = static_cast(start + 2); /* setup the points */ pt0 = del->points[start]; @@ -916,6 +917,7 @@ static void del_link( delaunay_t *result, delaunay_t *left, delaunay_t *right ) /* * divide and conquer delaunay */ +void del_divide_and_conquer( delaunay_t *del, int start, int end ); void del_divide_and_conquer( delaunay_t *del, int start, int end ) { delaunay_t left, right; diff --git a/src/libs/vobj/predicates.cpp b/src/libs/vobj/predicates.cpp index 97ad3a0ac..54ddcb16e 100644 --- a/src/libs/vobj/predicates.cpp +++ b/src/libs/vobj/predicates.cpp @@ -118,6 +118,11 @@ QT_WARNING_DISABLE_GCC("-Wmaybe-uninitialized") #else QT_WARNING_DISABLE_GCC("-Wuninitialized") #endif +QT_WARNING_DISABLE_CLANG("-Wold-style-cast") +QT_WARNING_DISABLE_CLANG("-Wmissing-variable-declarations") +QT_WARNING_DISABLE_CLANG("-Wfloat-equal") +QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") +QT_WARNING_DISABLE_CLANG("-Wconditional-uninitialized") /* On some machines, the exact arithmetic routines might be defeated by the */ /* use of internal extended precision floating-point registers. Sometimes */ diff --git a/src/libs/vpatterndb/vgrainlinegeometry.cpp b/src/libs/vpatterndb/vgrainlinegeometry.cpp index da8f32a90..e1f3b6ccb 100644 --- a/src/libs/vpatterndb/vgrainlinegeometry.cpp +++ b/src/libs/vpatterndb/vgrainlinegeometry.cpp @@ -38,11 +38,6 @@ VGrainlineGeometry::VGrainlineGeometry() //--------------------------------------------------------------------------------------------------------------------- -VGrainlineGeometry::~VGrainlineGeometry() -{} - -//--------------------------------------------------------------------------------------------------------------------- - QPointF VGrainlineGeometry::GetPos() const { return m_ptPos; diff --git a/src/libs/vpatterndb/vgrainlinegeometry.h b/src/libs/vpatterndb/vgrainlinegeometry.h index f556331db..8f040e008 100644 --- a/src/libs/vpatterndb/vgrainlinegeometry.h +++ b/src/libs/vpatterndb/vgrainlinegeometry.h @@ -49,9 +49,7 @@ public: atRear }; -public: VGrainlineGeometry(); - ~VGrainlineGeometry(); // methods, which set and return values of different parameters QPointF GetPos() const; diff --git a/src/libs/vpatterndb/vpatterninfogeometry.cpp b/src/libs/vpatterndb/vpatterninfogeometry.cpp index a97ecf438..5ac561404 100644 --- a/src/libs/vpatterndb/vpatterninfogeometry.cpp +++ b/src/libs/vpatterndb/vpatterninfogeometry.cpp @@ -42,10 +42,6 @@ VPatternInfoGeometry::VPatternInfoGeometry() m_dRotation = 0; } -//--------------------------------------------------------------------------------------------------------------------- -VPatternInfoGeometry::~VPatternInfoGeometry() -{} - //--------------------------------------------------------------------------------------------------------------------- QPointF VPatternInfoGeometry::GetPos() const { diff --git a/src/libs/vpatterndb/vpatterninfogeometry.h b/src/libs/vpatterndb/vpatterninfogeometry.h index d7b7203a5..3184fa225 100644 --- a/src/libs/vpatterndb/vpatterninfogeometry.h +++ b/src/libs/vpatterndb/vpatterninfogeometry.h @@ -43,7 +43,6 @@ class VPatternInfoGeometry { public: VPatternInfoGeometry(); - ~VPatternInfoGeometry(); // methods, which set up label parameters QPointF GetPos() const; diff --git a/src/libs/vpatterndb/vpatternpiecedata.cpp b/src/libs/vpatterndb/vpatternpiecedata.cpp index cea9802fa..f17de794d 100644 --- a/src/libs/vpatterndb/vpatternpiecedata.cpp +++ b/src/libs/vpatterndb/vpatternpiecedata.cpp @@ -41,10 +41,6 @@ VPatternPieceData::VPatternPieceData() m_iFontSize(MIN_FONT_SIZE), m_dRotation(0), m_bVisible(true) {} -//--------------------------------------------------------------------------------------------------------------------- -VPatternPieceData::~VPatternPieceData() -{} - //--------------------------------------------------------------------------------------------------------------------- void VPatternPieceData::Append(const MaterialCutPlacement& rMCP) { diff --git a/src/libs/vpatterndb/vpatternpiecedata.h b/src/libs/vpatterndb/vpatternpiecedata.h index 961dcb22c..c93055875 100644 --- a/src/libs/vpatterndb/vpatternpiecedata.h +++ b/src/libs/vpatterndb/vpatternpiecedata.h @@ -78,7 +78,6 @@ class VPatternPieceData { public: VPatternPieceData(); - ~VPatternPieceData(); // methods, which operate on MaterialCutPlacement container void Append(const MaterialCutPlacement& rMCP); diff --git a/src/libs/vtools/tools/vtextgraphicsitem.cpp b/src/libs/vtools/tools/vtextgraphicsitem.cpp index 4fb029650..3a49598e2 100644 --- a/src/libs/vtools/tools/vtextgraphicsitem.cpp +++ b/src/libs/vtools/tools/vtextgraphicsitem.cpp @@ -108,9 +108,9 @@ void VTextGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem QFont fnt = m_tm.GetFont(); // draw text lines int iY = 0; - for (int i = 0; i < m_tm.GetCount(); ++i) + for (int i = 0; i < m_tm.GetOutputLinesCount(); ++i) { - const TextLine& tl = m_tm.GetLine(i); + const TextLine& tl = m_tm.GetOutputLine(i); fnt.setPixelSize(m_tm.GetFont().pixelSize() + tl.m_iFontSize); fnt.setWeight(tl.m_eFontWeight); fnt.setStyle(tl.m_eStyle); @@ -195,7 +195,7 @@ bool VTextGraphicsItem::IsIdle() const */ void VTextGraphicsItem::AddLine(const TextLine& tl) { - m_tm.AddLine(tl); + m_tm.AddSourceLine(tl); qreal fW = MIN_W; qreal fH = m_iMinH; qreal fMinW; @@ -220,7 +220,7 @@ void VTextGraphicsItem::AddLine(const TextLine& tl) */ void VTextGraphicsItem::Clear() { - m_tm.Clear(); + m_tm.ClearSourceLines(); } //--------------------------------------------------------------------------------------------------------------------- @@ -346,7 +346,7 @@ void VTextGraphicsItem::UpdateData(const VAbstractPattern* pDoc, qreal dSize, qr */ int VTextGraphicsItem::GetTextLines() const { - return m_tm.GetCount(); + return m_tm.GetOutputLinesCount(); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/vtooluniondetails.cpp b/src/libs/vtools/tools/vtooluniondetails.cpp index f46ef6172..6002152eb 100644 --- a/src/libs/vtools/tools/vtooluniondetails.cpp +++ b/src/libs/vtools/tools/vtooluniondetails.cpp @@ -121,8 +121,8 @@ VToolUnionDetails::VToolUnionDetails(VAbstractPattern *doc, VContainer *data, co * @param det detail what we union. * @param i index node in detail. * @param idTool id tool union details. - * @param children - * @param drawName + * @param children list of children + * @param drawName name of pattern piece * @param dx bias node x axis. * @param dy bias node y axis. * @param pRotate point rotation. @@ -1055,9 +1055,9 @@ quint32 VToolUnionDetails::TakeNextId(QVector &children) { #if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0) idChild = children.takeFirst(); -#else - idChild = children.first(); - children.remove(0); +#else + idChild = children.first(); + children.remove(0); #endif } else diff --git a/src/libs/vtools/visualization/line/operation/visoperation.cpp b/src/libs/vtools/visualization/line/operation/visoperation.cpp index 03d3aa7a9..c581fc91e 100644 --- a/src/libs/vtools/visualization/line/operation/visoperation.cpp +++ b/src/libs/vtools/visualization/line/operation/visoperation.cpp @@ -129,11 +129,11 @@ void VisOperation::RefreshFlippedObjects(const QPointF &firstPoint, const QPoint const QSharedPointer p = Visualization::data->GeometricObject(id); ++iPoint; - QGraphicsEllipseItem *point = GetPoint(iPoint, supportColor2); + QGraphicsEllipseItem *point = GetPoint(static_cast(iPoint), supportColor2); DrawPoint(point, *p, supportColor2); ++iPoint; - point = GetPoint(iPoint, supportColor); + point = GetPoint(static_cast(iPoint), supportColor); if (object1Id != NULL_ID) { diff --git a/src/libs/vtools/visualization/line/operation/visoperation.h b/src/libs/vtools/visualization/line/operation/visoperation.h index 6e698e81d..3bcc5099d 100644 --- a/src/libs/vtools/visualization/line/operation/visoperation.h +++ b/src/libs/vtools/visualization/line/operation/visoperation.h @@ -71,11 +71,11 @@ int VisOperation::AddFlippedCurve(const QPointF &firstPoint, const QPointF &seco const QSharedPointer curve = Visualization::data->template GeometricObject(id); ++i; - QGraphicsPathItem *path = GetCurve(i, supportColor2); + QGraphicsPathItem *path = GetCurve(static_cast(i), supportColor2); DrawPath(path, curve->GetPath(PathDirection::Show), supportColor2, Qt::SolidLine, Qt::RoundCap); ++i; - path = GetCurve(i, supportColor); + path = GetCurve(static_cast(i), supportColor); if (object1Id != NULL_ID) { const Item flipped = curve->Flip(QLineF(firstPoint, secondPoint)); diff --git a/src/libs/vtools/visualization/line/operation/vistoolmove.cpp b/src/libs/vtools/visualization/line/operation/vistoolmove.cpp index 8554a2ac3..c4bd41362 100644 --- a/src/libs/vtools/visualization/line/operation/vistoolmove.cpp +++ b/src/libs/vtools/visualization/line/operation/vistoolmove.cpp @@ -165,7 +165,7 @@ QGraphicsPathItem *VisToolMove::AddOriginCurve(quint32 id, int &i) const QSharedPointer curve = Visualization::data->template GeometricObject(id); ++i; - QGraphicsPathItem *path = GetCurve(i, supportColor2); + QGraphicsPathItem *path = GetCurve(static_cast(i), supportColor2); DrawPath(path, curve->GetPath(PathDirection::Show), supportColor2, Qt::SolidLine, Qt::RoundCap); return path; @@ -178,7 +178,7 @@ int VisToolMove::AddMovedCurve(qreal angle, qreal length, quint32 id, int i) const QSharedPointer curve = Visualization::data->template GeometricObject(id); ++i; - QGraphicsPathItem *path = GetCurve(i, supportColor); + QGraphicsPathItem *path = GetCurve(static_cast(i), supportColor); const Item moved = curve->Move(length, angle); DrawPath(path, moved.GetPath(PathDirection::Show), supportColor, Qt::SolidLine, Qt::RoundCap); @@ -233,7 +233,7 @@ QVector VisToolMove::CreateOriginObjects(int &iPoint, int &iCur const QSharedPointer p = Visualization::data->GeometricObject(id); ++iPoint; - QGraphicsEllipseItem *point = GetPoint(iPoint, supportColor2); + QGraphicsEllipseItem *point = GetPoint(static_cast(iPoint), supportColor2); DrawPoint(point, *p, supportColor2); originObjects.append(point); @@ -288,7 +288,7 @@ void VisToolMove::CreateMovedObjects(int &iPoint, int &iCurve, qreal length, qre const QSharedPointer p = Visualization::data->GeometricObject(id); ++iPoint; - QGraphicsEllipseItem *point = GetPoint(iPoint, supportColor); + QGraphicsEllipseItem *point = GetPoint(static_cast(iPoint), supportColor); DrawPoint(point, p->Move(length, angle), supportColor); break; } diff --git a/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp b/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp index b2179db23..148990ebf 100644 --- a/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp +++ b/src/libs/vtools/visualization/line/operation/vistoolrotation.cpp @@ -141,11 +141,11 @@ void VisToolRotation::RefreshGeometry() const QSharedPointer p = Visualization::data->GeometricObject(id); ++iPoint; - QGraphicsEllipseItem *point = GetPoint(iPoint, supportColor2); + QGraphicsEllipseItem *point = GetPoint(static_cast(iPoint), supportColor2); DrawPoint(point, *p, supportColor2); ++iPoint; - point = GetPoint(iPoint, supportColor); + point = GetPoint(static_cast(iPoint), supportColor); if (object1Id != NULL_ID) { @@ -216,11 +216,11 @@ int VisToolRotation::AddCurve(qreal angle, const QPointF &origin, quint32 id, in const QSharedPointer curve = Visualization::data->template GeometricObject(id); ++i; - QGraphicsPathItem *path = GetCurve(i, supportColor2); + QGraphicsPathItem *path = GetCurve(static_cast(i), supportColor2); DrawPath(path, curve->GetPath(PathDirection::Show), supportColor2, Qt::SolidLine, Qt::RoundCap); ++i; - path = GetCurve(i, supportColor); + path = GetCurve(static_cast(i), supportColor); if (object1Id != NULL_ID) { const Item rotated = curve->Rotate(origin, angle);