+ use quantity boxes in location widget
This commit is contained in:
parent
d9e47e5896
commit
dd3d30a4da
|
@ -28,6 +28,7 @@
|
||||||
|
|
||||||
#include "InputVector.h"
|
#include "InputVector.h"
|
||||||
#include "ui_InputVector.h"
|
#include "ui_InputVector.h"
|
||||||
|
#include "QuantitySpinBox.h"
|
||||||
#include <Base/UnitsApi.h>
|
#include <Base/UnitsApi.h>
|
||||||
|
|
||||||
using namespace Gui;
|
using namespace Gui;
|
||||||
|
@ -37,21 +38,21 @@ LocationWidget::LocationWidget (QWidget * parent)
|
||||||
{
|
{
|
||||||
box = new QGridLayout();
|
box = new QGridLayout();
|
||||||
|
|
||||||
xValue = new QDoubleSpinBox(this);
|
xValue = new QuantitySpinBox(this);
|
||||||
xValue->setMinimum(-2.14748e+09);
|
xValue->setMinimum(-2.14748e+09);
|
||||||
xValue->setMaximum(2.14748e+09);
|
xValue->setMaximum(2.14748e+09);
|
||||||
xLabel = new QLabel(this);
|
xLabel = new QLabel(this);
|
||||||
box->addWidget(xLabel, 0, 0, 1, 1);
|
box->addWidget(xLabel, 0, 0, 1, 1);
|
||||||
box->addWidget(xValue, 0, 1, 1, 1);
|
box->addWidget(xValue, 0, 1, 1, 1);
|
||||||
|
|
||||||
yValue = new QDoubleSpinBox(this);
|
yValue = new QuantitySpinBox(this);
|
||||||
yValue->setMinimum(-2.14748e+09);
|
yValue->setMinimum(-2.14748e+09);
|
||||||
yValue->setMaximum(2.14748e+09);
|
yValue->setMaximum(2.14748e+09);
|
||||||
yLabel = new QLabel(this);
|
yLabel = new QLabel(this);
|
||||||
box->addWidget(yLabel, 1, 0, 1, 1);
|
box->addWidget(yLabel, 1, 0, 1, 1);
|
||||||
box->addWidget(yValue, 1, 1, 1, 1);
|
box->addWidget(yValue, 1, 1, 1, 1);
|
||||||
|
|
||||||
zValue = new QDoubleSpinBox(this);
|
zValue = new QuantitySpinBox(this);
|
||||||
zValue->setMinimum(-2.14748e+09);
|
zValue->setMinimum(-2.14748e+09);
|
||||||
zValue->setMaximum(2.14748e+09);
|
zValue->setMaximum(2.14748e+09);
|
||||||
zLabel = new QLabel(this);
|
zLabel = new QLabel(this);
|
||||||
|
@ -64,9 +65,9 @@ LocationWidget::LocationWidget (QWidget * parent)
|
||||||
box->addWidget(dLabel, 3, 0, 1, 1);
|
box->addWidget(dLabel, 3, 0, 1, 1);
|
||||||
box->addWidget(dValue, 3, 1, 1, 1);
|
box->addWidget(dValue, 3, 1, 1, 1);
|
||||||
|
|
||||||
xValue->setDecimals(Base::UnitsApi::getDecimals());
|
xValue->setUnit(Base::Unit::Length);
|
||||||
yValue->setDecimals(Base::UnitsApi::getDecimals());
|
yValue->setUnit(Base::Unit::Length);
|
||||||
zValue->setDecimals(Base::UnitsApi::getDecimals());
|
zValue->setUnit(Base::Unit::Length);
|
||||||
|
|
||||||
QGridLayout* gridLayout = new QGridLayout(this);
|
QGridLayout* gridLayout = new QGridLayout(this);
|
||||||
gridLayout->addLayout(box, 0, 0, 1, 2);
|
gridLayout->addLayout(box, 0, 0, 1, 2);
|
||||||
|
@ -122,13 +123,13 @@ void LocationWidget::retranslateUi()
|
||||||
dValue->setItemText(dValue->count()-1,
|
dValue->setItemText(dValue->count()-1,
|
||||||
QApplication::translate("Gui::LocationDialog", "User defined..."));
|
QApplication::translate("Gui::LocationDialog", "User defined..."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Base::Vector3d LocationWidget::getPosition() const
|
Base::Vector3d LocationWidget::getPosition() const
|
||||||
{
|
{
|
||||||
return Base::Vector3d(this->xValue->value(),
|
return Base::Vector3d(this->xValue->value().getValue(),
|
||||||
this->yValue->value(),
|
this->yValue->value().getValue(),
|
||||||
this->zValue->value());
|
this->zValue->value().getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationWidget::setPosition(const Base::Vector3d& v)
|
void LocationWidget::setPosition(const Base::Vector3d& v)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
#include <Gui/propertyeditor/PropertyItem.h>
|
#include <Gui/propertyeditor/PropertyItem.h>
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ class QDoubleSpinBox;
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
|
|
||||||
namespace Gui {
|
namespace Gui {
|
||||||
|
class QuantitySpinBox;
|
||||||
|
|
||||||
class GuiExport LocationWidget : public QWidget
|
class GuiExport LocationWidget : public QWidget
|
||||||
{
|
{
|
||||||
|
@ -65,9 +66,9 @@ private:
|
||||||
QLabel *yLabel;
|
QLabel *yLabel;
|
||||||
QLabel *zLabel;
|
QLabel *zLabel;
|
||||||
QLabel *dLabel;
|
QLabel *dLabel;
|
||||||
QDoubleSpinBox *xValue;
|
QuantitySpinBox *xValue;
|
||||||
QDoubleSpinBox *yValue;
|
QuantitySpinBox *yValue;
|
||||||
QDoubleSpinBox *zValue;
|
QuantitySpinBox *zValue;
|
||||||
QComboBox *dValue;
|
QComboBox *dValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -155,9 +156,9 @@ public:
|
||||||
|
|
||||||
Base::Vector3d getPosition() const
|
Base::Vector3d getPosition() const
|
||||||
{
|
{
|
||||||
return Base::Vector3d(this->xPos->value(),
|
return Base::Vector3d(this->xPos->value().getValue(),
|
||||||
this->yPos->value(),
|
this->yPos->value().getValue(),
|
||||||
this->zPos->value());
|
this->zPos->value().getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
Base::Vector3d getDirection() const
|
Base::Vector3d getDirection() const
|
||||||
|
@ -284,9 +285,9 @@ public:
|
||||||
|
|
||||||
Base::Vector3d getPosition() const
|
Base::Vector3d getPosition() const
|
||||||
{
|
{
|
||||||
return Base::Vector3d(this->xPos->value(),
|
return Base::Vector3d(this->xPos->value().getValue(),
|
||||||
this->yPos->value(),
|
this->yPos->value().getValue(),
|
||||||
this->zPos->value());
|
this->zPos->value().getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
Base::Vector3d getDirection() const
|
Base::Vector3d getDirection() const
|
||||||
|
|
Loading…
Reference in New Issue
Block a user