#include <plotzoomer.h>
Public Member Functions | |
void | keepAspectratio (bool doKeep) |
PlotZoomer () | |
PlotZoomer (QWidget *) | |
virtual | ~PlotZoomer () override |
Protected Member Functions | |
virtual bool | accept (QPolygon &) const override |
Check and correct a selected rectangle. | |
virtual QSizeF | minZoomSize () const override |
Limit zooming by a minimum rectangle. | |
virtual void | widgetMouseMoveEvent (QMouseEvent *event) override |
virtual void | widgetMousePressEvent (QMouseEvent *event) override |
virtual void | widgetMouseReleaseEvent (QMouseEvent *event) override |
virtual void | zoom (const QRectF &rect) override |
Zoom in. | |
Private Attributes | |
QPoint | _initial_pos |
bool | _keep_aspect_ratio |
bool | _mouse_pressed |
bool | _zoom_enabled |
Definition at line 7 of file plotzoomer.h.
PlotZoomer::PlotZoomer | ( | QWidget * | canvas | ) | [explicit] |
Definition at line 7 of file plotzoomer.cpp.
virtual PlotZoomer::~PlotZoomer | ( | ) | [override, virtual] |
bool PlotZoomer::accept | ( | QPolygon & | pa | ) | const [override, protected, virtual] |
Check and correct a selected rectangle.
Reject rectangles with a height or width < 2, otherwise expand the selected rectangle to a minimum size of 11x11 and accept it.
Reimplemented from QwtPlotZoomer.
Definition at line 75 of file plotzoomer.cpp.
void PlotZoomer::keepAspectratio | ( | bool | doKeep | ) | [inline] |
Definition at line 16 of file plotzoomer.h.
QSizeF PlotZoomer::minZoomSize | ( | ) | const [override, protected, virtual] |
Limit zooming by a minimum rectangle.
Reimplemented from QwtPlotZoomer.
Definition at line 119 of file plotzoomer.cpp.
void PlotZoomer::widgetMouseMoveEvent | ( | QMouseEvent * | mouseEvent | ) | [override, protected, virtual] |
Handle a mouse move event for the observed widget.
mouseEvent | Mouse event |
Reimplemented from QwtPicker.
Definition at line 32 of file plotzoomer.cpp.
void PlotZoomer::widgetMousePressEvent | ( | QMouseEvent * | mouseEvent | ) | [override, protected, virtual] |
Handle a mouse press event for the observed widget.
mouseEvent | Mouse event |
Reimplemented from QwtPicker.
Definition at line 16 of file plotzoomer.cpp.
void PlotZoomer::widgetMouseReleaseEvent | ( | QMouseEvent * | me | ) | [override, protected, virtual] |
Qt::MidButton zooms out one position on the zoom stack, Qt::RightButton to the zoom base.
Changes the current position on the stack, but doesn't pop any rectangle.
Reimplemented from QwtPlotZoomer.
Definition at line 67 of file plotzoomer.cpp.
void PlotZoomer::zoom | ( | const QRectF & | rect | ) | [override, protected, virtual] |
Zoom in.
Clears all rectangles above the current position of the zoom stack and pushes the normalized rectangle on it.
Reimplemented from QwtPlotZoomer.
Definition at line 92 of file plotzoomer.cpp.
QPoint PlotZoomer::_initial_pos [private] |
Definition at line 34 of file plotzoomer.h.
bool PlotZoomer::_keep_aspect_ratio [private] |
Definition at line 33 of file plotzoomer.h.
bool PlotZoomer::_mouse_pressed [private] |
Definition at line 31 of file plotzoomer.h.
bool PlotZoomer::_zoom_enabled [private] |
Definition at line 32 of file plotzoomer.h.