Skip to content
Permalink
Browse files

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)
  • Loading branch information
nyalldawson committed Dec 1, 2017
1 parent 6b56565 commit 297e8561a06db7fcaa337e339c68d5ecbf345f7a
@@ -1129,7 +1129,7 @@ class QgsProcessingParameterNumber : QgsProcessingParameterDefinition
Type type = Integer,
const QVariant &defaultValue = QVariant(),
bool optional = false,
double minValue = -DBL_MAX,
double minValue = -DBL_MAX + 1,
double maxValue = DBL_MAX
);
%Docstring
@@ -2003,7 +2003,7 @@ QString QgsProcessingParameterNumber::toolTip() const
{
QString text = QgsProcessingParameterDefinition::toolTip();
QStringList parts;
if ( mMin > -DBL_MAX )
if ( mMin > -DBL_MAX + 1 )
parts << QObject::tr( "Minimum value: %1" ).arg( mMin );
if ( mMax < DBL_MAX )
parts << QObject::tr( "Maximum value: %1" ).arg( mMax );
@@ -1099,7 +1099,7 @@ class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDe
Type type = Integer,
const QVariant &defaultValue = QVariant(),
bool optional = false,
double minValue = -DBL_MAX,
double minValue = -DBL_MAX + 1,
double maxValue = DBL_MAX
);

@@ -1159,7 +1159,7 @@ class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDe

private:

double mMin = -DBL_MAX;
double mMin = -DBL_MAX + 1;
double mMax = DBL_MAX;
Type mDataType = Integer;
};

0 comments on commit 297e856

Please sign in to comment.
You can’t perform that action at this time.