Clang warnings.

This commit is contained in:
Roman Telezhynskyi 2024-01-11 16:25:31 +02:00
parent b6542e989c
commit af6b86fb97
21 changed files with 137 additions and 97 deletions

View File

@ -246,8 +246,6 @@ void DialogHistory::FillTable()
}
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
/**
* @brief Record return description for record
* @param tool record data
@ -498,12 +496,10 @@ auto DialogHistory::RecordDescription(const VToolRecord &tool, HistoryRecord rec
case Tool::InsertNode:
case Tool::DuplicateDetail:
return record;
}
default:
return record;
}
QT_WARNING_POP
}
//---------------------------------------------------------------------------------------------------------------------
/**

View File

@ -3476,8 +3476,6 @@ void MainWindow::MouseMove(const QPointF &scenePos)
}
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
/**
* @brief CancelTool cancel tool.
*/
@ -3498,6 +3496,10 @@ void MainWindow::CancelTool()
currentScene->clearSelection();
emit ui->view->itemClicked(nullptr); // Hide visualization to avoid a crash
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (m_currentTool)
{
case Tool::Arrow:
@ -3667,6 +3669,8 @@ void MainWindow::CancelTool()
break;
}
QT_WARNING_POP
// Crash: using CRTL+Z while using line tool.
// related bug report:
// https://bitbucket.org/dismine/valentina/issues/454/crash-using-crtl-z-while-using-line-tool
@ -3739,8 +3743,6 @@ void MainWindow::SetupDrawToolsIcons()
ui->actionArcEndPointTool->setIcon(VTheme::GetIconResource(resource, QStringLiteral("arc_end.png")));
}
QT_WARNING_POP
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief ArrowTool enable arrow tool.
@ -5477,6 +5479,8 @@ void MainWindow::SetEnableTool(bool enable)
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (VAbstractValApplication::VApp()->GetDrawMode())
{
case Draw::Calculation:
@ -5489,6 +5493,7 @@ void MainWindow::SetEnableTool(bool enable)
layoutTools = enable;
break;
}
QT_WARNING_POP
// This check helps to find missed tools
@ -5837,8 +5842,6 @@ void MainWindow::CreateMenus()
}
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
void MainWindow::LastUsedTool()
{
// This check helps to find missed tools in the switch
@ -5849,6 +5852,10 @@ void MainWindow::LastUsedTool()
return;
}
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (m_lastUsedTool)
{
case Tool::Arrow:
@ -6055,9 +6062,9 @@ void MainWindow::LastUsedTool()
ToolArcEnd(true);
break;
}
}
QT_WARNING_POP
}
//---------------------------------------------------------------------------------------------------------------------
void MainWindow::AddDocks()

View File

@ -4591,9 +4591,6 @@ void VPattern::DrawToolsCommonAttributes(const QDomElement &domElement, quint32
}
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
auto VPattern::ActiveDrawBoundingRect() const -> QRectF
{
// This check helps to find missed tools in the switch
@ -4601,9 +4598,8 @@ auto VPattern::ActiveDrawBoundingRect() const -> QRectF
QRectF rec;
for (qint32 i = 0; i < history.size(); ++i)
for (const auto &tool : history)
{
const VToolRecord tool = history.at(i);
if (tool.getNameDraw() == nameActivPP)
{
switch (tool.getTypeTool())
@ -4685,6 +4681,7 @@ auto VPattern::ActiveDrawBoundingRect() const -> QRectF
case Tool::InsertNode:
case Tool::PlaceLabel:
case Tool::DuplicateDetail:
default:
break;
}
}
@ -4692,9 +4689,6 @@ auto VPattern::ActiveDrawBoundingRect() const -> QRectF
return rec;
}
// cppcheck-suppress unknownMacro
QT_WARNING_POP
//---------------------------------------------------------------------------------------------------------------------
template <typename T> auto VPattern::ToolBoundingRect(const QRectF &rec, quint32 id) const -> QRectF
{

View File

@ -197,9 +197,6 @@ auto LineStyleToPenStyle(const QString &typeLine) -> Qt::PenStyle
//---------------------------------------------------------------------------------------------------------------------
auto PenStyleToLineStyle(Qt::PenStyle penStyle) -> QString
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
switch (penStyle)
{
case Qt::NoPen:
@ -216,9 +213,6 @@ auto PenStyleToLineStyle(Qt::PenStyle penStyle) -> QString
break;
}
// cppcheck-suppress unknownMacro
QT_WARNING_POP
return TypeLineLine;
}

