New marcos Q_DISABLE_ASSIGN.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2019-07-01 11:33:29 +03:00
parent 0330869796
commit 0658d92688
38 changed files with 52 additions and 39 deletions

View File

@ -28,6 +28,7 @@
#include <QSharedData> #include <QSharedData>
#include "qmuparserdef.h" #include "qmuparserdef.h"
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#include "../vmisc/defglobal.h"
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Weffc++")
@ -88,7 +89,7 @@ public:
bool m_bAllowOpti; ///< Flag indication optimizeability bool m_bAllowOpti; ///< Flag indication optimizeability
private: private:
QmuParserCallbackData &operator=(const QmuParserCallbackData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(QmuParserCallbackData)
}; };
} }

View File

@ -70,7 +70,7 @@ public:
QString formulaLength; QString formulaLength;
private: private:
VAbstractArcData &operator=(const VAbstractArcData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VAbstractArcData)
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -68,7 +68,7 @@ public:
qreal approximationScale; qreal approximationScale;
private: private:
VAbstractCurveData &operator=(const VAbstractCurveData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VAbstractCurveData)
}; };
VAbstractCurveData::~VAbstractCurveData() VAbstractCurveData::~VAbstractCurveData()

View File

@ -54,7 +54,7 @@ public:
QString formulaRadius; QString formulaRadius;
private: private:
VArcData &operator=(const VArcData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VArcData)
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -62,7 +62,7 @@ public:
VPointF p4; VPointF p4;
private: private:
VCubicBezierData &operator=(const VCubicBezierData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VCubicBezierData)
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -57,7 +57,7 @@ public:
QVector<VPointF> path; QVector<VPointF> path;
private: private:
VCubicBezierPathData &operator=(const VCubicBezierPathData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VCubicBezierPathData)
}; };
VCubicBezierPathData::~VCubicBezierPathData() VCubicBezierPathData::~VCubicBezierPathData()

View File

@ -36,7 +36,7 @@ public:
QTransform m_transform; QTransform m_transform;
private: private:
VEllipticalArcData &operator=(const VEllipticalArcData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VEllipticalArcData)
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -71,7 +71,7 @@ public:
Draw mode; Draw mode;
private: private:
VGObjectData &operator=(const VGObjectData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VGObjectData)
}; };
VGObjectData::~VGObjectData() VGObjectData::~VGObjectData()

View File

@ -74,7 +74,7 @@ public:
qreal isVisible{1}; qreal isVisible{1};
private: private:
VPlaceLabelItemData &operator=(const VPlaceLabelItemData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VPlaceLabelItemData)
}; };
VPlaceLabelItemData::~VPlaceLabelItemData() VPlaceLabelItemData::~VPlaceLabelItemData()

View File

@ -80,7 +80,7 @@ public:
bool m_showLabel; bool m_showLabel;
private: private:
VPointFData &operator=(const VPointFData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VPointFData)
}; };
VPointFData::~VPointFData() VPointFData::~VPointFData()

View File

@ -87,7 +87,7 @@ public:
qreal kCurve; qreal kCurve;
private: private:
VSplineData &operator=(const VSplineData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VSplineData)
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -57,7 +57,7 @@ public:
QVector<VSplinePoint> path; QVector<VSplinePoint> path;
private: private:
VSplinePathData &operator=(const VSplinePathData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VSplinePathData)
}; };
VSplinePathData::~VSplinePathData() VSplinePathData::~VSplinePathData()

View File

@ -93,7 +93,7 @@ public:
qreal kAsm2; qreal kAsm2;
private: private:
VFSplinePointData &operator=(const VFSplinePointData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VFSplinePointData)
}; };
VFSplinePointData::~VFSplinePointData() VFSplinePointData::~VFSplinePointData()
@ -164,7 +164,7 @@ public:
QString length2F; QString length2F;
private: private:
VSplinePointData &operator=(const VSplinePointData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VSplinePointData)
}; };
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -34,6 +34,7 @@
#include <QCoreApplication> #include <QCoreApplication>
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#include "../vmisc/defglobal.h"
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Weffc++")
@ -82,7 +83,7 @@ public:
qreal m_my; qreal m_my;
private: private:
VAbstractPieceData &operator=(const VAbstractPieceData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VAbstractPieceData)
}; };
QT_WARNING_POP QT_WARNING_POP

View File

