commontk/CTK — Issue #60: ctkSliderWidget crash in debug mode
Author: espakm
Created: 2011-10-24 13:18:04+00:00
State: open

The ctkSliderWidget crashes here in debug mode with this message:

ASSERT: "d->equal(d->SpinBox->value(),d->Slider->value())" in file /home/espakm/src/CTK/Libs/Widgets/ctkSliderWidget.cpp, line 258

The code:

void ctkSliderWidget::setValue(double _value)
{
Q_D(ctkSliderWidget);
// disable the tracking temporally to emit the
// signal valueChanged if changeValue() is called
bool isChanging = d->Changing;
d->Changing = false;
d->SpinBox->setValue(_value);
// Why do we need to set the value to the slider ?
//d->Slider->setValue(d->SpinBox->value());
//double spinBoxValue = d->SpinBox->value();
Q_ASSERT(d->equal(d->SpinBox->minimum(),d->Slider->minimum()));
Q_ASSERT(d->equal(d->SpinBox->value(),d->Slider->value())); // line 258
Q_ASSERT(d->equal(d->SpinBox->maximum(),d->Slider->maximum()));
// restore the prop
d->Changing = isChanging;
}

I am afraid that the commented line (255) should be uncommented.