void Window::on_horizontalSlider_valueChanged(int value) { QCPRange range = ui->plot->xAxis->range(); double real_size = range.size() / old_x_slider_scale; double new_size = real_size * value; old_x_slider_scale = value; ui->plot->xAxis->setRange(QCPRange(range.center() - new_size / 2, range.center() + new_size / 2)); ui->plot->xAxis2->setRange(QCPRange(range.center() - new_size / 2, range.center() + new_size / 2)); ui->plot->replot(); }
void MainWindow::yAxisChanged(QCPRange range) { ui->verticalScrollBar->setValue(qRound(-range.center()*100.0)); // adjust position of scroll bar slider ui->verticalScrollBar->setPageStep(qRound(range.size()*100.0)); // adjust size of scroll bar slider }
void AP2DataPlot2D::xAxisChanged(QCPRange range) { ui.horizontalScrollBar->setValue(qRound(range.center())); // adjust position of scroll bar slider ui.horizontalScrollBar->setPageStep(qRound(range.size())); // adjust size of scroll bar slider }
void SequenceDialog::yAxisChanged(QCPRange range) { ui->verticalScrollBar->setValue(qRound(range.center()*100.0)); ui->verticalScrollBar->setPageStep(qRound(range.size()*100.0)); }
void ChartPage::xAxisChanged(QCPRange range) { ui->horizontalScrollBar->setValue(qRound(range.center()/1000000.0)); // adjust position of scroll bar slider ui->horizontalScrollBar->setPageStep(qRound(range.size()*1000000.0)); // adjust size of scroll bar slider }
void LBMUIMFlowDialog::yAxisChanged(QCPRange range) { m_ui->verticalScrollBar->setValue(qRound(range.center() * 100.0)); m_ui->verticalScrollBar->setPageStep(qRound(range.size() * 100.0)); }