@ -33,6 +33,7 @@
#include "vlayoutdef.h" #include "vlayoutdef.h"
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#include "../vmisc/defglobal.h"
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Weffc++")
@ -71,7 +72,7 @@ public:
QString exceptionReason{}; QString exceptionReason{};
private: private:
VBestSquareData &operator=(const VBestSquareData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VBestSquareData)
}; };
#endif // VBESTSQUARE_P_H #endif // VBESTSQUARE_P_H

View File

@ -36,6 +36,7 @@
#include <QPainterPath> #include <QPainterPath>
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#include "../vmisc/defglobal.h"
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Weffc++")
@ -81,7 +82,7 @@ public:
int m_emptySheetEdgesCount{0}; int m_emptySheetEdgesCount{0};
private: private:
VContourData &operator=(const VContourData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VContourData)
}; };
QT_WARNING_POP QT_WARNING_POP

View File

@ -88,7 +88,7 @@ public:
bool originPaperOrientation{true}; bool originPaperOrientation{true};
private: private:
VLayoutPaperData& operator=(const VLayoutPaperData&) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VLayoutPaperData)
}; };
QT_WARNING_POP QT_WARNING_POP

View File

@ -146,7 +146,7 @@ public:
qint64 m_square{0}; qint64 m_square{0};
private: private:
VLayoutPieceData &operator=(const VLayoutPieceData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VLayoutPieceData)
static const quint32 streamHeader; static const quint32 streamHeader;
static const quint16 classVersion; static const quint16 classVersion;

View File

@ -72,7 +72,7 @@ public:
bool m_cut{false}; bool m_cut{false};
private: private:
VLayoutPiecePathData &operator=(const VLayoutPiecePathData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VLayoutPiecePathData)
static const quint32 streamHeader; static const quint32 streamHeader;
static const quint16 classVersion; static const quint16 classVersion;

View File

@ -43,4 +43,9 @@ template <typename T>
void qAsConst(const T &&) Q_DECL_EQ_DELETE; void qAsConst(const T &&) Q_DECL_EQ_DELETE;
#endif #endif
#ifndef Q_DISABLE_ASSIGN
#define Q_DISABLE_ASSIGN(Class) \
Class &operator=(const Class &) Q_DECL_EQ_DELETE;
#endif
#endif // DEFGLOBAL_H #endif // DEFGLOBAL_H

View File

@ -33,6 +33,7 @@
#include <QSharedData> #include <QSharedData>
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#include "../vmisc/defglobal.h"
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Weffc++")
@ -60,7 +61,7 @@ public:
bool m_bVisible; bool m_bVisible;
private: private:
VAbstractFloatItemDataPrivate &operator=(const VAbstractFloatItemDataPrivate &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VAbstractFloatItemDataPrivate)
}; };
QT_WARNING_POP QT_WARNING_POP

View File

@ -78,7 +78,7 @@ public:
quint32 m_bottomPin; quint32 m_bottomPin;
private: private:
VGrainlineDataPrivate &operator=(const VGrainlineDataPrivate &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VGrainlineDataPrivate)
}; };
QT_WARNING_POP QT_WARNING_POP

View File

@ -81,7 +81,7 @@ public:
quint32 m_bottomRightPin; quint32 m_bottomRightPin;
private: private:
VPatternLabelDataPrivate &operator=(const VPatternLabelDataPrivate &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VPatternLabelDataPrivate)
}; };
QT_WARNING_POP QT_WARNING_POP

View File

@ -85,7 +85,7 @@ public:
QVector<VLabelTemplateLine> m_lines; QVector<VLabelTemplateLine> m_lines;
private: private:
VPieceLabelDataPrivate &operator=(const VPieceLabelDataPrivate &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VPieceLabelDataPrivate)
}; };
QT_WARNING_POP QT_WARNING_POP

View File

@ -32,6 +32,7 @@
#include <QSharedData> #include <QSharedData>
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#include "../vmisc/defglobal.h"
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Weffc++")
@ -53,12 +54,12 @@ public:
:QSharedData(var), arcId(var.arcId) :QSharedData(var), arcId(var.arcId)
{} {}
virtual ~VArcRadiusData() override; virtual ~VArcRadiusData();
quint32 arcId; quint32 arcId;
private: private:
VArcRadiusData &operator=(const VArcRadiusData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VArcRadiusData)
}; };
VArcRadiusData::~VArcRadiusData() VArcRadiusData::~VArcRadiusData()

