#include <plotzoomer.h>
Public Member Functions | |
void | keepAspectratio (bool doKeep) |
PlotZoomer () | |
PlotZoomer (QWidget *) | |
virtual | ~PlotZoomer () override=default |
Public Member Functions inherited from QwtPlotZoomer | |
int | maxStackDepth () const |
QwtPlotZoomer (QWidget *, bool doReplot=true) | |
Create a zoomer for a plot canvas. More... | |
QwtPlotZoomer (int xAxis, int yAxis, QWidget *, bool doReplot=true) | |
Create a zoomer for a plot canvas. More... | |
virtual void | setAxis (int xAxis, int yAxis) override |
void | setMaxStackDepth (int) |
Limit the number of recursive zoom operations to depth. More... | |
virtual void | setZoomBase (bool doReplot=true) |
virtual void | setZoomBase (const QRectF &) |
Set the initial size of the zoomer. More... | |
void | setZoomStack (const QStack< QRectF > &, int zoomRectIndex=-1) |
Assign a zoom stack. More... | |
QRectF | zoomBase () const |
QRectF | zoomRect () const |
uint | zoomRectIndex () const |
const QStack< QRectF > & | zoomStack () const |
virtual | ~QwtPlotZoomer () |
Public Member Functions inherited from QwtPlotPicker | |
QWidget * | canvas () |
const QWidget * | canvas () const |
QwtPlot * | plot () |
const QwtPlot * | plot () const |
QwtPlotPicker (QWidget *canvas) | |
Create a plot picker. More... | |
QwtPlotPicker (int xAxis, int yAxis, QWidget *) | |
QwtPlotPicker (int xAxis, int yAxis, RubberBand rubberBand, DisplayMode trackerMode, QWidget *) | |
int | xAxis () const |
Return x axis. More... | |
int | yAxis () const |
Return y axis. More... | |
virtual | ~QwtPlotPicker () |
Destructor. More... | |
Public Member Functions inherited from QwtPicker | |
virtual void | drawRubberBand (QPainter *) const |
virtual void | drawTracker (QPainter *) const |
virtual bool | eventFilter (QObject *, QEvent *) |
Event filter. More... | |
bool | isActive () const |
bool | isEnabled () const |
QWidget * | parentWidget () |
Return the parent widget, where the selection happens. More... | |
const QWidget * | parentWidget () const |
Return the parent widget, where the selection happens. More... | |
virtual QPainterPath | pickArea () const |
QwtPicker (QWidget *parent) | |
QwtPicker (RubberBand rubberBand, DisplayMode trackerMode, QWidget *) | |
ResizeMode | resizeMode () const |
RubberBand | rubberBand () const |
virtual QRegion | rubberBandMask () const |
QPen | rubberBandPen () const |
QPolygon | selection () const |
void | setResizeMode (ResizeMode) |
Set the resize mode. More... | |
void | setRubberBand (RubberBand) |
void | setRubberBandPen (const QPen &) |
void | setStateMachine (QwtPickerMachine *) |
void | setTrackerFont (const QFont &) |
void | setTrackerMode (DisplayMode) |
Set the display mode of the tracker. More... | |
void | setTrackerPen (const QPen &) |
const QwtPickerMachine * | stateMachine () const |
QwtPickerMachine * | stateMachine () |
QFont | trackerFont () const |
virtual QRegion | trackerMask () const |
DisplayMode | trackerMode () const |
QPen | trackerPen () const |
QPoint | trackerPosition () const |
virtual QRect | trackerRect (const QFont &) const |
virtual | ~QwtPicker () |
Destructor. More... | |
Public Member Functions inherited from QwtEventPattern | |
void | initKeyPattern () |
void | initMousePattern (int numButtons) |
bool | keyMatch (KeyPatternCode, const QKeyEvent *) const |
Compare a key event with an event pattern. More... | |
const QVector< KeyPattern > & | keyPattern () const |
QVector< KeyPattern > & | keyPattern () |
bool | mouseMatch (MousePatternCode, const QMouseEvent *) const |
Compare a mouse event with an event pattern. More... | |
const QVector< MousePattern > & | mousePattern () const |
QVector< MousePattern > & | mousePattern () |
QwtEventPattern () | |
void | setKeyPattern (KeyPatternCode, int keyCode, Qt::KeyboardModifiers modifierCodes=Qt::NoModifier) |
void | setKeyPattern (const QVector< KeyPattern > &) |
Change the key event patterns. More... | |
void | setMousePattern (MousePatternCode, Qt::MouseButton button, Qt::KeyboardModifiers=Qt::NoModifier) |
void | setMousePattern (const QVector< MousePattern > &) |
Change the mouse event patterns. More... | |
virtual | ~QwtEventPattern () |
Destructor. More... | |
Protected Member Functions | |
virtual bool | accept (QPolygon &) const override |
Check and correct a selected rectangle. More... | |
virtual QSizeF | minZoomSize () const override |
Limit zooming by a minimum rectangle. More... | |
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. More... | |
Protected Member Functions inherited from QwtPlotZoomer | |
virtual void | begin () override |
virtual bool | end (bool ok=true) override |
virtual void | rescale () |
virtual void | widgetKeyPressEvent (QKeyEvent *) override |
Protected Member Functions inherited from QwtPlotPicker | |
virtual void | append (const QPoint &) |
QRectF | invTransform (const QRect &) const |
QPointF | invTransform (const QPoint &) const |
virtual void | move (const QPoint &) |
QRectF | scaleRect () const |
virtual QwtText | trackerText (const QPoint &) const |
virtual QwtText | trackerTextF (const QPointF &) const |
Translate a position into a position string. More... | |
QRect | transform (const QRectF &) const |
QPoint | transform (const QPointF &) const |
Protected Member Functions inherited from QwtPicker | |
virtual QPolygon | adjustedPoints (const QPolygon &) const |
Map the pickedPoints() into a selection() More... | |
const QPolygon & | pickedPoints () const |
virtual void | remove () |
virtual void | reset () |
const QwtWidgetOverlay * | rubberBandOverlay () const |
virtual void | stretchSelection (const QSize &oldSize, const QSize &newSize) |
const QwtWidgetOverlay * | trackerOverlay () const |
virtual void | transition (const QEvent *) |
virtual void | updateDisplay () |
Update the state of rubber band and tracker label. More... | |
virtual void | widgetEnterEvent (QEvent *) |
virtual void | widgetKeyReleaseEvent (QKeyEvent *) |
virtual void | widgetLeaveEvent (QEvent *) |
virtual void | widgetMouseDoubleClickEvent (QMouseEvent *) |
virtual void | widgetWheelEvent (QWheelEvent *) |
Protected Member Functions inherited from QwtEventPattern | |
virtual bool | keyMatch (const KeyPattern &, const QKeyEvent *) const |
Compare a key event with an event pattern. More... | |
virtual bool | mouseMatch (const MousePattern &, const QMouseEvent *) const |
Compare a mouse event with an event pattern. More... | |
Private Attributes | |
QPoint | _initial_pos |
bool | _keep_aspect_ratio |
bool | _mouse_pressed |
bool | _zoom_enabled |
Additional Inherited Members | |
Public Types inherited from QwtPicker | |
enum | DisplayMode { AlwaysOff, AlwaysOn, ActiveOnly } |
Display mode. More... | |
enum | ResizeMode { Stretch, KeepSize } |
enum | RubberBand { NoRubberBand = 0, HLineRubberBand, VLineRubberBand, CrossRubberBand, RectRubberBand, EllipseRubberBand, PolygonRubberBand, UserRubberBand = 100 } |
Public Types inherited from QwtEventPattern | |
enum | KeyPatternCode { KeySelect1, KeySelect2, KeyAbort, KeyLeft, KeyRight, KeyUp, KeyDown, KeyRedo, KeyUndo, KeyHome, KeyPatternCount } |
Symbolic keyboard input codes. More... | |
enum | MousePatternCode { MouseSelect1, MouseSelect2, MouseSelect3, MouseSelect4, MouseSelect5, MouseSelect6, MousePatternCount } |
Symbolic mouse input codes. More... | |
Public Slots inherited from QwtPlotZoomer | |
void | moveBy (double dx, double dy) |
virtual void | moveTo (const QPointF &) |
virtual void | zoom (int offset) |
Zoom in or out. More... | |
Public Slots inherited from QwtPicker | |
void | setEnabled (bool) |
En/disable the picker. More... | |
Signals inherited from QwtPlotZoomer | |
void | zoomed (const QRectF &rect) |
Signals inherited from QwtPlotPicker | |
void | appended (const QPointF &pos) |
void | moved (const QPointF &pos) |
void | selected (const QPointF &pos) |
void | selected (const QRectF &rect) |
void | selected (const QVector< QPointF > &pa) |
Signals inherited from QwtPicker | |
void | activated (bool on) |
void | appended (const QPoint &pos) |
void | changed (const QPolygon &selection) |
void | moved (const QPoint &pos) |
void | removed (const QPoint &pos) |
void | selected (const QPolygon &polygon) |
Properties inherited from QwtPicker | |
bool | isEnabled |
ResizeMode | resizeMode |
RubberBand | rubberBand |
QPen | rubberBandPen |
QFont | trackerFont |
DisplayMode | trackerMode |
QPen | trackerPen |
Definition at line 7 of file plotzoomer.h.
PlotZoomer::PlotZoomer | ( | ) |
|
explicit |
Definition at line 7 of file plotzoomer.cpp.
|
overridevirtualdefault |
|
overrideprotectedvirtual |
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.
|
inline |
Definition at line 16 of file plotzoomer.h.
|
overrideprotectedvirtual |
Limit zooming by a minimum rectangle.
Reimplemented from QwtPlotZoomer.
Definition at line 119 of file plotzoomer.cpp.
|
overrideprotectedvirtual |
Handle a mouse move event for the observed widget.
mouseEvent | Mouse event |
Reimplemented from QwtPicker.
Definition at line 32 of file plotzoomer.cpp.
|
overrideprotectedvirtual |
Handle a mouse press event for the observed widget.
mouseEvent | Mouse event |
Reimplemented from QwtPicker.
Definition at line 16 of file plotzoomer.cpp.
|
overrideprotectedvirtual |
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.
|
overrideprotectedvirtual |
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.
|
private |
Definition at line 34 of file plotzoomer.h.
|
private |
Definition at line 33 of file plotzoomer.h.
|
private |
Definition at line 31 of file plotzoomer.h.
|
private |
Definition at line 32 of file plotzoomer.h.