Fix GCC warnings.

This commit is contained in:
Roman Telezhynskyi 2021-07-01 16:03:38 +03:00
parent da3e6a8dd7
commit 391a721d84
2 changed files with 17 additions and 5 deletions

View File

@ -659,7 +659,13 @@ void MainWindowsNoGUI::ExportApparelLayout(const QVector<VLayoutPiece> &details,
VAbstractValApplication::VApp()->ValentinaSettings()->SetPathLayout(path); VAbstractValApplication::VApp()->ValentinaSettings()->SetPathLayout(path);
const LayoutExportFormats format = m_dialogSaveLayout->Format(); const LayoutExportFormats format = m_dialogSaveLayout->Format();
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wnoexcept")
VLayoutExporter exporter; VLayoutExporter exporter;
QT_WARNING_POP
exporter.SetFileName(name); exporter.SetFileName(name);
exporter.SetImageRect(QRectF(0, 0, size.width(), size.height())); exporter.SetImageRect(QRectF(0, 0, size.width(), size.height()));
exporter.SetXScale(m_dialogSaveLayout->GetXScale()); exporter.SetXScale(m_dialogSaveLayout->GetXScale());
@ -1090,7 +1096,13 @@ void MainWindowsNoGUI::ExportScene(const QList<QGraphicsScene *> &scenes,
const QList<QList<QGraphicsItem *> > &details, bool ignorePrinterFields, const QList<QList<QGraphicsItem *> > &details, bool ignorePrinterFields,
const QMarginsF &margins) const const QMarginsF &margins) const
{ {
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wnoexcept")
VLayoutExporter exporter; VLayoutExporter exporter;
QT_WARNING_POP
exporter.SetMargins(margins); exporter.SetMargins(margins);
exporter.SetXScale(m_dialogSaveLayout->GetXScale()); exporter.SetXScale(m_dialogSaveLayout->GetXScale());
exporter.SetYScale(m_dialogSaveLayout->GetYScale()); exporter.SetYScale(m_dialogSaveLayout->GetYScale());

View File

@ -241,12 +241,12 @@ void AbstractTest::PassmarkDataFromJson(const QString &json, VPiecePassmarkData
AbstractTest::ReadStringValue(passmarkData, QStringLiteral("pieceName"), pieceName); AbstractTest::ReadStringValue(passmarkData, QStringLiteral("pieceName"), pieceName);
data.pieceName = pieceName; data.pieceName = pieceName;
PassmarkLineType passmarkLineType; PassmarkLineType passmarkLineType = PassmarkLineType::OneLine;
AbstractTest::ReadDoubleValue(passmarkData, QStringLiteral("passmarkLineType"), passmarkLineType, AbstractTest::ReadDoubleValue(passmarkData, QStringLiteral("passmarkLineType"), passmarkLineType,
QString::number(static_cast<int>(PassmarkLineType::OneLine))); QString::number(static_cast<int>(PassmarkLineType::OneLine)));
data.passmarkLineType = passmarkLineType; data.passmarkLineType = passmarkLineType;
PassmarkAngleType passmarkAngleType; PassmarkAngleType passmarkAngleType = PassmarkAngleType::Straightforward;
AbstractTest::ReadDoubleValue(passmarkData, QStringLiteral("passmarkAngleType"), passmarkAngleType, AbstractTest::ReadDoubleValue(passmarkData, QStringLiteral("passmarkAngleType"), passmarkAngleType,
QString::number(static_cast<int>(PassmarkAngleType::Straightforward))); QString::number(static_cast<int>(PassmarkAngleType::Straightforward)));
data.passmarkAngleType = passmarkAngleType; data.passmarkAngleType = passmarkAngleType;
@ -259,11 +259,11 @@ void AbstractTest::PassmarkDataFromJson(const QString &json, VPiecePassmarkData
AbstractTest::ReadBooleanValue(passmarkData, QStringLiteral("isShowSecondPassmark"), isShowSecondPassmark); AbstractTest::ReadBooleanValue(passmarkData, QStringLiteral("isShowSecondPassmark"), isShowSecondPassmark);
data.isShowSecondPassmark = isShowSecondPassmark; data.isShowSecondPassmark = isShowSecondPassmark;
int passmarkIndex; int passmarkIndex = -1;
AbstractTest::ReadDoubleValue(passmarkData, QStringLiteral("passmarkIndex"), passmarkIndex, QStringLiteral("-1")); AbstractTest::ReadDoubleValue(passmarkData, QStringLiteral("passmarkIndex"), passmarkIndex, QStringLiteral("-1"));
data.passmarkIndex = passmarkIndex; data.passmarkIndex = passmarkIndex;
vidtype id; vidtype id = NULL_ID;
AbstractTest::ReadDoubleValue(passmarkData, QStringLiteral("id"), id, QString::number(NULL_ID)); AbstractTest::ReadDoubleValue(passmarkData, QStringLiteral("id"), id, QString::number(NULL_ID));
data.id = id; data.id = id;
@ -891,7 +891,7 @@ void AbstractTest::SAPointFromJson(const QJsonObject &itemObject, VSAPoint &poin
AbstractTest::ReadDoubleValue(itemObject, QStringLiteral("saAfter"), saAfter, QStringLiteral("-1")); AbstractTest::ReadDoubleValue(itemObject, QStringLiteral("saAfter"), saAfter, QStringLiteral("-1"));
point.SetSAAfter(saAfter); point.SetSAAfter(saAfter);
PieceNodeAngle angleType; PieceNodeAngle angleType = PieceNodeAngle::ByLength;
AbstractTest::ReadDoubleValue(itemObject, QStringLiteral("angle"), angleType, AbstractTest::ReadDoubleValue(itemObject, QStringLiteral("angle"), angleType,
QString::number(static_cast<int>(PieceNodeAngle::ByLength))); QString::number(static_cast<int>(PieceNodeAngle::ByLength)));
point.SetAngleType(angleType); point.SetAngleType(angleType);