SOLVED: use a created vector as range for QDoubleSpinBox and QSlider
-
I've created a vector v with 128 elements from -3000 to 3000 and I want to associate it to a QDoubleSpinBox and a QSlider, because dividing 6000 to 128 and setting the QDoubleSpinBox we have always the round problem. So can we set the range and the stepsize both to a QDoubleSpinBox and QSlider with a vector like this?
@ std::vector<double> v(128);
for (int i = 0; i < 128; ++i)
{
v[i] = -3000.0 + 6000.0 * (i) / 127.0;
}@ -
Normaly we would do something like this,
@doubleSpinBox->setDecimals(0);
doubleSpinBox->setMinimum(min);
doubleSpinBox->setMaximum(max);
doubleSpinBox->setSingleStep(1.0);@I want the range to be the vector I created instead of choosing the min and max.
So I want the SpinBox to be only allowed to be on the value from the vector I created.