View File

@ -685,10 +685,11 @@ auto DRW_MText::parseCode(int code, const std::unique_ptr<dxfReader> &reader) ->
case 71:
{
// Attachment point
Attach a = static_cast<Attach>(reader->getInt32());
auto a = static_cast<Attach>(reader->getInt32());
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (a)
{

View File

@ -3563,6 +3563,7 @@ auto dxfRW::processDimension() -> bool
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (type)
{

View File

@ -742,9 +742,6 @@ auto VDxfEngine::ErrorString() const -> QString
}
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
auto VDxfEngine::FromPixel(double pix, const VarInsunits &unit) const -> double
{
switch (unit)
@ -755,9 +752,10 @@ auto VDxfEngine::FromPixel(double pix, const VarInsunits &unit) const -> double
return pix / m_resolution * 25.4 / 10.0;
case VarInsunits::Inches:
return pix / m_resolution;
}
default:
return pix;
}
}
//---------------------------------------------------------------------------------------------------------------------
auto VDxfEngine::ToPixel(double val, const VarInsunits &unit) const -> double
@ -770,11 +768,10 @@ auto VDxfEngine::ToPixel(double val, const VarInsunits &unit) const -> double
return ((val * 10.0) / 25.4) * m_resolution;
case VarInsunits::Inches:
return val * m_resolution;
}
default:
return val;
}
QT_WARNING_POP
}
//---------------------------------------------------------------------------------------------------------------------
auto VDxfEngine::ExportToAAMA(const QVector<VLayoutPiece> &details) -> bool

View File

@ -359,6 +359,8 @@ auto VPatternRecipe::Step(const VToolRecord &tool, const VContainer &data) -> QD
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (tool.getTypeTool())
{
case Tool::Arrow:
@ -461,8 +463,9 @@ auto VPatternRecipe::Step(const VToolRecord &tool, const VContainer &data) -> QD
case Tool::PlaceLabel:
case Tool::InsertNode:
case Tool::DuplicateDetail:
return QDomElement();
return {};
}
QT_WARNING_POP
}
catch (const VExceptionBadId &e)
@ -1249,6 +1252,8 @@ auto VPatternRecipe::GroupOperationSource(VAbstractOperation *tool, quint32 id,
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
@ -1273,6 +1278,7 @@ auto VPatternRecipe::GroupOperationSource(VAbstractOperation *tool, quint32 id,
Q_UNREACHABLE();
break;
}
QT_WARNING_POP
nodes.appendChild(node);

View File

@ -1119,6 +1119,8 @@ auto VAbstractPiece::Equidistant(QVector<VSAPoint> points, qreal width, const QS
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
// This check helps to find missed angle types in the switch
Q_STATIC_ASSERT_X(static_cast<int>(PieceNodeAngle::LAST_ONE_DO_NOT_USE) == 7, "Not all types were handled.");
switch (points.constLast().GetAngleType())
@ -1144,6 +1146,7 @@ auto VAbstractPiece::Equidistant(QVector<VSAPoint> points, qreal width, const QS
RollbackBySecondEdgeRightAngle(ekvPoints, points, width);
break;
}
QT_WARNING_POP
}
@ -1307,6 +1310,8 @@ auto VAbstractPiece::EkvPoint(QVector<VRawSAPoint> points, const VSAPoint &p1Lin
{ // Regular equdistant case
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
// This check helps to find missed angle types in the switch
Q_STATIC_ASSERT_X(static_cast<int>(PieceNodeAngle::LAST_ONE_DO_NOT_USE) == 7,
"Not all types were handled.");
@ -1335,6 +1340,7 @@ auto VAbstractPiece::EkvPoint(QVector<VRawSAPoint> points, const VSAPoint &p1Lin
return AngleBySecondRightAngle(points, p1Line1, p2Line1, p1Line2, bigLine1, crosPoint, bigLine2,
p2Line1, width, needRollback);
}
QT_WARNING_POP
}
else

View File

@ -689,8 +689,6 @@ auto LineColor(const QColor &borderColor, int size, const QString &color) -> QIc
}
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
auto SegmentAliases(GOType curveType, const QString &alias1, const QString &alias2) -> QPair<QString, QString>
{
switch (curveType)
@ -712,11 +710,10 @@ auto SegmentAliases(GOType curveType, const QString &alias1, const QString &alia
case GOType::Unknown:
Q_UNREACHABLE();
break;
}
default:
return {};
}
QT_WARNING_POP
}
//---------------------------------------------------------------------------------------------------------------------
auto GetNodeName(const VContainer *data, const VPieceNode &node, bool showPassmarkDetails) -> QString

