plotzoomer.h
Go to the documentation of this file.
1 #ifndef PLOTZOOMER_H
2 #define PLOTZOOMER_H
3 
4 #include <QObject>
5 #include "qwt_plot_zoomer.h"
6 
7 class PlotZoomer : public QwtPlotZoomer
8 {
9 public:
10  PlotZoomer();
11 
12  explicit PlotZoomer( QWidget *);
13 
14  virtual ~PlotZoomer() override = default;
15 
16  void keepAspectratio(bool doKeep)
17  {
18  _keep_aspect_ratio = doKeep;
19  }
20 
21 protected:
22  virtual void widgetMousePressEvent( QMouseEvent * event) override;
23  virtual void widgetMouseReleaseEvent( QMouseEvent * event) override;
24  virtual void widgetMouseMoveEvent( QMouseEvent * event) override;
25  virtual bool accept( QPolygon & ) const override;
26 
27  virtual void zoom( const QRectF &rect ) override;
28 
29  virtual QSizeF minZoomSize() const override;
30 private:
34  QPoint _initial_pos;
35 };
36 
37 #endif // PLOTZOOMER_H
virtual QSizeF minZoomSize() const override
Limit zooming by a minimum rectangle.
Definition: plotzoomer.cpp:119
virtual ~PlotZoomer() override=default
bool _mouse_pressed
Definition: plotzoomer.h:31
QPoint _initial_pos
Definition: plotzoomer.h:34
bool _zoom_enabled
Definition: plotzoomer.h:32
void keepAspectratio(bool doKeep)
Definition: plotzoomer.h:16
virtual bool accept(QPolygon &) const override
Check and correct a selected rectangle.
Definition: plotzoomer.cpp:75
virtual void widgetMouseMoveEvent(QMouseEvent *event) override
Definition: plotzoomer.cpp:32
QwtPlotZoomer provides stacked zooming for a plot widget.
virtual void zoom(const QRectF &rect) override
Zoom in.
Definition: plotzoomer.cpp:92
virtual void widgetMouseReleaseEvent(QMouseEvent *event) override
Definition: plotzoomer.cpp:67
virtual void widgetMousePressEvent(QMouseEvent *event) override
Definition: plotzoomer.cpp:16
bool _keep_aspect_ratio
Definition: plotzoomer.h:33


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