Change in detail dialog. Show fractional number, current unit.
--HG-- branch : feature
This commit is contained in:
parent
60e5167400
commit
2e7e0e92f7
|
@ -34,6 +34,7 @@
|
||||||
#include "../../geometry/vpointf.h"
|
#include "../../geometry/vpointf.h"
|
||||||
#include "../../geometry/vsplinepath.h"
|
#include "../../geometry/vsplinepath.h"
|
||||||
#include "../../container/vcontainer.h"
|
#include "../../container/vcontainer.h"
|
||||||
|
#include "../../xml/vdomdocument.h"
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -46,6 +47,9 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
labelEditNamePoint = ui.labelEditNameDetail;
|
labelEditNamePoint = ui.labelEditNameDetail;
|
||||||
|
ui.labelUnit->setText( VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
|
ui.labelUnitX->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
|
ui.labelUnitY->setText(VDomDocument::UnitsToStr(qApp->patternUnit(), true));
|
||||||
|
|
||||||
bOk = ui.buttonBox->button(QDialogButtonBox::Ok);
|
bOk = ui.buttonBox->button(QDialogButtonBox::Ok);
|
||||||
SCASSERT(bOk != nullptr);
|
SCASSERT(bOk != nullptr);
|
||||||
|
@ -61,9 +65,9 @@ DialogDetail::DialogDetail(const VContainer *data, QWidget *parent)
|
||||||
CheckState();
|
CheckState();
|
||||||
|
|
||||||
connect(ui.listWidget, &QListWidget::currentRowChanged, this, &DialogDetail::ObjectChanged);
|
connect(ui.listWidget, &QListWidget::currentRowChanged, this, &DialogDetail::ObjectChanged);
|
||||||
connect(ui.spinBoxBiasX, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
connect(ui.doubleSpinBoxBiasX, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasXChanged);
|
this, &DialogDetail::BiasXChanged);
|
||||||
connect(ui.spinBoxBiasY, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
connect(ui.doubleSpinBoxBiasY, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasYChanged);
|
this, &DialogDetail::BiasYChanged);
|
||||||
connect(ui.checkBoxSeams, &QCheckBox::clicked, this, &DialogDetail::ClickedSeams);
|
connect(ui.checkBoxSeams, &QCheckBox::clicked, this, &DialogDetail::ClickedSeams);
|
||||||
connect(ui.checkBoxClosed, &QCheckBox::clicked, this, &DialogDetail::ClickedClosed);
|
connect(ui.checkBoxClosed, &QCheckBox::clicked, this, &DialogDetail::ClickedClosed);
|
||||||
|
@ -119,7 +123,7 @@ void DialogDetail::DialogAccepted()
|
||||||
QListWidgetItem *item = ui.listWidget->item(i);
|
QListWidgetItem *item = ui.listWidget->item(i);
|
||||||
details.append( qvariant_cast<VNodeDetail>(item->data(Qt::UserRole)));
|
details.append( qvariant_cast<VNodeDetail>(item->data(Qt::UserRole)));
|
||||||
}
|
}
|
||||||
details.setWidth(ui.spinBoxSeams->value());
|
details.setWidth(ui.doubleSpinBoxSeams->value());
|
||||||
details.setName(ui.lineEditNameDetail->text());
|
details.setName(ui.lineEditNameDetail->text());
|
||||||
details.setSeamAllowance(supplement);
|
details.setSeamAllowance(supplement);
|
||||||
details.setClosed(closed);
|
details.setClosed(closed);
|
||||||
|
@ -198,15 +202,15 @@ void DialogDetail::NewItem(quint32 id, const Tool &typeTool, const NodeDetail &t
|
||||||
item->setData(Qt::UserRole, QVariant::fromValue(node));
|
item->setData(Qt::UserRole, QVariant::fromValue(node));
|
||||||
ui.listWidget->addItem(item);
|
ui.listWidget->addItem(item);
|
||||||
ui.listWidget->setCurrentRow(ui.listWidget->count()-1);
|
ui.listWidget->setCurrentRow(ui.listWidget->count()-1);
|
||||||
disconnect(ui.spinBoxBiasX, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
disconnect(ui.doubleSpinBoxBiasX, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasXChanged);
|
this, &DialogDetail::BiasXChanged);
|
||||||
disconnect(ui.spinBoxBiasY, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
disconnect(ui.doubleSpinBoxBiasY, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasYChanged);
|
this, &DialogDetail::BiasYChanged);
|
||||||
ui.spinBoxBiasX->setValue(static_cast<qint32>(qApp->fromPixel(node.getMx())));
|
ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx()));
|
||||||
ui.spinBoxBiasY->setValue(static_cast<qint32>(qApp->fromPixel(node.getMy())));
|
ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy()));
|
||||||
connect(ui.spinBoxBiasX, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
connect(ui.doubleSpinBoxBiasX, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasXChanged);
|
this, &DialogDetail::BiasXChanged);
|
||||||
connect(ui.spinBoxBiasY, static_cast<void (QSpinBox::*)(qint32)>(&QSpinBox::valueChanged),
|
connect(ui.doubleSpinBoxBiasY, static_cast<void (QDoubleSpinBox::*)(qreal)>(&QDoubleSpinBox::valueChanged),
|
||||||
this, &DialogDetail::BiasYChanged);
|
this, &DialogDetail::BiasYChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +233,7 @@ void DialogDetail::setDetails(const VDetail &value)
|
||||||
ui.checkBoxClosed->setChecked(details.getClosed());
|
ui.checkBoxClosed->setChecked(details.getClosed());
|
||||||
ClickedClosed(details.getClosed());
|
ClickedClosed(details.getClosed());
|
||||||
ClickedSeams(details.getSeamAllowance());
|
ClickedSeams(details.getSeamAllowance());
|
||||||
ui.spinBoxSeams->setValue(static_cast<qint32>(details.getWidth()));
|
ui.doubleSpinBoxSeams->setValue(details.getWidth());
|
||||||
ui.listWidget->setCurrentRow(0);
|
ui.listWidget->setCurrentRow(0);
|
||||||
ui.listWidget->setFocus(Qt::OtherFocusReason);
|
ui.listWidget->setFocus(Qt::OtherFocusReason);
|
||||||
ui.toolButtonDelete->setEnabled(true);
|
ui.toolButtonDelete->setEnabled(true);
|
||||||
|
@ -274,7 +278,7 @@ void DialogDetail::ClickedSeams(bool checked)
|
||||||
{
|
{
|
||||||
supplement = checked;
|
supplement = checked;
|
||||||
ui.checkBoxClosed->setEnabled(checked);
|
ui.checkBoxClosed->setEnabled(checked);
|
||||||
ui.spinBoxSeams->setEnabled(checked);
|
ui.doubleSpinBoxSeams->setEnabled(checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -300,8 +304,8 @@ void DialogDetail::ObjectChanged(int row)
|
||||||
}
|
}
|
||||||
QListWidgetItem *item = ui.listWidget->item( row );
|
QListWidgetItem *item = ui.listWidget->item( row );
|
||||||
VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
|
VNodeDetail node = qvariant_cast<VNodeDetail>(item->data(Qt::UserRole));
|
||||||
ui.spinBoxBiasX->setValue(static_cast<qint32>(qApp->fromPixel(node.getMx())));
|
ui.doubleSpinBoxBiasX->setValue(qApp->fromPixel(node.getMx()));
|
||||||
ui.spinBoxBiasY->setValue(static_cast<qint32>(qApp->fromPixel(node.getMy())));
|
ui.doubleSpinBoxBiasY->setValue(qApp->fromPixel(node.getMy()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -41,18 +41,37 @@
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Bias X</string>
|
<string>Bias X</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBoxBiasX">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxBiasX">
|
||||||
<property name="minimum">
|
<property name="sizePolicy">
|
||||||
<number>-3000</number>
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>3000</number>
|
<double>900.990000000000009</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelUnitX">
|
||||||
|
<property name="text">
|
||||||
|
<string>cm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -64,7 +83,7 @@
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>1</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
@ -74,12 +93,25 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBoxBiasY">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxBiasY">
|
||||||
<property name="minimum">
|
<property name="sizePolicy">
|
||||||
<number>-3000</number>
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>3000</number>
|
<double>900.990000000000009</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelUnitY">
|
||||||
|
<property name="text">
|
||||||
|
<string>cm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -177,7 +209,7 @@
|
||||||
<widget class="QLabel" name="labelEditWidth">
|
<widget class="QLabel" name="labelEditWidth">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>1</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
@ -190,9 +222,31 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBoxSeams">
|
<widget class="QDoubleSpinBox" name="doubleSpinBoxSeams">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||||
|
<horstretch>1</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>3000</number>
|
<double>900.990000000000009</double>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<double>0.100000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="labelUnit">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>cm</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -33,13 +33,13 @@
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VDetail::VDetail()
|
VDetail::VDetail()
|
||||||
:_id(0), nodes(QVector<VNodeDetail>()), name(QString()), mx(0), my(0), seamAllowance(true), closed(true),
|
:_id(0), nodes(QVector<VNodeDetail>()), name(QString()), mx(0), my(0), seamAllowance(true), closed(true),
|
||||||
width(10)
|
width(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VDetail::VDetail(const QString &name, const QVector<VNodeDetail> &nodes)
|
VDetail::VDetail(const QString &name, const QVector<VNodeDetail> &nodes)
|
||||||
:_id(0), nodes(QVector<VNodeDetail>()), name(name), mx(0), my(0), seamAllowance(true), closed(true),
|
:_id(0), nodes(QVector<VNodeDetail>()), name(name), mx(0), my(0), seamAllowance(true), closed(true),
|
||||||
width(10)
|
width(0)
|
||||||
{
|
{
|
||||||
this->nodes = nodes;
|
this->nodes = nodes;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ void VDetail::Clear()
|
||||||
my = 0;
|
my = 0;
|
||||||
seamAllowance = true;
|
seamAllowance = true;
|
||||||
closed = true;
|
closed = true;
|
||||||
width = 10;
|
width = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -271,6 +271,11 @@ QPainterPath VEquidistant::Equidistant(QVector<QPointF> points, const Equidistan
|
||||||
qDebug()<<"Not enough points for building the equidistant.\n";
|
qDebug()<<"Not enough points for building the equidistant.\n";
|
||||||
return ekv;
|
return ekv;
|
||||||
}
|
}
|
||||||
|
if (width <= 0)
|
||||||
|
{
|
||||||
|
qDebug()<<"Width <= 0.\n";
|
||||||
|
return ekv;
|
||||||
|
}
|
||||||
for (qint32 i = 0; i < points.size(); ++i )
|
for (qint32 i = 0; i < points.size(); ++i )
|
||||||
{
|
{
|
||||||
if (i != points.size()-1)
|
if (i != points.size()-1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user