View File

@ -384,6 +384,8 @@ void DialogPiecePath::ShowContextMenu(const QPoint &pos)
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (selectedOption)
{
case ContextMenuOption::NoSelection:
@ -448,6 +450,7 @@ void DialogPiecePath::ShowContextMenu(const QPoint &pos)
Q_UNREACHABLE();
break;
};
QT_WARNING_POP
ValidObjects(PathIsValid());

View File

@ -1114,6 +1114,8 @@ void DialogSeamAllowance::ShowMainPathContextMenu(const QPoint &pos)
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (selectedOption)
{
case MainPathContextMenuOption::NoSelection:
@ -1178,6 +1180,7 @@ void DialogSeamAllowance::ShowMainPathContextMenu(const QPoint &pos)
Q_UNREACHABLE();
break;
};
QT_WARNING_POP
ValidObjects(MainPathIsValid());
@ -1847,6 +1850,8 @@ void DialogSeamAllowance::FancyTabChanged(int index)
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (index) // NOLINT(hicpp-multiway-paths-covered)
{
case TabOrder::Paths:
@ -1874,6 +1879,7 @@ void DialogSeamAllowance::FancyTabChanged(int index)
Q_UNREACHABLE();
break;
}
QT_WARNING_POP
if (index == TabOrder::Pins || index == TabOrder::Grainline ||

View File

@ -29,9 +29,9 @@
#include "vabstractflipping.h"
#include "../vgeometry/vabstractcurve.h"
#include "../vgeometry/varc.h"
#include "../vgeometry/vellipticalarc.h"
#include "../vgeometry/vcubicbezier.h"
#include "../vgeometry/vcubicbezierpath.h"
#include "../vgeometry/vellipticalarc.h"
#include "../vgeometry/vgobject.h"
#include "../vgeometry/vpointf.h"
#include "../vgeometry/vspline.h"
@ -40,7 +40,8 @@
//---------------------------------------------------------------------------------------------------------------------
VAbstractFlipping::VAbstractFlipping(const VAbstractOperationInitData &initData, QGraphicsItem *parent)
: VAbstractOperation(initData, parent)
{}
{
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractFlipping::CreateDestination(VAbstractOperationInitData &initData, const QPointF &fPoint,
@ -61,43 +62,44 @@ void VAbstractFlipping::CreateDestination(VAbstractOperationInitData &initData,
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
initData.destination.append(CreatePoint(initData.id, object, fPoint, sPoint, initData.suffix,
initData.data));
initData.destination.append(
CreatePoint(initData.id, object, fPoint, sPoint, initData.suffix, initData.data));
break;
case GOType::Arc:
initData.destination.append(CreateArc<VArc>(initData.id, object, fPoint, sPoint, initData.suffix,
initData.data));
initData.destination.append(
CreateArc<VArc>(initData.id, object, fPoint, sPoint, initData.suffix, initData.data));
break;
case GOType::EllipticalArc:
initData.destination.append(CreateArc<VEllipticalArc>(initData.id, object, fPoint, sPoint,
initData.suffix, initData.data));
initData.destination.append(
CreateArc<VEllipticalArc>(initData.id, object, fPoint, sPoint, initData.suffix, initData.data));
break;
case GOType::Spline:
initData.destination.append(CreateCurve<VSpline>(initData.id, object, fPoint, sPoint,
initData.suffix, initData.data));
initData.destination.append(
CreateCurve<VSpline>(initData.id, object, fPoint, sPoint, initData.suffix, initData.data));
break;
case GOType::SplinePath:
initData.destination.append(CreateCurveWithSegments<VSplinePath>(initData.id, object, fPoint,
sPoint, initData.suffix,
initData.data));
initData.destination.append(CreateCurveWithSegments<VSplinePath>(
initData.id, object, fPoint, sPoint, initData.suffix, initData.data));
break;
case GOType::CubicBezier:
initData.destination.append(CreateCurve<VCubicBezier>(initData.id, object, fPoint, sPoint,
initData.suffix, initData.data));
initData.destination.append(
CreateCurve<VCubicBezier>(initData.id, object, fPoint, sPoint, initData.suffix, initData.data));
break;
case GOType::CubicBezierPath:
initData.destination.append(CreateCurveWithSegments<VCubicBezierPath>(initData.id, object, fPoint,
sPoint, initData.suffix,
initData.data));
initData.destination.append(CreateCurveWithSegments<VCubicBezierPath>(
initData.id, object, fPoint, sPoint, initData.suffix, initData.data));
break;
case GOType::Unknown:
case GOType::PlaceLabel:
Q_UNREACHABLE();
break;
}
QT_WARNING_POP
}
}
@ -113,6 +115,8 @@ QT_WARNING_POP
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
@ -150,6 +154,7 @@ QT_WARNING_DISABLE_GCC("-Wswitch-default")
Q_UNREACHABLE();
break;
}
QT_WARNING_POP
}
if (initData.parse != Document::FullParse)

