Public Member Functions | Protected Member Functions | Private Attributes
PlotZoomer Class Reference

#include <plotzoomer.h>

Inheritance diagram for PlotZoomer:
Inheritance graph
[legend]

List of all members.

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

Detailed Description

Definition at line 7 of file plotzoomer.h.


Constructor & Destructor Documentation

PlotZoomer::PlotZoomer ( QWidget *  canvas) [explicit]

Definition at line 7 of file plotzoomer.cpp.

virtual PlotZoomer::~PlotZoomer ( ) [override, virtual]

Member Function Documentation

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.

Returns:
true If the rectangle is accepted, or has been changed to an accepted one.

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.

Returns:
zoomBase().width() / 10e4, zoomBase().height() / 10e4

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.

Parameters:
mouseEventMouse event
See also:
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()

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.

Parameters:
mouseEventMouse event
See also:
eventFilter(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()

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.

Note:
The mouse events can be changed, using QwtEventPattern::setMousePattern: 2, 1

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.

Note:
If the maximal stack depth is reached, zoom is ignored.
The zoomed signal is emitted.

Reimplemented from QwtPlotZoomer.

Definition at line 92 of file plotzoomer.cpp.


Member Data Documentation

QPoint PlotZoomer::_initial_pos [private]

Definition at line 34 of file plotzoomer.h.

Definition at line 33 of file plotzoomer.h.

Definition at line 31 of file plotzoomer.h.

Definition at line 32 of file plotzoomer.h.


The documentation for this class was generated from the following files:


plotjuggler
Author(s): Davide Faconti
autogenerated on Wed Jul 3 2019 19:28:05