+ use quantity boxes in location widget
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "InputVector.h"
|
||||
#include "ui_InputVector.h"
|
||||
#include "QuantitySpinBox.h"
|
||||
#include <Base/UnitsApi.h>
|
||||
|
||||
using namespace Gui;
|
||||
@@ -37,21 +38,21 @@ LocationWidget::LocationWidget (QWidget * parent)
|
||||
{
|
||||
box = new QGridLayout();
|
||||
|
||||
xValue = new QDoubleSpinBox(this);
|
||||
xValue = new QuantitySpinBox(this);
|
||||
xValue->setMinimum(-2.14748e+09);
|
||||
xValue->setMaximum(2.14748e+09);
|
||||
xLabel = new QLabel(this);
|
||||
box->addWidget(xLabel, 0, 0, 1, 1);
|
||||
box->addWidget(xValue, 0, 1, 1, 1);
|
||||
|
||||
yValue = new QDoubleSpinBox(this);
|
||||
yValue = new QuantitySpinBox(this);
|
||||
yValue->setMinimum(-2.14748e+09);
|
||||
yValue->setMaximum(2.14748e+09);
|
||||
yLabel = new QLabel(this);
|
||||
box->addWidget(yLabel, 1, 0, 1, 1);
|
||||
box->addWidget(yValue, 1, 1, 1, 1);
|
||||
|
||||
zValue = new QDoubleSpinBox(this);
|
||||
zValue = new QuantitySpinBox(this);
|
||||
zValue->setMinimum(-2.14748e+09);
|
||||
zValue->setMaximum(2.14748e+09);
|
||||
zLabel = new QLabel(this);
|
||||
@@ -64,9 +65,9 @@ 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());
|
||||
xValue->setUnit(Base::Unit::Length);
|
||||
yValue->setUnit(Base::Unit::Length);
|
||||
zValue->setUnit(Base::Unit::Length);
|
||||
|
||||
QGridLayout* gridLayout = new QGridLayout(this);
|
||||
gridLayout->addLayout(box, 0, 0, 1, 2);
|
||||
@@ -122,13 +123,13 @@ void LocationWidget::retranslateUi()
|
||||
dValue->setItemText(dValue->count()-1,
|
||||
QApplication::translate("Gui::LocationDialog", "User defined..."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Base::Vector3d LocationWidget::getPosition() const
|
||||
{
|
||||
return Base::Vector3d(this->xValue->value(),
|
||||
this->yValue->value(),
|
||||
this->zValue->value());
|
||||
return Base::Vector3d(this->xValue->value().getValue(),
|
||||
this->yValue->value().getValue(),
|
||||
this->zValue->value().getValue());
|
||||
}
|
||||
|
||||
void LocationWidget::setPosition(const Base::Vector3d& v)
|
||||
|
||||
Reference in New Issue
Block a user