plotzoomer.h
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #ifndef PLOTZOOMER_H
8 #define PLOTZOOMER_H
9 
10 #include <QObject>
11 #include <QPoint>
12 #include <QDebug>
13 #include "qwt_plot_zoomer.h"
14 
15 class PlotZoomer : public QwtPlotZoomer
16 {
17 public:
18  PlotZoomer();
19 
20  explicit PlotZoomer(QWidget*);
21 
22  virtual ~PlotZoomer() override = default;
23 
24  void keepAspectRatio(bool doKeep)
25  {
26  _keep_aspect_ratio = doKeep;
27  }
28 
29 protected:
30  virtual void widgetMousePressEvent(QMouseEvent* event) override;
31  virtual void widgetMouseReleaseEvent(QMouseEvent* event) override;
32  virtual void widgetMouseMoveEvent(QMouseEvent* event) override;
33  virtual bool accept(QPolygon&) const override;
34 
35  virtual void zoom(const QRectF& rect) override;
36 
37  virtual QSizeF minZoomSize() const override;
38 
39 private:
43  QPoint _initial_pos;
44 };
45 
46 #endif // PLOTZOOMER_H
PlotZoomer::_mouse_pressed
bool _mouse_pressed
Definition: plotzoomer.h:40
QwtPlotZoomer
QwtPlotZoomer provides stacked zooming for a plot widget.
Definition: qwt_plot_zoomer.h:79
qwt_plot_zoomer.h
PlotZoomer
Definition: plotzoomer.h:15
PlotZoomer::_zoom_enabled
bool _zoom_enabled
Definition: plotzoomer.h:41
PlotZoomer::_initial_pos
QPoint _initial_pos
Definition: plotzoomer.h:43
PlotZoomer::accept
virtual bool accept(QPolygon &) const override
Check and correct a selected rectangle.
Definition: plotzoomer.cpp:92
PlotZoomer::widgetMouseMoveEvent
virtual void widgetMouseMoveEvent(QMouseEvent *event) override
Definition: plotzoomer.cpp:44
PlotZoomer::zoom
virtual void zoom(const QRectF &rect) override
Zoom in.
Definition: plotzoomer.cpp:110
PlotZoomer::widgetMousePressEvent
virtual void widgetMousePressEvent(QMouseEvent *event) override
Definition: plotzoomer.cpp:27
PlotZoomer::_keep_aspect_ratio
bool _keep_aspect_ratio
Definition: plotzoomer.h:42
PlotZoomer::widgetMouseReleaseEvent
virtual void widgetMouseReleaseEvent(QMouseEvent *event) override
Definition: plotzoomer.cpp:84
PlotZoomer::minZoomSize
virtual QSizeF minZoomSize() const override
Limit zooming by a minimum rectangle.
Definition: plotzoomer.cpp:138
PlotZoomer::~PlotZoomer
virtual ~PlotZoomer() override=default
PlotZoomer::PlotZoomer
PlotZoomer()
PlotZoomer::keepAspectRatio
void keepAspectRatio(bool doKeep)
Definition: plotzoomer.h:24


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45