Bump lowest possible min for numeric parameters to -DBL_MAX + 1

We need to reserve -DBL_MAX as a special value, to allow it to
work correctly in QDoubleSpinBoxes (limitation of QDoubleSpinBox)
This commit is contained in:
Nyall Dawson 2017-12-01 18:17:14 +10:00
parent 6b56565f89
commit 297e8561a0
3 changed files with 4 additions and 4 deletions

View File

@ -1129,7 +1129,7 @@ class QgsProcessingParameterNumber : QgsProcessingParameterDefinition
Type type = Integer, Type type = Integer,
const QVariant &defaultValue = QVariant(), const QVariant &defaultValue = QVariant(),
bool optional = false, bool optional = false,
double minValue = -DBL_MAX, double minValue = -DBL_MAX + 1,
double maxValue = DBL_MAX double maxValue = DBL_MAX
); );
%Docstring %Docstring

View File

@ -2003,7 +2003,7 @@ QString QgsProcessingParameterNumber::toolTip() const
{ {
QString text = QgsProcessingParameterDefinition::toolTip(); QString text = QgsProcessingParameterDefinition::toolTip();
QStringList parts; QStringList parts;
if ( mMin > -DBL_MAX ) if ( mMin > -DBL_MAX + 1 )
parts << QObject::tr( "Minimum value: %1" ).arg( mMin ); parts << QObject::tr( "Minimum value: %1" ).arg( mMin );
if ( mMax < DBL_MAX ) if ( mMax < DBL_MAX )
parts << QObject::tr( "Maximum value: %1" ).arg( mMax ); parts << QObject::tr( "Maximum value: %1" ).arg( mMax );

View File

@ -1099,7 +1099,7 @@ class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDe
Type type = Integer, Type type = Integer,
const QVariant &defaultValue = QVariant(), const QVariant &defaultValue = QVariant(),
bool optional = false, bool optional = false,
double minValue = -DBL_MAX, double minValue = -DBL_MAX + 1,
double maxValue = DBL_MAX double maxValue = DBL_MAX
); );
@ -1159,7 +1159,7 @@ class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDe
private: private:
double mMin = -DBL_MAX; double mMin = -DBL_MAX + 1;
double mMax = DBL_MAX; double mMax = DBL_MAX;
Type mDataType = Integer; Type mDataType = Integer;
}; };