+ fixes #0000854: Ability to change number of digits to the right of decimal place in spinboxes
This commit is contained in:
parent
2d511524ac
commit
fb994e204c
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "InputVector.h"
|
||||
#include "ui_InputVector.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
|
||||
using namespace Gui;
|
||||
|
||||
|
@ -63,6 +64,10 @@ LocationWidget::LocationWidget (QWidget * parent)
|
|||
box->addWidget(dLabel, 3, 0, 1, 1);
|
||||
box->addWidget(dValue, 3, 1, 1, 1);
|
||||
|
||||
xValue->setDecimals(Base::UnitsApi::getDecimals());
|
||||
yValue->setDecimals(Base::UnitsApi::getDecimals());
|
||||
zValue->setDecimals(Base::UnitsApi::getDecimals());
|
||||
|
||||
QGridLayout* gridLayout = new QGridLayout(this);
|
||||
gridLayout->addLayout(box, 0, 0, 1, 2);
|
||||
|
||||
|
@ -177,6 +182,9 @@ Base::Vector3d LocationWidget::getUserDirection(bool* ok) const
|
|||
Gui::Dialog::Ui_InputVector iv;
|
||||
QDialog dlg(const_cast<LocationWidget*>(this));
|
||||
iv.setupUi(&dlg);
|
||||
iv.vectorX->setDecimals(Base::UnitsApi::getDecimals());
|
||||
iv.vectorY->setDecimals(Base::UnitsApi::getDecimals());
|
||||
iv.vectorZ->setDecimals(Base::UnitsApi::getDecimals());
|
||||
Base::Vector3d dir;
|
||||
if (dlg.exec()) {
|
||||
dir.x = iv.vectorX->value();
|
||||
|
@ -225,6 +233,9 @@ Base::Vector3d LocationDialog::getUserDirection(bool* ok) const
|
|||
Gui::Dialog::Ui_InputVector iv;
|
||||
QDialog dlg(const_cast<LocationDialog*>(this));
|
||||
iv.setupUi(&dlg);
|
||||
iv.vectorX->setDecimals(Base::UnitsApi::getDecimals());
|
||||
iv.vectorY->setDecimals(Base::UnitsApi::getDecimals());
|
||||
iv.vectorZ->setDecimals(Base::UnitsApi::getDecimals());
|
||||
Base::Vector3d dir;
|
||||
if (dlg.exec()) {
|
||||
dir.x = iv.vectorX->value();
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#include <App/Document.h>
|
||||
#include <App/PropertyGeo.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/UnitsApi.h>
|
||||
|
||||
using namespace Gui::Dialog;
|
||||
|
||||
|
@ -80,6 +81,17 @@ Placement::Placement(QWidget* parent, Qt::WFlags fl)
|
|||
ui = new Ui_PlacementComp(this);
|
||||
ui->applyPlacementChange->hide();
|
||||
|
||||
ui->xPos->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->yPos->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->zPos->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->xCnt->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->yCnt->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->zCnt->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->yawAngle->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->pitchAngle->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->rollAngle->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->angle->setDecimals(Base::UnitsApi::getDecimals());
|
||||
|
||||
ui->angle->setSuffix(QString::fromUtf8(" \xc2\xb0"));
|
||||
ui->yawAngle->setSuffix(QString::fromUtf8(" \xc2\xb0"));
|
||||
ui->pitchAngle->setSuffix(QString::fromUtf8(" \xc2\xb0"));
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "VisualInspection.h"
|
||||
#include "ui_VisualInspection.h"
|
||||
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Document.h>
|
||||
#include <App/DocumentObject.h>
|
||||
#include <App/Application.h>
|
||||
|
@ -87,6 +88,8 @@ VisualInspection::VisualInspection(QWidget* parent, Qt::WFlags fl)
|
|||
//FIXME: Not used yet
|
||||
ui->textLabel2->hide();
|
||||
ui->prefFloatSpinBox2->hide();
|
||||
ui->prefFloatSpinBox1->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->prefFloatSpinBox2->setDecimals(Base::UnitsApi::getDecimals());
|
||||
|
||||
connect(ui->buttonHelp, SIGNAL(clicked()), Gui::getMainWindow(), SLOT(whatsThis()));
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include <Base/PyObjectBase.h>
|
||||
#include <Base/Interpreter.h>
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <Gui/Application.h>
|
||||
#include <Gui/Command.h>
|
||||
#include <Gui/Document.h>
|
||||
|
@ -54,6 +55,9 @@ MeshGui::DlgRegularSolidImp::DlgRegularSolidImp(QWidget* parent, Qt::WFlags fl)
|
|||
: QDialog( parent, fl )
|
||||
{
|
||||
this->setupUi(this);
|
||||
QList<QDoubleSpinBox*> list = this->findChildren<QDoubleSpinBox*>();
|
||||
for (QList<QDoubleSpinBox*>::iterator it = list.begin(); it != list.end(); ++it)
|
||||
(*it)->setDecimals(Base::UnitsApi::getDecimals());
|
||||
Gui::Command::doCommand(Gui::Command::Doc, "import Mesh,BuildRegularGeoms");
|
||||
|
||||
// set limits
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
#include <Gui/View3DInventor.h>
|
||||
#include <Gui/View3DInventorViewer.h>
|
||||
#include <Base/Sequencer.h>
|
||||
#include <Base/UnitsApi.h>
|
||||
|
||||
using namespace PartGui;
|
||||
#undef CS_FUTURE // multi-threading causes some problems
|
||||
|
@ -124,6 +125,8 @@ CrossSections::CrossSections(const Base::BoundBox3d& bb, QWidget* parent, Qt::WF
|
|||
ui = new Ui_CrossSections();
|
||||
ui->setupUi(this);
|
||||
ui->position->setRange(-DBL_MAX, DBL_MAX);
|
||||
ui->position->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->distance->setDecimals(Base::UnitsApi::getDecimals());
|
||||
vp = new ViewProviderCrossSections();
|
||||
|
||||
Base::Vector3d c = bbox.CalcCenter();
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "DlgExtrusion.h"
|
||||
#include "../App/PartFeature.h"
|
||||
#include <Base/Console.h>
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <App/DocumentObject.h>
|
||||
|
@ -57,6 +58,11 @@ DlgExtrusion::DlgExtrusion(QWidget* parent, Qt::WFlags fl)
|
|||
ui->statusLabel->clear();
|
||||
ui->labelNormal->hide();
|
||||
ui->viewButton->hide();
|
||||
ui->dirX->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->dirY->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->dirZ->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->dirLen->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->taperAngle->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->dirLen->setMinimumWidth(55); // needed to show all digits
|
||||
findShapes();
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@
|
|||
#include "../App/PartFeature.h"
|
||||
#include "../App/FeatureFillet.h"
|
||||
#include "../App/FeatureChamfer.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <App/DocumentObject.h>
|
||||
|
@ -84,6 +85,7 @@ QWidget *FilletRadiusDelegate::createEditor(QWidget *parent, const QStyleOptionV
|
|||
return 0;
|
||||
|
||||
QDoubleSpinBox *editor = new QDoubleSpinBox(parent);
|
||||
editor->setDecimals(Base::UnitsApi::getDecimals());
|
||||
editor->setMinimum(0.0);
|
||||
editor->setMaximum(INT_MAX);
|
||||
editor->setSingleStep(0.1);
|
||||
|
@ -106,7 +108,7 @@ void FilletRadiusDelegate::setModelData(QWidget *editor, QAbstractItemModel *mod
|
|||
spinBox->interpretText();
|
||||
//double value = spinBox->value();
|
||||
//QString value = QString::fromAscii("%1").arg(spinBox->value(),0,'f',2);
|
||||
QString value = QLocale::system().toString(spinBox->value(),'f',2);
|
||||
QString value = QLocale::system().toString(spinBox->value(),'f',Base::UnitsApi::getDecimals());
|
||||
|
||||
model->setData(index, value, Qt::EditRole);
|
||||
}
|
||||
|
@ -197,6 +199,8 @@ DlgFilletEdges::DlgFilletEdges(FilletType type, Part::FilletBase* fillet, QWidge
|
|||
ui->setupUi(this);
|
||||
ui->filletStartRadius->setMaximum(INT_MAX);
|
||||
ui->filletEndRadius->setMaximum(INT_MAX);
|
||||
ui->filletStartRadius->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->filletEndRadius->setDecimals(Base::UnitsApi::getDecimals());
|
||||
|
||||
d->object = 0;
|
||||
d->selection = new EdgeFaceSelection(d->object);
|
||||
|
@ -534,8 +538,8 @@ void DlgFilletEdges::setupFillet(const std::vector<App::DocumentObject*>& objs)
|
|||
if (it != d->edge_ids.end()) {
|
||||
int index = it - d->edge_ids.begin();
|
||||
model->setData(model->index(index, 0), Qt::Checked, Qt::CheckStateRole);
|
||||
model->setData(model->index(index, 1), QVariant(QLocale::system().toString(et->radius1,'f',2)));
|
||||
model->setData(model->index(index, 2), QVariant(QLocale::system().toString(et->radius2,'f',2)));
|
||||
model->setData(model->index(index, 1), QVariant(QLocale::system().toString(et->radius1,'f',Base::UnitsApi::getDecimals())));
|
||||
model->setData(model->index(index, 2), QVariant(QLocale::system().toString(et->radius2,'f',Base::UnitsApi::getDecimals())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -630,8 +634,8 @@ void DlgFilletEdges::on_shapeObject_activated(int index)
|
|||
for (std::vector<int>::iterator it = d->edge_ids.begin(); it != d->edge_ids.end(); ++it) {
|
||||
model->setData(model->index(index, 0), QVariant(tr("Edge%1").arg(*it)));
|
||||
model->setData(model->index(index, 0), QVariant(*it), Qt::UserRole);
|
||||
model->setData(model->index(index, 1), QVariant(QLocale::system().toString(1.0,'f',2)));
|
||||
model->setData(model->index(index, 2), QVariant(QLocale::system().toString(1.0,'f',2)));
|
||||
model->setData(model->index(index, 1), QVariant(QLocale::system().toString(1.0,'f',Base::UnitsApi::getDecimals())));
|
||||
model->setData(model->index(index, 2), QVariant(QLocale::system().toString(1.0,'f',Base::UnitsApi::getDecimals())));
|
||||
std::stringstream element;
|
||||
element << "Edge" << *it;
|
||||
if (Gui::Selection().isSelected(part, element.str().c_str()))
|
||||
|
@ -701,7 +705,7 @@ void DlgFilletEdges::on_filletType_activated(int index)
|
|||
void DlgFilletEdges::on_filletStartRadius_valueChanged(double radius)
|
||||
{
|
||||
QAbstractItemModel* model = ui->treeView->model();
|
||||
QString text = QLocale::system().toString(radius,'f',2);
|
||||
QString text = QLocale::system().toString(radius,'f',Base::UnitsApi::getDecimals());
|
||||
for (int i=0; i<model->rowCount(); ++i) {
|
||||
QVariant value = model->index(i,0).data(Qt::CheckStateRole);
|
||||
Qt::CheckState checkState = static_cast<Qt::CheckState>(value.toInt());
|
||||
|
@ -716,7 +720,7 @@ void DlgFilletEdges::on_filletStartRadius_valueChanged(double radius)
|
|||
void DlgFilletEdges::on_filletEndRadius_valueChanged(double radius)
|
||||
{
|
||||
QAbstractItemModel* model = ui->treeView->model();
|
||||
QString text = QLocale::system().toString(radius,'f',2);
|
||||
QString text = QLocale::system().toString(radius,'f',Base::UnitsApi::getDecimals());
|
||||
for (int i=0; i<model->rowCount(); ++i) {
|
||||
QVariant value = model->index(i,0).data(Qt::CheckStateRole);
|
||||
Qt::CheckState checkState = static_cast<Qt::CheckState>(value.toInt());
|
||||
|
@ -780,7 +784,7 @@ bool DlgFilletEdges::accept()
|
|||
r2 = model->index(i,2).data().toDouble();
|
||||
code += QString::fromAscii(
|
||||
"__fillets__.append((%1,%2,%3))\n")
|
||||
.arg(id).arg(r1,0,'f',2).arg(r2,0,'f',2);
|
||||
.arg(id).arg(r1,0,'f',Base::UnitsApi::getDecimals()).arg(r2,0,'f',Base::UnitsApi::getDecimals());
|
||||
todo = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,6 +39,9 @@ using namespace PartGui;
|
|||
DlgPartCylinderImp::DlgPartCylinderImp(QWidget* parent, Qt::WFlags fl)
|
||||
: Gui::LocationInterface<Ui_DlgPartCylinder>(parent, fl)
|
||||
{
|
||||
QList<QDoubleSpinBox*> list = this->findChildren<QDoubleSpinBox*>();
|
||||
for (QList<QDoubleSpinBox*>::iterator it = list.begin(); it != list.end(); ++it)
|
||||
(*it)->setDecimals(Base::UnitsApi::getDecimals());
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -260,6 +260,10 @@ DlgPrimitives::DlgPrimitives(QWidget* parent)
|
|||
ui.edgeZ2->setMaximum(INT_MAX);
|
||||
ui.edgeZ2->setMinimum(INT_MIN);
|
||||
// RegularPolygon
|
||||
|
||||
QList<QDoubleSpinBox*> list = this->findChildren<QDoubleSpinBox*>();
|
||||
for (QList<QDoubleSpinBox*>::iterator it = list.begin(); it != list.end(); ++it)
|
||||
(*it)->setDecimals(Base::UnitsApi::getDecimals());
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -660,6 +664,9 @@ void DlgPrimitives::createPrimitive(const QString& placement)
|
|||
Location::Location(QWidget* parent)
|
||||
{
|
||||
ui.setupUi(this);
|
||||
QList<QDoubleSpinBox*> list = this->findChildren<QDoubleSpinBox*>();
|
||||
for (QList<QDoubleSpinBox*>::iterator it = list.begin(); it != list.end(); ++it)
|
||||
(*it)->setDecimals(Base::UnitsApi::getDecimals());
|
||||
}
|
||||
|
||||
Location::~Location()
|
||||
|
|
|
@ -100,6 +100,10 @@ DlgRevolution::DlgRevolution(QWidget* parent, Qt::WFlags fl)
|
|||
ui->xPos->setRange(-DBL_MAX,DBL_MAX);
|
||||
ui->yPos->setRange(-DBL_MAX,DBL_MAX);
|
||||
ui->zPos->setRange(-DBL_MAX,DBL_MAX);
|
||||
ui->xPos->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->yPos->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->zPos->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->angle->setDecimals(Base::UnitsApi::getDecimals());
|
||||
findShapes();
|
||||
|
||||
Gui::ItemViewSelection sel(ui->treeWidget);
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "ui_Mirroring.h"
|
||||
#include "../App/PartFeature.h"
|
||||
#include <Base/Exception.h>
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <App/DocumentObject.h>
|
||||
|
@ -59,6 +60,9 @@ Mirroring::Mirroring(QWidget* parent)
|
|||
ui->baseX->setRange(-DBL_MAX, DBL_MAX);
|
||||
ui->baseY->setRange(-DBL_MAX, DBL_MAX);
|
||||
ui->baseZ->setRange(-DBL_MAX, DBL_MAX);
|
||||
ui->baseX->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->baseY->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->baseZ->setDecimals(Base::UnitsApi::getDecimals());
|
||||
findShapes();
|
||||
|
||||
Gui::ItemViewSelection sel(ui->shapes);
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
|
||||
#include <Base/Console.h>
|
||||
#include <Base/Interpreter.h>
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <App/DocumentObject.h>
|
||||
|
@ -72,6 +73,7 @@ OffsetWidget::OffsetWidget(Part::Offset* offset, QWidget* parent)
|
|||
|
||||
d->offset = offset;
|
||||
d->ui.setupUi(this);
|
||||
d->ui.spinOffset->setDecimals(Base::UnitsApi::getDecimals());
|
||||
d->ui.spinOffset->setRange(-INT_MAX, INT_MAX);
|
||||
d->ui.spinOffset->setSingleStep(0.1);
|
||||
d->ui.spinOffset->setValue(d->offset->Value.getValue());
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <Gui/ViewProvider.h>
|
||||
#include <Gui/WaitCursor.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/Command.h>
|
||||
#include <Mod/PartDesign/App/FeatureChamfer.h>
|
||||
|
@ -64,6 +65,7 @@ TaskChamferParameters::TaskChamferParameters(ViewProviderChamfer *ChamferView,QW
|
|||
PartDesign::Chamfer* pcChamfer = static_cast<PartDesign::Chamfer*>(ChamferView->getObject());
|
||||
double r = pcChamfer->Size.getValue();
|
||||
|
||||
ui->doubleSpinBox->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->doubleSpinBox->setMaximum(INT_MAX);
|
||||
ui->doubleSpinBox->setValue(r);
|
||||
ui->doubleSpinBox->selectAll();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "ui_TaskDraftParameters.h"
|
||||
#include "TaskDraftParameters.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <Gui/Application.h>
|
||||
|
@ -77,6 +78,7 @@ TaskDraftParameters::TaskDraftParameters(ViewProviderDraft *DraftView,QWidget *p
|
|||
PartDesign::Draft* pcDraft = static_cast<PartDesign::Draft*>(DraftView->getObject());
|
||||
double a = pcDraft->Angle.getValue();
|
||||
|
||||
ui->doubleSpinBox->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->doubleSpinBox->setMinimum(0.0);
|
||||
ui->doubleSpinBox->setMaximum(89.99);
|
||||
ui->doubleSpinBox->setValue(a);
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "ui_TaskFilletParameters.h"
|
||||
#include "TaskFilletParameters.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <Gui/Application.h>
|
||||
|
@ -64,6 +65,7 @@ TaskFilletParameters::TaskFilletParameters(ViewProviderFillet *FilletView,QWidge
|
|||
PartDesign::Fillet* pcFillet = static_cast<PartDesign::Fillet*>(FilletView->getObject());
|
||||
double r = pcFillet->Radius.getValue();
|
||||
|
||||
ui->doubleSpinBox->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->doubleSpinBox->setMaximum(INT_MAX);
|
||||
ui->doubleSpinBox->setValue(r);
|
||||
ui->doubleSpinBox->selectAll();
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "ui_TaskGrooveParameters.h"
|
||||
#include "TaskGrooveParameters.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <Gui/Application.h>
|
||||
|
@ -80,6 +81,7 @@ TaskGrooveParameters::TaskGrooveParameters(ViewProviderGroove *GrooveView,QWidge
|
|||
bool mirrored = pcGroove->Midplane.getValue();
|
||||
bool reversed = pcGroove->Reversed.getValue();
|
||||
|
||||
ui->doubleSpinBox->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->doubleSpinBox->setValue(l);
|
||||
|
||||
int count=pcGroove->getSketchAxisCount();
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <Gui/ViewProvider.h>
|
||||
#include <Gui/WaitCursor.h>
|
||||
#include <Base/Console.h>
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <Gui/Selection.h>
|
||||
#include <Gui/Command.h>
|
||||
|
||||
|
@ -50,6 +51,7 @@ TaskHoleParameters::TaskHoleParameters(QWidget *parent)
|
|||
proxy = new QWidget(this);
|
||||
ui = new Ui_TaskHoleParameters();
|
||||
ui->setupUi(proxy);
|
||||
ui->doubleSpinBox->setDecimals(Base::UnitsApi::getDecimals());
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "ui_TaskLinearPatternParameters.h"
|
||||
#include "TaskLinearPatternParameters.h"
|
||||
#include "TaskMultiTransformParameters.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <Gui/Application.h>
|
||||
|
@ -130,6 +131,7 @@ void TaskLinearPatternParameters::setupUI()
|
|||
ui->checkReverse->setEnabled(true);
|
||||
ui->spinLength->setEnabled(true);
|
||||
ui->spinOccurrences->setEnabled(true);
|
||||
ui->spinLength->setDecimals(Base::UnitsApi::getDecimals());
|
||||
updateUI();
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
#include "ui_TaskPocketParameters.h"
|
||||
#include "TaskPocketParameters.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <Gui/Application.h>
|
||||
|
@ -61,12 +62,14 @@ TaskPocketParameters::TaskPocketParameters(ViewProviderPocket *PocketView,QWidge
|
|||
ui->setupUi(proxy);
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
|
||||
ui->doubleSpinBox->setDecimals(Base::UnitsApi::getDecimals());
|
||||
|
||||
connect(ui->doubleSpinBox, SIGNAL(valueChanged(double)),
|
||||
this, SLOT(onLengthChanged(double)));
|
||||
connect(ui->checkBoxMidplane, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onMidplaneChanged(bool)));
|
||||
connect(ui->checkBoxReversed, SIGNAL(toggled(bool)),
|
||||
this, SLOT(onReversedChanged(bool)));
|
||||
this, SLOT(onReversedChanged(bool)));
|
||||
connect(ui->changeMode, SIGNAL(currentIndexChanged(int)),
|
||||
this, SLOT(onModeChanged(int)));
|
||||
connect(ui->buttonFace, SIGNAL(pressed()),
|
||||
|
@ -146,13 +149,13 @@ void TaskPocketParameters::updateUI(int index)
|
|||
ui->doubleSpinBox->selectAll();
|
||||
QMetaObject::invokeMethod(ui->doubleSpinBox, "setFocus", Qt::QueuedConnection);
|
||||
ui->checkBoxMidplane->setEnabled(true);
|
||||
ui->checkBoxReversed->setEnabled(!ui->checkBoxMidplane->isChecked()); // Will flip direction of dimension
|
||||
ui->checkBoxReversed->setEnabled(!ui->checkBoxMidplane->isChecked()); // Will flip direction of dimension
|
||||
ui->buttonFace->setEnabled(false);
|
||||
ui->lineFaceName->setEnabled(false);
|
||||
onButtonFace(false);
|
||||
} else if (index == 1) { // Through all
|
||||
ui->checkBoxMidplane->setEnabled(true);
|
||||
ui->checkBoxReversed->setEnabled(!ui->checkBoxMidplane->isChecked()); // Will flip direction of through all
|
||||
ui->checkBoxReversed->setEnabled(!ui->checkBoxMidplane->isChecked()); // Will flip direction of through all
|
||||
ui->doubleSpinBox->setEnabled(false);
|
||||
ui->buttonFace->setEnabled(false);
|
||||
ui->lineFaceName->setEnabled(false);
|
||||
|
@ -160,7 +163,7 @@ void TaskPocketParameters::updateUI(int index)
|
|||
} else if (index == 2) { // Neither value nor face required // To First
|
||||
ui->doubleSpinBox->setEnabled(false);
|
||||
ui->checkBoxMidplane->setEnabled(false); // Can't have a midplane to a single face
|
||||
ui->checkBoxReversed->setEnabled(false); // Will change the direction it seeks for its first face?
|
||||
ui->checkBoxReversed->setEnabled(false); // Will change the direction it seeks for its first face?
|
||||
// Doesnt work so is currently disabled. Fix probably lies
|
||||
// somwhere in IF block on line 125 of FeaturePocket.cpp
|
||||
ui->buttonFace->setEnabled(false);
|
||||
|
@ -169,7 +172,7 @@ void TaskPocketParameters::updateUI(int index)
|
|||
} else if (index == 3) { // Only this option requires to select a face // Up to face
|
||||
ui->doubleSpinBox->setEnabled(false);
|
||||
ui->checkBoxMidplane->setEnabled(false);
|
||||
ui->checkBoxReversed->setEnabled(false); // No need for reverse since user-chosen face will dtermine direction
|
||||
ui->checkBoxReversed->setEnabled(false); // No need for reverse since user-chosen face will dtermine direction
|
||||
ui->buttonFace->setEnabled(true);
|
||||
ui->lineFaceName->setEnabled(true);
|
||||
QMetaObject::invokeMethod(ui->lineFaceName, "setFocus", Qt::QueuedConnection);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "ui_TaskPolarPatternParameters.h"
|
||||
#include "TaskPolarPatternParameters.h"
|
||||
#include "TaskMultiTransformParameters.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <Gui/Application.h>
|
||||
|
@ -130,6 +131,7 @@ void TaskPolarPatternParameters::setupUI()
|
|||
ui->checkReverse->setEnabled(true);
|
||||
ui->spinAngle->setEnabled(true);
|
||||
ui->spinOccurrences->setEnabled(true);
|
||||
ui->spinAngle->setDecimals(Base::UnitsApi::getDecimals());
|
||||
updateUI();
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "ui_TaskRevolutionParameters.h"
|
||||
#include "TaskRevolutionParameters.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <Gui/Application.h>
|
||||
|
@ -80,6 +81,7 @@ TaskRevolutionParameters::TaskRevolutionParameters(ViewProviderRevolution *Revol
|
|||
bool mirrored = pcRevolution->Midplane.getValue();
|
||||
bool reversed = pcRevolution->Reversed.getValue();
|
||||
|
||||
ui->doubleSpinBox->setDecimals(Base::UnitsApi::getDecimals());
|
||||
ui->doubleSpinBox->setValue(l);
|
||||
|
||||
int count=pcRevolution->getSketchAxisCount();
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "ui_TaskScaledParameters.h"
|
||||
#include "TaskScaledParameters.h"
|
||||
#include "TaskMultiTransformParameters.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
#include <App/Application.h>
|
||||
#include <App/Document.h>
|
||||
#include <Gui/Application.h>
|
||||
|
@ -113,6 +114,7 @@ void TaskScaledParameters::setupUI()
|
|||
|
||||
ui->spinFactor->setEnabled(true);
|
||||
ui->spinOccurrences->setEnabled(true);
|
||||
ui->spinFactor->setDecimals(Base::UnitsApi::getDecimals());
|
||||
|
||||
updateUI();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user