plotmagnifier.h
Go to the documentation of this file.
1 #ifndef PLOTMAGNIFIER_H
2 #define PLOTMAGNIFIER_H
3 
4 #include <QTimer>
5 #include "qwt_plot_magnifier.h"
6 #include "qwt_plot.h"
7 #include <QEvent>
8 
10 {
11  Q_OBJECT
12 
13 public:
14  explicit PlotMagnifier( QWidget *canvas);
15  virtual ~PlotMagnifier() override;
16 
17  void setAxisLimits(int axis,double lower, double upper);
18  virtual void widgetWheelEvent( QWheelEvent *event ) override;
19 
21 
22  virtual void rescale( double factor ) override
23  {
24  rescale( factor, _default_mode );
25  }
26 
27  void setDefaultMode(AxisMode mode) { _default_mode = mode; }
28 
29  void rescale( double factor, AxisMode axis );
30 protected:
31 
32  virtual void widgetMousePressEvent( QMouseEvent* event ) override;
33 
36 
37  QPointF _mouse_position;
38 
39 signals:
40  void rescaled(QRectF new_size);
41 
42 private:
43  QPointF invTransform(QPoint pos);
44  QTimer _future_emit;
46 
47 };
48 
49 #endif // PLOTMAGNIFIER_H
QTimer _future_emit
Definition: plotmagnifier.h:44
virtual void rescale(double factor) override
Definition: plotmagnifier.h:22
QwtPlotMagnifier provides zooming, by magnifying in steps.
Number of axes.
Definition: qwt_plot.h:108
QPointF invTransform(QPoint pos)
virtual void widgetMousePressEvent(QMouseEvent *event) override
double _upper_bounds[QwtPlot::axisCnt]
Definition: plotmagnifier.h:35
double _lower_bounds[QwtPlot::axisCnt]
Definition: plotmagnifier.h:34
QPointF _mouse_position
Definition: plotmagnifier.h:37
virtual void widgetWheelEvent(QWheelEvent *event) override
virtual ~PlotMagnifier() override
void setDefaultMode(AxisMode mode)
Definition: plotmagnifier.h:27
void rescaled(QRectF new_size)
QWidget * canvas()
Return observed plot canvas.
AxisMode _default_mode
Definition: plotmagnifier.h:45
void setAxisLimits(int axis, double lower, double upper)
PlotMagnifier(QWidget *canvas)


plotjuggler
Author(s): Davide Faconti
autogenerated on Sat Jul 6 2019 03:44:17