本文整理汇总了C++中QCPRange::center方法的典型用法代码示例。如果您正苦于以下问题:C++ QCPRange::center方法的具体用法?C++ QCPRange::center怎么用?C++ QCPRange::center使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCPRange
的用法示例。
在下文中一共展示了QCPRange::center方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_horizontalSlider_valueChanged
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();
}
示例2: yAxisChanged
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
}
示例3:
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
}
示例4: yAxisChanged
void SequenceDialog::yAxisChanged(QCPRange range)
{
ui->verticalScrollBar->setValue(qRound(range.center()*100.0));
ui->verticalScrollBar->setPageStep(qRound(range.size()*100.0));
}
示例5: xAxisChanged
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
}
示例6: yAxisChanged
void LBMUIMFlowDialog::yAxisChanged(QCPRange range)
{
m_ui->verticalScrollBar->setValue(qRound(range.center() * 100.0));
m_ui->verticalScrollBar->setPageStep(qRound(range.size() * 100.0));
}