Skip to content
Permalink
Browse files
Merge pull request #7354 from m-kuhn/rangewidget_nostep
Handle invalid step size
  • Loading branch information
m-kuhn committed Jul 3, 2018
2 parents 76f574a + 2469c9e commit 497637b8a58eb3e1e20a4e37333294eeb8db0fff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
@@ -138,7 +138,7 @@ void QgsRangeWidgetWrapper::initWidget( QWidget *editor )
int minval = min.toInt();
if ( allowNull )
{
int stepval = step.toInt();
int stepval = step.isValid() ? step.toInt() : 1;
minval -= stepval;
mIntSpinBox->setValue( minval );
mIntSpinBox->setSpecialValueText( QgsApplication::nullRepresentation() );
@@ -479,7 +479,7 @@ def testTransactionConstrains(self):

# check new values
self.assertTrue(vl.getFeatures('id=1').nextFeature(f))
self.assertEqual(f.attributes(), [1, 1, NULL])
self.assertEqual(f.attributes(), [1, 1, 0])

def testTransactionTuple(self):
# create a vector layer based on postgres

0 comments on commit 497637b

Please sign in to comment.