View File

@ -888,6 +888,8 @@ void VAbstractOperation::InitOperatedObjects()
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
@ -926,6 +928,7 @@ void VAbstractOperation::InitOperatedObjects()
Q_UNREACHABLE();
break;
}
QT_WARNING_POP
}
}

View File

@ -70,8 +70,6 @@ const QString VToolMove::ToolType = QStringLiteral("moving");
namespace
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
auto GetOriginPoint(const QVector<SourceItem> &objects, const VContainer *data, qreal calcLength, qreal calcAngle)
-> QPointF
{
@ -101,6 +99,8 @@ auto GetOriginPoint(const QVector<SourceItem> &objects, const VContainer *data,
case GOType::PlaceLabel:
Q_UNREACHABLE();
break;
default:
break;
}
}
@ -109,7 +109,6 @@ auto GetOriginPoint(const QVector<SourceItem> &objects, const VContainer *data,
move.setAngle(calcAngle);
return move.p2();
}
QT_WARNING_POP
} // namespace
//---------------------------------------------------------------------------------------------------------------------
@ -202,6 +201,8 @@ auto VToolMove::Create(VToolMoveInitData &initData) -> VToolMove *
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
@ -244,6 +245,7 @@ auto VToolMove::Create(VToolMoveInitData &initData) -> VToolMove *
Q_UNREACHABLE();
break;
}
QT_WARNING_POP
}
}
@ -259,6 +261,8 @@ auto VToolMove::Create(VToolMoveInitData &initData) -> VToolMove *
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
@ -298,6 +302,7 @@ auto VToolMove::Create(VToolMoveInitData &initData) -> VToolMove *
Q_UNREACHABLE();
break;
}
QT_WARNING_POP
}
if (initData.parse != Document::FullParse)

View File

@ -152,6 +152,8 @@ auto VToolRotation::Create(VToolRotationInitData &initData) -> VToolRotation *
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
@ -187,6 +189,7 @@ auto VToolRotation::Create(VToolRotationInitData &initData) -> VToolRotation *
Q_UNREACHABLE();
break;
}
QT_WARNING_POP
}
}
@ -202,6 +205,8 @@ auto VToolRotation::Create(VToolRotationInitData &initData) -> VToolRotation *
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
@ -239,6 +244,7 @@ auto VToolRotation::Create(VToolRotationInitData &initData) -> VToolRotation *
Q_UNREACHABLE();
break;
}
QT_WARNING_POP
}
if (initData.parse != Document::FullParse)

