PartDesign: Replaced QuantitySpinBox by SpinBox for "occurrences" input field.

This commit is contained in:
Eivind Kvedalen
2015-09-28 22:05:39 +02:00
committed by wmayer
parent cbb4c52310
commit 9a0c58986f
9 changed files with 50 additions and 38 deletions

View File

@@ -27,8 +27,6 @@
# include <QMessageBox>
#endif
#include <boost/math/special_functions/round.hpp>
#include "ui_TaskScaledParameters.h"
#include "TaskScaledParameters.h"
#include "TaskMultiTransformParameters.h"
@@ -94,8 +92,8 @@ void TaskScaledParameters::setupUI()
{
connect(ui->spinFactor, SIGNAL(valueChanged(double)),
this, SLOT(onFactor(double)));
connect(ui->spinOccurrences, SIGNAL(valueChanged(double)),
this, SLOT(onOccurrences(double)));
connect(ui->spinOccurrences, SIGNAL(valueChanged(uint)),
this, SLOT(onOccurrences(uint)));
connect(ui->checkBoxUpdateView, SIGNAL(toggled(bool)),
this, SLOT(onUpdateView(bool)));
@@ -157,12 +155,12 @@ void TaskScaledParameters::onFactor(const double f)
recomputeFeature();
}
void TaskScaledParameters::onOccurrences(const double n)
void TaskScaledParameters::onOccurrences(const uint n)
{
if (blockUpdate)
return;
PartDesign::Scaled* pcScaled = static_cast<PartDesign::Scaled*>(getObject());
pcScaled->Occurrences.setValue(boost::math::round(n));
pcScaled->Occurrences.setValue(n);
recomputeFeature();
}
@@ -185,7 +183,7 @@ const double TaskScaledParameters::getFactor(void) const
const unsigned TaskScaledParameters::getOccurrences(void) const
{
return boost::math::round(ui->spinOccurrences->value().getValue());
return ui->spinOccurrences->value();
}
TaskScaledParameters::~TaskScaledParameters()