From 233d13815bbe36cf42b4ac73377cc75c85dccb70 Mon Sep 17 00:00:00 2001 From: sbh Date: Fri, 18 Apr 2014 12:55:40 +0400 Subject: [PATCH] Bug #26: set default range for spinbox to -DBL_MAX .. DBL_MAX. --- src/Config/plugin-PartSet.xml | 9 +++------ src/XGUI/XGUI_WidgetFactory.cpp | 7 +++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/Config/plugin-PartSet.xml b/src/Config/plugin-PartSet.xml index d9795ad2c..3cc8a1182 100644 --- a/src/Config/plugin-PartSet.xml +++ b/src/Config/plugin-PartSet.xml @@ -9,12 +9,9 @@ - - - + + + diff --git a/src/XGUI/XGUI_WidgetFactory.cpp b/src/XGUI/XGUI_WidgetFactory.cpp index bd08442a4..4c5223324 100644 --- a/src/XGUI/XGUI_WidgetFactory.cpp +++ b/src/XGUI/XGUI_WidgetFactory.cpp @@ -26,6 +26,9 @@ #include #endif +#include +#include + XGUI_WidgetFactory::XGUI_WidgetFactory(ModuleBase_Operation* theOperation) : myOperation(theOperation) { @@ -132,11 +135,15 @@ QWidget* XGUI_WidgetFactory::doubleSpinBoxControl() double aMinVal = qs(aProp).toDouble(&isOk); if (isOk) { aBox->setMinimum(aMinVal); + } else { + aBox->setMinimum(-DBL_MAX); } aProp = myWidgetApi->getProperty(DOUBLE_WDG_MAX); double aMaxVal = qs(aProp).toDouble(&isOk); if (isOk) { aBox->setMaximum(aMaxVal); + } else { + aBox->setMaximum(DBL_MAX); } aProp = myWidgetApi->getProperty(DOUBLE_WDG_STEP); double aStepVal = qs(aProp).toDouble(&isOk); -- 2.39.2