From 406d32aebb856a8882f9ff5987894a25cca36cc9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 31 Jul 2014 15:14:27 +0200 Subject: [PATCH] + Replace InputField with QuantitySpinBox --- src/Gui/Placement.cpp | 73 ++-- src/Gui/Placement.h | 2 +- src/Gui/Placement.ui | 26 +- src/Gui/Transform.cpp | 20 +- src/Gui/propertyeditor/PropertyItem.cpp | 12 +- src/Mod/Part/Gui/DlgPrimitives.cpp | 127 +++--- src/Mod/Part/Gui/DlgPrimitives.ui | 555 ++++++++++++++++-------- 7 files changed, 498 insertions(+), 317 deletions(-) diff --git a/src/Gui/Placement.cpp b/src/Gui/Placement.cpp index f7ba38216..1443f62bf 100644 --- a/src/Gui/Placement.cpp +++ b/src/Gui/Placement.cpp @@ -100,8 +100,8 @@ Placement::Placement(QWidget* parent, Qt::WFlags fl) signalMapper->setMapping(this, 0); int id = 1; - QList sb = this->findChildren(); - for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { + QList sb = this->findChildren(); + for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { connect(*it, SIGNAL(valueChanged(double)), signalMapper, SLOT(map())); signalMapper->setMapping(*it, id++); } @@ -132,14 +132,14 @@ void Placement::slotActiveDocument(const Gui::Document& doc) documents.insert(doc.getDocument()->getName()); } -bool Placement::hasValidInputs() const +QWidget* Placement::getInvalidInput() const { - QList sb = this->findChildren(); - for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { + QList sb = this->findChildren(); + for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { if (!(*it)->hasValidInput()) - return false; + return (*it); } - return true; + return 0; } void Placement::revertTransformation() @@ -302,8 +302,11 @@ void Placement::on_applyButton_clicked() bool Placement::onApply() { //only process things when we have valid inputs! - if (!hasValidInputs()) { - QMessageBox msg; + QWidget* input = getInvalidInput(); + if (input) { + input->setFocus(); + QMessageBox msg(this); + msg.setWindowTitle(tr("Incorrect quantity")); msg.setIcon(QMessageBox::Critical); msg.setText(tr("There are input fields with incorrect input, please ensure valid placement values!")); msg.exec(); @@ -322,8 +325,8 @@ bool Placement::onApply() /*emit*/ placementChanged(data, incr, true); if (ui->applyIncrementalPlacement->isChecked()) { - QList sb = this->findChildren(); - for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { + QList sb = this->findChildren(); + for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { (*it)->blockSignals(true); (*it)->setValue(0); (*it)->blockSignals(false); @@ -335,8 +338,8 @@ bool Placement::onApply() void Placement::on_resetButton_clicked() { - QList sb = this->findChildren(); - for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { + QList sb = this->findChildren(); + for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { (*it)->blockSignals(true); (*it)->setValue(0); (*it)->blockSignals(false); @@ -420,18 +423,18 @@ Base::Placement Placement::getPlacementData() const Base::Vector3d pos; Base::Vector3d cnt; - pos = Base::Vector3d(ui->xPos->getQuantity().getValue(),ui->yPos->getQuantity().getValue(),ui->zPos->getQuantity().getValue()); - cnt = Base::Vector3d(ui->xCnt->getQuantity().getValue(),ui->yCnt->getQuantity().getValue(),ui->zCnt->getQuantity().getValue()); + pos = Base::Vector3d(ui->xPos->value().getValue(),ui->yPos->value().getValue(),ui->zPos->value().getValue()); + cnt = Base::Vector3d(ui->xCnt->value().getValue(),ui->yCnt->value().getValue(),ui->zCnt->value().getValue()); if (index == 0) { Base::Vector3d dir = getDirection(); - rot.setValue(Base::Vector3d(dir.x,dir.y,dir.z),Base::toRadians(ui->angle->getQuantity().getValue())); + rot.setValue(Base::Vector3d(dir.x,dir.y,dir.z),Base::toRadians(ui->angle->value().getValue())); } else if (index == 1) { rot.setYawPitchRoll( - ui->yawAngle->getQuantity().getValue(), - ui->pitchAngle->getQuantity().getValue(), - ui->rollAngle->getQuantity().getValue()); + ui->yawAngle->value().getValue(), + ui->pitchAngle->value().getValue(), + ui->rollAngle->value().getValue()); } Base::Placement p(pos, rot, cnt); @@ -447,29 +450,29 @@ QString Placement::getPlacementString() const Base::Vector3d dir = getDirection(); cmd = QString::fromAscii( "App.Placement(App.Vector(%1,%2,%3), App.Rotation(App.Vector(%4,%5,%6),%7), App.Vector(%8,%9,%10))") - .arg(ui->xPos->getQuantity().getValue()) - .arg(ui->yPos->getQuantity().getValue()) - .arg(ui->zPos->getQuantity().getValue()) + .arg(ui->xPos->value().getValue()) + .arg(ui->yPos->value().getValue()) + .arg(ui->zPos->value().getValue()) .arg(dir.x) .arg(dir.y) .arg(dir.z) - .arg(ui->angle->getQuantity().getValue()) - .arg(ui->xCnt->getQuantity().getValue()) - .arg(ui->yCnt->getQuantity().getValue()) - .arg(ui->zCnt->getQuantity().getValue()); + .arg(ui->angle->value().getValue()) + .arg(ui->xCnt->value().getValue()) + .arg(ui->yCnt->value().getValue()) + .arg(ui->zCnt->value().getValue()); } else if (index == 1) { cmd = QString::fromAscii( "App.Placement(App.Vector(%1,%2,%3), App.Rotation(%4,%5,%6), App.Vector(%7,%8,%9))") - .arg(ui->xPos->getQuantity().getValue()) - .arg(ui->yPos->getQuantity().getValue()) - .arg(ui->zPos->getQuantity().getValue()) - .arg(ui->yawAngle->getQuantity().getValue()) - .arg(ui->pitchAngle->getQuantity().getValue()) - .arg(ui->rollAngle->getQuantity().getValue()) - .arg(ui->xCnt->getQuantity().getValue()) - .arg(ui->yCnt->getQuantity().getValue()) - .arg(ui->zCnt->getQuantity().getValue()); + .arg(ui->xPos->value().getValue()) + .arg(ui->yPos->value().getValue()) + .arg(ui->zPos->value().getValue()) + .arg(ui->yawAngle->value().getValue()) + .arg(ui->pitchAngle->value().getValue()) + .arg(ui->rollAngle->value().getValue()) + .arg(ui->xCnt->value().getValue()) + .arg(ui->yCnt->value().getValue()) + .arg(ui->zCnt->value().getValue()); } return cmd; diff --git a/src/Gui/Placement.h b/src/Gui/Placement.h index a6c7965b6..fd1491977 100644 --- a/src/Gui/Placement.h +++ b/src/Gui/Placement.h @@ -74,7 +74,7 @@ private: void applyPlacement(const QString& p, bool incremental); void revertTransformation(); void slotActiveDocument(const Gui::Document&); - bool hasValidInputs() const; + QWidget* getInvalidInput() const; Q_SIGNALS: void placementChanged(const QVariant &, bool, bool); diff --git a/src/Gui/Placement.ui b/src/Gui/Placement.ui index 5c0e94a2c..7fc72b04f 100644 --- a/src/Gui/Placement.ui +++ b/src/Gui/Placement.ui @@ -85,13 +85,13 @@ - + - + - + @@ -161,13 +161,13 @@ - + - + - + @@ -239,7 +239,7 @@ - + @@ -301,13 +301,13 @@ - + - + - + @@ -439,9 +439,9 @@ - Gui::InputField - QLineEdit -
Gui/InputField.h
+ Gui::QuantitySpinBox + QWidget +
Gui/QuantitySpinBox.h
diff --git a/src/Gui/Transform.cpp b/src/Gui/Transform.cpp index 8d6b55a00..3796c427f 100644 --- a/src/Gui/Transform.cpp +++ b/src/Gui/Transform.cpp @@ -318,8 +318,8 @@ Transform::Transform(QWidget* parent, Qt::WFlags fl) signalMapper->setMapping(this, 0); int id = 1; - QList sb = this->findChildren(); - for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { + QList sb = this->findChildren(); + for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { connect(*it, SIGNAL(valueChanged(double)), signalMapper, SLOT(map())); signalMapper->setMapping(*it, id++); } @@ -383,8 +383,8 @@ void Transform::on_applyButton_clicked() strategy->commitTransform(mat); // nullify the values - QList sb = this->findChildren(); - for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { + QList sb = this->findChildren(); + for (QList::iterator it = sb.begin(); it != sb.end(); ++it) { (*it)->blockSignals(true); (*it)->setValue(0.0); (*it)->blockSignals(false); @@ -415,18 +415,18 @@ Base::Placement Transform::getPlacementData() const Base::Vector3d pos; Base::Vector3d cnt; - pos = Base::Vector3d(ui->xPos->getQuantity().getValue(),ui->yPos->getQuantity().getValue(),ui->zPos->getQuantity().getValue()); - cnt = Base::Vector3d(ui->xCnt->getQuantity().getValue(),ui->yCnt->getQuantity().getValue(),ui->zCnt->getQuantity().getValue()); + pos = Base::Vector3d(ui->xPos->value().getValue(),ui->yPos->value().getValue(),ui->zPos->value().getValue()); + cnt = Base::Vector3d(ui->xCnt->value().getValue(),ui->yCnt->value().getValue(),ui->zCnt->value().getValue()); if (index == 0) { Base::Vector3d dir = getDirection(); - rot.setValue(Base::Vector3d(dir.x,dir.y,dir.z),ui->angle->getQuantity().getValue()*D_PI/180.0); + rot.setValue(Base::Vector3d(dir.x,dir.y,dir.z),ui->angle->value().getValue()*D_PI/180.0); } else if (index == 1) { rot.setYawPitchRoll( - ui->yawAngle->getQuantity().getValue(), - ui->pitchAngle->getQuantity().getValue(), - ui->rollAngle->getQuantity().getValue()); + ui->yawAngle->value().getValue(), + ui->pitchAngle->value().getValue(), + ui->rollAngle->value().getValue()); } Base::Placement p(pos, rot, cnt); diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 7fbe75703..ad9c621e4 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include "PropertyItem.h" @@ -625,7 +625,7 @@ void PropertyUnitItem::setValue(const QVariant& value) QWidget* PropertyUnitItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const { - Gui::InputField *infield = new Gui::InputField(parent); + Gui::QuantitySpinBox *infield = new Gui::QuantitySpinBox(parent); infield->setFrame(false); infield->setMinimumHeight(0); QObject::connect(infield, SIGNAL(valueChanged(double)), receiver, method); @@ -636,14 +636,14 @@ void PropertyUnitItem::setEditorData(QWidget *editor, const QVariant& data) cons { const Base::Quantity& value = data.value(); - Gui::InputField *infield = qobject_cast(editor); + Gui::QuantitySpinBox *infield = qobject_cast(editor); infield->setValue(value); } QVariant PropertyUnitItem::editorData(QWidget *editor) const { - Gui::InputField *infield = qobject_cast(editor); - Base::Quantity value = infield->getQuantity(); + Gui::QuantitySpinBox *infield = qobject_cast(editor); + Base::Quantity value = infield->value(); return QVariant::fromValue(value); } @@ -661,7 +661,7 @@ void PropertyUnitConstraintItem::setEditorData(QWidget *editor, const QVariant& { const Base::Quantity& value = data.value(); - Gui::InputField *infield = qobject_cast(editor); + Gui::QuantitySpinBox *infield = qobject_cast(editor); infield->setValue(value); const std::vector& items = getPropertyData(); diff --git a/src/Mod/Part/Gui/DlgPrimitives.cpp b/src/Mod/Part/Gui/DlgPrimitives.cpp index afd7ed0a7..7abc96570 100644 --- a/src/Mod/Part/Gui/DlgPrimitives.cpp +++ b/src/Mod/Part/Gui/DlgPrimitives.cpp @@ -260,11 +260,6 @@ DlgPrimitives::DlgPrimitives(QWidget* parent) ui.edgeZ2->setMaximum(INT_MAX); ui.edgeZ2->setMinimum(INT_MIN); // RegularPolygon - - QList list = this->findChildren(); - for (QList::iterator it = list.begin(); it != list.end(); ++it) { - (*it)->setValue((*it)->getQuantity()); - } } /* @@ -361,8 +356,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%4\n" "App.ActiveDocument.%1.Label='%5'\n") .arg(name) - .arg(ui.planeLength->getQuantity().getValue(),0,'f',2) - .arg(ui.planeWidth->getQuantity().getValue(),0,'f',2) + .arg(ui.planeLength->value().getValue(),0,'f',2) + .arg(ui.planeWidth->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Plane")); } @@ -376,9 +371,9 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%5\n" "App.ActiveDocument.%1.Label='%6'\n") .arg(name) - .arg(ui.boxLength->getQuantity().getValue(),0,'f',2) - .arg(ui.boxWidth->getQuantity().getValue(),0,'f',2) - .arg(ui.boxHeight->getQuantity().getValue(),0,'f',2) + .arg(ui.boxLength->value().getValue(),0,'f',2) + .arg(ui.boxWidth->value().getValue(),0,'f',2) + .arg(ui.boxHeight->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Box")); } @@ -392,9 +387,9 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%5\n" "App.ActiveDocument.%1.Label='%6'\n") .arg(name) - .arg(ui.cylinderRadius->getQuantity().getValue(),0,'f',2) - .arg(ui.cylinderHeight->getQuantity().getValue(),0,'f',2) - .arg(ui.cylinderAngle->getQuantity().getValue(),0,'f',2) + .arg(ui.cylinderRadius->value().getValue(),0,'f',2) + .arg(ui.cylinderHeight->value().getValue(),0,'f',2) + .arg(ui.cylinderAngle->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Cylinder")); } @@ -409,10 +404,10 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%6\n" "App.ActiveDocument.%1.Label='%7'\n") .arg(name) - .arg(ui.coneRadius1->getQuantity().getValue(),0,'f',2) - .arg(ui.coneRadius2->getQuantity().getValue(),0,'f',2) - .arg(ui.coneHeight->getQuantity().getValue(),0,'f',2) - .arg(ui.coneAngle->getQuantity().getValue(),0,'f',2) + .arg(ui.coneRadius1->value().getValue(),0,'f',2) + .arg(ui.coneRadius2->value().getValue(),0,'f',2) + .arg(ui.coneHeight->value().getValue(),0,'f',2) + .arg(ui.coneAngle->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Cone")); } @@ -427,10 +422,10 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%6\n" "App.ActiveDocument.%1.Label='%7'\n") .arg(name) - .arg(ui.sphereRadius->getQuantity().getValue(),0,'f',2) - .arg(ui.sphereAngle1->getQuantity().getValue(),0,'f',2) - .arg(ui.sphereAngle2->getQuantity().getValue(),0,'f',2) - .arg(ui.sphereAngle3->getQuantity().getValue(),0,'f',2) + .arg(ui.sphereRadius->value().getValue(),0,'f',2) + .arg(ui.sphereAngle1->value().getValue(),0,'f',2) + .arg(ui.sphereAngle2->value().getValue(),0,'f',2) + .arg(ui.sphereAngle3->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Sphere")); } @@ -446,11 +441,11 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%7\n" "App.ActiveDocument.%1.Label='%8'\n") .arg(name) - .arg(ui.ellipsoidRadius1->getQuantity().getValue(),0,'f',2) - .arg(ui.ellipsoidRadius2->getQuantity().getValue(),0,'f',2) - .arg(ui.ellipsoidAngle1->getQuantity().getValue(),0,'f',2) - .arg(ui.ellipsoidAngle2->getQuantity().getValue(),0,'f',2) - .arg(ui.ellipsoidAngle3->getQuantity().getValue(),0,'f',2) + .arg(ui.ellipsoidRadius1->value().getValue(),0,'f',2) + .arg(ui.ellipsoidRadius2->value().getValue(),0,'f',2) + .arg(ui.ellipsoidAngle1->value().getValue(),0,'f',2) + .arg(ui.ellipsoidAngle2->value().getValue(),0,'f',2) + .arg(ui.ellipsoidAngle3->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Ellipsoid")); } @@ -466,11 +461,11 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%7\n" "App.ActiveDocument.%1.Label='%8'\n") .arg(name) - .arg(ui.torusRadius1->getQuantity().getValue(),0,'f',2) - .arg(ui.torusRadius2->getQuantity().getValue(),0,'f',2) - .arg(ui.torusAngle1->getQuantity().getValue(),0,'f',2) - .arg(ui.torusAngle2->getQuantity().getValue(),0,'f',2) - .arg(ui.torusAngle3->getQuantity().getValue(),0,'f',2) + .arg(ui.torusRadius1->value().getValue(),0,'f',2) + .arg(ui.torusRadius2->value().getValue(),0,'f',2) + .arg(ui.torusAngle1->value().getValue(),0,'f',2) + .arg(ui.torusAngle2->value().getValue(),0,'f',2) + .arg(ui.torusAngle3->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Torus")); } @@ -485,8 +480,8 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Label='%6'\n") .arg(name) .arg(ui.prismPolygon->value()) - .arg(ui.prismCircumradius->getQuantity().getValue(),0,'f',2) - .arg(ui.prismHeight->getQuantity().getValue(),0,'f',2) + .arg(ui.prismCircumradius->value().getValue(),0,'f',2) + .arg(ui.prismHeight->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Prism")); } @@ -507,16 +502,16 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%12\n" "App.ActiveDocument.%1.Label='%13'\n") .arg(name) - .arg(ui.wedgeXmin->getQuantity().getValue(),0,'f',2) - .arg(ui.wedgeYmin->getQuantity().getValue(),0,'f',2) - .arg(ui.wedgeZmin->getQuantity().getValue(),0,'f',2) - .arg(ui.wedgeX2min->getQuantity().getValue(),0,'f',2) - .arg(ui.wedgeZ2min->getQuantity().getValue(),0,'f',2) - .arg(ui.wedgeXmax->getQuantity().getValue(),0,'f',2) - .arg(ui.wedgeYmax->getQuantity().getValue(),0,'f',2) - .arg(ui.wedgeZmax->getQuantity().getValue(),0,'f',2) - .arg(ui.wedgeX2max->getQuantity().getValue(),0,'f',2) - .arg(ui.wedgeZ2max->getQuantity().getValue(),0,'f',2) + .arg(ui.wedgeXmin->value().getValue(),0,'f',2) + .arg(ui.wedgeYmin->value().getValue(),0,'f',2) + .arg(ui.wedgeZmin->value().getValue(),0,'f',2) + .arg(ui.wedgeX2min->value().getValue(),0,'f',2) + .arg(ui.wedgeZ2min->value().getValue(),0,'f',2) + .arg(ui.wedgeXmax->value().getValue(),0,'f',2) + .arg(ui.wedgeYmax->value().getValue(),0,'f',2) + .arg(ui.wedgeZmax->value().getValue(),0,'f',2) + .arg(ui.wedgeX2max->value().getValue(),0,'f',2) + .arg(ui.wedgeZ2max->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Wedge")); } @@ -533,10 +528,10 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%7\n" "App.ActiveDocument.%1.Label='%8'\n") .arg(name) - .arg(ui.helixPitch->getQuantity().getValue(),0,'f',2) - .arg(ui.helixHeight->getQuantity().getValue(),0,'f',2) - .arg(ui.helixRadius->getQuantity().getValue(),0,'f',2) - .arg(ui.helixAngle->getQuantity().getValue(),0,'f',2) + .arg(ui.helixPitch->value().getValue(),0,'f',2) + .arg(ui.helixHeight->value().getValue(),0,'f',2) + .arg(ui.helixRadius->value().getValue(),0,'f',2) + .arg(ui.helixAngle->value().getValue(),0,'f',2) .arg(ui.helixLocalCS->currentIndex()) .arg(placement) .arg(tr("Helix")); @@ -551,9 +546,9 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%5\n" "App.ActiveDocument.%1.Label='%6'\n") .arg(name) - .arg(ui.spiralGrowth->getQuantity().getValue(),0,'f',2) + .arg(ui.spiralGrowth->value().getValue(),0,'f',2) .arg(ui.spiralRotation->value(),0,'f',2) - .arg(ui.spiralRadius->getQuantity().getValue(),0,'f',2) + .arg(ui.spiralRadius->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Spiral")); } @@ -567,9 +562,9 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%5\n" "App.ActiveDocument.%1.Label='%6'\n") .arg(name) - .arg(ui.circleRadius->getQuantity().getValue(),0,'f',2) - .arg(ui.circleAngle0->getQuantity().getValue(),0,'f',2) - .arg(ui.circleAngle1->getQuantity().getValue(),0,'f',2) + .arg(ui.circleRadius->value().getValue(),0,'f',2) + .arg(ui.circleAngle0->value().getValue(),0,'f',2) + .arg(ui.circleAngle1->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Circle")); } @@ -584,10 +579,10 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%6\n" "App.ActiveDocument.%1.Label='%7'\n") .arg(name) - .arg(ui.ellipseMajorRadius->getQuantity().getValue(),0,'f',2) - .arg(ui.ellipseMinorRadius->getQuantity().getValue(),0,'f',2) - .arg(ui.ellipseAngle0->getQuantity().getValue(),0,'f',2) - .arg(ui.ellipseAngle1->getQuantity().getValue(),0,'f',2) + .arg(ui.ellipseMajorRadius->value().getValue(),0,'f',2) + .arg(ui.ellipseMinorRadius->value().getValue(),0,'f',2) + .arg(ui.ellipseAngle0->value().getValue(),0,'f',2) + .arg(ui.ellipseAngle1->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Ellipse")); } @@ -601,9 +596,9 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%5\n" "App.ActiveDocument.%1.Label='%6'\n") .arg(name) - .arg(ui.vertexX->getQuantity().getValue(),0,'f',2) - .arg(ui.vertexY->getQuantity().getValue(),0,'f',2) - .arg(ui.vertexZ->getQuantity().getValue(),0,'f',2) + .arg(ui.vertexX->value().getValue(),0,'f',2) + .arg(ui.vertexY->value().getValue(),0,'f',2) + .arg(ui.vertexZ->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Vertex")); } @@ -620,12 +615,12 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Placement=%8\n" "App.ActiveDocument.%1.Label='%9'\n") .arg(name) - .arg(ui.edgeX1->getQuantity().getValue(),0,'f',2) - .arg(ui.edgeY1->getQuantity().getValue(),0,'f',2) - .arg(ui.edgeZ1->getQuantity().getValue(),0,'f',2) - .arg(ui.edgeX2->getQuantity().getValue(),0,'f',2) - .arg(ui.edgeY2->getQuantity().getValue(),0,'f',2) - .arg(ui.edgeZ2->getQuantity().getValue(),0,'f',2) + .arg(ui.edgeX1->value().getValue(),0,'f',2) + .arg(ui.edgeY1->value().getValue(),0,'f',2) + .arg(ui.edgeZ1->value().getValue(),0,'f',2) + .arg(ui.edgeX2->value().getValue(),0,'f',2) + .arg(ui.edgeY2->value().getValue(),0,'f',2) + .arg(ui.edgeZ2->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Line")); } @@ -639,7 +634,7 @@ void DlgPrimitives::createPrimitive(const QString& placement) "App.ActiveDocument.%1.Label='%5'\n") .arg(name) .arg(ui.regularPolygonPolygon->value()) - .arg(ui.regularPolygonCircumradius->getQuantity().getValue(),0,'f',2) + .arg(ui.regularPolygonCircumradius->value().getValue(),0,'f',2) .arg(placement) .arg(tr("Regular polygon")); } diff --git a/src/Mod/Part/Gui/DlgPrimitives.ui b/src/Mod/Part/Gui/DlgPrimitives.ui index 59d3e7ff6..f57f5aa3f 100644 --- a/src/Mod/Part/Gui/DlgPrimitives.ui +++ b/src/Mod/Part/Gui/DlgPrimitives.ui @@ -208,9 +208,12 @@ 6 - - - 10.00 mm + + + mm + + + 10.000000000000000 @@ -229,9 +232,12 @@ - - - 10.00 mm + + + mm + + + 10.000000000000000 @@ -285,16 +291,22 @@ 6 - - - 10.00 mm + + + mm + + + 10.000000000000000 - - - 10.00 mm + + + mm + + + 10.000000000000000 @@ -320,9 +332,12 @@ - - - 10.00 mm + + + mm + + + 10.000000000000000 @@ -354,9 +369,12 @@ - - - 360.00 deg + + + deg + + + 360.000000000000000 @@ -411,16 +429,22 @@ - - - 10.00 mm + + + mm + + + 10.000000000000000 - - - 2.00 mm + + + mm + + + 2.000000000000000 @@ -452,9 +476,12 @@ - - - 360.00 deg + + + deg + + + 360.000000000000000 @@ -495,16 +522,22 @@ 6 - - - 10.00 mm + + + mm + + + 10.000000000000000 - - - 2.00 mm + + + mm + + + 2.000000000000000 @@ -530,9 +563,12 @@ - - - 4.00 mm + + + mm + + + 4.000000000000000 @@ -597,23 +633,32 @@ - - - -90.00 deg + + + deg + + + -90.000000000000000 - - - 90.00 deg + + + deg + + + 90.000000000000000 - - - 360.00 deg + + + deg + + + 360.000000000000000 @@ -651,9 +696,12 @@ - - - 5.00 mm + + + mm + + + 5.000000000000000 @@ -715,16 +763,22 @@ - - - 2.00 mm + + + mm + + + 2.000000000000000 - - - 4.00 mm + + + mm + + + 4.000000000000000 @@ -769,23 +823,32 @@ - - - 360.00 deg + + + deg + + + 360.000000000000000 - - - -90.00 deg + + + deg + + + -90.000000000000000 - - - 90.00 deg + + + deg + + + 90.000000000000000 @@ -850,23 +913,32 @@ - - - 360.00 deg + + + deg + + + 360.000000000000000 - - - -180.00 deg + + + deg + + + -180.000000000000000 - - - 180.00 deg + + + deg + + + 180.000000000000000 @@ -897,9 +969,12 @@ 6 - - - 10.00 mm + + + mm + + + 10.000000000000000 @@ -918,9 +993,12 @@ - - - 2.00 mm + + + mm + + + 2.000000000000000 @@ -945,9 +1023,12 @@ 6 - - - 2.00 mm + + + mm + + + 2.000000000000000 @@ -986,9 +1067,12 @@ - - - 10.0 mm + + + mm + + + 10.000000000000000 @@ -1055,72 +1139,102 @@ - - - 0.00 + + + mm + + + 0.000000000000000 - - - 10.00 mm + + + mm + + + 10.000000000000000 - - - 0.00 + + + mm + + + 0.000000000000000 - - - 10.00 mm + + + mm + + + 10.000000000000000 - - - 0.00 + + + mm + + + 0.000000000000000 - - - 10.00 mm + + + mm + + + 10.000000000000000 - - - 2.00 mm + + + mm + + + 2.000000000000000 - - - 8.00 mm + + + mm + + + 8.000000000000000 - - - 2.00 mm + + + mm + + + 2.000000000000000 - - - 8.00 mm + + + mm + + + 8.000000000000000 @@ -1220,30 +1334,42 @@ - - - 0.00 deg + + + deg + + + 0.000000000000000 - - - 1.00 mm + + + mm + + + 1.000000000000000 - - - 2.00 mm + + + mm + + + 2.000000000000000 - - - 1.00 mm + + + mm + + + 1.000000000000000 @@ -1302,9 +1428,12 @@ - - - 1.00 mm + + + mm + + + 1.000000000000000 @@ -1319,9 +1448,12 @@ - - - 1.00 mm + + + mm + + + 1.000000000000000 @@ -1361,23 +1493,32 @@ - - - 0.00 deg + + + deg + + + 0.000000000000000 - - - 360.00 deg + + + deg + + + 360.000000000000000 - - - 2.00 mm + + + mm + + + 2.000000000000000 @@ -1455,30 +1596,42 @@ - - - 4.00 mm + + + mm + + + 4.000000000000000 - - - 2.00 mm + + + mm + + + 2.000000000000000 - - - 0.00 deg + + + deg + + + 0.000000000000000 - - - 360.00 deg + + + deg + + + 360.000000000000000 @@ -1534,23 +1687,32 @@ - - - 0.00 + + + mm + + + 0.000000000000000 - - - 0.00 + + + mm + + + 0.000000000000000 - - - 0.00 + + + mm + + + 0.000000000000000 @@ -1660,44 +1822,62 @@ - - - 0.00 + + + mm + + + 0.000000000000000 - - - 0.00 + + + mm + + + 0.000000000000000 - - - 0.00 + + + mm + + + 0.000000000000000 - - - 1.00 mm + + + mm + + + 10.000000000000000 - - - 1.00 mm + + + mm + + + 10.000000000000000 - - - 1.00 mm + + + mm + + + 10.000000000000000 @@ -1762,9 +1942,12 @@ - - - 2.00 mm + + + mm + + + 2.000000000000000 @@ -1795,9 +1978,9 @@ - Gui::InputField - QLineEdit -
Gui/InputField.h
+ Gui::QuantitySpinBox + QWidget +
Gui/QuantitySpinBox.h