void RangeSelectWidget::updateControls()
{
	const ndimdata::DataStatistic &statistic(m_statistic);
	m_updating = true;
	ui->spinMinMax1->setValue(m_bound1);
	ui->spinMinMax2->setValue(m_bound2);
	ui->sliderMinMax1->setValue(toSliderValue(m_bound1, ui->sliderMinMax1->maximum(), statistic.min, statistic.max));
	ui->sliderMinMax2->setValue(toSliderValue(m_bound2, ui->sliderMinMax1->maximum(), statistic.min, statistic.max));

	auto bounds = std::minmax(m_bound1, m_bound2);
	double diff = bounds.second - bounds.first;
	double min = bounds.first - 4 * diff;
	double max = bounds.second + 4 * diff;
	min = std::max(min, statistic.min);
	max = std::min(max, statistic.max);
	ui->histogram->setAxisScale(QwtPlot::xBottom, min, max);

	zoneSelection->setInterval(QwtInterval(m_bound1, m_bound2).normalized());
	m_updating = false;
}
Ejemplo n.º 2
0
void RangeSelector::labelUpperChanged(QString value)
{
  slider->setUpperValue(toSliderValue(value.toFloat()));
}