Skip to content

Commit 297e856

Browse files
committedDec 1, 2017
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)
1 parent 6b56565 commit 297e856

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎python/core/processing/qgsprocessingparameters.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ class QgsProcessingParameterNumber : QgsProcessingParameterDefinition
11291129
Type type = Integer,
11301130
const QVariant &defaultValue = QVariant(),
11311131
bool optional = false,
1132-
double minValue = -DBL_MAX,
1132+
double minValue = -DBL_MAX + 1,
11331133
double maxValue = DBL_MAX
11341134
);
11351135
%Docstring

‎src/core/processing/qgsprocessingparameters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,7 @@ QString QgsProcessingParameterNumber::toolTip() const
20032003
{
20042004
QString text = QgsProcessingParameterDefinition::toolTip();
20052005
QStringList parts;
2006-
if ( mMin > -DBL_MAX )
2006+
if ( mMin > -DBL_MAX + 1 )
20072007
parts << QObject::tr( "Minimum value: %1" ).arg( mMin );
20082008
if ( mMax < DBL_MAX )
20092009
parts << QObject::tr( "Maximum value: %1" ).arg( mMax );

‎src/core/processing/qgsprocessingparameters.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@ class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDe
10991099
Type type = Integer,
11001100
const QVariant &defaultValue = QVariant(),
11011101
bool optional = false,
1102-
double minValue = -DBL_MAX,
1102+
double minValue = -DBL_MAX + 1,
11031103
double maxValue = DBL_MAX
11041104
);
11051105

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

11601160
private:
11611161

1162-
double mMin = -DBL_MAX;
1162+
double mMin = -DBL_MAX + 1;
11631163
double mMax = DBL_MAX;
11641164
Type mDataType = Integer;
11651165
};

0 commit comments

Comments
 (0)
Please sign in to comment.