PartDesign: Replaced QuantitySpinBox by SpinBox for "occurrences" input field.
This commit is contained in:
@@ -28,8 +28,6 @@
|
||||
# include <QTimer>
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/round.hpp>
|
||||
|
||||
#include "ui_TaskPolarPatternParameters.h"
|
||||
#include "TaskPolarPatternParameters.h"
|
||||
#include "TaskMultiTransformParameters.h"
|
||||
@@ -109,8 +107,8 @@ void TaskPolarPatternParameters::setupUI()
|
||||
this, SLOT(onCheckReverse(bool)));
|
||||
connect(ui->polarAngle, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(onAngle(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)));
|
||||
|
||||
@@ -141,7 +139,7 @@ void TaskPolarPatternParameters::setupUI()
|
||||
|
||||
void TaskPolarPatternParameters::updateUI()
|
||||
{
|
||||
if (blockUpdate)
|
||||
if (blockUpdate)
|
||||
return;
|
||||
blockUpdate = true;
|
||||
|
||||
@@ -161,7 +159,7 @@ void TaskPolarPatternParameters::updateUI()
|
||||
ui->comboAxis->setCurrentIndex(0);
|
||||
else if (axisFeature != NULL && !axes.empty()) {
|
||||
ui->comboAxis->addItem(QString::fromAscii(axes.front().c_str()));
|
||||
ui->comboAxis->setCurrentIndex(1);
|
||||
ui->comboAxis->setCurrentIndex(1);
|
||||
}
|
||||
} else {
|
||||
// Error message?
|
||||
@@ -234,7 +232,7 @@ void TaskPolarPatternParameters::onCheckReverse(const bool on) {
|
||||
return;
|
||||
PartDesign::PolarPattern* pcPolarPattern = static_cast<PartDesign::PolarPattern*>(getObject());
|
||||
pcPolarPattern->Reversed.setValue(on);
|
||||
|
||||
|
||||
exitSelectionMode();
|
||||
kickUpdateViewTimer();
|
||||
}
|
||||
@@ -244,26 +242,26 @@ void TaskPolarPatternParameters::onAngle(const double a) {
|
||||
return;
|
||||
PartDesign::PolarPattern* pcPolarPattern = static_cast<PartDesign::PolarPattern*>(getObject());
|
||||
pcPolarPattern->Angle.setValue(a);
|
||||
|
||||
|
||||
exitSelectionMode();
|
||||
kickUpdateViewTimer();
|
||||
}
|
||||
|
||||
void TaskPolarPatternParameters::onOccurrences(const double n) {
|
||||
void TaskPolarPatternParameters::onOccurrences(const uint n) {
|
||||
if (blockUpdate)
|
||||
return;
|
||||
PartDesign::PolarPattern* pcPolarPattern = static_cast<PartDesign::PolarPattern*>(getObject());
|
||||
pcPolarPattern->Occurrences.setValue(boost::math::round(n));
|
||||
pcPolarPattern->Occurrences.setValue(n);
|
||||
|
||||
exitSelectionMode();
|
||||
kickUpdateViewTimer();
|
||||
}
|
||||
|
||||
void TaskPolarPatternParameters::onAxisChanged(int num) {
|
||||
if (blockUpdate)
|
||||
if (blockUpdate)
|
||||
return;
|
||||
PartDesign::PolarPattern* pcPolarPattern = static_cast<PartDesign::PolarPattern*>(getObject());
|
||||
|
||||
|
||||
if (num == 0) {
|
||||
pcPolarPattern->Axis.setValue(getSketchObject(), std::vector<std::string>(1,"N_Axis"));
|
||||
exitSelectionMode();
|
||||
@@ -328,7 +326,7 @@ const double TaskPolarPatternParameters::getAngle(void) const
|
||||
|
||||
const unsigned TaskPolarPatternParameters::getOccurrences(void) const
|
||||
{
|
||||
return boost::math::round(ui->spinOccurrences->value().getValue());
|
||||
return ui->spinOccurrences->value();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user