From b861d6a28ef3c9a27ad884219afbfb5d9b7e0b1d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 25 Sep 2021 17:18:33 +0300 Subject: [PATCH] GCC warnings. --- src/libs/fervor/fvupdater.cpp | 9 ++- src/libs/ifc/exception/vexception.h | 1 + src/libs/ifc/xml/vabstractconverter.h | 6 ++ src/libs/qmuparser/qmudef.h | 50 ----------------- src/libs/qmuparser/qmuparser.h | 5 +- src/libs/qmuparser/qmuparserbase.h | 6 ++ src/libs/qmuparser/qmutokenparser.h | 5 +- src/libs/vdxf/libdxfrw/drw_interface.h | 6 ++ src/libs/vgeometry/vabstractcubicbezierpath.h | 1 + src/libs/vgeometry/vabstractcurve.h | 6 ++ src/libs/vgeometry/vcubicbezierpath_p.h | 2 +- src/libs/vgeometry/vgobject.h | 6 ++ src/libs/vgeometry/vpointf.h | 2 +- src/libs/vgeometry/vspline.h | 2 +- src/libs/vgeometry/vsplinepath.h | 2 +- src/libs/vlayout/vbestsquare.h | 4 +- src/libs/vlayout/vlayoutpiece.h | 6 ++ src/libs/vlayout/vposition.h | 4 +- src/libs/vmisc/def.h | 56 ++----------------- src/libs/vmisc/vabstractapplication.h | 1 + src/libs/vpatterndb/calculator.h | 2 +- src/libs/vpatterndb/variables/varcradius.h | 2 +- .../vpatterndb/variables/vcurvevariable.cpp | 11 ++-- .../vpatterndb/variables/vinternalvariable.h | 6 ++ src/libs/vpatterndb/variables/vlineangle.h | 2 +- src/libs/vpatterndb/variables/vlinelength.h | 2 +- src/libs/vpatterndb/variables/vmeasurement.h | 2 +- .../plugins/Vector3d/vvector3dproperty.h | 5 +- .../vpropertyexplorer/plugins/vboolproperty.h | 5 +- .../plugins/vcolorproperty.h | 5 +- .../plugins/vemptyproperty.h | 5 +- .../vpropertyexplorer/plugins/venumproperty.h | 6 +- .../vpropertyexplorer/plugins/vfileproperty.h | 6 +- .../plugins/vfilepropertyeditor.h | 4 +- .../plugins/vnumberproperty.h | 4 +- .../plugins/vshortcutproperty.h | 5 +- .../vpropertyexplorer/plugins/vtextproperty.h | 5 +- .../plugins/vwidgetproperty.h | 5 +- src/libs/vpropertyexplorer/vproperty.h | 6 +- src/libs/vpropertyexplorer/vproperty_p.h | 6 ++ .../vpropertyexplorer_global.h | 50 ----------------- .../vpropertyexplorer/vpropertyformview.h | 6 +- src/libs/vpropertyexplorer/vpropertymodel.h | 6 +- src/libs/vpropertyexplorer/vpropertyset.h | 6 +- src/libs/vtools/dialogs/tools/dialogarc.cpp | 7 ++- .../dialogs/tools/dialogarcwithlength.cpp | 5 +- .../vtools/dialogs/tools/dialogcutarc.cpp | 5 +- .../vtools/dialogs/tools/dialogcutspline.cpp | 5 +- .../dialogs/tools/dialogcutsplinepath.cpp | 5 +- .../dialogs/tools/dialogellipticalarc.cpp | 5 +- .../vtools/dialogs/tools/dialogendline.cpp | 5 +- src/libs/vtools/dialogs/tools/dialogline.cpp | 5 +- src/libs/vtools/dialogs/tools/dialogtool.h | 8 ++- .../tools/piece/dialogduplicatedetail.cpp | 5 +- .../vtools/dialogs/tools/piece/dialogpin.cpp | 5 +- .../dialogs/tools/piece/dialogplacelabel.cpp | 5 +- src/libs/vtools/visualization/visualization.h | 6 ++ src/libs/vwidgets/vabstractmainwindow.h | 1 + src/libs/vwidgets/vcurvepathitem.h | 1 + 59 files changed, 214 insertions(+), 201 deletions(-) diff --git a/src/libs/fervor/fvupdater.cpp b/src/libs/fervor/fvupdater.cpp index a0ec1ffa6..f4efe04f4 100644 --- a/src/libs/fervor/fvupdater.cpp +++ b/src/libs/fervor/fvupdater.cpp @@ -130,13 +130,16 @@ void FvUpdater::showUpdaterWindowUpdatedWithCurrentUpdateProposal() // Create a new window m_updaterWindow = new FvUpdateWindow(VAbstractValApplication::VApp()->getMainWindow()); m_updaterWindow->UpdateWindowWithCurrentProposedUpdate(); - m_updaterWindow->exec(); + if (m_updaterWindow != nullptr) + { + m_updaterWindow->exec(); + } } //--------------------------------------------------------------------------------------------------------------------- void FvUpdater::hideUpdaterWindow() { - if (m_updaterWindow) + if (m_updaterWindow != nullptr) { m_updaterWindow->close(); } @@ -352,7 +355,7 @@ void FvUpdater::startDownloadFeed(const QUrl &url) //--------------------------------------------------------------------------------------------------------------------- void FvUpdater::cancelDownloadFeed() { - if (m_reply) + if (m_reply != nullptr) { m_httpRequestAborted = true; m_reply->abort(); diff --git a/src/libs/ifc/exception/vexception.h b/src/libs/ifc/exception/vexception.h index 429d1e634..ef1ac9613 100644 --- a/src/libs/ifc/exception/vexception.h +++ b/src/libs/ifc/exception/vexception.h @@ -38,6 +38,7 @@ QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") /** * @brief The VException class parent for all exception. Could be use for abstract exception diff --git a/src/libs/ifc/xml/vabstractconverter.h b/src/libs/ifc/xml/vabstractconverter.h index 254b9d6d0..2a59bc2c9 100644 --- a/src/libs/ifc/xml/vabstractconverter.h +++ b/src/libs/ifc/xml/vabstractconverter.h @@ -38,6 +38,10 @@ #include "vdomdocument.h" #include "../vmisc/projectversion.h" +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + class VAbstractConverter :public VDomDocument { Q_DECLARE_TR_FUNCTIONS(VAbstractConverter) @@ -85,4 +89,6 @@ private: void ReserveFile() const; }; +QT_WARNING_POP + #endif // VABSTRACTCONVERTER_H diff --git a/src/libs/qmuparser/qmudef.h b/src/libs/qmuparser/qmudef.h index a5ea2e722..508ad6eb7 100644 --- a/src/libs/qmuparser/qmudef.h +++ b/src/libs/qmuparser/qmudef.h @@ -113,56 +113,6 @@ QMUPARSERSHARED_EXPORT QString NameRegExp(); QT_WARNING_POP -#ifndef QMU_ATTRIBUTE_UNUSED -# if defined(Q_CC_GNU) || defined(Q_CC_CLANG) -# define QMU_ATTRIBUTE_UNUSED [[gnu::unused]] -#elif defined(Q_CC_MSVC) -# define QMU_ATTRIBUTE_UNUSED __declspec(unused) -# else -# define QMU_ATTRIBUTE_UNUSED -# endif -#endif - -// Example of use -//class Base -//{ -// virtual ~Base() -// { -// } - -// virtual int a(float f) -// { -// } -// virtual void b(double) -// { -// } -//}; - -//QMU_MARK_NONFINAL_CLASS(Base) -//QMU_ATTRIBUTE_UNUSED(Base, int, a(float)) -//QMU_ATTRIBUTE_UNUSED(Base, void, b(double) - -#ifndef QMU_MARK_NONFINAL_CLASS -#define QMU_MARK_NONFINAL_CLASS(base) \ - namespace qmu_void_namespace_for_class_##base \ - { \ - struct QMU_ATTRIBUTE_UNUSED temp_marker final : base \ - { \ - }; \ - } -#endif - -#ifndef QMU_MARK_NONFINAL_METHOD -#define QMU_MARK_NONFINAL_METHOD(base, return_type, method) \ - namespace qmu_void_namespace_for_class_##base##_methos_##method \ - { \ - struct QMU_ATTRIBUTE_UNUSED temp_marker final : base \ - { \ - inline return_type QMU_ATTRIBUTE_UNUSED method override {} \ - }; \ - } -#endif - Q_REQUIRED_RESULT static inline bool QmuFuzzyComparePossibleNulls(double p1, double p2); static inline bool QmuFuzzyComparePossibleNulls(double p1, double p2) { diff --git a/src/libs/qmuparser/qmuparser.h b/src/libs/qmuparser/qmuparser.h index 309701c46..c91974df5 100644 --- a/src/libs/qmuparser/qmuparser.h +++ b/src/libs/qmuparser/qmuparser.h @@ -37,6 +37,9 @@ namespace qmu { + QT_WARNING_PUSH + QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") + /** @brief Mathematical expressions parser. * * Standard implementation of the mathematical expressions parser. @@ -99,7 +102,7 @@ namespace qmu static qreal Max(const qreal*, int); // maximum }; - QMU_MARK_NONFINAL_CLASS(QmuParser) + QT_WARNING_POP //--------------------------------------------------------------------------------------------------------------------- /** diff --git a/src/libs/qmuparser/qmuparserbase.h b/src/libs/qmuparser/qmuparserbase.h index 96f06b9b3..2aeb40cba 100644 --- a/src/libs/qmuparser/qmuparserbase.h +++ b/src/libs/qmuparser/qmuparserbase.h @@ -52,6 +52,10 @@ namespace qmu * @brief This file contains the class definition of the qmuparser engine. */ +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + /** * @brief Mathematical expressions parser (base parser engine). * @author (C) 2013 Ingo Berg @@ -279,6 +283,8 @@ private: void StackDump(const QStack &a_stVal, const QStack &a_stOprt) const; }; +QT_WARNING_POP + //--------------------------------------------------------------------------------------------------------------------- /** * @fn void qmu::QmuParserBase::DefineFun(const string_type &a_strName, fun_type0 a_pFun, diff --git a/src/libs/qmuparser/qmutokenparser.h b/src/libs/qmuparser/qmutokenparser.h index 15c6a125b..8a20e4104 100644 --- a/src/libs/qmuparser/qmutokenparser.h +++ b/src/libs/qmuparser/qmutokenparser.h @@ -33,6 +33,9 @@ namespace qmu { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") + class QMUPARSERSHARED_EXPORT QmuTokenParser : public QmuFormulaBase { public: @@ -50,7 +53,7 @@ private: QmuTokenParser(); }; -QMU_MARK_NONFINAL_CLASS(QmuTokenParser) +QT_WARNING_POP } // namespace qmu diff --git a/src/libs/vdxf/libdxfrw/drw_interface.h b/src/libs/vdxf/libdxfrw/drw_interface.h index b0de89012..99585f14d 100644 --- a/src/libs/vdxf/libdxfrw/drw_interface.h +++ b/src/libs/vdxf/libdxfrw/drw_interface.h @@ -19,6 +19,10 @@ #include "drw_objects.h" #include "drw_header.h" +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + /** * Abstract class (interface) for comunicate dxfReader with the application. * Inherit your class which takes care of the entities in the @@ -187,4 +191,6 @@ public: virtual void writeAppId() { } }; +QT_WARNING_POP + #endif diff --git a/src/libs/vgeometry/vabstractcubicbezierpath.h b/src/libs/vgeometry/vabstractcubicbezierpath.h index d8a2b3c30..6f457b166 100644 --- a/src/libs/vgeometry/vabstractcubicbezierpath.h +++ b/src/libs/vgeometry/vabstractcubicbezierpath.h @@ -45,6 +45,7 @@ class VSplinePoint; QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") class VAbstractCubicBezierPath : public VAbstractBezier { diff --git a/src/libs/vgeometry/vabstractcurve.h b/src/libs/vgeometry/vabstractcurve.h index c84f321cb..d7ceed4d2 100644 --- a/src/libs/vgeometry/vabstractcurve.h +++ b/src/libs/vgeometry/vabstractcurve.h @@ -47,6 +47,10 @@ typedef QPair DirectionArrow; class QPainterPath; class VAbstractCurveData; +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + class VAbstractCurve :public VGObject { public: @@ -117,6 +121,8 @@ private: static QVector ToEnd(const QVector &points, const QPointF &end, bool *ok = nullptr); }; +QT_WARNING_POP + Q_DECLARE_TYPEINFO(VAbstractCurve, Q_MOVABLE_TYPE); #endif // VABSTRACTCURVE_H diff --git a/src/libs/vgeometry/vcubicbezierpath_p.h b/src/libs/vgeometry/vcubicbezierpath_p.h index 34db4879c..cbb82d165 100644 --- a/src/libs/vgeometry/vcubicbezierpath_p.h +++ b/src/libs/vgeometry/vcubicbezierpath_p.h @@ -38,7 +38,7 @@ QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Wnon-virtual-dtor") -class VCubicBezierPathData : public QSharedData +class VCubicBezierPathData final : public QSharedData { public: diff --git a/src/libs/vgeometry/vgobject.h b/src/libs/vgeometry/vgobject.h index 05f80a0e8..660d18208 100644 --- a/src/libs/vgeometry/vgobject.h +++ b/src/libs/vgeometry/vgobject.h @@ -45,6 +45,10 @@ class QRectF; class VGObjectData; class QTransform; +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + /** * @brief The VGObject class keep information graphical objects. */ @@ -120,6 +124,8 @@ private: static int PointInCircle (const QPointF &p, const QPointF ¢er, qreal radius); }; +QT_WARNING_POP + Q_DECLARE_TYPEINFO(VGObject, Q_MOVABLE_TYPE); #endif // VGOBJECT_H diff --git a/src/libs/vgeometry/vpointf.h b/src/libs/vgeometry/vpointf.h index a6db22f21..65ef2c99e 100644 --- a/src/libs/vgeometry/vpointf.h +++ b/src/libs/vgeometry/vpointf.h @@ -44,6 +44,7 @@ class VPointFData; QT_WARNING_PUSH QT_WARNING_DISABLE_INTEL(2304) +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") /** * @brief The VPointF class keep data of point. @@ -97,7 +98,6 @@ private: Q_DECLARE_METATYPE(VPointF) Q_DECLARE_TYPEINFO(VPointF, Q_MOVABLE_TYPE); -V_MARK_NONFINAL_CLASS(VPointF) QT_WARNING_POP diff --git a/src/libs/vgeometry/vspline.h b/src/libs/vgeometry/vspline.h index 40e436aab..1f701a909 100644 --- a/src/libs/vgeometry/vspline.h +++ b/src/libs/vgeometry/vspline.h @@ -48,7 +48,7 @@ class VSplineData; /** * @brief VSpline class that implements the spline. */ -class VSpline :public VAbstractCubicBezier +class VSpline final :public VAbstractCubicBezier { public: VSpline(); diff --git a/src/libs/vgeometry/vsplinepath.h b/src/libs/vgeometry/vsplinepath.h index fddc82e95..6990345e2 100644 --- a/src/libs/vgeometry/vsplinepath.h +++ b/src/libs/vgeometry/vsplinepath.h @@ -50,7 +50,7 @@ class VSplinePathData; /** * @brief The VSplinePath class keep information about splinePath. */ -class VSplinePath :public VAbstractCubicBezierPath +class VSplinePath final :public VAbstractCubicBezierPath { Q_DECLARE_TR_FUNCTIONS(VSplinePath) public: diff --git a/src/libs/vlayout/vbestsquare.h b/src/libs/vlayout/vbestsquare.h index 54be7f9f5..fdd6a0c23 100644 --- a/src/libs/vlayout/vbestsquare.h +++ b/src/libs/vlayout/vbestsquare.h @@ -39,13 +39,13 @@ class VBestSquareData; -class VBestSquare +class VBestSquare final { public: VBestSquare(); VBestSquare(QSizeF sheetSize, bool saveLength, bool isPortrait); VBestSquare(const VBestSquare &res); - virtual ~VBestSquare(); + ~VBestSquare(); VBestSquare &operator=(const VBestSquare &res); #ifdef Q_COMPILER_RVALUE_REFS diff --git a/src/libs/vlayout/vlayoutpiece.h b/src/libs/vlayout/vlayoutpiece.h index 850416a69..1afe12191 100644 --- a/src/libs/vlayout/vlayoutpiece.h +++ b/src/libs/vlayout/vlayoutpiece.h @@ -56,6 +56,10 @@ class VPieceLabelData; class VAbstractPattern; class VPatternLabelData; +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + class VLayoutPiece :public VAbstractPiece { Q_DECLARE_TR_FUNCTIONS(VLayoutPiece) @@ -218,6 +222,8 @@ private: int EdgeByPoint(const QVector &path, const QPointF &p1) const; }; +QT_WARNING_POP + Q_DECLARE_TYPEINFO(VLayoutPiece, Q_MOVABLE_TYPE); #endif // VLAYOUTDETAIL_H diff --git a/src/libs/vlayout/vposition.h b/src/libs/vlayout/vposition.h index 2f80199e2..0a1a46ef6 100644 --- a/src/libs/vlayout/vposition.h +++ b/src/libs/vlayout/vposition.h @@ -72,9 +72,9 @@ public: VPosition(const VPosition&) = default; VPosition& operator=(const VPosition&) = default; VPosition& operator=(VPosition&&) = default; - virtual ~VPosition()= default; + ~VPosition()= default; - virtual void run(); + void run(); VBestSquare getBestResult() const; diff --git a/src/libs/vmisc/def.h b/src/libs/vmisc/def.h index 6653b086d..f15aa1402 100644 --- a/src/libs/vmisc/def.h +++ b/src/libs/vmisc/def.h @@ -354,56 +354,6 @@ if (!(cond)) \ #endif // defined(__cplusplus) #endif // QT_VERSION < QT_VERSION_CHECK(5, 8, 0) -#ifndef V_ATTRIBUTE_UNUSED -# if defined(Q_CC_GNU) || defined(Q_CC_CLANG) -# define V_ATTRIBUTE_UNUSED [[gnu::unused]] -#elif defined(Q_CC_MSVC) -# define V_ATTRIBUTE_UNUSED __declspec(unused) -# else -# define V_ATTRIBUTE_UNUSED -# endif -#endif - -// Example of use -//class Base -//{ -// virtual ~Base() -// { -// } - -// virtual int a(float f) -// { -// } -// virtual void b(double) -// { -// } -//}; - -//V_MARK_NONFINAL_CLASS(Base) -//V_ATTRIBUTE_UNUSED(Base, int, a(float)) -//V_ATTRIBUTE_UNUSED(Base, void, b(double) - -#ifndef V_MARK_NONFINAL_CLASS -#define V_MARK_NONFINAL_CLASS(base) \ - namespace v_void_namespace_for_class_##base \ - { \ - struct V_ATTRIBUTE_UNUSED temp_marker final : base \ - { \ - }; \ - } -#endif - -#ifndef V_MARK_NONFINAL_METHOD -#define V_MARK_NONFINAL_METHOD(base, return_type, method) \ - namespace v_void_namespace_for_class_##base##_methos_##method \ - { \ - struct V_ATTRIBUTE_UNUSED temp_marker final : base \ - { \ - inline return_type V_ATTRIBUTE_UNUSED method override {} \ - }; \ - } -#endif - bool IsOptionSet(int argc, char *argv[], const char *option); void InitHighDpiScaling(int argc, char *argv[]); @@ -726,6 +676,10 @@ Q_DECLARE_TYPEINFO(CustomSARecord, Q_MOVABLE_TYPE); #define QXT_D(PUB) PUB##Private& d = qxt_d() #define QXT_P(PUB) PUB& p = qxt_p() +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + template class QxtPrivate { @@ -762,6 +716,8 @@ private: PUB* qxt_p_ptr; }; +QT_WARNING_POP + template class QxtPrivateInterface { diff --git a/src/libs/vmisc/vabstractapplication.h b/src/libs/vmisc/vabstractapplication.h index c9372bad3..73d398dfc 100644 --- a/src/libs/vmisc/vabstractapplication.h +++ b/src/libs/vmisc/vabstractapplication.h @@ -51,6 +51,7 @@ class VCommonSettings; QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") class VAbstractApplication : public QApplication { diff --git a/src/libs/vpatterndb/calculator.h b/src/libs/vpatterndb/calculator.h index 9848e6d19..5ef7d6cc3 100644 --- a/src/libs/vpatterndb/calculator.h +++ b/src/libs/vpatterndb/calculator.h @@ -57,7 +57,7 @@ class VInternalVariable; * result = cal->EvalFormula(data->PlainVariables(), formula); * } */ -class Calculator:public qmu::QmuFormulaBase +class Calculator final : public qmu::QmuFormulaBase { public: Calculator(); diff --git a/src/libs/vpatterndb/variables/varcradius.h b/src/libs/vpatterndb/variables/varcradius.h index a41518510..bb4e94921 100644 --- a/src/libs/vpatterndb/variables/varcradius.h +++ b/src/libs/vpatterndb/variables/varcradius.h @@ -39,7 +39,7 @@ class VArc; class VEllipticalArc; -class VArcRadius :public VCurveVariable +class VArcRadius final :public VCurveVariable { public: VArcRadius(); diff --git a/src/libs/vpatterndb/variables/vcurvevariable.cpp b/src/libs/vpatterndb/variables/vcurvevariable.cpp index 3be59f5ec..13f91b2f5 100644 --- a/src/libs/vpatterndb/variables/vcurvevariable.cpp +++ b/src/libs/vpatterndb/variables/vcurvevariable.cpp @@ -91,14 +91,17 @@ bool VCurveVariable::Filter(quint32 id) return false; } + QT_WARNING_PUSH + QT_WARNING_DISABLE_GCC("-Wnull-dereference") + if (d->parentId != NULL_ID)//Do not check if value zero {// Not all curves have parents. Only those who was created after cutting the parent curve. return d->id == id || d->parentId == id; } - else - { - return d->id == id; - } + + return d->id == id; + + QT_WARNING_POP } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vpatterndb/variables/vinternalvariable.h b/src/libs/vpatterndb/variables/vinternalvariable.h index 118f89519..640e74832 100644 --- a/src/libs/vpatterndb/variables/vinternalvariable.h +++ b/src/libs/vpatterndb/variables/vinternalvariable.h @@ -38,6 +38,10 @@ class VInternalVariableData; +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + class VInternalVariable { public: @@ -73,6 +77,8 @@ private: QSharedDataPointer d; }; +QT_WARNING_POP + Q_DECLARE_TYPEINFO(VInternalVariable, Q_MOVABLE_TYPE); #endif // VINTERNALVARIABLE_H diff --git a/src/libs/vpatterndb/variables/vlineangle.h b/src/libs/vpatterndb/variables/vlineangle.h index d1e1f4402..e0540d8de 100644 --- a/src/libs/vpatterndb/variables/vlineangle.h +++ b/src/libs/vpatterndb/variables/vlineangle.h @@ -39,7 +39,7 @@ class VLineAngleData; class VPointF; -class VLineAngle :public VInternalVariable +class VLineAngle final :public VInternalVariable { public: VLineAngle(); diff --git a/src/libs/vpatterndb/variables/vlinelength.h b/src/libs/vpatterndb/variables/vlinelength.h index 96a6f876f..b46170246 100644 --- a/src/libs/vpatterndb/variables/vlinelength.h +++ b/src/libs/vpatterndb/variables/vlinelength.h @@ -41,7 +41,7 @@ class VLengthLineData; class VPointF; -class VLengthLine :public VInternalVariable +class VLengthLine final :public VInternalVariable { public: VLengthLine(); diff --git a/src/libs/vpatterndb/variables/vmeasurement.h b/src/libs/vpatterndb/variables/vmeasurement.h index ce16ea4b4..281e0a2d3 100644 --- a/src/libs/vpatterndb/variables/vmeasurement.h +++ b/src/libs/vpatterndb/variables/vmeasurement.h @@ -47,7 +47,7 @@ class VMeasurementData; /** * @brief The VMeasurement class keep data row of multisize table */ -class VMeasurement :public VVariable +class VMeasurement final :public VVariable { public: VMeasurement(quint32 index, const QString &name, qreal baseA, qreal baseB, qreal baseC, qreal base); diff --git a/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.h b/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.h index 7c8017a98..75097b7f4 100644 --- a/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.h +++ b/src/libs/vpropertyexplorer/plugins/Vector3d/vvector3dproperty.h @@ -70,6 +70,9 @@ Q_DECLARE_METATYPE(QPE::Vector3D) // todo */ +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") + class VPROPERTYEXPLORERSHARED_EXPORT QVector3DProperty : public VProperty { Q_OBJECT @@ -113,7 +116,7 @@ private: Q_DISABLE_COPY(QVector3DProperty) }; -VPE_MARK_NONFINAL_CLASS(QVector3DProperty) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/plugins/vboolproperty.h b/src/libs/vpropertyexplorer/plugins/vboolproperty.h index abc047a84..a643f84af 100644 --- a/src/libs/vpropertyexplorer/plugins/vboolproperty.h +++ b/src/libs/vpropertyexplorer/plugins/vboolproperty.h @@ -36,6 +36,9 @@ namespace VPE { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") + //! The VBoolProperty can take two states: True or False. class VPROPERTYEXPLORERSHARED_EXPORT VBoolProperty : public VProperty { @@ -80,7 +83,7 @@ private: Q_DISABLE_COPY(VBoolProperty) }; -VPE_MARK_NONFINAL_CLASS(VBoolProperty) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/plugins/vcolorproperty.h b/src/libs/vpropertyexplorer/plugins/vcolorproperty.h index b76df13d8..0ae7cc280 100644 --- a/src/libs/vpropertyexplorer/plugins/vcolorproperty.h +++ b/src/libs/vpropertyexplorer/plugins/vcolorproperty.h @@ -37,6 +37,9 @@ namespace VPE { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") + class VPROPERTYEXPLORERSHARED_EXPORT VColorProperty : public VProperty { Q_OBJECT @@ -74,7 +77,7 @@ private: Q_DISABLE_COPY(VColorProperty) }; -VPE_MARK_NONFINAL_CLASS(VColorProperty) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/plugins/vemptyproperty.h b/src/libs/vpropertyexplorer/plugins/vemptyproperty.h index 509c4cad2..58847a7f5 100644 --- a/src/libs/vpropertyexplorer/plugins/vemptyproperty.h +++ b/src/libs/vpropertyexplorer/plugins/vemptyproperty.h @@ -41,6 +41,9 @@ class VPropertyPrivate; namespace VPE { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") + class VPROPERTYEXPLORERSHARED_EXPORT VEmptyProperty : public VProperty { Q_OBJECT @@ -87,7 +90,7 @@ private: Q_DISABLE_COPY(VEmptyProperty) }; -VPE_MARK_NONFINAL_CLASS(VEmptyProperty) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/plugins/venumproperty.h b/src/libs/vpropertyexplorer/plugins/venumproperty.h index 3418e24c2..e23e9bdfd 100644 --- a/src/libs/vpropertyexplorer/plugins/venumproperty.h +++ b/src/libs/vpropertyexplorer/plugins/venumproperty.h @@ -37,6 +37,10 @@ namespace VPE { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + class VPROPERTYEXPLORERSHARED_EXPORT VEnumProperty : public VProperty { Q_OBJECT @@ -104,7 +108,7 @@ private: Q_DISABLE_COPY(VEnumProperty) }; -VPE_MARK_NONFINAL_CLASS(VEnumProperty) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/plugins/vfileproperty.h b/src/libs/vpropertyexplorer/plugins/vfileproperty.h index a3f6a0a5c..b22c6d139 100644 --- a/src/libs/vpropertyexplorer/plugins/vfileproperty.h +++ b/src/libs/vpropertyexplorer/plugins/vfileproperty.h @@ -38,6 +38,10 @@ namespace VPE { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + class VPROPERTYEXPLORERSHARED_EXPORT VFileProperty : public VProperty { Q_OBJECT @@ -108,7 +112,7 @@ private: Q_DISABLE_COPY(VFileProperty) }; -VPE_MARK_NONFINAL_CLASS(VFileProperty) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.h b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.h index dbe6c7f11..4b714aa3f 100644 --- a/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.h +++ b/src/libs/vpropertyexplorer/plugins/vfilepropertyeditor.h @@ -37,6 +37,8 @@ namespace VPE { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") class VPROPERTYEXPLORERSHARED_EXPORT VFileEditWidget : public QWidget { @@ -113,7 +115,7 @@ private: Q_DISABLE_COPY(VFileEditWidget) }; -VPE_MARK_NONFINAL_CLASS(VFileEditWidget) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/plugins/vnumberproperty.h b/src/libs/vpropertyexplorer/plugins/vnumberproperty.h index 7211171de..07ab4b4a1 100644 --- a/src/libs/vpropertyexplorer/plugins/vnumberproperty.h +++ b/src/libs/vpropertyexplorer/plugins/vnumberproperty.h @@ -38,6 +38,8 @@ namespace VPE { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") //! Class for holding an integer property class VPROPERTYEXPLORERSHARED_EXPORT VIntegerProperty : public VProperty @@ -146,7 +148,7 @@ private: Q_DISABLE_COPY(VDoubleProperty) }; -VPE_MARK_NONFINAL_CLASS(VDoubleProperty) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.h b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.h index 8dceaf416..5891ddf5b 100644 --- a/src/libs/vpropertyexplorer/plugins/vshortcutproperty.h +++ b/src/libs/vpropertyexplorer/plugins/vshortcutproperty.h @@ -36,6 +36,9 @@ namespace VPE { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") + //! This property can be used to handle key shortcuts class VPROPERTYEXPLORERSHARED_EXPORT VShortcutProperty : public VProperty { @@ -81,7 +84,7 @@ private: Q_DISABLE_COPY(VShortcutProperty) }; -VPE_MARK_NONFINAL_CLASS(VShortcutProperty) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/plugins/vtextproperty.h b/src/libs/vpropertyexplorer/plugins/vtextproperty.h index 8912fdf65..da006f486 100644 --- a/src/libs/vpropertyexplorer/plugins/vtextproperty.h +++ b/src/libs/vpropertyexplorer/plugins/vtextproperty.h @@ -36,6 +36,9 @@ namespace VPE { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") + //! Class for holding a text property class VPROPERTYEXPLORERSHARED_EXPORT VTextProperty : public VProperty { @@ -86,7 +89,7 @@ private: Q_DISABLE_COPY(VTextProperty) }; -VPE_MARK_NONFINAL_CLASS(VTextProperty) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/plugins/vwidgetproperty.h b/src/libs/vpropertyexplorer/plugins/vwidgetproperty.h index 9287ee80a..ee3fb2cda 100644 --- a/src/libs/vpropertyexplorer/plugins/vwidgetproperty.h +++ b/src/libs/vpropertyexplorer/plugins/vwidgetproperty.h @@ -38,6 +38,9 @@ namespace VPE // todo: this way, this class doesn't really make sense. What we have to do is pass a widget factory instead of the // actual widget! +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") + //! This property holds a QWidget and displays it, if the view supports that. If not, it will behave like an empty //! property class VPROPERTYEXPLORERSHARED_EXPORT VWidgetProperty: public VEmptyProperty @@ -67,7 +70,7 @@ public: VProperty* container = nullptr) const override; }; -VPE_MARK_NONFINAL_CLASS(VWidgetProperty) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/vproperty.h b/src/libs/vpropertyexplorer/vproperty.h index aed589b60..130672fe9 100644 --- a/src/libs/vpropertyexplorer/vproperty.h +++ b/src/libs/vpropertyexplorer/vproperty.h @@ -58,6 +58,10 @@ public: class VPropertyPrivate; +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + class VPROPERTYEXPLORERSHARED_EXPORT VProperty : public QObject { Q_OBJECT @@ -226,7 +230,7 @@ private: Q_DISABLE_COPY(VProperty) }; -VPE_MARK_NONFINAL_CLASS(VProperty) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/vproperty_p.h b/src/libs/vpropertyexplorer/vproperty_p.h index db04d39e0..add5c4cc8 100644 --- a/src/libs/vpropertyexplorer/vproperty_p.h +++ b/src/libs/vpropertyexplorer/vproperty_p.h @@ -30,6 +30,10 @@ namespace VPE { +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + class VPropertyPrivate { public: @@ -86,6 +90,8 @@ private: Q_DISABLE_COPY(VPropertyPrivate) }; +QT_WARNING_POP + } #endif // VPROPERTY_P_H diff --git a/src/libs/vpropertyexplorer/vpropertyexplorer_global.h b/src/libs/vpropertyexplorer/vpropertyexplorer_global.h index fd3f87ad5..783cdda43 100644 --- a/src/libs/vpropertyexplorer/vpropertyexplorer_global.h +++ b/src/libs/vpropertyexplorer/vpropertyexplorer_global.h @@ -29,54 +29,4 @@ # define VPROPERTYEXPLORERSHARED_EXPORT Q_DECL_IMPORT #endif -#ifndef VPE_ATTRIBUTE_UNUSED -# if defined(Q_CC_GNU) || defined(Q_CC_CLANG) -# define VPE_ATTRIBUTE_UNUSED [[gnu::unused]] -#elif defined(Q_CC_MSVC) -# define VPE_ATTRIBUTE_UNUSED __declspec(unused) -# else -# define VPE_ATTRIBUTE_UNUSED -# endif -#endif - -// Example of use -//class Base -//{ -// virtual ~Base() -// { -// } - -// virtual int a(float f) -// { -// } -// virtual void b(double) -// { -// } -//}; - -//VPE_MARK_NONFINAL_CLASS(Base) -//VPE_ATTRIBUTE_UNUSED(Base, int, a(float)) -//VPE_ATTRIBUTE_UNUSED(Base, void, b(double) - -#ifndef VPE_MARK_NONFINAL_CLASS -#define VPE_MARK_NONFINAL_CLASS(base) \ - namespace vpe_void_namespace_for_class_##base \ - { \ - struct VPE_ATTRIBUTE_UNUSED temp_marker final : base \ - { \ - }; \ - } -#endif - -#ifndef VPE_MARK_NONFINAL_METHOD -#define VPE_MARK_NONFINAL_METHOD(base, return_type, method) \ - namespace vpe_void_namespace_for_class_##base##_methos_##method \ - { \ - struct VPE_ATTRIBUTE_UNUSED temp_marker final : base \ - { \ - inline return_type VPE_ATTRIBUTE_UNUSED method override {} \ - }; \ - } -#endif - #endif // VPROPERTYEXPLORER_GLOBAL_H diff --git a/src/libs/vpropertyexplorer/vpropertyformview.h b/src/libs/vpropertyexplorer/vpropertyformview.h index 231cbe214..82054175d 100644 --- a/src/libs/vpropertyexplorer/vpropertyformview.h +++ b/src/libs/vpropertyexplorer/vpropertyformview.h @@ -36,6 +36,10 @@ namespace VPE class VPropertyModel; +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + //! This class populates a form layout with the properties in a model class VPROPERTYEXPLORERSHARED_EXPORT VPropertyFormView : public VPropertyFormWidget { @@ -103,7 +107,7 @@ private: Q_DISABLE_COPY(VPropertyFormView) }; -VPE_MARK_NONFINAL_CLASS(VPropertyFormView) +QT_WARNING_POP } // Namespace VPE diff --git a/src/libs/vpropertyexplorer/vpropertymodel.h b/src/libs/vpropertyexplorer/vpropertymodel.h index 8cbcd4ceb..c3fce3c11 100644 --- a/src/libs/vpropertyexplorer/vpropertymodel.h +++ b/src/libs/vpropertyexplorer/vpropertymodel.h @@ -41,6 +41,10 @@ namespace VPE class VPropertyModelPrivate; class VPropertySet; +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + //! \brief This is the base model for managing all the properties //! and passing them to the view. //! @@ -169,7 +173,7 @@ private: Q_DISABLE_COPY(VPropertyModel) }; -VPE_MARK_NONFINAL_CLASS(VPropertyModel) +QT_WARNING_POP } diff --git a/src/libs/vpropertyexplorer/vpropertyset.h b/src/libs/vpropertyexplorer/vpropertyset.h index d0f9b69ec..5a246e454 100644 --- a/src/libs/vpropertyexplorer/vpropertyset.h +++ b/src/libs/vpropertyexplorer/vpropertyset.h @@ -38,6 +38,10 @@ namespace VPE // Forward declaration class VPropertySetPrivate; +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + // todo: better description //! \brief VPropertySet is a simple class for managing a set of properties. //! If you don't need all the Model-functionality, chose this class @@ -138,7 +142,7 @@ private: Q_DISABLE_COPY(VPropertySet) }; -VPE_MARK_NONFINAL_CLASS(VPropertySet) +QT_WARNING_POP } diff --git a/src/libs/vtools/dialogs/tools/dialogarc.cpp b/src/libs/vtools/dialogs/tools/dialogarc.cpp index ac1fb1d3b..24a6d082f 100644 --- a/src/libs/vtools/dialogs/tools/dialogarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarc.cpp @@ -310,13 +310,16 @@ void DialogArc::SetRadius(const QString &value) */ void DialogArc::ChosenObject(quint32 id, const SceneObject &type) { - if (prepare == false)// After first choose we ignore all objects + if (not prepare)// After first choose we ignore all objects { if (type == SceneObject::Point) { if (SetObject(id, ui->comboBoxBasePoint, QString())) { - vis->VisualMode(id); + if (vis != nullptr) + { + vis->VisualMode(id); + } prepare = true; this->setModal(true); this->show(); diff --git a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp index 1f95b1b01..8288d9418 100644 --- a/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp +++ b/src/libs/vtools/dialogs/tools/dialogarcwithlength.cpp @@ -296,7 +296,10 @@ void DialogArcWithLength::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxCenter, QString())) { - vis->VisualMode(id); + if (vis != nullptr) + { + vis->VisualMode(id); + } prepare = true; this->setModal(true); this->show(); diff --git a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp index 2a484473b..05bc127fc 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutarc.cpp @@ -170,7 +170,10 @@ void DialogCutArc::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxArc, QString())) { - vis->VisualMode(id); + if (vis != nullptr) + { + vis->VisualMode(id); + } prepare = true; this->setModal(true); this->show(); diff --git a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp index fc1795152..d54f2c8bb 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutspline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutspline.cpp @@ -178,7 +178,10 @@ void DialogCutSpline::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxSpline, QString())) { - vis->VisualMode(id); + if (vis != nullptr) + { + vis->VisualMode(id); + } prepare = true; this->setModal(true); this->show(); diff --git a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp index 90f5305cb..9bf2c1498 100644 --- a/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogcutsplinepath.cpp @@ -178,7 +178,10 @@ void DialogCutSplinePath::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxSplinePath, QString())) { - vis->VisualMode(id); + if (vis != nullptr) + { + vis->VisualMode(id); + } prepare = true; this->setModal(true); this->show(); diff --git a/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp b/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp index b27c703d0..151ebf2ff 100644 --- a/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp +++ b/src/libs/vtools/dialogs/tools/dialogellipticalarc.cpp @@ -559,7 +559,10 @@ void DialogEllipticalArc::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxBasePoint, QString())) { - vis->VisualMode(id); + if (vis != nullptr) + { + vis->VisualMode(id); + } prepare = true; this->setModal(true); this->show(); diff --git a/src/libs/vtools/dialogs/tools/dialogendline.cpp b/src/libs/vtools/dialogs/tools/dialogendline.cpp index 9e0c0aead..edc66fe58 100644 --- a/src/libs/vtools/dialogs/tools/dialogendline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogendline.cpp @@ -214,7 +214,10 @@ void DialogEndLine::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxBasePoint, QString())) { - vis->VisualMode(id); + if (vis != nullptr) + { + vis->VisualMode(id); + } VAbstractMainWindow *window = qobject_cast(VAbstractValApplication::VApp()->getMainWindow()); SCASSERT(window != nullptr) diff --git a/src/libs/vtools/dialogs/tools/dialogline.cpp b/src/libs/vtools/dialogs/tools/dialogline.cpp index 4bc9dec78..d0b246932 100644 --- a/src/libs/vtools/dialogs/tools/dialogline.cpp +++ b/src/libs/vtools/dialogs/tools/dialogline.cpp @@ -189,7 +189,10 @@ void DialogLine::ChosenObject(quint32 id, const SceneObject &type) if (SetObject(id, ui->comboBoxFirstPoint, tr("Select second point"))) { number++; - vis->VisualMode(id); + if (vis != nullptr) + { + vis->VisualMode(id); + } } break; case 1: diff --git a/src/libs/vtools/dialogs/tools/dialogtool.h b/src/libs/vtools/dialogs/tools/dialogtool.h index 37bff7874..8412d78ee 100644 --- a/src/libs/vtools/dialogs/tools/dialogtool.h +++ b/src/libs/vtools/dialogs/tools/dialogtool.h @@ -70,6 +70,10 @@ class VAbstractTool; enum class FillComboBox : qint8 { Whole, NoChildren}; +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + /** * @brief The DialogTool class parent for all dialog of tools. */ @@ -232,10 +236,10 @@ private: template void FillCombo(QComboBox *box, GOType gType, FillComboBox rule = FillComboBox::Whole, const quint32 &ch1 = NULL_ID, const quint32 &ch2 = NULL_ID) const; - - }; +QT_WARNING_POP + //--------------------------------------------------------------------------------------------------------------------- template QVector DialogTool::GetListInternals(const QListWidget *list) const diff --git a/src/libs/vtools/dialogs/tools/piece/dialogduplicatedetail.cpp b/src/libs/vtools/dialogs/tools/piece/dialogduplicatedetail.cpp index 3f47e711d..eb7f3d042 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogduplicatedetail.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogduplicatedetail.cpp @@ -94,7 +94,10 @@ void DialogDuplicateDetail::ChosenObject(quint32 id, const SceneObject &type) } emit ToolTip(tr("Click to place duplicate")); - vis->VisualMode(id); + if (vis != nullptr) + { + vis->VisualMode(id); + } prepare = true; } } diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp b/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp index 77f1ee49e..597027cfd 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogpin.cpp @@ -131,7 +131,10 @@ void DialogPin::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxPoint, QString())) { - vis->VisualMode(id); + if (vis != nullptr) + { + vis->VisualMode(id); + } CheckPoint(); prepare = true; this->setModal(true); diff --git a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp index df716a621..e5c97d449 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogplacelabel.cpp @@ -255,7 +255,10 @@ void DialogPlaceLabel::ChosenObject(quint32 id, const SceneObject &type) { if (SetObject(id, ui->comboBoxPoint, QString())) { - vis->VisualMode(id); + if (vis != nullptr) + { + vis->VisualMode(id); + } CheckPoint(); prepare = true; diff --git a/src/libs/vtools/visualization/visualization.h b/src/libs/vtools/visualization/visualization.h index 95e87a044..38de01428 100644 --- a/src/libs/vtools/visualization/visualization.h +++ b/src/libs/vtools/visualization/visualization.h @@ -51,6 +51,10 @@ class VInternalVariable; enum class Mode : qint8 {Creation, Show}; +QT_WARNING_PUSH +QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") + class Visualization : public QObject { Q_OBJECT @@ -120,6 +124,8 @@ private: Q_DISABLE_COPY(Visualization) }; +QT_WARNING_POP + //--------------------------------------------------------------------------------------------------------------------- template inline void Visualization::AddItem(Item *item) diff --git a/src/libs/vwidgets/vabstractmainwindow.h b/src/libs/vwidgets/vabstractmainwindow.h index ac2ad7ca4..25c650d23 100644 --- a/src/libs/vwidgets/vabstractmainwindow.h +++ b/src/libs/vwidgets/vabstractmainwindow.h @@ -39,6 +39,7 @@ struct VFinalMeasurement; QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") class VAbstractMainWindow : public QMainWindow { diff --git a/src/libs/vwidgets/vcurvepathitem.h b/src/libs/vwidgets/vcurvepathitem.h index 694116361..e9f9ff22a 100644 --- a/src/libs/vwidgets/vcurvepathitem.h +++ b/src/libs/vwidgets/vcurvepathitem.h @@ -36,6 +36,7 @@ QT_WARNING_PUSH QT_WARNING_DISABLE_GCC("-Wsuggest-final-types") +QT_WARNING_DISABLE_GCC("-Wsuggest-final-methods") class VCurvePathItem : public QGraphicsPathItem {