Skip to content

Commit

Permalink
BUG: Fix crash in Debug replacing Q_ASSERT by qWarning in ctkRangeWid…
Browse files Browse the repository at this point in the history
…get::setRange (#948)

See discussion here: https://discourse.slicer.org/t/crash-with-ctkrangewidget/15299/3

Co-authored-by: x_riobe <riobe@certis-therapeutics.com>
  • Loading branch information
xriobe and x_riobe authored Feb 1, 2021
1 parent 3b19577 commit 24e2f7f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Libs/Widgets/ctkRangeWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,13 @@ void ctkRangeWidget::setRange(double min, double max)
d->SettingSliderRange = false;
if (!d->useCustomSpinBoxesLimits())
{
Q_ASSERT(d->equal(d->MinimumSpinBox->minimum(), d->Slider->minimum()));
Q_ASSERT(d->equal(d->MaximumSpinBox->maximum(), d->Slider->maximum()));
Q_ASSERT(d->equal(d->Slider->minimumValue(), d->MinimumSpinBox->value()));
Q_ASSERT(d->equal(d->Slider->maximumValue(), d->MaximumSpinBox->value()));
if (!(d->equal(d->MinimumSpinBox->minimum(), d->Slider->minimum())) ||
!(d->equal(d->MaximumSpinBox->maximum(), d->Slider->maximum())) ||
!(d->equal(d->Slider->minimumValue(), d->MinimumSpinBox->value())) ||
!(d->equal(d->Slider->maximumValue(), d->MaximumSpinBox->value())))
{
qWarning("ctkRangeWidget::setRange : slider and spinbox are not synchronized");
}
}
d->updateSpinBoxWidth();
if (!d->useCustomSpinBoxesLimits())
Expand Down

0 comments on commit 24e2f7f

Please sign in to comment.