This commit is contained in:
2019-06-06 18:41:31 +02:00
parent bb760f3210
commit 48dd0fb084
5 changed files with 200 additions and 292 deletions

View File

@ -50,8 +50,10 @@ class SlsQt1DZoomer:public QwtPlotZoomer{
#if QWT_VERSION<0x060000
virtual QwtText trackerText(const QwtDoublePoint &pos) const{
#else
#elif QWT_VERSION==0x060000
virtual QwtText trackerText(const QPointF &pos) const{
#else
virtual QwtText trackerTextF(const QPointF &pos) const{
#endif
QColor bg(Qt::white);

View File

@ -35,14 +35,14 @@ void SlsQt1DZoomer::SetZoomBase(double xmin,double ymin,double x_width, double y
if(plot()){
if(xIsLog){
#if QWT_VERSION < 0x50200
float xmin_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->lBound();
float xmax_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->hBound();
double xmin_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->lBound();
double xmax_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->hBound();
#elif QWT_VERSION < 0x060100
float xmin_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->lowerBound();
float xmax_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->upperBound();
double xmin_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->lowerBound();
double xmax_curr = plot()->axisScaleDiv(QwtPlot::xBottom)->upperBound();
#else
float xmin_curr = plot()->axisScaleDiv(QwtPlot::xBottom).lowerBound();
float xmax_curr = plot()->axisScaleDiv(QwtPlot::xBottom).upperBound();
double xmin_curr = plot()->axisScaleDiv(QwtPlot::xBottom).lowerBound();
double xmax_curr = plot()->axisScaleDiv(QwtPlot::xBottom).upperBound();
#endif
if(xmin_curr<xmin) xmin_curr=xmin;
if(xmax_curr>xmin+x_width) xmax_curr=xmin+x_width;
@ -50,14 +50,14 @@ void SlsQt1DZoomer::SetZoomBase(double xmin,double ymin,double x_width, double y
}
if(yIsLog){
#if QWT_VERSION < 0x50200
float ymin_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->lBound();
float ymax_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->hBound();
double ymin_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->lBound();
double ymax_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->hBound();
#elif QWT_VERSION < 0x060100
float ymin_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->lowerBound();
float ymax_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->upperBound();
double ymin_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->lowerBound();
double ymax_curr = plot()->axisScaleDiv(QwtPlot::yLeft)->upperBound();
#else
float ymin_curr = plot()->axisScaleDiv(QwtPlot::yLeft).lowerBound();
float ymax_curr = plot()->axisScaleDiv(QwtPlot::yLeft).upperBound();
double ymin_curr = plot()->axisScaleDiv(QwtPlot::yLeft).lowerBound();
double ymax_curr = plot()->axisScaleDiv(QwtPlot::yLeft).upperBound();
#endif
if(ymin_curr<ymin) ymin_curr=ymin;
if(ymax_curr>ymin+y_width) ymax_curr=ymin+y_width;