diff --git a/src/core/knumbermodel.cpp b/src/core/knumbermodel.cpp --- a/src/core/knumbermodel.cpp +++ b/src/core/knumbermodel.cpp @@ -75,7 +75,6 @@ void KNumberModel::setStepSize(qreal stepSize) { - Q_ASSERT(stepSize != 0); if (stepSize == d->stepSize) { return; } @@ -122,6 +121,9 @@ if (index.parent().isValid()) { return 0; } + if (d->stepSize == 0) { + return 1; + } //1 initial entry (the minimumValue) + the number of valid steps afterwards return 1 + std::max(0, qFloor((d->maximumValue - d->minimumValue) / d->stepSize)); }