This commit is contained in:
Erik Frojdh
2020-03-09 12:42:57 +01:00
parent a4fa9ff480
commit e4a86e544a
8 changed files with 49 additions and 258 deletions

View File

@ -20,11 +20,7 @@ class SlsQt1DZoomer:public QwtPlotZoomer{
bool xIsLog,yIsLog;
public:
#if QWT_VERSION < 0x060100
SlsQt1DZoomer(QwtPlotCanvas *canvas):QwtPlotZoomer(canvas){
#else
SlsQt1DZoomer(QWidget *canvas):QwtPlotZoomer(canvas){
#endif
SlsQt1DZoomer(QWidget *canvas):QwtPlotZoomer(canvas){
setTrackerMode(AlwaysOn);
xIsLog=yIsLog=0;
}
@ -48,25 +44,15 @@ class SlsQt1DZoomer:public QwtPlotZoomer{
bool SetLogY(bool yes) { return yIsLog=yes;}
#if QWT_VERSION<0x060000
virtual QwtText trackerText(const QwtDoublePoint &pos) const{
#else
using QwtPlotPicker::trackerText;
using QwtPlotPicker::trackerText;
virtual QwtText trackerText(const QPoint &pos) const{
#endif
QColor bg(Qt::white);
#if QT_VERSION >= 0x040300
bg.setAlpha(200);
#endif
#if QWT_VERSION<0x060000
QwtText text = QwtPlotZoomer::trackerText(pos);
#else
QwtText text = QwtPlotPicker::trackerText(pos);
#endif
text.setBackgroundBrush( QBrush( bg ));
return text;
QColor bg(Qt::white);
bg.setAlpha(200);
QwtText text = QwtPlotPicker::trackerText(pos);
text.setBackgroundBrush( QBrush( bg ));
return text;
}
};

View File

@ -77,9 +77,7 @@ class SlsQt2DHist: public QwtRasterData{
return (QwtRasterData*) this;
}
#if QWT_VERSION<0x060000
virtual QwtDoubleInterval range() const{ return QwtDoubleInterval(z_min,z_max);}
#else
virtual QwtInterval range() const{ return QwtInterval(z_min,z_max);}
virtual QwtInterval interval(Qt::Axis axis) const {
switch (axis){
@ -93,7 +91,7 @@ class SlsQt2DHist: public QwtRasterData{
return QwtInterval(z_min,z_max);
};
};
#endif

View File

@ -85,13 +85,8 @@ private:
QwtLinearColorMap* colorMapLinearScale{nullptr};
QwtLinearColorMap* colorMapLogScale{nullptr};
#if QWT_VERSION<0x060000
QwtValueList* contourLevelsLinear{nullptr};
QwtValueList* contourLevelsLog{nullptr};
#else
QList<double> contourLevelsLinear;
QList<double> contourLevelsLog;
#endif
bool disableZoom{false};
int isLog;
};

View File

@ -25,11 +25,8 @@ class SlsQt2DZoomer:public QwtPlotZoomer{
SlsQt2DHist* hist;
public:
#if QWT_VERSION < 0x060100
SlsQt2DZoomer(QwtPlotCanvas *canvas):QwtPlotZoomer(canvas){
#else
SlsQt2DZoomer(QWidget *canvas):QwtPlotZoomer(canvas){
#endif
setTrackerMode(AlwaysOn);
}
@ -38,15 +35,11 @@ class SlsQt2DZoomer:public QwtPlotZoomer{
}
#if QWT_VERSION<0x060000
virtual QwtText trackerText(const QwtDoublePoint &pos) const{
#else
virtual QwtText trackerTextF(const QPointF &pos) const{
#endif
QColor bg(Qt::white);
#if QT_VERSION >= 0x040300
bg.setAlpha(200);
#endif
//QwtText text = QwtPlotZoomer::trackerText(pos);
@ -57,12 +50,10 @@ class SlsQt2DZoomer:public QwtPlotZoomer{
sprintf(t,"%3.2f, %3.2f, %3.2f",pos.x(),pos.y(),hist->value(pos.x(),pos.y()));
text.setText(t);
}else {
#if QWT_VERSION<0x060000
QwtText text = QwtPlotZoomer::trackerText(pos);
#else
QPoint p=pos.toPoint();
QwtText text = QwtPlotZoomer::trackerText(p);
#endif
}
text.setBackgroundBrush( QBrush( bg ));