From 3970bbdbc09eba71aa7b4b97e5b5c73ac8d5d45a Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 12 Apr 2018 13:13:19 +0300 Subject: [PATCH] Refactoring. Use QChar instead of QString where possible. --HG-- branch : develop --- src/app/tape/tmainwindow.cpp | 2 +- src/app/valentina/core/vcmdexport.cpp | 8 +- .../dialogs/dialogfinalmeasurements.cpp | 2 +- src/app/valentina/dialogs/dialoghistory.cpp | 2 +- .../valentina/dialogs/dialogsavelayout.cpp | 2 +- src/app/valentina/xml/vpattern.cpp | 127 +++++++++--------- src/libs/ifc/ifcdef.h | 2 +- src/libs/ifc/xml/vabstractpattern.cpp | 23 ++-- src/libs/ifc/xml/vdomdocument.cpp | 8 +- src/libs/ifc/xml/vdomdocument.h | 9 +- src/libs/ifc/xml/vpatternconverter.cpp | 20 +-- src/libs/qmuparser/qmuparserbytecode.cpp | 2 +- src/libs/vdxf/dxiface.cpp | 12 +- src/libs/vdxf/libdxfrw/drw_entities.h | 2 +- src/libs/vdxf/libdxfrw/libdxfrw.cpp | 4 +- src/libs/vdxf/vdxfengine.cpp | 34 ++--- src/libs/vformat/vmeasurements.cpp | 18 +-- src/libs/vgeometry/vabstractarc_p.h | 4 +- src/libs/vgeometry/vplacelabelitem_p.h | 2 +- src/libs/vgeometry/vspline_p.h | 20 +-- src/libs/vgeometry/vsplinepoint_p.h | 6 +- src/libs/vpatterndb/vnodedetail.cpp | 6 +- src/libs/vpatterndb/vpiece.cpp | 2 +- src/libs/vpatterndb/vpiece_p.h | 2 +- src/libs/vpatterndb/vpiecepath_p.h | 4 +- .../dialogs/tools/piece/dialogpiecepath.cpp | 4 +- .../flipping/vtoolflippingbyaxis.cpp | 2 +- .../tools/drawTools/operation/vtoolmove.cpp | 6 +- .../drawTools/operation/vtoolrotation.cpp | 2 +- .../tools/drawTools/toolcurve/vtoolarc.h | 6 +- .../drawTools/toolcurve/vtoolarcwithlength.h | 6 +- .../toolcurve/vtoolellipticalarc.cpp | 4 +- .../drawTools/toolcurve/vtoolellipticalarc.h | 10 +- .../toolsinglepoint/toolcut/vtoolcutarc.cpp | 2 +- .../toollinepoint/vtoolcurveintersectaxis.h | 2 +- .../toollinepoint/vtoollineintersectaxis.h | 2 +- .../toollinepoint/vtoolnormal.cpp | 2 +- .../vtoolpointfromarcandtangent.cpp | 2 +- .../vtoolpointfromcircleandtangent.cpp | 2 +- .../vtoolpointfromcircleandtangent.h | 2 +- .../toolsinglepoint/vtoolpointofcontact.h | 2 +- .../vtoolpointofintersectionarcs.cpp | 2 +- .../vtoolpointofintersectioncircles.cpp | 2 +- .../vtoolpointofintersectioncircles.h | 4 +- .../vtoolpointofintersectioncurves.cpp | 4 +- .../tools/nodeDetails/vtoolplacelabel.h | 6 +- src/libs/vtools/tools/vtoolseamallowance.cpp | 2 +- src/libs/vtools/tools/vtoolseamallowance.h | 2 +- src/libs/vtools/tools/vtooluniondetails.cpp | 12 +- .../vtools/undocommands/additemtogroup.cpp | 4 +- .../undocommands/removeitemfromgroup.cpp | 4 +- .../visualization/path/vistoolsplinepath.cpp | 8 +- src/test/ValentinaTest/tst_vpiece.cpp | 6 +- src/test/ValentinaTest/tst_vsplinepath.cpp | 14 +- 54 files changed, 230 insertions(+), 219 deletions(-) diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index 9f8a091a3..d4745c203 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -3168,7 +3168,7 @@ void TMainWindow::ImportIndividualMeasurements(const QxtCsvModel &csv) { IndividualMeasurement() : name(), - value("0"), + value('0'), fullName(), description() {} diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp index acc7ce6f9..b8ed14ea5 100644 --- a/src/app/valentina/core/vcmdexport.cpp +++ b/src/app/valentina/core/vcmdexport.cpp @@ -100,7 +100,7 @@ void VCommandLine::InitOptions(VCommandLineOptions &options, QMap translate("VCommandLine", "Number corresponding to output format (default = " "0, export mode):") + DialogSaveLayout::MakeHelpFormatList(), - translate("VCommandLine", "Format number"), "0")); + translate("VCommandLine", "Format number"), QChar('0'))); optionsIndex.insert(LONG_OPTION_BINARYDXF, index++); options.append(new QCommandLineOption(QStringList() << LONG_OPTION_BINARYDXF, @@ -144,7 +144,7 @@ void VCommandLine::InitOptions(VCommandLineOptions &options, QMap translate("VCommandLine", "Number corresponding to layout page template " "(default = 0, export mode):") + DialogLayoutSettings::MakeHelpTemplateList(), - translate("VCommandLine", "Template number"), "0")); + translate("VCommandLine", "Template number"), QChar('0'))); optionsIndex.insert(LONG_OPTION_PAGEW, index++); options.append(new QCommandLineOption(QStringList() << SINGLE_OPTION_PAGEW << LONG_OPTION_PAGEW, @@ -259,7 +259,7 @@ void VCommandLine::InitOptions(VCommandLineOptions &options, QMap options.append(new QCommandLineOption(QStringList() << SINGLE_OPTION_GROUPPING << LONG_OPTION_GROUPPING, translate("VCommandLine", "Sets layout groupping cases (export mode): %1.") .arg(DialogLayoutSettings::MakeGroupsHelp()), - translate("VCommandLine", "Grouping type"), "2")); + translate("VCommandLine", "Grouping type"), QChar('2'))); optionsIndex.insert(LONG_OPTION_TEST, index++); options.append(new QCommandLineOption(QStringList() << SINGLE_OPTION_TEST << LONG_OPTION_TEST, @@ -323,7 +323,7 @@ void VCommandLine::InitOptions(VCommandLineOptions &options, QMap "(default = 0, export mode with tiled pdf " "format):") + DialogLayoutSettings::MakeHelpTiledPdfTemplateList(), - translate("VCommandLine", "Template number"), "0")); + translate("VCommandLine", "Template number"), QChar('0'))); optionsIndex.insert(LONG_OPTION_TILED_PDF_LEFT_MARGIN, index++); options.append(new QCommandLineOption(QStringList() << LONG_OPTION_TILED_PDF_LEFT_MARGIN, diff --git a/src/app/valentina/dialogs/dialogfinalmeasurements.cpp b/src/app/valentina/dialogs/dialogfinalmeasurements.cpp index cf2dc41fe..f6db6ae68 100644 --- a/src/app/valentina/dialogs/dialogfinalmeasurements.cpp +++ b/src/app/valentina/dialogs/dialogfinalmeasurements.cpp @@ -269,7 +269,7 @@ void DialogFinalMeasurements::Add() VFinalMeasurement m; m.name = tr("measurement"); - m.formula = "0"; + m.formula = QLatin1Char('0'); m_measurements.append(m); diff --git a/src/app/valentina/dialogs/dialoghistory.cpp b/src/app/valentina/dialogs/dialoghistory.cpp index 2e3117eac..bf9cb2640 100644 --- a/src/app/valentina/dialogs/dialoghistory.cpp +++ b/src/app/valentina/dialogs/dialoghistory.cpp @@ -460,7 +460,7 @@ QString DialogHistory::PointName(quint32 pointId) //--------------------------------------------------------------------------------------------------------------------- quint32 DialogHistory::AttrUInt(const QDomElement &domElement, const QString &name) { - return doc->GetParametrUInt(domElement, name, "0"); + return doc->GetParametrUInt(domElement, name, QChar('0')); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index eb9e4e20a..25f6a3709 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -563,7 +563,7 @@ void DialogSaveLayout::PathChanged(const QString &text) void DialogSaveLayout::ShowExample() { const LayoutExportFormats currentFormat = Format(); - ui->labelExample->setText(tr("Example:") + FileName() + QLatin1String("1") + ExportFromatSuffix(currentFormat)); + ui->labelExample->setText(tr("Example:") + FileName() + QLatin1Char('1') + ExportFromatSuffix(currentFormat)); ui->checkBoxBinaryDXF->setEnabled(false); ui->groupBoxPaperFormat->setEnabled(false); diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp index 4eb280ce0..fcdd2e74a 100644 --- a/src/app/valentina/xml/vpattern.cpp +++ b/src/app/valentina/xml/vpattern.cpp @@ -677,7 +677,7 @@ VNodeDetail VPattern::ParseDetailNode(const QDomElement &domElement) const const quint32 id = GetParametrUInt(domElement, AttrIdObject, NULL_ID_STR); const qreal mx = GetParametrDouble(domElement, AttrMx, "0.0"); const qreal my = GetParametrDouble(domElement, AttrMy, "0.0"); - const bool reverse = GetParametrUInt(domElement, VAbstractPattern::AttrNodeReverse, "0"); + const bool reverse = GetParametrUInt(domElement, VAbstractPattern::AttrNodeReverse, QChar('0')); const NodeDetail nodeType = NodeDetail::Contour; const QString t = GetParametrString(domElement, AttrType, "NodePoint"); @@ -900,7 +900,7 @@ void VPattern::ParseDetailElement(QDomElement &domElement, const Document &parse //--------------------------------------------------------------------------------------------------------------------- void VPattern::ParseDetailInternals(const QDomElement &domElement, VPiece &detail) const { - const uint version = GetParametrUInt(domElement, AttrVersion, "1"); + const uint version = GetParametrUInt(domElement, AttrVersion, QChar('1')); const QStringList tags = QStringList() << TagNodes << TagData @@ -935,7 +935,7 @@ void VPattern::ParseDetailInternals(const QDomElement &domElement, VPiece &detai // TODO. Delete if minimal supported version is 0.4.0 Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < CONVERTER_VERSION_CHECK(0, 4, 0), "Time to refactor the code."); - const bool closed = GetParametrUInt(domElement, AttrClosed, "1"); + const bool closed = GetParametrUInt(domElement, AttrClosed, QChar('1')); const qreal width = GetParametrDouble(domElement, AttrWidth, "0.0"); futurePathV1 = QtConcurrent::run(this, &VPattern::ParseDetailNodes, element, width, closed); } @@ -1047,13 +1047,14 @@ VPieceLabelData VPattern::ParsePieceDataTag(const QDomElement &domElement, VPiec ppData.SetRotationWay(GetParametrEmptyString(domElement, AttrRotationWay)); ppData.SetTilt(GetParametrEmptyString(domElement, AttrTilt)); ppData.SetFoldPosition(GetParametrEmptyString(domElement, AttrFoldPosition)); - ppData.SetQuantity(static_cast(GetParametrUInt(domElement, AttrQuantity, "1"))); + ppData.SetQuantity(static_cast(GetParametrUInt(domElement, AttrQuantity, QChar('1')))); ppData.SetOnFold(GetParametrBool(domElement, AttrOnFold, falseStr)); - ppData.SetPos(QPointF(GetParametrDouble(domElement, AttrMx, "0"), GetParametrDouble(domElement, AttrMy, "0"))); - ppData.SetLabelWidth(GetParametrString(domElement, AttrWidth, "1")); - ppData.SetLabelHeight(GetParametrString(domElement, AttrHeight, "1")); - ppData.SetFontSize(static_cast(GetParametrUInt(domElement, VToolSeamAllowance::AttrFont, "0"))); - ppData.SetRotation(GetParametrString(domElement, AttrRotation, "0")); + ppData.SetPos(QPointF(GetParametrDouble(domElement, AttrMx, QChar('0')), + GetParametrDouble(domElement, AttrMy, QChar('0')))); + ppData.SetLabelWidth(GetParametrString(domElement, AttrWidth, QChar('1'))); + ppData.SetLabelHeight(GetParametrString(domElement, AttrHeight, QChar('1'))); + ppData.SetFontSize(static_cast(GetParametrUInt(domElement, VToolSeamAllowance::AttrFont, QChar('0')))); + ppData.SetRotation(GetParametrString(domElement, AttrRotation, QChar('0'))); ppData.SetCenterPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrCenterPin, NULL_ID_STR)); ppData.SetTopLeftPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrTopLeftPin, NULL_ID_STR)); ppData.SetBottomRightPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrBottomRightPin, NULL_ID_STR)); @@ -1065,11 +1066,12 @@ VPieceLabelData VPattern::ParsePieceDataTag(const QDomElement &domElement, VPiec VPatternLabelData VPattern::ParsePiecePatternInfo(const QDomElement &domElement, VPatternLabelData patternInfo) const { patternInfo.SetVisible(GetParametrBool(domElement, AttrVisible, trueStr)); - patternInfo.SetPos(QPointF(GetParametrDouble(domElement, AttrMx, "0"), GetParametrDouble(domElement, AttrMy, "0"))); - patternInfo.SetLabelWidth(GetParametrString(domElement, AttrWidth, "1")); - patternInfo.SetLabelHeight(GetParametrString(domElement, AttrHeight, "1")); - patternInfo.SetFontSize(static_cast(GetParametrUInt(domElement, VToolSeamAllowance::AttrFont, "0"))); - patternInfo.SetRotation(GetParametrString(domElement, AttrRotation, "0")); + patternInfo.SetPos(QPointF(GetParametrDouble(domElement, AttrMx, QChar('0')), + GetParametrDouble(domElement, AttrMy, QChar('0')))); + patternInfo.SetLabelWidth(GetParametrString(domElement, AttrWidth, QChar('1'))); + patternInfo.SetLabelHeight(GetParametrString(domElement, AttrHeight, QChar('1'))); + patternInfo.SetFontSize(static_cast(GetParametrUInt(domElement, VToolSeamAllowance::AttrFont, QChar('0')))); + patternInfo.SetRotation(GetParametrString(domElement, AttrRotation, QChar('0'))); patternInfo.SetCenterPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrCenterPin, NULL_ID_STR)); patternInfo.SetTopLeftPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrTopLeftPin, NULL_ID_STR)); patternInfo.SetBottomRightPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrBottomRightPin, NULL_ID_STR)); @@ -1080,10 +1082,11 @@ VPatternLabelData VPattern::ParsePiecePatternInfo(const QDomElement &domElement, VGrainlineData VPattern::ParsePieceGrainline(const QDomElement &domElement, VGrainlineData gGeometry) const { gGeometry.SetVisible(GetParametrBool(domElement, AttrVisible, falseStr)); - gGeometry.SetPos(QPointF(GetParametrDouble(domElement, AttrMx, "0"), GetParametrDouble(domElement, AttrMy, "0"))); - gGeometry.SetLength(GetParametrString(domElement, AttrLength, "1")); + gGeometry.SetPos(QPointF(GetParametrDouble(domElement, AttrMx, QChar('0')), + GetParametrDouble(domElement, AttrMy, QChar('0')))); + gGeometry.SetLength(GetParametrString(domElement, AttrLength, QChar('1'))); gGeometry.SetRotation(GetParametrString(domElement, AttrRotation, "90")); - gGeometry.SetArrowType(static_cast(GetParametrUInt(domElement, AttrArrows, "0"))); + gGeometry.SetArrowType(static_cast(GetParametrUInt(domElement, AttrArrows, QChar('0')))); gGeometry.SetCenterPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrCenterPin, NULL_ID_STR)); gGeometry.SetTopPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrTopPin, NULL_ID_STR)); gGeometry.SetBottomPin(GetParametrUInt(domElement, VToolSeamAllowance::AttrBottomPin, NULL_ID_STR)); @@ -1696,7 +1699,7 @@ void VPattern::ParseToolPointOfContact(VMainGraphicsScene *scene, QDomElement &d initData.typeCreation = Source::FromFile; PointsCommonAttributes(domElement, initData); - initData.radius = GetParametrString(domElement, AttrRadius, "0"); + initData.radius = GetParametrString(domElement, AttrRadius, QChar('0')); const QString f = initData.radius;//need for saving fixed formula; initData.center = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); initData.firstPointId = GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); @@ -1824,7 +1827,7 @@ void VPattern::ParsePlaceLabel(QDomElement &domElement, const Document &parse) initData.angle = GetParametrString(domElement, AttrAngle, "0.0"); const QString angle = initData.angle;//need for saving fixed formula; - initData.type = static_cast(GetParametrUInt(domElement, AttrPlaceLabelType, "0")); + initData.type = static_cast(GetParametrUInt(domElement, AttrPlaceLabelType, QChar('0'))); VToolPlaceLabel::Create(initData); @@ -1959,7 +1962,7 @@ void VPattern::ParseToolCutSpline(VMainGraphicsScene *scene, QDomElement &domEle initData.typeCreation = Source::FromFile; PointsCommonAttributes(domElement, initData); - initData.formula = GetParametrString(domElement, AttrLength, "0"); + initData.formula = GetParametrString(domElement, AttrLength, QChar('0')); const QString f = initData.formula;//need for saving fixed formula; initData.splineId = GetParametrUInt(domElement, VToolCutSpline::AttrSpline, NULL_ID_STR); @@ -2002,7 +2005,7 @@ void VPattern::ParseToolCutSplinePath(VMainGraphicsScene *scene, QDomElement &do initData.typeCreation = Source::FromFile; PointsCommonAttributes(domElement, initData); - initData.formula = GetParametrString(domElement, AttrLength, "0"); + initData.formula = GetParametrString(domElement, AttrLength, QChar('0')); const QString f = initData.formula;//need for saving fixed formula; initData.splinePathId = GetParametrUInt(domElement, VToolCutSplinePath::AttrSplinePath, NULL_ID_STR); @@ -2045,7 +2048,7 @@ void VPattern::ParseToolCutArc(VMainGraphicsScene *scene, QDomElement &domElemen initData.typeCreation = Source::FromFile; PointsCommonAttributes(domElement, initData); - initData.formula = GetParametrString(domElement, AttrLength, "0"); + initData.formula = GetParametrString(domElement, AttrLength, QChar('0')); const QString f = initData.formula;//need for saving fixed formula; initData.arcId = GetParametrUInt(domElement, AttrArc, NULL_ID_STR); @@ -2189,7 +2192,7 @@ void VPattern::ParseToolPointOfIntersectionArcs(VMainGraphicsScene *scene, const PointsCommonAttributes(domElement, initData); initData.firstArcId = GetParametrUInt(domElement, AttrFirstArc, NULL_ID_STR); initData.secondArcId = GetParametrUInt(domElement, AttrSecondArc, NULL_ID_STR); - initData.pType = static_cast(GetParametrUInt(domElement, AttrCrossPoint, "1")); + initData.pType = static_cast(GetParametrUInt(domElement, AttrCrossPoint, QChar('1'))); VToolPointOfIntersectionArcs::Create(initData); } @@ -2224,7 +2227,7 @@ void VPattern::ParseToolPointOfIntersectionCircles(VMainGraphicsScene *scene, QD const QString c1R = initData.firstCircleRadius; initData.secondCircleRadius = GetParametrString(domElement, AttrC2Radius); const QString c2R = initData.secondCircleRadius; - initData.crossPoint = static_cast(GetParametrUInt(domElement, AttrCrossPoint, "1")); + initData.crossPoint = static_cast(GetParametrUInt(domElement, AttrCrossPoint, QChar('1'))); VToolPointOfIntersectionCircles::Create(initData); //Rewrite attribute formula. Need for situation when we have wrong formula. @@ -2263,8 +2266,8 @@ void VPattern::ParseToolPointOfIntersectionCurves(VMainGraphicsScene *scene, QDo PointsCommonAttributes(domElement, initData); initData.firstCurveId = GetParametrUInt(domElement, AttrCurve1, NULL_ID_STR); initData.secondCurveId = GetParametrUInt(domElement, AttrCurve2, NULL_ID_STR); - initData.vCrossPoint = static_cast(GetParametrUInt(domElement, AttrVCrossPoint, "1")); - initData.hCrossPoint = static_cast(GetParametrUInt(domElement, AttrHCrossPoint, "1")); + initData.vCrossPoint = static_cast(GetParametrUInt(domElement, AttrVCrossPoint, QChar('1'))); + initData.hCrossPoint = static_cast(GetParametrUInt(domElement, AttrHCrossPoint, QChar('1'))); VToolPointOfIntersectionCurves::Create(initData); } @@ -2297,7 +2300,7 @@ void VPattern::ParseToolPointFromCircleAndTangent(VMainGraphicsScene *scene, QDo initData.tangentPointId = GetParametrUInt(domElement, AttrTangent, NULL_ID_STR); initData.circleRadius = GetParametrString(domElement, AttrCRadius); const QString cR = initData.circleRadius; - initData.crossPoint = static_cast(GetParametrUInt(domElement, AttrCrossPoint, "1")); + initData.crossPoint = static_cast(GetParametrUInt(domElement, AttrCrossPoint, QChar('1'))); VToolPointFromCircleAndTangent::Create(initData); //Rewrite attribute formula. Need for situation when we have wrong formula. @@ -2335,7 +2338,7 @@ void VPattern::ParseToolPointFromArcAndTangent(VMainGraphicsScene *scene, const PointsCommonAttributes(domElement, initData); initData.arcId = GetParametrUInt(domElement, AttrArc, NULL_ID_STR); initData.tangentPointId = GetParametrUInt(domElement, AttrTangent, NULL_ID_STR); - initData.crossPoint = static_cast(GetParametrUInt(domElement, AttrCrossPoint, "1")); + initData.crossPoint = static_cast(GetParametrUInt(domElement, AttrCrossPoint, QChar('1'))); VToolPointFromArcAndTangent::Create(initData); } @@ -2418,7 +2421,7 @@ void VPattern::ParseOldToolSpline(VMainGraphicsScene *scene, const QDomElement & const qreal kAsm2 = GetParametrDouble(domElement, AttrKAsm2, "1.0"); const qreal kCurve = GetParametrDouble(domElement, AttrKCurve, "1.0"); const QString color = GetParametrString(domElement, AttrColor, ColorBlack); - const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, "0"); + const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, QChar('0')); const auto p1 = data->GeometricObject(point1); const auto p4 = data->GeometricObject(point4); @@ -2459,22 +2462,22 @@ void VPattern::ParseToolSpline(VMainGraphicsScene *scene, QDomElement &domElemen initData.point1 = GetParametrUInt(domElement, AttrPoint1, NULL_ID_STR); initData.point4 = GetParametrUInt(domElement, AttrPoint4, NULL_ID_STR); - initData.a1 = GetParametrString(domElement, AttrAngle1, "0"); + initData.a1 = GetParametrString(domElement, AttrAngle1, QChar('0')); const QString angle1 = initData.a1;//need for saving fixed formula; - initData.a2 = GetParametrString(domElement, AttrAngle2, "0"); + initData.a2 = GetParametrString(domElement, AttrAngle2, QChar('0')); const QString angle2 = initData.a2;//need for saving fixed formula; - initData.l1 = GetParametrString(domElement, AttrLength1, "0"); + initData.l1 = GetParametrString(domElement, AttrLength1, QChar('0')); const QString length1 = initData.l1;//need for saving fixed formula; - initData.l2 = GetParametrString(domElement, AttrLength2, "0"); + initData.l2 = GetParametrString(domElement, AttrLength2, QChar('0')); const QString length2 = initData.l2;//need for saving fixed formula; initData.color = GetParametrString(domElement, AttrColor, ColorBlack); initData.penStyle = GetParametrString(domElement, AttrPenStyle, TypeLineLine); - initData.duplicate = GetParametrUInt(domElement, AttrDuplicate, "0"); - initData.approximationScale = GetParametrDouble(domElement, AttrAScale, "0"); + initData.duplicate = GetParametrUInt(domElement, AttrDuplicate, QChar('0')); + initData.approximationScale = GetParametrDouble(domElement, AttrAScale, QChar('0')); VToolSpline *spl = VToolSpline::Create(initData); @@ -2534,8 +2537,8 @@ void VPattern::ParseToolCubicBezier(VMainGraphicsScene *scene, const QDomElement const QString color = GetParametrString(domElement, AttrColor, ColorBlack); const QString penStyle = GetParametrString(domElement, AttrPenStyle, TypeLineLine); - const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, "0"); - const qreal approximationScale = GetParametrDouble(domElement, AttrAScale, "0"); + const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, QChar('0')); + const qreal approximationScale = GetParametrDouble(domElement, AttrAScale, QChar('0')); auto p1 = data->GeometricObject(point1); auto p2 = data->GeometricObject(point2); @@ -2580,8 +2583,8 @@ void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, const QDomEleme ToolsCommonAttributes(domElement, initData.id); const qreal kCurve = GetParametrDouble(domElement, AttrKCurve, "1.0"); const QString color = GetParametrString(domElement, AttrColor, ColorBlack); - const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, "0"); - const qreal approximationScale = GetParametrDouble(domElement, AttrAScale, "0"); + const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, QChar('0')); + const qreal approximationScale = GetParametrDouble(domElement, AttrAScale, QChar('0')); QVector points; @@ -2595,7 +2598,7 @@ void VPattern::ParseOldToolSplinePath(VMainGraphicsScene *scene, const QDomEleme if (element.tagName() == AttrPathPoint) { const qreal kAsm1 = GetParametrDouble(element, AttrKAsm1, "1.0"); - const qreal angle = GetParametrDouble(element, AttrAngle, "0"); + const qreal angle = GetParametrDouble(element, AttrAngle, QChar('0')); const qreal kAsm2 = GetParametrDouble(element, AttrKAsm2, "1.0"); const quint32 pSpline = GetParametrUInt(element, AttrPSpline, NULL_ID_STR); const VPointF p = *data->GeometricObject(pSpline); @@ -2649,8 +2652,8 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement ToolsCommonAttributes(domElement, initData.id); initData.color = GetParametrString(domElement, AttrColor, ColorBlack); initData.penStyle = GetParametrString(domElement, AttrPenStyle, TypeLineLine); - initData.duplicate = GetParametrUInt(domElement, AttrDuplicate, "0"); - initData.approximationScale = GetParametrDouble(domElement, AttrAScale, "0"); + initData.duplicate = GetParametrUInt(domElement, AttrDuplicate, QChar('0')); + initData.approximationScale = GetParametrDouble(domElement, AttrAScale, QChar('0')); const QDomNodeList nodeList = domElement.childNodes(); const qint32 num = nodeList.size(); @@ -2659,10 +2662,10 @@ void VPattern::ParseToolSplinePath(VMainGraphicsScene *scene, const QDomElement const QDomElement element = nodeList.at(i).toElement(); if (not element.isNull() && element.tagName() == AttrPathPoint) { - initData.a1.append(GetParametrString(element, AttrAngle1, "0")); - initData.a2.append(GetParametrString(element, AttrAngle2, "0")); - initData.l1.append(GetParametrString(element, AttrLength1, "0")); - initData.l2.append(GetParametrString(element, AttrLength2, "0")); + initData.a1.append(GetParametrString(element, AttrAngle1, QChar('0'))); + initData.a2.append(GetParametrString(element, AttrAngle2, QChar('0'))); + initData.l1.append(GetParametrString(element, AttrLength1, QChar('0'))); + initData.l2.append(GetParametrString(element, AttrLength2, QChar('0'))); const quint32 pSpline = GetParametrUInt(element, AttrPSpline, NULL_ID_STR); initData.points.append(pSpline); @@ -2741,8 +2744,8 @@ void VPattern::ParseToolCubicBezierPath(VMainGraphicsScene *scene, const QDomEle ToolsCommonAttributes(domElement, initData.id); const QString color = GetParametrString(domElement, AttrColor, ColorBlack); const QString penStyle = GetParametrString(domElement, AttrPenStyle, TypeLineLine); - const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, "0"); - const qreal approximationScale = GetParametrDouble(domElement, AttrAScale, "0"); + const quint32 duplicate = GetParametrUInt(domElement, AttrDuplicate, QChar('0')); + const qreal approximationScale = GetParametrDouble(domElement, AttrAScale, QChar('0')); QVector points; @@ -2906,7 +2909,7 @@ void VPattern::ParseToolArc(VMainGraphicsScene *scene, QDomElement &domElement, const QString f2Fix = initData.f2;//need for saving fixed formula; initData.color = GetParametrString(domElement, AttrColor, ColorBlack); initData.penStyle = GetParametrString(domElement, AttrPenStyle, TypeLineLine); - initData.approximationScale = GetParametrDouble(domElement, AttrAScale, "0"); + initData.approximationScale = GetParametrDouble(domElement, AttrAScale, QChar('0')); VToolArc::Create(initData); //Rewrite attribute formula. Need for situation when we have wrong formula. @@ -2958,11 +2961,11 @@ void VPattern::ParseToolEllipticalArc(VMainGraphicsScene *scene, QDomElement &do const QString f1Fix = initData.f1;//need for saving fixed formula; initData.f2 = GetParametrString(domElement, AttrAngle2, "270"); const QString f2Fix = initData.f2;//need for saving fixed formula; - initData.rotationAngle = GetParametrString(domElement, AttrRotationAngle, "0"); + initData.rotationAngle = GetParametrString(domElement, AttrRotationAngle, QChar('0')); const QString frotationFix = initData.rotationAngle;//need for saving fixed formula; initData.color = GetParametrString(domElement, AttrColor, ColorBlack); initData.penStyle = GetParametrString(domElement, AttrPenStyle, TypeLineLine); - initData.approximationScale = GetParametrDouble(domElement, AttrAScale, "0"); + initData.approximationScale = GetParametrDouble(domElement, AttrAScale, QChar('0')); VToolEllipticalArc::Create(initData); //Rewrite attribute formula. Need for situation when we have wrong formula. @@ -3216,7 +3219,7 @@ void VPattern::ParseToolFlippingByAxis(VMainGraphicsScene *scene, QDomElement &d ToolsCommonAttributes(domElement, initData.id); initData.originPointId = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); - initData.axisType = static_cast(GetParametrUInt(domElement, AttrAxisType, "1")); + initData.axisType = static_cast(GetParametrUInt(domElement, AttrAxisType, QChar('1'))); initData.suffix = GetParametrString(domElement, AttrSuffix, QString()); VAbstractOperation::ExtractData(domElement, initData); @@ -3247,11 +3250,11 @@ void VPattern::ParseToolMove(VMainGraphicsScene *scene, QDomElement &domElement, initData.typeCreation = Source::FromFile; ToolsCommonAttributes(domElement, initData.id); - initData.formulaAngle = GetParametrString(domElement, AttrAngle, "0"); + initData.formulaAngle = GetParametrString(domElement, AttrAngle, QChar('0')); const QString a = initData.formulaAngle;//need for saving fixed formula; - initData.formulaRotationAngle = GetParametrString(domElement, AttrRotationAngle, "0"); + initData.formulaRotationAngle = GetParametrString(domElement, AttrRotationAngle, QChar('0')); const QString r = initData.formulaRotationAngle;//need for saving fixed formula; - initData.formulaLength = GetParametrString(domElement, AttrLength, "0"); + initData.formulaLength = GetParametrString(domElement, AttrLength, QChar('0')); const QString len = initData.formulaLength;//need for saving fixed formula; initData.suffix = GetParametrString(domElement, AttrSuffix, QString()); initData.rotationOrigin = GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); @@ -3315,8 +3318,8 @@ QDomElement VPattern::MakeEmptyIncrement(const QString &name) { QDomElement element = createElement(TagIncrement); SetAttribute(element, AttrName, name); - SetAttribute(element, AttrFormula, QString("0")); - SetAttribute(element, AttrDescription, QString(QString())); + SetAttribute(element, AttrFormula, QChar('0')); + SetAttribute(element, AttrDescription, QString()); return element; } @@ -3644,7 +3647,7 @@ void VPattern::ParseToolsElement(VMainGraphicsScene *scene, const QDomElement &d VToolUnionDetailsInitData initData; initData.indexD1 = GetParametrUInt(domElement, VToolUnionDetails::AttrIndexD1, "-1"); initData.indexD2 = GetParametrUInt(domElement, VToolUnionDetails::AttrIndexD2, "-1"); - initData.version = GetParametrUInt(domElement, AttrVersion, "1"); + initData.version = GetParametrUInt(domElement, AttrVersion, QChar('1')); initData.scene = scene; initData.doc = this; initData.data = data; @@ -3732,7 +3735,7 @@ void VPattern::ParsePathElement(VMainGraphicsScene *scene, QDomElement &domEleme if (initData.path.GetType() == PiecePathType::InternalPath) { - initData.path.SetVisibilityTrigger(GetParametrString(domElement, AttrVisible, "1")); + initData.path.SetVisibilityTrigger(GetParametrString(domElement, AttrVisible, QChar('1'))); } VToolPiecePath::Create(initData); @@ -3766,7 +3769,7 @@ void VPattern::ParseIncrementsElement(const QDomNode &node, const Document &pars { const QString name = GetParametrString(domElement, AttrName, QString()); const QString desc = GetParametrEmptyString(domElement, AttrDescription); - const QString formula = GetParametrString(domElement, AttrFormula, "0"); + const QString formula = GetParametrString(domElement, AttrFormula, QChar('0')); bool ok = false; const qreal value = EvalFormula(data, formula, &ok); @@ -4077,7 +4080,7 @@ int VPattern::GetDefCustomHeight() const const QDomElement domElement = domNode.toElement(); if (domElement.isNull() == false) { - return static_cast(GetParametrUInt(domElement, AttrDefHeight, QStringLiteral("0"))); + return static_cast(GetParametrUInt(domElement, AttrDefHeight, QChar('0'))); } else { @@ -4136,7 +4139,7 @@ int VPattern::GetDefCustomSize() const const QDomElement domElement = domNode.toElement(); if (domElement.isNull() == false) { - return static_cast(GetParametrUInt(domElement, AttrDefSize, QStringLiteral("0"))); + return static_cast(GetParametrUInt(domElement, AttrDefSize, QChar('0'))); } else { diff --git a/src/libs/ifc/ifcdef.h b/src/libs/ifc/ifcdef.h index 5222137fe..f3b472e7e 100644 --- a/src/libs/ifc/ifcdef.h +++ b/src/libs/ifc/ifcdef.h @@ -47,7 +47,7 @@ extern const QString CustomIncrSign; static const quint32 null_id = 0; #define NULL_ID null_id//use this value for initialization variables that keeps id values. 0 mean uknown id value. -#define NULL_ID_STR "0" +#define NULL_ID_STR QChar('0') // Detect whether the compiler supports C++11 noexcept exception specifications. # if defined(__clang__) diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index a3f3dfade..98b5ddd0e 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -634,7 +634,7 @@ QVector VAbstractPattern::ParsePieceCSARecords(const QDomElement record.reverse = GetParametrBool(element, VAbstractPattern::AttrNodeReverse, falseStr); record.includeType = static_cast(GetParametrUInt(element, VAbstractPattern::AttrIncludeAs, - "1")); + QChar('1'))); records.append(record); } } @@ -685,14 +685,15 @@ QVector VAbstractPattern::ParsePiecePointRecords(const QDomElement &dom VPieceNode VAbstractPattern::ParseSANode(const QDomElement &domElement) { const quint32 id = VDomDocument::GetParametrUInt(domElement, AttrIdObject, NULL_ID_STR); - const bool reverse = VDomDocument::GetParametrUInt(domElement, VAbstractPattern::AttrNodeReverse, "0"); + const bool reverse = VDomDocument::GetParametrUInt(domElement, VAbstractPattern::AttrNodeReverse, QChar('0')); const bool excluded = VDomDocument::GetParametrBool(domElement, VAbstractPattern::AttrNodeExcluded, falseStr); const bool uniqeness = VDomDocument::GetParametrBool(domElement, VAbstractPattern::AttrCheckUniqueness, trueStr); const QString saBefore = VDomDocument::GetParametrString(domElement, VAbstractPattern::AttrSABefore, currentSeamAllowance); const QString saAfter = VDomDocument::GetParametrString(domElement, VAbstractPattern::AttrSAAfter, currentSeamAllowance); - const PieceNodeAngle angle = static_cast(VDomDocument::GetParametrUInt(domElement, AttrAngle, "0")); + const PieceNodeAngle angle = static_cast(VDomDocument::GetParametrUInt(domElement, AttrAngle, + QChar('0'))); const bool passmark = VDomDocument::GetParametrBool(domElement, VAbstractPattern::AttrNodePassmark, falseStr); const PassmarkLineType passmarkLine = StringToPassmarkLineType(VDomDocument::GetParametrString(domElement, @@ -2110,7 +2111,7 @@ QMap VAbstractPattern::GetMaterials(const QDomElement &element) co { if (tagMaterial.tagName() == TagMaterial) { - const int number = static_cast(GetParametrUInt(tagMaterial, AttrNumber, "0")); + const int number = static_cast(GetParametrUInt(tagMaterial, AttrNumber, QChar('0'))); const QString name = GetParametrEmptyString(tagMaterial, AttrName); if (number > 0 && number <= userMaterialPlaceholdersQuantity) @@ -2159,7 +2160,7 @@ QVector VAbstractPattern::GetFMeasurements(const QDomElement VFinalMeasurement m; m.name = GetParametrString(tagFMeasurement, AttrName, tr("measurement")); - m.formula = GetParametrString(tagFMeasurement, AttrFormula, "0"); + m.formula = GetParametrString(tagFMeasurement, AttrFormula, QChar('0')); m.description = GetParametrEmptyString(tagFMeasurement, AttrDescription); measurements.append(m); @@ -2352,7 +2353,7 @@ QMap > VAbstractPattern::GetGroups() { if (group.tagName() == TagGroup) { - const quint32 id = GetParametrUInt(group, AttrId, "0"); + const quint32 id = GetParametrUInt(group, AttrId, QChar('0')); const bool visible = GetParametrBool(group, AttrVisible, trueStr); const QString name = GetParametrString(group, AttrName, tr("New group")); @@ -2411,7 +2412,7 @@ QMap VAbstractPattern::GetGroupsContainingItem(quint32 toolId, bool groupHasItem = GroupHasItem(group, toolId, objectId); if((containItem && groupHasItem) || (not containItem && not groupHasItem)) { - const quint32 groupId = GetParametrUInt(group, AttrId, "0"); + const quint32 groupId = GetParametrUInt(group, AttrId, QChar('0')); const QString name = GetParametrString(group, AttrName, tr("New group")); data.insert(groupId, name); } @@ -2448,8 +2449,8 @@ bool VAbstractPattern::GroupHasItem(const QDomElement &groupDomElement, quint32 const QDomElement item = itemNode.toElement(); if (item.isNull() == false) { - quint32 toolIdIterate= GetParametrUInt(item, AttrTool, "0"); - quint32 objectIdIterate= GetParametrUInt(item, AttrObject, "0"); + quint32 toolIdIterate= GetParametrUInt(item, AttrTool, QChar('0')); + quint32 objectIdIterate= GetParametrUInt(item, AttrObject, QChar('0')); if(toolIdIterate == toolId && objectIdIterate == objectId) { @@ -2538,8 +2539,8 @@ QDomElement VAbstractPattern::RemoveItemFromGroup(quint32 toolId, quint32 object const QDomElement item = itemNode.toElement(); if (item.isNull() == false) { - quint32 toolIdIterate= GetParametrUInt(item, AttrTool, "0"); - quint32 objectIdIterate= GetParametrUInt(item, AttrObject, "0"); + quint32 toolIdIterate= GetParametrUInt(item, AttrTool, QChar('0')); + quint32 objectIdIterate= GetParametrUInt(item, AttrObject, QChar('0')); if(toolIdIterate == toolId && objectIdIterate == objectId) { diff --git a/src/libs/ifc/xml/vdomdocument.cpp b/src/libs/ifc/xml/vdomdocument.cpp index e6fc3b4e1..58daef214 100644 --- a/src/libs/ifc/xml/vdomdocument.cpp +++ b/src/libs/ifc/xml/vdomdocument.cpp @@ -378,8 +378,8 @@ bool VDomDocument::GetParametrBool(const QDomElement &domElement, const QString const QStringList bools = QStringList() << QLatin1String("true") << QLatin1String("false") - << QLatin1String("1") - << QLatin1String("0"); + << QChar('1') + << QChar('0'); switch (bools.indexOf(parametr)) { case 0: // true @@ -956,8 +956,8 @@ QVector VDomDocument::GetLabelTemplate(const QDomElement &el line.line = GetParametrString(tagLine, AttrText, tr("")); line.bold = GetParametrBool(tagLine, AttrBold, falseStr); line.italic = GetParametrBool(tagLine, AttrItalic, falseStr); - line.alignment = static_cast(GetParametrUInt(tagLine, AttrAlignment, "0")); - line.fontSizeIncrement = static_cast(GetParametrUInt(tagLine, AttrFSIncrement, "0")); + line.alignment = static_cast(GetParametrUInt(tagLine, AttrAlignment, QChar('0'))); + line.fontSizeIncrement = static_cast(GetParametrUInt(tagLine, AttrFSIncrement, QChar('0'))); lines.append(line); } tagLine = tagLine.nextSiblingElement(TagLine); diff --git a/src/libs/ifc/xml/vdomdocument.h b/src/libs/ifc/xml/vdomdocument.h index cb490e116..9b681fe82 100644 --- a/src/libs/ifc/xml/vdomdocument.h +++ b/src/libs/ifc/xml/vdomdocument.h @@ -181,6 +181,13 @@ inline void VDomDocument::SetAttribute(QDomElement &domElement, const Q domElement.setAttribute(name, value); } +//--------------------------------------------------------------------------------------------------------------------- +template <> +inline void VDomDocument::SetAttribute(QDomElement &domElement, const QString &name, const QChar &value) const +{ + domElement.setAttribute(name, value); +} + //--------------------------------------------------------------------------------------------------------------------- template <> inline void VDomDocument::SetAttribute(QDomElement &domElement, const QString &name, const bool &value) const @@ -191,7 +198,7 @@ inline void VDomDocument::SetAttribute(QDomElement &domElement, const QStr //--------------------------------------------------------------------------------------------------------------------- template <> inline void VDomDocument::SetAttribute(QDomElement &domElement, const QString &name, - const MeasurementsType &value) const + const MeasurementsType &value) const { domElement.setAttribute(name, value == MeasurementsType::Multisize ? QStringLiteral("multisize") : QStringLiteral("individual")); diff --git a/src/libs/ifc/xml/vpatternconverter.cpp b/src/libs/ifc/xml/vpatternconverter.cpp index 16c1f0424..1562e6518 100644 --- a/src/libs/ifc/xml/vpatternconverter.cpp +++ b/src/libs/ifc/xml/vpatternconverter.cpp @@ -2109,10 +2109,10 @@ void VPatternConverter::TagDetailToV0_4_0() if (not dom.isNull()) { - dom.setAttribute(*strSeamAllowance, dom.attribute(*strSupplement, "0")); + dom.setAttribute(*strSeamAllowance, dom.attribute(*strSupplement, QChar('0'))); dom.removeAttribute(*strSupplement); - dom.setAttribute(*strVersion, "1"); + dom.setAttribute(*strVersion, '1'); const QStringList tags = QStringList() << *strNode << *strData << *strPatternInfo << *strGrainline; @@ -2137,17 +2137,17 @@ void VPatternConverter::TagDetailToV0_4_0() if (element.hasAttribute(*strReverse)) { - tagNode.setAttribute(*strReverse, element.attribute(*strReverse, "0")); + tagNode.setAttribute(*strReverse, element.attribute(*strReverse, QChar('0'))); } if (element.hasAttribute(*strMx)) { - tagNode.setAttribute(*strMx, element.attribute(*strMx, "0")); + tagNode.setAttribute(*strMx, element.attribute(*strMx, QChar('0'))); } if (element.hasAttribute(*strMy)) { - tagNode.setAttribute(*strMy, element.attribute(*strMy, "0")); + tagNode.setAttribute(*strMy, element.attribute(*strMy, QChar('0'))); } tagNode.setAttribute(*strType, element.attribute(*strType, QString())); @@ -2200,7 +2200,7 @@ QDomElement VPatternConverter::GetUnionDetailNodesV0_4_0(const QDomElement &deta if (node.hasAttribute(*strReverse)) { - tagNode.setAttribute(*strReverse, node.attribute(*strReverse, "0")); + tagNode.setAttribute(*strReverse, node.attribute(*strReverse, QChar('0'))); } tagNode.setAttribute(*strType, node.attribute(*strType, QString())); @@ -2263,7 +2263,7 @@ void VPatternConverter::LabelTagToV0_4_4(const QString &tagName) { if (dom.hasAttribute(attribute)) { - QString valStr = dom.attribute(attribute, "1"); + QString valStr = dom.attribute(attribute, QChar('1')); bool ok = false; qreal val = valStr.toDouble(&ok); if (not ok) @@ -2430,7 +2430,7 @@ void VPatternConverter::PortPieceLabelstoV0_6_0() QString line; - const int material = static_cast(GetParametrUInt(domMCP, *strMaterial, "0")); + const int material = static_cast(GetParametrUInt(domMCP, *strMaterial, QChar('0'))); switch(material) { case 0: @@ -2453,7 +2453,7 @@ void VPatternConverter::PortPieceLabelstoV0_6_0() line.append(", %wCut% "); - const int cutNumber = static_cast(GetParametrUInt(domMCP, *strCutNumber, "1")); + const int cutNumber = static_cast(GetParametrUInt(domMCP, *strCutNumber, QChar('1'))); if (firstLine) { @@ -2474,7 +2474,7 @@ void VPatternConverter::PortPieceLabelstoV0_6_0() } } - if (GetParametrUInt(domMCP, *strPlacement, "0") == 1) + if (GetParametrUInt(domMCP, *strPlacement, QChar('0')) == 1) { line.append(" %wOnFold%"); } diff --git a/src/libs/qmuparser/qmuparserbytecode.cpp b/src/libs/qmuparser/qmuparserbytecode.cpp index 244aba2dd..b2253719a 100644 --- a/src/libs/qmuparser/qmuparserbytecode.cpp +++ b/src/libs/qmuparser/qmuparserbytecode.cpp @@ -194,7 +194,7 @@ void QmuParserByteCode::ConstantFolding(ECmdCode a_Oprt) #if defined(MUP_MATH_EXCEPTIONS) if (y==0) { - throw qmuParserError(ecDIV_BY_ZERO, "0"); + throw qmuParserError(ecDIV_BY_ZERO, QLatin1Char('0')); } #endif x = x / y; diff --git a/src/libs/vdxf/dxiface.cpp b/src/libs/vdxf/dxiface.cpp index 50cb275d9..df2aa7301 100644 --- a/src/libs/vdxf/dxiface.cpp +++ b/src/libs/vdxf/dxiface.cpp @@ -239,19 +239,19 @@ void dx_iface::AddAAMALayers() { DRW_Layer layer; - layer.name = "1";// CUT, OUTLINE + layer.name = '1';// CUT, OUTLINE layer.color = DRW::black; cData.layers.push_back(layer); - layer.name = "8";// DRAW, INK + layer.name = '8';// DRAW, INK layer.color = DRW::black; cData.layers.push_back(layer); - layer.name = "7";// GRAINLINE + layer.name = '7';// GRAINLINE layer.color = DRW::black; cData.layers.push_back(layer); -// layer.name = "6";// MIRROR LINES +// layer.name = '6';// MIRROR LINES // layer.color = DRW::black; // cData.layers.push_back(layer); @@ -263,7 +263,7 @@ void dx_iface::AddAAMALayers() // layer.color = DRW::black; // cData.layers.push_back(layer); - layer.name = "4";// NOTCH + layer.name = '4';// NOTCH layer.color = DRW::black; cData.layers.push_back(layer); @@ -285,7 +285,7 @@ void dx_iface::AddAAMAHeaderData() void dx_iface::AddDefLayers() { DRW_Layer defLayer; - defLayer.name = "0"; + defLayer.name = '0'; defLayer.color = DRW::black; // default color defLayer.lWeight = DRW_LW_Conv::width03; // default width cData.layers.push_back(defLayer); diff --git a/src/libs/vdxf/libdxfrw/drw_entities.h b/src/libs/vdxf/libdxfrw/drw_entities.h index a02470cf6..c93d3da3f 100644 --- a/src/libs/vdxf/libdxfrw/drw_entities.h +++ b/src/libs/vdxf/libdxfrw/drw_entities.h @@ -516,7 +516,7 @@ public: flags(0) { eType = DRW::BLOCK; - layer = "0"; + layer = '0'; } virtual void applyExtrusion(){} diff --git a/src/libs/vdxf/libdxfrw/libdxfrw.cpp b/src/libs/vdxf/libdxfrw/libdxfrw.cpp index 3e9acbf56..b24e6a987 100644 --- a/src/libs/vdxf/libdxfrw/libdxfrw.cpp +++ b/src/libs/vdxf/libdxfrw/libdxfrw.cpp @@ -1481,7 +1481,7 @@ bool dxfRW::writeTables() { iface->writeLayers(); if (!wlayer0 && version > DRW::AC1009) { DRW_Layer lay0; - lay0.name = "0"; + lay0.name = '0'; writeLayer(&lay0); } writer->writeString(0, "ENDTAB"); @@ -1766,7 +1766,7 @@ bool dxfRW::writeObjects() { writer->writeString(0, "IMAGEDEF"); writer->writeString(5, toHexStr(static_cast(id->handle)) ); if (version > DRW::AC1014) { -// writer->writeString(330, "0"); handle to DICTIONARY +// writer->writeString(330, '0'); handle to DICTIONARY } writer->writeString(102, "{ACAD_REACTORS"); std::map::iterator it; diff --git a/src/libs/vdxf/vdxfengine.cpp b/src/libs/vdxf/vdxfengine.cpp index 493a67423..0106d8632 100644 --- a/src/libs/vdxf/vdxfengine.cpp +++ b/src/libs/vdxf/vdxfengine.cpp @@ -153,7 +153,7 @@ void VDxfEngine::drawPath(const QPainterPath &path) if (m_version > DRW::AC1009) { // Use lwpolyline DRW_LWPolyline *poly = new DRW_LWPolyline(); - poly->layer = "0"; + poly->layer = '0'; poly->color = getPenColor(); poly->lWeight = DRW_LW_Conv::widthByLayer; poly->lineType = getPenStyle(); @@ -176,7 +176,7 @@ void VDxfEngine::drawPath(const QPainterPath &path) else { // Use polyline DRW_Polyline *poly = new DRW_Polyline(); - poly->layer = "0"; + poly->layer = '0'; poly->color = getPenColor(); poly->lWeight = DRW_LW_Conv::widthByLayer; poly->lineType = getPenStyle(); @@ -211,7 +211,7 @@ void VDxfEngine::drawLines(const QLineF * lines, int lineCount) FromPixel(getSize().height() - p1.y(), varInsunits), 0); line->secPoint = DRW_Coord(FromPixel(p2.x(), varInsunits), FromPixel(getSize().height() - p2.y(), varInsunits), 0); - line->layer = "0"; + line->layer = '0'; line->color = getPenColor(); line->lWeight = DRW_LW_Conv::widthByLayer; line->lineType = getPenStyle(); @@ -239,7 +239,7 @@ void VDxfEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawM if (m_version > DRW::AC1009) { // Use lwpolyline DRW_LWPolyline *poly = new DRW_LWPolyline(); - poly->layer = "0"; + poly->layer = '0'; poly->color = getPenColor(); poly->lWeight = DRW_LW_Conv::widthByLayer; poly->lineType = getPenStyle(); @@ -263,7 +263,7 @@ void VDxfEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawM else { // Use polyline DRW_Polyline *poly = new DRW_Polyline(); - poly->layer = "0"; + poly->layer = '0'; poly->color = getPenColor(); poly->lWeight = DRW_LW_Conv::widthByLayer; poly->lineType = getPenStyle(); @@ -325,7 +325,7 @@ void VDxfEngine::drawEllipse(const QRectF & rect) ellipse->staparam = 0; ellipse->endparam = 2*M_PI; - ellipse->layer = "0"; + ellipse->layer = '0'; ellipse->color = getPenColor(); ellipse->lWeight = DRW_LW_Conv::widthByLayer; ellipse->lineType = getPenStyle(); @@ -359,7 +359,7 @@ void VDxfEngine::drawTextItem(const QPointF & p, const QTextItem & textItem) textBuffer->style = fontStyle; textBuffer->angle = -rotationAngle; - textBuffer->layer = "0"; + textBuffer->layer = '0'; textBuffer->color = getPenColor(); textBuffer->lWeight = DRW_LW_Conv::widthByLayer; textBuffer->lineType = getPenStyle(); @@ -632,7 +632,7 @@ bool VDxfEngine::ExportToAAMA(const QVector &details) } detailBlock->name = blockName.toStdString(); - detailBlock->layer = "1"; + detailBlock->layer = '1'; ExportAAMAOutline(detailBlock, detail); ExportAAMADraw(detailBlock, detail); @@ -646,7 +646,7 @@ bool VDxfEngine::ExportToAAMA(const QVector &details) DRW_Insert *insert = new DRW_Insert(); insert->name = blockName.toStdString(); - insert->layer = "1"; + insert->layer = '1'; input->AddEntity(insert); } @@ -667,7 +667,7 @@ void VDxfEngine::ExportAAMAOutline(dx_ifaceBlock *detailBlock, const VLayoutPiec outline = detail.GetContourPoints(); } - DRW_Entity *e = AAMAPolygon(outline, "1", true); + DRW_Entity *e = AAMAPolygon(outline, QChar('1'), true); if (e) { detailBlock->ent.push_back(e); @@ -680,7 +680,7 @@ void VDxfEngine::ExportAAMADraw(dx_ifaceBlock *detailBlock, const VLayoutPiece & if (not detail.IsHideMainPath()) { QVector poly = detail.GetContourPoints(); - if (DRW_Entity *e = AAMAPolygon(poly, "8", true)) + if (DRW_Entity *e = AAMAPolygon(poly, QChar('8'), true)) { detailBlock->ent.push_back(e); } @@ -689,7 +689,7 @@ void VDxfEngine::ExportAAMADraw(dx_ifaceBlock *detailBlock, const VLayoutPiece & const QVector> drawIntCut = detail.InternalPathsForCut(false); for(auto &intCut : drawIntCut) { - if (DRW_Entity *e = AAMAPolygon(intCut, "8", false)) + if (DRW_Entity *e = AAMAPolygon(intCut, QChar('8'), false)) { detailBlock->ent.push_back(e); } @@ -702,7 +702,7 @@ void VDxfEngine::ExportAAMADraw(dx_ifaceBlock *detailBlock, const VLayoutPiece & { for(auto &p : qAsConst(label.shape)) { - if (DRW_Entity *e = AAMAPolygon(p, "8", false)) + if (DRW_Entity *e = AAMAPolygon(p, QChar('8'), false)) { detailBlock->ent.push_back(e); } @@ -732,7 +732,7 @@ void VDxfEngine::ExportAAMANotch(dx_ifaceBlock *detailBlock, const VLayoutPiece const QVector passmarks = detail.GetPassmarks(); for(auto passmark : passmarks) { - if (DRW_Entity *e = AAMALine(passmark, "4")) + if (DRW_Entity *e = AAMALine(passmark, QChar('4'))) { detailBlock->ent.push_back(e); } @@ -746,7 +746,7 @@ void VDxfEngine::ExportAAMAGrainline(dx_ifaceBlock *detailBlock, const VLayoutPi const QVector grainline = detail.GetGrainline(); if (grainline.count() > 1) { - if (DRW_Entity *e = AAMALine(QLineF(grainline.first(), grainline.last()), "7")) + if (DRW_Entity *e = AAMALine(QLineF(grainline.first(), grainline.last()), QChar('7'))) { detailBlock->ent.push_back(e); } @@ -762,7 +762,7 @@ void VDxfEngine::ExportAAMAText(dx_ifaceBlock *detailBlock, const VLayoutPiece & for (int i = 0; i < list.size(); ++i) { QPointF pos(startPos.x(), startPos.y() - ToPixel(AAMATextHeight, varInsunits)*(list.size() - i-1)); - detailBlock->ent.push_back(AAMAText(pos, list.at(i), "1")); + detailBlock->ent.push_back(AAMAText(pos, list.at(i), QChar('1'))); } } @@ -777,7 +777,7 @@ void VDxfEngine::ExportAAMAGlobalText(const QSharedPointer &input, con for (int j = 0; j < strings.size(); ++j) { QPointF pos(0, getSize().height() - ToPixel(AAMATextHeight, varInsunits)*(strings.size() - j-1)); - input->AddEntity(AAMAText(pos, strings.at(j), "1")); + input->AddEntity(AAMAText(pos, strings.at(j), QChar('1'))); } return; } diff --git a/src/libs/vformat/vmeasurements.cpp b/src/libs/vformat/vmeasurements.cpp index 316250b50..67a591530 100644 --- a/src/libs/vformat/vmeasurements.cpp +++ b/src/libs/vformat/vmeasurements.cpp @@ -277,9 +277,9 @@ void VMeasurements::ReadMeasurements() const QSharedPointer tempMeash; if (type == MeasurementsType::Multisize) { - qreal base = GetParametrDouble(dom, AttrBase, "0"); - qreal ksize = GetParametrDouble(dom, AttrSizeIncrease, "0"); - qreal kheight = GetParametrDouble(dom, AttrHeightIncrease, "0"); + qreal base = GetParametrDouble(dom, AttrBase, QChar('0')); + qreal ksize = GetParametrDouble(dom, AttrSizeIncrease, QChar('0')); + qreal kheight = GetParametrDouble(dom, AttrHeightIncrease, QChar('0')); tempMeash = QSharedPointer(new VMeasurement(static_cast(i), name, BaseSize(), BaseHeight(), base, ksize, kheight)); @@ -302,7 +302,7 @@ void VMeasurements::ReadMeasurements() const } else { - const QString formula = GetParametrString(dom, AttrValue, "0"); + const QString formula = GetParametrString(dom, AttrValue, QChar('0')); bool ok = false; qreal value = EvalFormula(tempData.data(), formula, &ok); @@ -330,7 +330,7 @@ void VMeasurements::ClearForExport() { if (qmu::QmuTokenParser::IsSingle(domElement.attribute(AttrValue))) { - SetAttribute(domElement, AttrValue, QString("0")); + SetAttribute(domElement, AttrValue, QChar('0')); } } } @@ -806,13 +806,13 @@ QDomElement VMeasurements::MakeEmpty(const QString &name, const QString &formula if (type == MeasurementsType::Multisize) { - SetAttribute(element, AttrBase, QString("0")); - SetAttribute(element, AttrSizeIncrease, QString("0")); - SetAttribute(element, AttrHeightIncrease, QString("0")); + SetAttribute(element, AttrBase, QChar('0')); + SetAttribute(element, AttrSizeIncrease, QChar('0')); + SetAttribute(element, AttrHeightIncrease, QChar('0')); } else { - SetAttribute(element, AttrValue, formula.isEmpty() ? QString("0") : formula); + SetAttribute(element, AttrValue, formula.isEmpty() ? QChar('0') : formula); } return element; diff --git a/src/libs/vgeometry/vabstractarc_p.h b/src/libs/vgeometry/vabstractarc_p.h index eec751622..f71a49c79 100644 --- a/src/libs/vgeometry/vabstractarc_p.h +++ b/src/libs/vgeometry/vabstractarc_p.h @@ -102,7 +102,7 @@ VAbstractArcData::VAbstractArcData(const QString &formulaLength, const VPointF & : f1(f1), formulaF1(formulaF1), f2(0), - formulaF2("0"), + formulaF2('0'), center(center), isFlipped(false), formulaLength(formulaLength) @@ -113,7 +113,7 @@ VAbstractArcData::VAbstractArcData(const VPointF ¢er, qreal f1) : f1(f1), formulaF1(QString().number(f1)), f2(0), - formulaF2("0"), + formulaF2('0'), center(center), isFlipped(false), formulaLength() diff --git a/src/libs/vgeometry/vplacelabelitem_p.h b/src/libs/vgeometry/vplacelabelitem_p.h index 61dd9db1e..2fdf0197a 100644 --- a/src/libs/vgeometry/vplacelabelitem_p.h +++ b/src/libs/vgeometry/vplacelabelitem_p.h @@ -43,7 +43,7 @@ public: VPlaceLabelItemData() : width(), height(), - angle("0"), + angle('0'), type(PlaceLabelType::Button), centerPoint(0), wValue(0), diff --git a/src/libs/vgeometry/vspline_p.h b/src/libs/vgeometry/vspline_p.h index 87be355b5..d6a3e3da8 100644 --- a/src/libs/vgeometry/vspline_p.h +++ b/src/libs/vgeometry/vspline_p.h @@ -95,13 +95,13 @@ VSplineData::VSplineData() : p1(), p4(), angle1(0), - angle1F("0"), + angle1F('0'), angle2(0), - angle2F("0"), + angle2F('0'), c1Length(0), - c1LengthF("0"), + c1LengthF('0'), c2Length(0), - c2LengthF("0"), + c2LengthF('0'), kCurve(1) {} @@ -130,9 +130,9 @@ VSplineData::VSplineData(VPointF p1, VPointF p4, qreal angle1, qreal angle2, qre angle2(angle2), angle2F(QString().number(angle2)), c1Length(0), - c1LengthF("0"), + c1LengthF('0'), c2Length(0), - c2LengthF("0"), + c2LengthF('0'), kCurve(kCurve) { const qreal L = GetL(static_cast(p1), static_cast(p4), kCurve); @@ -153,13 +153,13 @@ VSplineData::VSplineData(VPointF p1, QPointF p2, QPointF p3, VPointF p4) : p1(p1), p4(p4), angle1(0), - angle1F("0"), + angle1F('0'), angle2(0), - angle2F("0"), + angle2F('0'), c1Length(0), - c1LengthF("0"), + c1LengthF('0'), c2Length(0), - c2LengthF("0"), + c2LengthF('0'), kCurve(1) { QLineF p1p2(static_cast(p1), static_cast(p2)); diff --git a/src/libs/vgeometry/vsplinepoint_p.h b/src/libs/vgeometry/vsplinepoint_p.h index 129228c76..b215a95b0 100644 --- a/src/libs/vgeometry/vsplinepoint_p.h +++ b/src/libs/vgeometry/vsplinepoint_p.h @@ -107,13 +107,13 @@ public: VSplinePointData() : pSpline(), angle1(0), - angle1F("0"), + angle1F('0'), angle2(180), angle2F("180"), length1(0), - length1F("0"), + length1F('0'), length2(0), - length2F("0") + length2F('0') {} VSplinePointData(VPointF pSpline, qreal angle1, const QString &angle1F, qreal angle2, const QString &angle2F, diff --git a/src/libs/vpatterndb/vnodedetail.cpp b/src/libs/vpatterndb/vnodedetail.cpp index cad66a5b3..4a8dd41f2 100644 --- a/src/libs/vpatterndb/vnodedetail.cpp +++ b/src/libs/vpatterndb/vnodedetail.cpp @@ -61,7 +61,7 @@ QString LocalWidth(const QLineF &line, const QLineF &movedLine) } else {// different direction means value is negative - return QString("0"); + return QChar('0'); } } @@ -261,8 +261,8 @@ QVector VNodeDetail::Convert(const VContainer *data, const QVector 1) { - path[0].SetFormulaSABefore("0"); - path[path.CountNodes()-1].SetFormulaSAAfter("0"); + path[0].SetFormulaSABefore(QChar('0')); + path[path.CountNodes()-1].SetFormulaSAAfter(QChar('0')); } return path.GetNodes(); diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index 522b1c3cb..fd0153bca 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -600,7 +600,7 @@ void VPiece::SetFormulaSAWidth(const QString &formula, qreal value) { SetSAWidth(value); const qreal width = GetSAWidth(); - width >= 0 ? d->m_formulaWidth = formula : d->m_formulaWidth = QLatin1String("0"); + width >= 0 ? d->m_formulaWidth = formula : d->m_formulaWidth = QLatin1Char('0'); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vpatterndb/vpiece_p.h b/src/libs/vpatterndb/vpiece_p.h index a3bf101b6..06c80a18d 100644 --- a/src/libs/vpatterndb/vpiece_p.h +++ b/src/libs/vpatterndb/vpiece_p.h @@ -58,7 +58,7 @@ public: m_ppData(), m_piPatternInfo(), m_glGrainline(), - m_formulaWidth("0") + m_formulaWidth('0') {} VPieceData(const VPieceData &detail) diff --git a/src/libs/vpatterndb/vpiecepath_p.h b/src/libs/vpatterndb/vpiecepath_p.h index fe705ed09..08f22c268 100644 --- a/src/libs/vpatterndb/vpiecepath_p.h +++ b/src/libs/vpatterndb/vpiecepath_p.h @@ -48,7 +48,7 @@ public: m_name(), m_penType(Qt::SolidLine), m_cut(false), - m_visibilityTrigger("1") + m_visibilityTrigger('1') {} explicit VPiecePathData(PiecePathType type) @@ -57,7 +57,7 @@ public: m_name(), m_penType(Qt::SolidLine), m_cut(false), - m_visibilityTrigger("1") + m_visibilityTrigger('1') {} VPiecePathData(const VPiecePathData &path) diff --git a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp index 8066d8667..979441eaa 100644 --- a/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp +++ b/src/libs/vtools/dialogs/tools/piece/dialogpiecepath.cpp @@ -1094,7 +1094,7 @@ void DialogPiecePath::SetPiecePath(const VPiecePath &path) } else { - ui->plainTextEditFormulaVisible->setPlainText("1"); + ui->plainTextEditFormulaVisible->setPlainText(QChar('1')); } ValidObjects(PathIsValid()); @@ -1318,7 +1318,7 @@ VPiecePath DialogPiecePath::CreatePath() const } else { - path.SetVisibilityTrigger("1"); + path.SetVisibilityTrigger(QChar('1')); } return path; diff --git a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp index e9831fc36..bc4b2477e 100644 --- a/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp +++ b/src/libs/vtools/tools/drawTools/operation/flipping/vtoolflippingbyaxis.cpp @@ -215,7 +215,7 @@ void VToolFlippingByAxis::SaveDialog(QDomElement &domElement, QList &ol void VToolFlippingByAxis::ReadToolAttributes(const QDomElement &domElement) { m_originPointId = doc->GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); - m_axisType = static_cast(doc->GetParametrUInt(domElement, AttrAxisType, "1")); + m_axisType = static_cast(doc->GetParametrUInt(domElement, AttrAxisType, QChar('1'))); suffix = doc->GetParametrString(domElement, AttrSuffix); } diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp index f2c58688a..02d704d3f 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolmove.cpp @@ -480,9 +480,9 @@ void VToolMove::SaveDialog(QDomElement &domElement, QList &oldDependenc void VToolMove::ReadToolAttributes(const QDomElement &domElement) { origPointId = doc->GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); - formulaAngle = doc->GetParametrString(domElement, AttrAngle, "0"); - formulaRotationAngle = doc->GetParametrString(domElement, AttrRotationAngle, "0"); - formulaLength = doc->GetParametrString(domElement, AttrLength, "0"); + formulaAngle = doc->GetParametrString(domElement, AttrAngle, QChar('0')); + formulaRotationAngle = doc->GetParametrString(domElement, AttrRotationAngle, QChar('0')); + formulaLength = doc->GetParametrString(domElement, AttrLength, QChar('0')); suffix = doc->GetParametrString(domElement, AttrSuffix); } diff --git a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp index bf0317612..6ee6ef27b 100644 --- a/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp +++ b/src/libs/vtools/tools/drawTools/operation/vtoolrotation.cpp @@ -351,7 +351,7 @@ void VToolRotation::SaveDialog(QDomElement &domElement, QList &oldDepen void VToolRotation::ReadToolAttributes(const QDomElement &domElement) { origPointId = doc->GetParametrUInt(domElement, AttrCenter, NULL_ID_STR); - formulaAngle = doc->GetParametrString(domElement, AttrAngle, "0"); + formulaAngle = doc->GetParametrString(domElement, AttrAngle, QChar('0')); suffix = doc->GetParametrString(domElement, AttrSuffix); } diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h index 47ca3002a..7b55664f2 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarc.h @@ -48,9 +48,9 @@ struct VToolArcInitData : VAbstractSplineInitData VToolArcInitData() : VAbstractSplineInitData(), center(NULL_ID), - radius("0"), - f1("0"), - f2("0") + radius('0'), + f1('0'), + f2('0') {} quint32 center; diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h index f92c55b0d..6a78b7019 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolarcwithlength.h @@ -48,9 +48,9 @@ struct VToolArcWithLengthInitData : VAbstractSplineInitData VToolArcWithLengthInitData() : VAbstractSplineInitData(), center(NULL_ID), - radius("0"), - f1("0"), - length("0") + radius('0'), + f1('0'), + length('0') {} quint32 center; diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp index 3da1b75dd..e3feaf8f7 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.cpp @@ -441,9 +441,9 @@ QString VToolEllipticalArc::MakeToolTip() const .arg(tr("Length")) // 1 .arg(qApp->fromPixel(elArc->GetLength())) // 2 .arg(UnitsToStr(qApp->patternUnit(), true), // 3 - tr("Radius") + QLatin1String("1")) // 4 + tr("Radius") + QLatin1Char('1')) // 4 .arg(qApp->fromPixel(elArc->GetRadius1())) // 5 - .arg(tr("Radius") + QLatin1String("2")) // 6 + .arg(tr("Radius") + QLatin1Char('2')) // 6 .arg(qApp->fromPixel(elArc->GetRadius2())) // 7 .arg(tr("Start angle")) // 8 .arg(elArc->GetStartAngle()) // 9 diff --git a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h index f2c2bcf7d..5928b70fe 100644 --- a/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h +++ b/src/libs/vtools/tools/drawTools/toolcurve/vtoolellipticalarc.h @@ -48,11 +48,11 @@ struct VToolEllipticalArcInitData : VAbstractSplineInitData VToolEllipticalArcInitData() : VAbstractSplineInitData(), center(NULL_ID), - radius1("0"), - radius2("0"), - f1("0"), - f2("0"), - rotationAngle("0") + radius1('0'), + radius2('0'), + f1('0'), + f2('0'), + rotationAngle('0') {} quint32 center; diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp index a855ced6b..20dca6775 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toolcut/vtoolcutarc.cpp @@ -283,5 +283,5 @@ QString VToolCutArc::MakeToolTip() const return toolTip; }; - return ArcToolTip(ArcToolTip("", ar1, "1"), ar2, "2") + QLatin1String("
"); + return ArcToolTip(ArcToolTip("", ar1, QChar('1')), ar2, QChar('2')) + QLatin1String("
"); } diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h index 388cdf11a..16f644062 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolcurveintersectaxis.h @@ -50,7 +50,7 @@ struct VToolCurveIntersectAxisInitData : VToolLinePointInitData { VToolCurveIntersectAxisInitData() : VToolLinePointInitData(), - formulaAngle("0"), + formulaAngle('0'), basePointId(NULL_ID), curveId(NULL_ID) {} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h index f82a66a89..a6c82f5a3 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoollineintersectaxis.h @@ -50,7 +50,7 @@ struct VToolLineIntersectAxisInitData : VToolLinePointInitData { VToolLineIntersectAxisInitData() : VToolLinePointInitData(), - formulaAngle("0"), + formulaAngle('0'), basePointId(NULL_ID), firstPointId(NULL_ID), secondPointId(NULL_ID) diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp index 209605ae3..f3c757a5d 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/toollinepoint/vtoolnormal.cpp @@ -254,7 +254,7 @@ void VToolNormal::ReadToolAttributes(const QDomElement &domElement) formulaLength = doc->GetParametrString(domElement, AttrLength, QString()); basePointId = doc->GetParametrUInt(domElement, AttrFirstPoint, NULL_ID_STR); secondPointId = doc->GetParametrUInt(domElement, AttrSecondPoint, NULL_ID_STR); - angle = doc->GetParametrDouble(domElement, AttrAngle, "0"); + angle = doc->GetParametrDouble(domElement, AttrAngle, QChar('0')); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp index 39b520499..f77007e00 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromarcandtangent.cpp @@ -314,7 +314,7 @@ void VToolPointFromArcAndTangent::ReadToolAttributes(const QDomElement &domEleme { arcId = doc->GetParametrUInt(domElement, AttrArc, NULL_ID_STR); tangentPointId = doc->GetParametrUInt(domElement, AttrTangent, NULL_ID_STR); - crossPoint = static_cast(doc->GetParametrUInt(domElement, AttrCrossPoint, "1")); + crossPoint = static_cast(doc->GetParametrUInt(domElement, AttrCrossPoint, QChar('1'))); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp index 8e6ee91b1..21f8811b1 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.cpp @@ -299,7 +299,7 @@ void VToolPointFromCircleAndTangent::ReadToolAttributes(const QDomElement &domEl circleCenterId = doc->GetParametrUInt(domElement, AttrCCenter, NULL_ID_STR); tangentPointId = doc->GetParametrUInt(domElement, AttrTangent, NULL_ID_STR); circleRadius = doc->GetParametrString(domElement, AttrCRadius); - crossPoint = static_cast(doc->GetParametrUInt(domElement, AttrCrossPoint, "1")); + crossPoint = static_cast(doc->GetParametrUInt(domElement, AttrCrossPoint, QChar('1'))); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h index 73653bb8f..2e382bd0e 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointfromcircleandtangent.h @@ -50,7 +50,7 @@ struct VToolPointFromCircleAndTangentInitData : VToolSinglePointInitData VToolPointFromCircleAndTangentInitData() : VToolSinglePointInitData(), circleCenterId(NULL_ID), - circleRadius("0"), + circleRadius('0'), tangentPointId(NULL_ID), crossPoint(CrossCirclesPoint::FirstPoint) {} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h index b2f13990b..92f6c0c1b 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofcontact.h @@ -49,7 +49,7 @@ struct VToolPointOfContactInitData : VToolSinglePointInitData { VToolPointOfContactInitData() : VToolSinglePointInitData(), - radius("0"), + radius('0'), center(NULL_ID), firstPointId(NULL_ID), secondPointId(NULL_ID) diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp index 352706648..96f3bd674 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectionarcs.cpp @@ -318,7 +318,7 @@ void VToolPointOfIntersectionArcs::ReadToolAttributes(const QDomElement &domElem { firstArcId = doc->GetParametrUInt(domElement, AttrFirstArc, NULL_ID_STR); secondArcId = doc->GetParametrUInt(domElement, AttrSecondArc, NULL_ID_STR); - crossPoint = static_cast(doc->GetParametrUInt(domElement, AttrCrossPoint, "1")); + crossPoint = static_cast(doc->GetParametrUInt(domElement, AttrCrossPoint, QChar('1'))); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp index 2abb306a3..95314ff21 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.cpp @@ -334,7 +334,7 @@ void VToolPointOfIntersectionCircles::ReadToolAttributes(const QDomElement &domE secondCircleCenterId = doc->GetParametrUInt(domElement, AttrC2Center, NULL_ID_STR); firstCircleRadius = doc->GetParametrString(domElement, AttrC1Radius); secondCircleRadius = doc->GetParametrString(domElement, AttrC2Radius); - crossPoint = static_cast(doc->GetParametrUInt(domElement, AttrCrossPoint, "1")); + crossPoint = static_cast(doc->GetParametrUInt(domElement, AttrCrossPoint, QChar('1'))); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h index db9720822..7a8820bd6 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncircles.h @@ -51,8 +51,8 @@ struct VToolPointOfIntersectionCirclesInitData : VToolSinglePointInitData : VToolSinglePointInitData(), firstCircleCenterId(NULL_ID), secondCircleCenterId(NULL_ID), - firstCircleRadius("0"), - secondCircleRadius("0"), + firstCircleRadius('0'), + secondCircleRadius('0'), crossPoint(CrossCirclesPoint::FirstPoint) {} diff --git a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp index 49a6fa0cd..25d3fa26b 100644 --- a/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp +++ b/src/libs/vtools/tools/drawTools/toolpoint/toolsinglepoint/vtoolpointofintersectioncurves.cpp @@ -370,8 +370,8 @@ void VToolPointOfIntersectionCurves::ReadToolAttributes(const QDomElement &domEl { firstCurveId = doc->GetParametrUInt(domElement, AttrCurve1, NULL_ID_STR); secondCurveId = doc->GetParametrUInt(domElement, AttrCurve2, NULL_ID_STR); - vCrossPoint = static_cast(doc->GetParametrUInt(domElement, AttrVCrossPoint, "1")); - hCrossPoint = static_cast(doc->GetParametrUInt(domElement, AttrHCrossPoint, "1")); + vCrossPoint = static_cast(doc->GetParametrUInt(domElement, AttrVCrossPoint, QChar('1'))); + hCrossPoint = static_cast(doc->GetParametrUInt(domElement, AttrHCrossPoint, QChar('1'))); } //--------------------------------------------------------------------------------------------------------------------- diff --git a/src/libs/vtools/tools/nodeDetails/vtoolplacelabel.h b/src/libs/vtools/tools/nodeDetails/vtoolplacelabel.h index 77d10f6e3..5e6e474f7 100644 --- a/src/libs/vtools/tools/nodeDetails/vtoolplacelabel.h +++ b/src/libs/vtools/tools/nodeDetails/vtoolplacelabel.h @@ -39,9 +39,9 @@ struct VToolPlaceLabelInitData : VAbstractNodeInitData { VToolPlaceLabelInitData() : VAbstractNodeInitData(), - width("0"), - height("0"), - angle("0"), + width('0'), + height('0'), + angle('0'), type(PlaceLabelType::Button), centerPoint(NULL_ID) {} diff --git a/src/libs/vtools/tools/vtoolseamallowance.cpp b/src/libs/vtools/tools/vtoolseamallowance.cpp index 5458c4cd7..e57da355e 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.cpp +++ b/src/libs/vtools/tools/vtoolseamallowance.cpp @@ -993,7 +993,7 @@ void VToolSeamAllowance::RefreshDataInFile() Q_STATIC_ASSERT_X(VPatternConverter::PatternMinVer < CONVERTER_VERSION_CHECK(0, 4, 0), "Time to refactor the code."); - const uint version = doc->GetParametrUInt(domElement, AttrVersion, "1"); + const uint version = doc->GetParametrUInt(domElement, AttrVersion, QChar('1')); if (version == 1) { const VPiece piece = VAbstractTool::data.GetPiece(m_id); diff --git a/src/libs/vtools/tools/vtoolseamallowance.h b/src/libs/vtools/tools/vtoolseamallowance.h index e9b1770bb..969b19c36 100644 --- a/src/libs/vtools/tools/vtoolseamallowance.h +++ b/src/libs/vtools/tools/vtoolseamallowance.h @@ -46,7 +46,7 @@ struct VToolSeamAllowanceInitData : VAbstractToolInitData VToolSeamAllowanceInitData() : VAbstractToolInitData(), detail(), - width("0"), + width('0'), drawName() {} diff --git a/src/libs/vtools/tools/vtooluniondetails.cpp b/src/libs/vtools/tools/vtooluniondetails.cpp index 6937b895c..7c97ec86e 100644 --- a/src/libs/vtools/tools/vtooluniondetails.cpp +++ b/src/libs/vtools/tools/vtooluniondetails.cpp @@ -583,7 +583,7 @@ quint32 AddNodeElArc(const VPieceNode &node, const VToolUnionDetailsInitData &in QScopedPointer arc1(new VEllipticalArc (*tmpCenter, arc->GetRadius1(), arc->GetRadius2(), arc->GetFormulaRadius1(), arc->GetFormulaRadius2(), l1.angle(), QString().setNum(l1.angle()), l2.angle(), - QString().setNum(l2.angle()), 0, "0")); + QString().setNum(l2.angle()), 0, QChar('0'))); arc1->setMode(Draw::Modeling); QScopedPointer arc2(new VEllipticalArc(*arc1)); @@ -687,13 +687,13 @@ quint32 AddNodeSplinePath(const VPieceNode &node, const VToolUnionDetailsInitDat const QString angle1F = QString().number(angle1); path->append(VSplinePoint(*p1, angle1, angle1F, spl.GetStartAngle(), spl.GetStartAngleFormula(), - 0, "0", spline.GetC1Length(), spline.GetC1LengthFormula())); + 0, QChar('0'), spline.GetC1Length(), spline.GetC1LengthFormula())); } const qreal angle2 = spl.GetEndAngle()+180; const QString angle2F = QString().number(angle2); qreal pL2 = 0; - QString pL2F("0"); + QString pL2F('0'); if (i+1 <= splinePath->CountSubSpl()) { const VSpline nextSpline = splinePath->GetSpline(i+1); @@ -997,7 +997,7 @@ void UpdateNodeElArc(VContainer *data, const VPieceNode &node, QVector QScopedPointer arc1(new VEllipticalArc (*center, arc->GetRadius1(), arc->GetRadius2(), arc->GetFormulaRadius1(), arc->GetFormulaRadius2(), l1.angle(), QString().setNum(l1.angle()), l2.angle(), - QString().setNum(l2.angle()), 0, "0")); + QString().setNum(l2.angle()), 0, QChar('0'))); arc1->setMode(Draw::Modeling); data->UpdateGObject(TakeNextId(children), arc1.take()); } @@ -1064,14 +1064,14 @@ void UpdateNodeSplinePath(VContainer *data, const VPieceNode &node, QVectorappend(VSplinePoint(*p1, angle1, angle1F, spl.GetStartAngle(), spl.GetStartAngleFormula(), - 0, "0", spline.GetC1Length(), spline.GetC1LengthFormula())); + 0, QChar('0'), spline.GetC1Length(), spline.GetC1LengthFormula())); } const qreal angle2 = spl.GetEndAngle()+180; const QString angle2F = QString().number(angle2); qreal pL2 = 0; - QString pL2F("0"); + QString pL2F('0'); if (i+1 <= splinePath->CountSubSpl()) { const VSpline nextSpline = splinePath->GetSpline(i+1); diff --git a/src/libs/vtools/undocommands/additemtogroup.cpp b/src/libs/vtools/undocommands/additemtogroup.cpp index 26180b5a7..15e9ea3b0 100644 --- a/src/libs/vtools/undocommands/additemtogroup.cpp +++ b/src/libs/vtools/undocommands/additemtogroup.cpp @@ -79,8 +79,8 @@ void AddItemToGroup::performUndoRedo(bool isUndo) // set the item visible. Because if the undo is done when unvisible and it's not in any group after the // undo, it stays unvisible until the entire drawing is completly rerendered. - quint32 objectId = doc->GetParametrUInt(xml,QString("object"),NULL_ID_STR); - quint32 toolId = doc->GetParametrUInt(xml,QString("tool"),NULL_ID_STR); + quint32 objectId = doc->GetParametrUInt(xml, QStringLiteral("object"), NULL_ID_STR); + quint32 toolId = doc->GetParametrUInt(xml, QStringLiteral("tool"), NULL_ID_STR); VDataTool* tool = doc->getTool(toolId); tool->GroupVisibility(objectId,true); } diff --git a/src/libs/vtools/undocommands/removeitemfromgroup.cpp b/src/libs/vtools/undocommands/removeitemfromgroup.cpp index 2dc1459f4..0a1d58163 100644 --- a/src/libs/vtools/undocommands/removeitemfromgroup.cpp +++ b/src/libs/vtools/undocommands/removeitemfromgroup.cpp @@ -88,8 +88,8 @@ void RemoveItemFromGroup::performUndoRedo(bool isUndo) // set the item visible. Because if the undo is done when unvisibile and it's not in any group after the // undo, it stays unvisible until the entire drawing is completly rerendered. - quint32 objectId = doc->GetParametrUInt(xml,QString("object"),NULL_ID_STR); - quint32 toolId = doc->GetParametrUInt(xml,QString("tool"),NULL_ID_STR); + quint32 objectId = doc->GetParametrUInt(xml, QStringLiteral("object"), NULL_ID_STR); + quint32 toolId = doc->GetParametrUInt(xml, QStringLiteral("tool"), NULL_ID_STR); VDataTool* tool = doc->getTool(toolId); tool->GroupVisibility(objectId,true); } diff --git a/src/libs/vtools/visualization/path/vistoolsplinepath.cpp b/src/libs/vtools/visualization/path/vistoolsplinepath.cpp index 126e9dcbd..b2b315517 100644 --- a/src/libs/vtools/visualization/path/vistoolsplinepath.cpp +++ b/src/libs/vtools/visualization/path/vistoolsplinepath.cpp @@ -256,7 +256,7 @@ void VisToolSplinePath::Creating(const QPointF &pSpl, int size) } else { - path[size-1].SetLength2(0, "0"); + path[size-1].SetLength2(0, QChar('0')); } emit PathChanged(path); } @@ -273,8 +273,8 @@ void VisToolSplinePath::Creating(const QPointF &pSpl, int size) } else { - path[size-1].SetLength1(0, "0"); - path[size-1].SetLength2(0, "0"); + path[size-1].SetLength1(0, QChar('0')); + path[size-1].SetLength2(0, QChar('0')); } emit PathChanged(path); } @@ -293,7 +293,7 @@ void VisToolSplinePath::Creating(const QPointF &pSpl, int size) } else { - path[size-1].SetLength2(0, "0"); + path[size-1].SetLength2(0, QChar('0')); } emit PathChanged(path); diff --git a/src/test/ValentinaTest/tst_vpiece.cpp b/src/test/ValentinaTest/tst_vpiece.cpp index 1111d88b0..acb1d3257 100644 --- a/src/test/ValentinaTest/tst_vpiece.cpp +++ b/src/test/ValentinaTest/tst_vpiece.cpp @@ -104,8 +104,8 @@ void TST_VPiece::ClearLoop() detail.GetPath().Append(VPieceNode(309, Tool::NodePoint)); detail.GetPath().Append(VPieceNode(310, Tool::NodePoint)); // Closed - detail.GetPath()[0].SetFormulaSABefore("0"); - detail.GetPath()[detail.GetPath().CountNodes()-1].SetFormulaSAAfter("0"); + detail.GetPath()[0].SetFormulaSABefore(QChar('0')); + detail.GetPath()[detail.GetPath().CountNodes()-1].SetFormulaSAAfter(QChar('0')); const QVector pointsEkv = detail.SeamAllowancePoints(data.data()); @@ -243,7 +243,7 @@ void TST_VPiece::Issue620() { const QSharedPointer point = data->GeometricObject(6); VSplinePoint p(*point.data(), 239.37700000000001, "239.377", 419.37700000000001, "59.3765", - 0, "0", 109.55943307086613, "2.89876"); + 0, QChar('0'), 109.55943307086613, "2.89876"); points.append(p); } diff --git a/src/test/ValentinaTest/tst_vsplinepath.cpp b/src/test/ValentinaTest/tst_vsplinepath.cpp index 625caf49f..bb7e8d3af 100644 --- a/src/test/ValentinaTest/tst_vsplinepath.cpp +++ b/src/test/ValentinaTest/tst_vsplinepath.cpp @@ -52,7 +52,7 @@ void TST_VSplinePath::TestRotation_data() { VPointF pSpline(30, 39.999874015748034, "X", 5.0000125984251973, 9.9999874015748045); - VSplinePoint p(pSpline, 89.208600000000004, "89.2086", 269.20859999999999, "269.209", 0, "0", + VSplinePoint p(pSpline, 89.208600000000004, "89.2086", 269.20859999999999, "269.209", 0, QChar('0'), 153.33618897637794, "4.05702"); originPoints.append(p); } @@ -67,7 +67,7 @@ void TST_VSplinePath::TestRotation_data() { VPointF pSpline(820.42771653543309, 417.95262992125987, "X", 5.0000125984251973, 9.9999874015748045); VSplinePoint p(pSpline, 173.39500000000001, "173.395", 353.39499999999998, "353.395", - 381.23716535433073, "10.0869", 0, "0"); + 381.23716535433073, "10.0869", 0, QChar('0')); originPoints.append(p); } @@ -75,7 +75,7 @@ void TST_VSplinePath::TestRotation_data() { VPointF pSpline(-347.55140568256883, 400.53936590535034, "X", 5.0000125984251973, 9.9999874015748045); - VSplinePoint p(pSpline, 176.56789999999998, "176.568", 356.56790000000001, "356.568", 0, "0", + VSplinePoint p(pSpline, 176.56789999999998, "176.568", 356.56790000000001, "356.568", 0, QChar('0'), 153.33618897637794, "4.05702"); rotatedPoints.append(p); } @@ -90,7 +90,7 @@ void TST_VSplinePath::TestRotation_data() { VPointF pSpline(66.417055567032421, -371.63572683892357, "X", 5.0000125984251973, 9.9999874015748045); VSplinePoint p(pSpline, 260.7543, "260.754", 80.754300000000015, "80.7543", 381.23716535433078, "10.0869", 0, - "0"); + QChar('0')); rotatedPoints.append(p); } @@ -146,7 +146,7 @@ void TST_VSplinePath::TestFlip_data() { VPointF pSpline(30, 39.999874015748034, "X", 5.0000125984251973, 9.9999874015748045); - VSplinePoint p(pSpline, 89.208600000000004, "89.2086", 269.20859999999999, "269.209", 0, "0", + VSplinePoint p(pSpline, 89.208600000000004, "89.2086", 269.20859999999999, "269.209", 0, QChar('0'), 153.33618897637794, "4.05702"); originPoints.append(p); } @@ -161,7 +161,7 @@ void TST_VSplinePath::TestFlip_data() { VPointF pSpline(820.42771653543309, 417.95262992125987, "X", 5.0000125984251973, 9.9999874015748045); VSplinePoint p(pSpline, 173.39500000000001, "173.395", 353.39499999999998, "353.395", - 381.23716535433073, "10.0869", 0, "0"); + 381.23716535433073, "10.0869", 0, QChar('0')); originPoints.append(p); } @@ -189,7 +189,7 @@ void TST_VSplinePath::TestFlip() const VSplinePath splPath(originPoints); const VSplinePath res = splPath.Flip(axis, prefix); - const QString errorMsg = QString("The name doesn't contain the prefix '%1'.").arg(prefix); + const QString errorMsg = QStringLiteral("The name doesn't contain the prefix '%1'.").arg(prefix); QVERIFY2(res.name().endsWith(prefix), qUtf8Printable(errorMsg)); QCOMPARE(splPath.GetLength(), res.GetLength());