+ use quantity boxes in location widget
This commit is contained in:
parent
d9e47e5896
commit
dd3d30a4da
|
@ -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)
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <cfloat>
|
||||
#include <QDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QApplication>
|
||||
#include <QApplication>
|
||||
|
||||
#include <Gui/propertyeditor/PropertyItem.h>
|
||||
|
||||
|
@ -36,6 +36,7 @@ class QDoubleSpinBox;
|
|||
class QComboBox;
|
||||
|
||||
namespace Gui {
|
||||
class QuantitySpinBox;
|
||||
|
||||
class GuiExport LocationWidget : public QWidget
|
||||
{
|
||||
|
@ -65,9 +66,9 @@ private:
|
|||
QLabel *yLabel;
|
||||
QLabel *zLabel;
|
||||
QLabel *dLabel;
|
||||
QDoubleSpinBox *xValue;
|
||||
QDoubleSpinBox *yValue;
|
||||
QDoubleSpinBox *zValue;
|
||||
QuantitySpinBox *xValue;
|
||||
QuantitySpinBox *yValue;
|
||||
QuantitySpinBox *zValue;
|
||||
QComboBox *dValue;
|
||||
};
|
||||
|
||||
|
@ -155,9 +156,9 @@ public:
|
|||
|
||||
Base::Vector3d getPosition() const
|
||||
{
|
||||
return Base::Vector3d(this->xPos->value(),
|
||||
this->yPos->value(),
|
||||
this->zPos->value());
|
||||
return Base::Vector3d(this->xPos->value().getValue(),
|
||||
this->yPos->value().getValue(),
|
||||
this->zPos->value().getValue());
|
||||
}
|
||||
|
||||
Base::Vector3d getDirection() const
|
||||
|
@ -284,9 +285,9 @@ public:
|
|||
|
||||
Base::Vector3d getPosition() const
|
||||
{
|
||||
return Base::Vector3d(this->xPos->value(),
|
||||
this->yPos->value(),
|
||||
this->zPos->value());
|
||||
return Base::Vector3d(this->xPos->value().getValue(),
|
||||
this->yPos->value().getValue(),
|
||||
this->zPos->value().getValue());
|
||||
}
|
||||
|
||||
Base::Vector3d getDirection() const
|
||||
|
|
Loading…
Reference in New Issue
Block a user