View File

@ -390,12 +390,15 @@ void VToolSinglePoint::ToolSelectionType(const SelectionType &type)
}
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
auto VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPointF *p, quint32 curveId,
VContainer *data, const QString &alias1, const QString &alias2)
-> QPair<QString, QString>
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (curveType)
{
case GOType::EllipticalArc:
@ -518,7 +521,7 @@ auto VToolSinglePoint::InitSegments(GOType curveType, qreal segLength, const VPo
break;
}
QT_WARNING_POP
return {};
}
QT_WARNING_POP

View File

@ -591,6 +591,8 @@ void VNodePoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (selectedOption)
{
case ContextMenuOption::LAST_ONE_DO_NOT_USE:
@ -709,6 +711,7 @@ void VNodePoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
SelectPassmarkLine(PassmarkLineType::CheckMark);
break;
};
QT_WARNING_POP
}

View File

@ -83,8 +83,7 @@ auto VisOperation::GetCurve(quint32 i, VColorRole role) -> VCurvePathItem *
}
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
void VisOperation::RefreshFlippedObjects(quint32 originPointId, const QPointF &firstPoint, const QPointF &secondPoint)
{
int iPoint = -1;
@ -96,6 +95,10 @@ void VisOperation::RefreshFlippedObjects(quint32 originPointId, const QPointF &f
// This check helps to find missed objects in the switch
Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects were handled.");
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
@ -150,6 +153,7 @@ void VisOperation::RefreshFlippedObjects(quint32 originPointId, const QPointF &f
Q_UNREACHABLE();
break;
}
}
}
QT_WARNING_POP
}
}

View File

@ -280,9 +280,6 @@ auto VisToolMove::GetOriginPoint(const QVector<QGraphicsItem *> &objects) -> QPo
}
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
auto VisToolMove::CreateOriginObjects(int &iPoint, int &iCurve) -> QVector<QGraphicsItem *>
{
QVector<QGraphicsItem *> originObjects;
@ -295,6 +292,10 @@ auto VisToolMove::CreateOriginObjects(int &iPoint, int &iCurve) -> QVector<QGrap
// This check helps to find missed objects in the switch
Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects were handled.");
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
@ -331,17 +332,14 @@ auto VisToolMove::CreateOriginObjects(int &iPoint, int &iCurve) -> QVector<QGrap
Q_UNREACHABLE();
break;
}
QT_WARNING_POP
}
return originObjects;
}
QT_WARNING_POP
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
void VisToolMove::CreateMovedRotatedObjects(int &iPoint, int &iCurve, qreal length, qreal angle, qreal rotationAngle,
const QPointF &rotationOrigin)
{
@ -352,6 +350,10 @@ void VisToolMove::CreateMovedRotatedObjects(int &iPoint, int &iCurve, qreal leng
// This check helps to find missed objects in the switch
Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects was handled.");
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
@ -387,7 +389,7 @@ void VisToolMove::CreateMovedRotatedObjects(int &iPoint, int &iCurve, qreal leng
Q_UNREACHABLE();
break;
}
}
}
QT_WARNING_POP
}
}

View File

@ -65,9 +65,6 @@ VisToolRotation::VisToolRotation(const VContainer *data, QGraphicsItem *parent)
}
//---------------------------------------------------------------------------------------------------------------------
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
void VisToolRotation::RefreshGeometry()
{
if (Objects().isEmpty())
@ -124,6 +121,10 @@ void VisToolRotation::RefreshGeometry()
// This check helps to find missed objects in the switch
Q_STATIC_ASSERT_X(static_cast<int>(GOType::Unknown) == 8, "Not all objects was handled.");
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wswitch-default")
QT_WARNING_DISABLE_CLANG("-Wswitch-default")
switch (static_cast<GOType>(obj->getType()))
{
case GOType::Point:
@ -178,10 +179,10 @@ void VisToolRotation::RefreshGeometry()
Q_UNREACHABLE();
break;
}
}
}
QT_WARNING_POP
}
}
//---------------------------------------------------------------------------------------------------------------------
auto VisToolRotation::Angle() const -> QString