/*! \brief Set the range \param minValue value corresponding lower or left end of the thermometer \param maxValue value corresponding to the upper or right end of the thermometer \param logarithmic logarithmic mapping, true or false */ void QwtThermo::setRange( double minValue, double maxValue, bool logarithmic ) { if ( minValue == d_data->minValue && maxValue == d_data->maxValue && logarithmic == qwtIsLogarithmic( this ) ) { return; } if ( logarithmic != qwtIsLogarithmic( this ) ) { if ( logarithmic ) setScaleEngine( new QwtLog10ScaleEngine ); else setScaleEngine( new QwtLinearScaleEngine ); } d_data->minValue = minValue; d_data->maxValue = maxValue; /* There are two different maps, one for the scale, the other for the values. This is confusing and will be changed in the future. TODO ... */ d_data->map.setTransformation( scaleEngine()->transformation() ); d_data->map.setScaleInterval( minValue, maxValue ); if ( autoScale() ) rescale( minValue, maxValue ); layoutThermo( true ); }
void TimelineWidget::setRange(double vmin, double vmax, bool lg) { mpD->minValue = vmin; mpD->maxValue = vmax; setScaleEngine(new QwtLinearScaleEngine); mpD->map.setTransformation(scaleEngine()->transformation()); mpD->map.setScaleInterval(mpD->minValue, mpD->maxValue); if(autoScale()) { rescale(mpD->minValue, mpD->maxValue); } }
/*! \brief Set the range \param vmin value corresponding lower or left end of the thermometer \param vmax value corresponding to the upper or right end of the thermometer \param logarithmic logarithmic mapping, true or false */ void QwtThermo::setRange(double vmin, double vmax, bool logarithmic) { d_data->minValue = vmin; d_data->maxValue = vmax; if ( logarithmic ) setScaleEngine(new QwtLog10ScaleEngine); else setScaleEngine(new QwtLinearScaleEngine); /* There are two different maps, one for the scale, the other for the values. This is confusing and will be changed in the future. TODO ... */ d_data->map.setTransformation(scaleEngine()->transformation()); d_data->map.setScaleInterval(d_data->minValue, d_data->maxValue); if (autoScale()) rescale(d_data->minValue, d_data->maxValue); layoutThermo(); }