Public Types | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
PlotMagnifier Class Reference

#include <plotmagnifier.h>

Inheritance diagram for PlotMagnifier:
Inheritance graph
[legend]

Public Types

enum  AxisMode { X_AXIS, Y_AXIS, BOTH_AXES }
 

Signals

void rescaled (QRectF new_size)
 

Public Member Functions

 PlotMagnifier (QWidget *canvas)
 
virtual void rescale (double factor) override
 
void rescale (double factor, AxisMode axis)
 
void setAxisLimits (int axis, double lower, double upper)
 
void setDefaultMode (AxisMode mode)
 
virtual void widgetWheelEvent (QWheelEvent *event) override
 
virtual ~PlotMagnifier () override
 
- Public Member Functions inherited from QwtPlotMagnifier
QWidget * canvas ()
 Return observed plot canvas. More...
 
const QWidget * canvas () const
 
bool isAxisEnabled (QwtAxisId) const
 
QwtPlotplot ()
 Return plot widget, containing the observed plot canvas. More...
 
const QwtPlotplot () const
 
 QwtPlotMagnifier (QWidget *)
 
void setAxisEnabled (QwtAxisId, bool on)
 En/Disable an axis. More...
 
virtual ~QwtPlotMagnifier ()
 Destructor. More...
 
- Public Member Functions inherited from QwtMagnifier
virtual bool eventFilter (QObject *, QEvent *) QWT_OVERRIDE
 Event filter. More...
 
void getMouseButton (Qt::MouseButton &, Qt::KeyboardModifiers &) const
 
void getZoomInKey (int &key, Qt::KeyboardModifiers &) const
 Retrieve the settings of the zoom in key. More...
 
void getZoomOutKey (int &key, Qt::KeyboardModifiers &) const
 Retrieve the settings of the zoom out key. More...
 
bool isEnabled () const
 
double keyFactor () const
 
double mouseFactor () const
 
QWidget * parentWidget ()
 
const QWidget * parentWidget () const
 
 QwtMagnifier (QWidget *)
 
void setEnabled (bool)
 En/disable the magnifier. More...
 
void setKeyFactor (double)
 Change the key factor. More...
 
void setMouseButton (Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)
 
void setMouseFactor (double)
 Change the mouse factor. More...
 
void setWheelFactor (double)
 Change the wheel factor. More...
 
void setWheelModifiers (Qt::KeyboardModifiers)
 
void setZoomInKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
 
void setZoomOutKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
 
double wheelFactor () const
 
Qt::KeyboardModifiers wheelModifiers () const
 
virtual ~QwtMagnifier ()
 Destructor. More...
 

Protected Member Functions

virtual void widgetMousePressEvent (QMouseEvent *event) override
 
- Protected Member Functions inherited from QwtMagnifier
virtual void widgetKeyPressEvent (QKeyEvent *)
 
virtual void widgetKeyReleaseEvent (QKeyEvent *)
 
virtual void widgetMouseMoveEvent (QMouseEvent *)
 
virtual void widgetMouseReleaseEvent (QMouseEvent *)
 

Protected Attributes

double _lower_bounds [QwtPlot::axisCnt]
 
QPointF _mouse_position
 
double _upper_bounds [QwtPlot::axisCnt]
 

Private Member Functions

QPointF invTransform (QPoint pos)
 

Private Attributes

AxisMode _default_mode
 
QTimer _future_emit
 

Additional Inherited Members

- Public Slots inherited from QwtPlotMagnifier

Detailed Description

Definition at line 15 of file plotmagnifier.h.

Member Enumeration Documentation

◆ AxisMode

Enumerator
X_AXIS 
Y_AXIS 
BOTH_AXES 

Definition at line 26 of file plotmagnifier.h.

Constructor & Destructor Documentation

◆ PlotMagnifier()

PlotMagnifier::PlotMagnifier ( QWidget *  canvas)
explicit

Definition at line 16 of file plotmagnifier.cpp.

◆ ~PlotMagnifier()

PlotMagnifier::~PlotMagnifier ( )
overridevirtual

Definition at line 26 of file plotmagnifier.cpp.

Member Function Documentation

◆ invTransform()

QPointF PlotMagnifier::invTransform ( QPoint  pos)
private

Definition at line 145 of file plotmagnifier.cpp.

◆ rescale() [1/2]

virtual void PlotMagnifier::rescale ( double  factor)
inlineoverridevirtual

Zoom in/out the axes scales

Parameters
factorA value < 1.0 zooms in, a value > 1.0 zooms out.

Reimplemented from QwtPlotMagnifier.

Definition at line 33 of file plotmagnifier.h.

◆ rescale() [2/2]

void PlotMagnifier::rescale ( double  factor,
AxisMode  axis 
)

Definition at line 39 of file plotmagnifier.cpp.

◆ rescaled

void PlotMagnifier::rescaled ( QRectF  new_size)
signal

◆ setAxisLimits()

void PlotMagnifier::setAxisLimits ( int  axis,
double  lower,
double  upper 
)

Definition at line 30 of file plotmagnifier.cpp.

◆ setDefaultMode()

void PlotMagnifier::setDefaultMode ( AxisMode  mode)
inline

Definition at line 38 of file plotmagnifier.h.

◆ widgetMousePressEvent()

void PlotMagnifier::widgetMousePressEvent ( QMouseEvent *  mouseEvent)
overrideprotectedvirtual

Handle a mouse press event for the observed widget.

Parameters
mouseEventMouse event
See also
eventFilter(), widgetMouseReleaseEvent(), widgetMouseMoveEvent()

Reimplemented from QwtMagnifier.

Definition at line 158 of file plotmagnifier.cpp.

◆ widgetWheelEvent()

void PlotMagnifier::widgetWheelEvent ( QWheelEvent *  wheelEvent)
overridevirtual

Handle a wheel event for the observed widget.

Parameters
wheelEventWheel event
See also
eventFilter()

Reimplemented from QwtMagnifier.

Definition at line 152 of file plotmagnifier.cpp.

Member Data Documentation

◆ _default_mode

AxisMode PlotMagnifier::_default_mode
private

Definition at line 59 of file plotmagnifier.h.

◆ _future_emit

QTimer PlotMagnifier::_future_emit
private

Definition at line 58 of file plotmagnifier.h.

◆ _lower_bounds

double PlotMagnifier::_lower_bounds[QwtPlot::axisCnt]
protected

Definition at line 48 of file plotmagnifier.h.

◆ _mouse_position

QPointF PlotMagnifier::_mouse_position
protected

Definition at line 51 of file plotmagnifier.h.

◆ _upper_bounds

double PlotMagnifier::_upper_bounds[QwtPlot::axisCnt]
protected

Definition at line 49 of file plotmagnifier.h.


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


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