2 #include "ui_axis_limits_dialog.h" 5 #include <QDoubleValidator> 7 using std::numeric_limits;
15 _limits.min = ( -numeric_limits<double>::max() / 2 );
16 _limits.max = ( numeric_limits<double>::max() / 2 );
18 ui->lineEditMinY->setValidator(
new QDoubleValidator(
this) );
19 ui->lineEditMaxY->setValidator(
new QDoubleValidator(
this) );
32 if( !
ui->checkBoxMinY->isChecked() )
36 if( !
ui->checkBoxMaxY->isChecked() )
46 ui->checkBoxMinY->setChecked(enabled);
53 ui->checkBoxMaxY->setChecked(enabled);
58 return ui->checkBoxMinY->isChecked() ||
ui->checkBoxMaxY->isChecked();
63 ui->lineEditMinY->setEnabled(checked);
64 ui->pushButtonMinY->setEnabled(checked);
69 ui->lineEditMaxY->setEnabled(checked);
70 ui->pushButtonMaxY->setEnabled(checked);
75 double ymin = -numeric_limits<double>::max();
76 double ymax = numeric_limits<double>::max();
78 if ( !
ui->lineEditMinY->text().isEmpty() )
80 ymin =
ui->lineEditMinY->text().toDouble();
83 if ( !
ui->lineEditMaxY->text().isEmpty() )
85 ymax =
ui->lineEditMaxY->text().toDouble();
91 ui->lineEditMinY->setText( QString::number( ymax ));
92 ui->lineEditMaxY->setText( QString::number( ymin ));
95 _limits.min = (
ui->checkBoxMinY->isChecked() ? ymin : -numeric_limits<double>::max()/2 );
96 _limits.max = (
ui->checkBoxMaxY->isChecked() ? ymax : numeric_limits<double>::max()/2 );
PlotData::RangeValue _limits
void enableMin(bool enabled, double value)
AxisLimitsDialog(QWidget *parent=0)
virtual void closeEvent(QCloseEvent *event) override
void on_checkBoxMinY_toggled(bool checked)
void enableMax(bool enabled, double value)
bool limitsEnabled() const
void on_pushButtonMaxY_pressed()
void on_checkBoxMaxY_toggled(bool checked)
void on_pushButtonMinY_pressed()
void on_pushButtonDone_pressed()
Ui::AxisLimitsDialog * ui
PlotData::RangeValue _parent_limits
void setDefaultRange(PlotData::RangeValue range)