diff --git a/ChangeLog.txt b/ChangeLog.txt
index 85e8e97c3..39db02f83 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -21,6 +21,7 @@
- Move Tool options and Group menu to Window section.
- Raise the minimum value for curve approximation to 0.2.
- Make piece labels transparent.
+- New layout option --nestQuantity.
# Version 0.6.2 (unreleased)
- [#903] Bug in tool Cut Spline path.
diff --git a/dist/debian/valentina.1 b/dist/debian/valentina.1
index 80809891f..1028056e5 100644
--- a/dist/debian/valentina.1
+++ b/dist/debian/valentina.1
@@ -1,6 +1,6 @@
.\" Manpage for valentina.
.\" Contact dismine@gmail.com to correct errors.
-.TH valentina 1 "30 March, 2019" "valentina man page"
+.TH valentina 1 "4 July, 2019" "valentina man page"
.SH NAME
Valentina \- Pattern making program.
.SH SYNOPSIS
@@ -188,6 +188,8 @@ The path to output destination folder. By default the directory at which the app
.RB "Page bottom margin in current units like 3.0 (" "export mode" "). If not set will be used value from default printer. Or 0 if none printers was found."
.IP "--followGrainline"
.RB "Order detail to follow grainline direction (" "export mode" ").
+.IP "--nestQuantity"
+.RB "Nest quantity copies of each piece (" "export mode" ").
.IP "-c, --crop"
.RB "Auto crop unused length (" "export mode" ")."
.IP "-u, --unite"
diff --git a/src/app/valentina/core/vcmdexport.cpp b/src/app/valentina/core/vcmdexport.cpp
index 02464e690..a5cb85371 100644
--- a/src/app/valentina/core/vcmdexport.cpp
+++ b/src/app/valentina/core/vcmdexport.cpp
@@ -225,6 +225,7 @@ VLayoutGeneratorPtr VCommandLine::DefaultGenerator() const
diag.SetFields(margins);
diag.SetFollowGrainline(IsOptionSet(LONG_OPTION_FOLLOW_GRAINLINE));
+ diag.SetNestQuantity(IsOptionSet(LONG_OPTION_NEST_QUANTITY));
diag.SetNestingTime(OptNestingTime());
diag.SetEfficiencyCoefficient(OptEfficiencyCoefficient());
@@ -655,6 +656,8 @@ void VCommandLine::InitCommandLineOptions()
//=================================================================================================================
{LONG_OPTION_FOLLOW_GRAINLINE,
translate("VCommandLine", "Order detail to follow grainline direction (export mode).")},
+ {LONG_OPTION_NEST_QUANTITY,
+ translate("VCommandLine", "Nest quantity copies of each piece (export mode).")},
{{SINGLE_OPTION_CROP, LONG_OPTION_CROP},
translate("VCommandLine", "Auto crop unused length (export mode).")},
{{SINGLE_OPTION_UNITE, LONG_OPTION_UNITE},
diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.cpp b/src/app/valentina/dialogs/dialoglayoutsettings.cpp
index 35c8f4e82..a1bbab069 100644
--- a/src/app/valentina/dialogs/dialoglayoutsettings.cpp
+++ b/src/app/valentina/dialogs/dialoglayoutsettings.cpp
@@ -328,6 +328,18 @@ void DialogLayoutSettings::SetTextAsPaths(bool value)
ui->checkBoxTextAsPaths->setChecked(value);
}
+//---------------------------------------------------------------------------------------------------------------------
+bool DialogLayoutSettings::IsNestQuantity() const
+{
+ return ui->checkBoxNestQuantity->isChecked();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void DialogLayoutSettings::SetNestQuantity(bool state)
+{
+ ui->checkBoxNestQuantity->setChecked(state);
+}
+
//---------------------------------------------------------------------------------------------------------------------
QString DialogLayoutSettings::SelectedPrinter() const
{
@@ -566,6 +578,7 @@ void DialogLayoutSettings::DialogAccepted()
generator->SetStripOptimization(IsStripOptimization());
generator->SetMultiplier(GetMultiplier());
generator->SetTextAsPaths(IsTextAsPaths());
+ generator->SetNestQuantity(IsNestQuantity());
if (IsIgnoreAllFields())
{
@@ -654,6 +667,7 @@ void DialogLayoutSettings::RestoreDefaults()
SetMultiplier(VSettings::GetDefMultiplier());
SetNestingTime(VSettings::GetDefNestingTime());
SetEfficiencyCoefficient(VSettings::GetDefEfficiencyCoefficient());
+ SetNestQuantity(VSettings::GetDefLayoutNestQuantity());
CorrectMaxFileds();
IgnoreAllFields(ui->checkBoxIgnoreFileds->isChecked());
@@ -982,6 +996,7 @@ void DialogLayoutSettings::ReadSettings()
SetStripOptimization(settings->GetStripOptimization());
SetMultiplier(settings->GetMultiplier());
SetTextAsPaths(settings->GetTextAsPaths());
+ SetNestQuantity(settings->GetLayoutNestQuantity());
FindTemplate();
@@ -1008,6 +1023,7 @@ void DialogLayoutSettings::WriteSettings() const
settings->SetTextAsPaths(IsTextAsPaths());
settings->SetNestingTime(GetNestingTime());
settings->SetEfficiencyCoefficient(GetEfficiencyCoefficient());
+ settings->SetLayoutNestQuantity(IsNestQuantity());
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.h b/src/app/valentina/dialogs/dialoglayoutsettings.h
index 79c4dcf42..463827322 100644
--- a/src/app/valentina/dialogs/dialoglayoutsettings.h
+++ b/src/app/valentina/dialogs/dialoglayoutsettings.h
@@ -95,6 +95,9 @@ public:
bool IsTextAsPaths() const;
void SetTextAsPaths(bool value);
+ bool IsNestQuantity() const;
+ void SetNestQuantity(bool state);
+
QString SelectedPrinter() const;
void EnableLandscapeOrientation();
diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.ui b/src/app/valentina/dialogs/dialoglayoutsettings.ui
index 730eaabf0..6732b2d30 100644
--- a/src/app/valentina/dialogs/dialoglayoutsettings.ui
+++ b/src/app/valentina/dialogs/dialoglayoutsettings.ui
@@ -518,6 +518,16 @@
+ -
+
+
+ Nest quantity of copies according to piece settings.
+
+
+ Nest quantity
+
+
+
-
diff --git a/src/app/valentina/xml/vpattern.cpp b/src/app/valentina/xml/vpattern.cpp
index 76778b45c..f8e507393 100644
--- a/src/app/valentina/xml/vpattern.cpp
+++ b/src/app/valentina/xml/vpattern.cpp
@@ -1028,7 +1028,7 @@ 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, QChar('1'))));
+ ppData.SetQuantity(static_cast(GetParametrUInt(domElement, AttrQuantity, QChar('1'))));
ppData.SetOnFold(GetParametrBool(domElement, AttrOnFold, falseStr));
ppData.SetPos(QPointF(GetParametrDouble(domElement, AttrMx, QChar('0')),
GetParametrDouble(domElement, AttrMy, QChar('0'))));
diff --git a/src/libs/vlayout/vbank.cpp b/src/libs/vlayout/vbank.cpp
index b3f6477fd..c7ffbdf26 100644
--- a/src/libs/vlayout/vbank.cpp
+++ b/src/libs/vlayout/vbank.cpp
@@ -50,6 +50,24 @@ QT_WARNING_POP
#undef small
#endif
+namespace
+{
+QVector PrepareQuantity(const QVector &details)
+{
+ QVector withQuantity;
+ withQuantity.reserve(details.size());
+ for(auto &piece : details)
+ {
+ for (int i = 0; i < piece.GetQuantity(); ++i)
+ {
+ withQuantity.append(piece);
+ }
+ }
+
+ return withQuantity;
+}
+}
+
//---------------------------------------------------------------------------------------------------------------------
VBank::VBank()
: details(),
@@ -76,6 +94,18 @@ void VBank::SetLayoutWidth(qreal value)
Reset();
}
+//---------------------------------------------------------------------------------------------------------------------
+bool VBank::IsNestQuantity() const
+{
+ return m_nestQuantity;
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VBank::SetNestQuantity(bool value)
+{
+ m_nestQuantity = value;
+}
+
//---------------------------------------------------------------------------------------------------------------------
void VBank::SetDetails(const QVector &details)
{
@@ -213,6 +243,11 @@ bool VBank::PrepareDetails()
return prepare;
}
+ if (m_nestQuantity)
+ {
+ details = PrepareQuantity(details);
+ }
+
diagonal = 0;
for (int i=0; i < details.size(); ++i)
diff --git a/src/libs/vlayout/vbank.h b/src/libs/vlayout/vbank.h
index beee3479c..836c647ac 100644
--- a/src/libs/vlayout/vbank.h
+++ b/src/libs/vlayout/vbank.h
@@ -54,6 +54,8 @@ public:
qreal GetLayoutWidth() const;
void SetLayoutWidth(qreal value);
+ bool IsNestQuantity() const;
+ void SetNestQuantity(bool value);
void SetDetails(const QVector &details);
int GetNext();
@@ -90,6 +92,7 @@ private:
Cases caseType;
bool prepare;
qreal diagonal;
+ bool m_nestQuantity{false};
void PrepareGroup();
diff --git a/src/libs/vlayout/vlayoutgenerator.cpp b/src/libs/vlayout/vlayoutgenerator.cpp
index a46a52c8b..372f66bd4 100644
--- a/src/libs/vlayout/vlayoutgenerator.cpp
+++ b/src/libs/vlayout/vlayoutgenerator.cpp
@@ -728,6 +728,18 @@ void VLayoutGenerator::SetFollowGrainline(bool value)
followGrainline = value;
}
+//---------------------------------------------------------------------------------------------------------------------
+bool VLayoutGenerator::IsNestQuantity() const
+{
+ return bank->IsNestQuantity();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VLayoutGenerator::SetNestQuantity(bool value)
+{
+ bank->SetNestQuantity(value);
+}
+
//---------------------------------------------------------------------------------------------------------------------
qreal VLayoutGenerator::GetPaperWidth() const
{
diff --git a/src/libs/vlayout/vlayoutgenerator.h b/src/libs/vlayout/vlayoutgenerator.h
index ba6a5f8d0..caca10d6e 100644
--- a/src/libs/vlayout/vlayoutgenerator.h
+++ b/src/libs/vlayout/vlayoutgenerator.h
@@ -99,6 +99,9 @@ public:
bool GetFollowGrainline() const;
void SetFollowGrainline(bool value);
+ bool IsNestQuantity() const;
+ void SetNestQuantity(bool value);
+
int GetRotationNumber() const;
void SetRotationNumber(int value);
diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp
index 69fcf0cb5..c05a04a1d 100644
--- a/src/libs/vlayout/vlayoutpiece.cpp
+++ b/src/libs/vlayout/vlayoutpiece.cpp
@@ -60,7 +60,7 @@
#include "vgraphicsfillitem.h"
const quint32 VLayoutPieceData::streamHeader = 0x80D7D009; // CRC-32Q string "VLayoutPieceData"
-const quint16 VLayoutPieceData::classVersion = 1;
+const quint16 VLayoutPieceData::classVersion = 2;
namespace
{
@@ -443,13 +443,14 @@ VLayoutPiece VLayoutPiece::Create(const VPiece &piece, const VContainer *pattern
}
const VPieceLabelData& data = piece.GetPatternPieceData();
- if (data.IsVisible() == true)
+ det.SetQuantity(data.GetQuantity());
+ if (data.IsVisible())
{
det.SetPieceText(piece.GetName(), data, qApp->Settings()->GetLabelFont(), pattern);
}
const VPatternLabelData& geom = piece.GetPatternInfo();
- if (geom.IsVisible() == true)
+ if (geom.IsVisible())
{
VAbstractPattern* pDoc = qApp->getCurrentDocument();
det.SetPatternInfo(pDoc, geom, qApp->Settings()->GetLabelFont(), pattern);
@@ -757,6 +758,18 @@ void VLayoutPiece::SetLayoutWidth(qreal value)
d->layoutWidth = value;
}
+//---------------------------------------------------------------------------------------------------------------------
+quint16 VLayoutPiece::GetQuantity() const
+{
+ return d->m_quantity;
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VLayoutPiece::SetQuantity(quint16 value)
+{
+ d->m_quantity = qMax(static_cast(1), value);
+}
+
//---------------------------------------------------------------------------------------------------------------------
void VLayoutPiece::Translate(qreal dx, qreal dy)
{
diff --git a/src/libs/vlayout/vlayoutpiece.h b/src/libs/vlayout/vlayoutpiece.h
index 685a587c6..9f92d8bdf 100644
--- a/src/libs/vlayout/vlayoutpiece.h
+++ b/src/libs/vlayout/vlayoutpiece.h
@@ -116,6 +116,9 @@ public:
qreal GetLayoutWidth() const;
void SetLayoutWidth(qreal value);
+ quint16 GetQuantity() const;
+ void SetQuantity(quint16 value);
+
bool IsMirror() const;
void SetMirror(bool value);
diff --git a/src/libs/vlayout/vlayoutpiece_p.h b/src/libs/vlayout/vlayoutpiece_p.h
index 4ef3e33a0..6bda27f5e 100644
--- a/src/libs/vlayout/vlayoutpiece_p.h
+++ b/src/libs/vlayout/vlayoutpiece_p.h
@@ -52,23 +52,6 @@ class VLayoutPieceData : public QSharedData
{
public:
VLayoutPieceData()
- : contour(),
- seamAllowance(),
- layoutAllowance(),
- passmarks(),
- m_internalPaths(),
- matrix(),
- layoutWidth(0),
- mirror(false),
- detailLabel(),
- patternInfo(),
- grainlinePoints(),
- grainlineArrowType(ArrowType::atFront),
- grainlineAngle(0),
- grainlineEnabled(false),
- m_tmDetail(),
- m_tmPattern(),
- m_placeLabels()
{}
VLayoutPieceData(const VLayoutPieceData &detail)
@@ -90,7 +73,8 @@ public:
m_tmDetail(detail.m_tmDetail),
m_tmPattern(detail.m_tmPattern),
m_placeLabels(detail.m_placeLabels),
- m_square(detail.m_square)
+ m_square(detail.m_square),
+ m_quantity(detail.m_quantity)
{}
~VLayoutPieceData() Q_DECL_EQ_DEFAULT;
@@ -99,52 +83,54 @@ public:
friend QDataStream& operator>>(QDataStream& dataStream, VLayoutPieceData& piece);
/** @brief contour list of contour points. */
- QVector contour;
+ QVector contour{};
/** @brief seamAllowance list of seam allowance points. */
- QVector seamAllowance;
+ QVector seamAllowance{};
/** @brief layoutAllowance list of layout allowance points. */
- QVector layoutAllowance;
+ QVector layoutAllowance{};
/** @brief passmarks list of passmakrs. */
- QVector passmarks;
+ QVector passmarks{};
/** @brief m_internalPaths list of internal paths. */
- QVector m_internalPaths;
+ QVector m_internalPaths{};
/** @brief matrix transformation matrix*/
- QTransform matrix;
+ QTransform matrix{};
/** @brief layoutWidth value layout allowance width in pixels. */
- qreal layoutWidth;
+ qreal layoutWidth{0};
- bool mirror;
+ bool mirror{false};
/** @brief detailLabel detail label rectangle */
- QVector detailLabel;
+ QVector detailLabel{};
/** @brief patternInfo pattern info rectangle */
- QVector patternInfo;
+ QVector patternInfo{};
/** @brief grainlineInfo line */
- QVector grainlinePoints;
+ QVector grainlinePoints{};
- ArrowType grainlineArrowType;
- qreal grainlineAngle;
- bool grainlineEnabled;
+ ArrowType grainlineArrowType{ArrowType::atFront};
+ qreal grainlineAngle{0};
+ bool grainlineEnabled{false};
/** @brief m_tmDetail text manager for laying out detail info */
- VTextManager m_tmDetail;
+ VTextManager m_tmDetail{};
/** @brief m_tmPattern text manager for laying out pattern info */
- VTextManager m_tmPattern;
+ VTextManager m_tmPattern{};
/** @brief m_placeLabels list of place labels. */
- QVector m_placeLabels;
+ QVector m_placeLabels{};
qint64 m_square{0};
+ quint16 m_quantity{1};
+
private:
Q_DISABLE_ASSIGN(VLayoutPieceData)
@@ -177,6 +163,7 @@ inline QDataStream &operator<<(QDataStream &dataStream, const VLayoutPieceData &
dataStream << piece.m_square;
// Added in classVersion = 2
+ dataStream << piece.m_quantity;
return dataStream;
}
@@ -224,10 +211,10 @@ inline QDataStream &operator>>(QDataStream &dataStream, VLayoutPieceData &piece)
dataStream >> piece.m_placeLabels;
dataStream >> piece.m_square;
-// if (actualClassVersion >= 2)
-// {
-
-// }
+ if (actualClassVersion >= 2)
+ {
+ dataStream >> piece.m_quantity;
+ }
return dataStream;
}
diff --git a/src/libs/vmisc/commandoptions.cpp b/src/libs/vmisc/commandoptions.cpp
index 6fe44d561..11269a905 100644
--- a/src/libs/vmisc/commandoptions.cpp
+++ b/src/libs/vmisc/commandoptions.cpp
@@ -130,6 +130,8 @@ const QString LONG_OPTION_FOLLOW_GRAINLINE = QStringLiteral("followGrainline");
const QString LONG_OPTION_LANDSCAPE_ORIENTATION = QStringLiteral("landscapeOrientation");
+const QString LONG_OPTION_NEST_QUANTITY = QStringLiteral("nestQuantity");
+
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief AllKeys return list with all command line keys (short and long forms). Used for testing on conflicts.
@@ -181,6 +183,7 @@ QStringList AllKeys()
LONG_OPTION_TILED_PDF_BOTTOM_MARGIN,
LONG_OPTION_TILED_PDF_LANDSCAPE,
LONG_OPTION_FOLLOW_GRAINLINE,
- LONG_OPTION_LANDSCAPE_ORIENTATION
+ LONG_OPTION_LANDSCAPE_ORIENTATION,
+ LONG_OPTION_NEST_QUANTITY
};
}
diff --git a/src/libs/vmisc/commandoptions.h b/src/libs/vmisc/commandoptions.h
index 1bab419e0..fe94e861d 100644
--- a/src/libs/vmisc/commandoptions.h
+++ b/src/libs/vmisc/commandoptions.h
@@ -124,6 +124,7 @@ extern const QString LONG_OPTION_TILED_PDF_BOTTOM_MARGIN;
extern const QString LONG_OPTION_TILED_PDF_LANDSCAPE;
extern const QString LONG_OPTION_FOLLOW_GRAINLINE;
extern const QString LONG_OPTION_LANDSCAPE_ORIENTATION;
+extern const QString LONG_OPTION_NEST_QUANTITY;
QStringList AllKeys();
diff --git a/src/libs/vmisc/vsettings.cpp b/src/libs/vmisc/vsettings.cpp
index ff756d342..33711cebb 100644
--- a/src/libs/vmisc/vsettings.cpp
+++ b/src/libs/vmisc/vsettings.cpp
@@ -83,6 +83,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutSorting, (QLatin1String("l
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPaperHeight, (QLatin1String("layout/paperHeight")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutPaperWidth, (QLatin1String("layout/paperWidth")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutFollowGrainline, (QLatin1String("layout/followGrainline")))
+Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutNestQuantity, (QLatin1String("layout/nestQuantity")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutAutoCrop, (QLatin1String("layout/autoCrop")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutSaveLength, (QLatin1String("layout/saveLength")))
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingLayoutUnitePages, (QLatin1String("layout/unitePages")))
@@ -292,6 +293,24 @@ void VSettings::SetLayoutFollowGrainline(bool value)
setValue(*settingLayoutFollowGrainline, value);
}
+//---------------------------------------------------------------------------------------------------------------------
+bool VSettings::GetLayoutNestQuantity() const
+{
+ return value(*settingLayoutNestQuantity, GetDefLayoutNestQuantity()).toBool();
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+bool VSettings::GetDefLayoutNestQuantity()
+{
+ return false;
+}
+
+//---------------------------------------------------------------------------------------------------------------------
+void VSettings::SetLayoutNestQuantity(bool value)
+{
+ setValue(*settingLayoutNestQuantity, value);
+}
+
//---------------------------------------------------------------------------------------------------------------------
bool VSettings::GetLayoutAutoCrop() const
{
diff --git a/src/libs/vmisc/vsettings.h b/src/libs/vmisc/vsettings.h
index 0e85502db..3024bd6d7 100644
--- a/src/libs/vmisc/vsettings.h
+++ b/src/libs/vmisc/vsettings.h
@@ -92,6 +92,10 @@ public:
static bool GetDefLayoutFollowGrainline();
void SetLayoutFollowGrainline(bool value);
+ bool GetLayoutNestQuantity() const;
+ static bool GetDefLayoutNestQuantity();
+ void SetLayoutNestQuantity(bool value);
+
bool GetLayoutAutoCrop() const;
static bool GetDefLayoutAutoCrop();
void SetLayoutAutoCrop(bool value);
diff --git a/src/libs/vpatterndb/floatItemData/vpiecelabeldata.cpp b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.cpp
index da97c84d5..4dd7ca40a 100644
--- a/src/libs/vpatterndb/floatItemData/vpiecelabeldata.cpp
+++ b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.cpp
@@ -138,18 +138,15 @@ void VPieceLabelData::SetFoldPosition(const QString &val)
}
//---------------------------------------------------------------------------------------------------------------------
-int VPieceLabelData::GetQuantity() const
+quint16 VPieceLabelData::GetQuantity() const
{
return d->m_quantity;
}
//---------------------------------------------------------------------------------------------------------------------
-void VPieceLabelData::SetQuantity(int val)
+void VPieceLabelData::SetQuantity(quint16 val)
{
- if (val >= 1)
- {
- d->m_quantity = val;
- }
+ d->m_quantity = qMax(static_cast(1), val);
}
//---------------------------------------------------------------------------------------------------------------------
diff --git a/src/libs/vpatterndb/floatItemData/vpiecelabeldata.h b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.h
index e88abbf51..58a61fc1a 100644
--- a/src/libs/vpatterndb/floatItemData/vpiecelabeldata.h
+++ b/src/libs/vpatterndb/floatItemData/vpiecelabeldata.h
@@ -78,8 +78,8 @@ public:
QString GetFoldPosition() const;
void SetFoldPosition(const QString &val);
- int GetQuantity() const;
- void SetQuantity(int val);
+ quint16 GetQuantity() const;
+ void SetQuantity(quint16 val);
bool IsOnFold() const;
void SetOnFold(bool onFold);
diff --git a/src/libs/vpatterndb/floatItemData/vpiecelabeldata_p.h b/src/libs/vpatterndb/floatItemData/vpiecelabeldata_p.h
index b7d0bd1ed..51892d610 100644
--- a/src/libs/vpatterndb/floatItemData/vpiecelabeldata_p.h
+++ b/src/libs/vpatterndb/floatItemData/vpiecelabeldata_p.h
@@ -81,7 +81,7 @@ public:
QString m_tilt;
QString m_foldPosition;
- int m_quantity;
+ quint16 m_quantity;
bool m_onFold;
QVector m_lines;
diff --git a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp
index cd62479d8..64c500d4f 100644
--- a/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp
+++ b/src/libs/vtools/dialogs/tools/piece/dialogseamallowance.cpp
@@ -2460,7 +2460,7 @@ VPiece DialogSeamAllowance::CreatePiece() const
piece.GetPatternPieceData().SetRotationWay(uiTabLabels->lineEditRotation->text());
piece.GetPatternPieceData().SetTilt(uiTabLabels->lineEditTilt->text());
piece.GetPatternPieceData().SetFoldPosition(uiTabLabels->lineEditFoldPosition->text());
- piece.GetPatternPieceData().SetQuantity(uiTabLabels->spinBoxQuantity->value());
+ piece.GetPatternPieceData().SetQuantity(static_cast(uiTabLabels->spinBoxQuantity->value()));
piece.GetPatternPieceData().SetOnFold(uiTabLabels->checkBoxFold->isChecked());
piece.GetPatternPieceData().SetLabelTemplate(m_templateLines);
piece.GetPatternPieceData().SetRotation(GetFormulaFromUser(uiTabLabels->lineEditDLAngleFormula));