Returned "Forbid flipping" feature.
--HG-- branch : feature
This commit is contained in:
parent
0dbf26a109
commit
df20415e9e
|
@ -621,8 +621,8 @@ void VPattern::ParseDetailElement(const QDomElement &domElement, const Document
|
|||
// detail.setSeamAllowance(GetParametrUInt(domElement, VToolDetail::AttrSupplement, "1"));
|
||||
// detail.setWidth(GetParametrDouble(domElement, VToolDetail::AttrWidth, "10.0"));
|
||||
// detail.setClosed(GetParametrUInt(domElement, VToolDetail::AttrClosed, "1"));
|
||||
// detail.setForbidFlipping(GetParametrUInt(domElement, VToolDetail::AttrForbidFlipping,
|
||||
// QString().setNum(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping())));
|
||||
detail.SetForbidFlipping(GetParametrUInt(domElement, VToolSeamAllowance::AttrForbidFlipping,
|
||||
QString().setNum(qApp->ValentinaSettings()->GetForbidWorkpieceFlipping())));
|
||||
detail.SetInLayout(GetParametrBool(domElement, AttrInLayout, trueStr));
|
||||
|
||||
const QStringList tags = QStringList() << VToolSeamAllowance::TagNodes
|
||||
|
|
|
@ -414,6 +414,7 @@
|
|||
<xs:attribute name="my" type="xs:double"></xs:attribute>
|
||||
<xs:attribute name="name" type="xs:string"></xs:attribute>
|
||||
<xs:attribute name="inLayout" type="xs:boolean"></xs:attribute>
|
||||
<xs:attribute name="forbidFlipping" type="xs:unsignedInt"></xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
|
|
|
@ -1697,7 +1697,6 @@ void VPatternConverter::TagDetailToV0_4_0()
|
|||
dom.removeAttribute(strSupplement);
|
||||
dom.removeAttribute(strClosed);
|
||||
dom.removeAttribute(strWidth);
|
||||
dom.removeAttribute(strForbidFlipping);
|
||||
|
||||
dom.setAttribute(strVersion, "1");
|
||||
|
||||
|
|
|
@ -73,6 +73,18 @@ void VAbstractPiece::SetName(const QString &value)
|
|||
d->m_name = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VAbstractPiece::IsForbidFlipping() const
|
||||
{
|
||||
return d->m_forbidFlipping;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VAbstractPiece::SetForbidFlipping(bool value)
|
||||
{
|
||||
d->m_forbidFlipping = value;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
qreal VAbstractPiece::SumTrapezoids(const QVector<QPointF> &points)
|
||||
{
|
||||
|
|
|
@ -47,6 +47,9 @@ public:
|
|||
QString GetName() const;
|
||||
void SetName(const QString &value);
|
||||
|
||||
bool IsForbidFlipping() const;
|
||||
void SetForbidFlipping(bool value);
|
||||
|
||||
static qreal SumTrapezoids(const QVector<QPointF> &points);
|
||||
static QVector<QPointF> CheckLoops(const QVector<QPointF> &points);
|
||||
static QVector<QPointF> CorrectEquidistantPoints(const QVector<QPointF> &points, bool removeFirstAndLast = true);
|
||||
|
|
|
@ -41,17 +41,21 @@ class VAbstractPieceData : public QSharedData
|
|||
{
|
||||
public:
|
||||
VAbstractPieceData()
|
||||
: m_name()
|
||||
: m_name(),
|
||||
m_forbidFlipping(false)
|
||||
{}
|
||||
|
||||
VAbstractPieceData(const VAbstractPieceData &piece)
|
||||
: QSharedData(piece),
|
||||
m_name(piece.m_name)
|
||||
m_name(piece.m_name),
|
||||
m_forbidFlipping(piece.m_forbidFlipping)
|
||||
{}
|
||||
|
||||
~VAbstractPieceData();
|
||||
|
||||
QString m_name;
|
||||
/** @brief forbidFlipping forbid piece be mirrored in a layout. */
|
||||
bool m_forbidFlipping;
|
||||
|
||||
private:
|
||||
VAbstractPieceData &operator=(const VAbstractPieceData &) Q_DECL_EQ_DELETE;
|
||||
|
|
|
@ -50,6 +50,8 @@ DialogSeamAllowance::DialogSeamAllowance(const VContainer *data, const quint32 &
|
|||
flagError = MainPathIsValid();
|
||||
CheckState();
|
||||
|
||||
ui->checkBoxForbidFlipping->setChecked(qApp->Settings()->GetForbidWorkpieceFlipping());
|
||||
|
||||
ui->listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(ui->listWidget, &QListWidget::customContextMenuRequested, this, &DialogSeamAllowance::ShowContextMenu);
|
||||
connect(ui->listWidget->model(), &QAbstractItemModel::rowsMoved, this, &DialogSeamAllowance::ListChanged);
|
||||
|
@ -91,6 +93,8 @@ void DialogSeamAllowance::SetPiece(const VPiece &piece)
|
|||
NewItem(m_piece.at(i));
|
||||
}
|
||||
|
||||
ui->checkBoxForbidFlipping->setChecked(m_piece.IsForbidFlipping());
|
||||
|
||||
ValidObjects(MainPathIsValid());
|
||||
}
|
||||
|
||||
|
@ -260,6 +264,8 @@ VPiece DialogSeamAllowance::CreatePiece() const
|
|||
piece.Append(qvariant_cast<VPieceNode>(item->data(Qt::UserRole)));
|
||||
}
|
||||
|
||||
piece.SetForbidFlipping(ui->checkBoxForbidFlipping->isChecked());
|
||||
|
||||
return piece;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,16 @@
|
|||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxForbidFlipping">
|
||||
<property name="toolTip">
|
||||
<string>Forbid piece be mirrored in a layout.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Forbid flipping</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget">
|
||||
<property name="dragDropMode">
|
||||
|
|
|
@ -61,6 +61,7 @@ const QString VToolSeamAllowance::TagNode = QStringLiteral("node");
|
|||
|
||||
const QString VToolSeamAllowance::AttrVersion = QStringLiteral("version");
|
||||
const QString VToolSeamAllowance::AttrNodeReverse = QStringLiteral("reverse");
|
||||
const QString VToolSeamAllowance::AttrForbidFlipping = QStringLiteral("forbidFlipping");
|
||||
|
||||
const QString VToolSeamAllowance::NodeArc = QStringLiteral("NodeArc");
|
||||
const QString VToolSeamAllowance::NodePoint = QStringLiteral("NodePoint");
|
||||
|
@ -252,6 +253,7 @@ void VToolSeamAllowance::AddAttributes(VAbstractPattern *doc, QDomElement &domEl
|
|||
doc->SetAttribute(domElement, AttrMx, qApp->fromPixel(piece.GetMx()));
|
||||
doc->SetAttribute(domElement, AttrMy, qApp->fromPixel(piece.GetMy()));
|
||||
doc->SetAttribute(domElement, AttrInLayout, piece.IsInLayout());
|
||||
doc->SetAttribute(domElement, AttrForbidFlipping, static_cast<quint8>(piece.IsForbidFlipping()));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
|
||||
static const QString AttrVersion;
|
||||
static const QString AttrNodeReverse;
|
||||
static const QString AttrForbidFlipping;
|
||||
|
||||
static const QString NodeArc;
|
||||
static const QString NodePoint;
|
||||
|
|
Loading…
Reference in New Issue
Block a user