View File

@ -60,7 +60,7 @@ public:
quint32 parentId; quint32 parentId;
private: private:
VCurveVariableData &operator=(const VCurveVariableData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VCurveVariableData)
}; };
VCurveVariableData::~VCurveVariableData() VCurveVariableData::~VCurveVariableData()

View File

@ -84,7 +84,7 @@ public:
IncrementType incrType{IncrementType::Increment}; IncrementType incrType{IncrementType::Increment};
private: private:
VIncrementData &operator=(const VIncrementData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VIncrementData)
}; };
VIncrementData::~VIncrementData() VIncrementData::~VIncrementData()

View File

@ -59,7 +59,7 @@ public:
QString name; QString name;
private: private:
VInternalVariableData &operator=(const VInternalVariableData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VInternalVariableData)
}; };
VInternalVariableData::~VInternalVariableData() VInternalVariableData::~VInternalVariableData()

View File

@ -60,7 +60,7 @@ public:
quint32 p2Id; quint32 p2Id;
private: private:
VLineAngleData &operator=(const VLineAngleData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VLineAngleData)
}; };
VLineAngleData::~VLineAngleData() VLineAngleData::~VLineAngleData()

View File

@ -61,7 +61,7 @@ public:
Unit patternUnit; Unit patternUnit;
private: private:
VLengthLineData &operator=(const VLengthLineData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VLengthLineData)
}; };
VLengthLineData::~VLengthLineData() VLengthLineData::~VLengthLineData()

View File

@ -122,7 +122,7 @@ public:
qreal baseHeight; qreal baseHeight;
private: private:
VMeasurementData &operator=(const VMeasurementData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VMeasurementData)
}; };
VMeasurementData::~VMeasurementData() VMeasurementData::~VMeasurementData()

View File

@ -32,6 +32,7 @@
#include <QSharedData> #include <QSharedData>
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#include "../vmisc/defglobal.h"
QT_WARNING_PUSH QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Weffc++") QT_WARNING_DISABLE_GCC("-Weffc++")
@ -60,7 +61,7 @@ public:
QString description; QString description;
private: private:
VVariableData &operator=(const VVariableData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VVariableData)
}; };
VVariableData::~VVariableData() VVariableData::~VVariableData()

View File

@ -111,7 +111,7 @@ public:
QString nspace; QString nspace;
private: private:
VContainerData &operator=(const VContainerData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VContainerData)
}; };
QT_WARNING_POP QT_WARNING_POP

View File

@ -31,6 +31,7 @@
#include "../vmisc/diagnostic.h" #include "../vmisc/diagnostic.h"
#include "../vmisc/typedef.h" #include "../vmisc/typedef.h"
#include "../vmisc/vmath.h" #include "../vmisc/vmath.h"
#include "../vmisc/defglobal.h"
#include <QSharedData> #include <QSharedData>
#include <QCoreApplication> #include <QCoreApplication>
@ -82,7 +83,7 @@ public:
QString reason{tr("Formula is empty")}; QString reason{tr("Formula is empty")};
private: private:
VFormulaData &operator=(const VFormulaData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VFormulaData)
}; };
QT_WARNING_POP QT_WARNING_POP

View File

@ -81,7 +81,7 @@ public:
bool reverse; bool reverse;
private: private:
VNodeDetailData &operator=(const VNodeDetailData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VNodeDetailData)
}; };
QT_WARNING_POP QT_WARNING_POP

View File

@ -101,7 +101,7 @@ public:
QString m_formulaWidth; QString m_formulaWidth;
private: private:
VPieceData &operator=(const VPieceData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VPieceData)
}; };
VPieceData::~VPieceData() VPieceData::~VPieceData()

View File

@ -118,7 +118,7 @@ public:
bool m_manualPassmarkLength{false}; bool m_manualPassmarkLength{false};
private: private:
VPieceNodeData &operator=(const VPieceNodeData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VPieceNodeData)
}; };
// Friend functions // Friend functions

View File

@ -73,7 +73,7 @@ public:
bool m_lastToCuttingCountour{false}; bool m_lastToCuttingCountour{false};
private: private:
VPiecePathData &operator=(const VPiecePathData &) Q_DECL_EQ_DELETE; Q_DISABLE_ASSIGN(VPiecePathData)
}; };
VPiecePathData::~VPiecePathData() VPiecePathData::~VPiecePathData()