00001 #ifndef PLOTZOOMER_H 00002 #define PLOTZOOMER_H 00003 00004 #include <QObject> 00005 #include <qwt_plot_zoomer.h> 00006 00007 class PlotZoomer : public QwtPlotZoomer 00008 { 00009 public: 00010 PlotZoomer(); 00011 00012 explicit PlotZoomer( QWidget *, bool doReplot = true ); 00013 00014 virtual ~PlotZoomer() = default; 00015 protected: 00016 virtual void widgetMousePressEvent( QMouseEvent * event) override; 00017 virtual void widgetMouseReleaseEvent( QMouseEvent * event) override; 00018 virtual void widgetMouseMoveEvent( QMouseEvent * event) override; 00019 virtual bool accept( QPolygon & ) const; 00020 00021 virtual QSizeF minZoomSize() const override; 00022 private: 00023 bool _mouse_pressed; 00024 bool _zoom_enabled; 00025 QPoint _initial_pos; 00026 }; 00027 00028 #endif // PLOTZOOMER_H