# HG changeset patch # User Hasan Yavuz Ă–ZDERYA # Date 2017-08-30 06:23:31 # Node ID 2c1e89113ca8ee868d8d01c2fb35779e2d4d78e3 # Parent 196054fd981603d37d33e04dd5e4f17c8a44355f don't allow xmin >= xmax it breaks the plot because of newly implemented setrectofinterest diff --git a/src/plotcontrolpanel.cpp b/src/plotcontrolpanel.cpp --- a/src/plotcontrolpanel.cpp +++ b/src/plotcontrolpanel.cpp @@ -86,9 +86,25 @@ PlotControlPanel::PlotControlPanel(QWidg connect(ui->spXmax, SIGNAL(valueChanged(double)), this, SLOT(onXScaleChanged())); + connect(ui->spXmax, static_cast(&QDoubleSpinBox::valueChanged), + [this](double v) + { + // set limit just a little below + double step = pow(10, -1 * ui->spXmin->decimals()); + ui->spXmin->setMaximum(v - step); + }); + connect(ui->spXmin, SIGNAL(valueChanged(double)), this, SLOT(onXScaleChanged())); + connect(ui->spXmin, static_cast(&QDoubleSpinBox::valueChanged), + [this](double v) + { + // set limit just a little above + double step = pow(10, -1 * ui->spXmax->decimals()); + ui->spXmax->setMinimum(v + step); + }); + connect(ui->spPlotWidth, SIGNAL(valueChanged(int)), this, SLOT(onPlotWidthChanged()));