QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Slots | Public Member Functions | List of all members
QwtPlotMagnifier Class Reference

QwtPlotMagnifier provides zooming, by magnifying in steps. More...

#include <qwt_plot_magnifier.h>

Inheritance diagram for QwtPlotMagnifier:
QwtMagnifier

Classes

class  PrivateData
 

Public Slots

virtual void rescale (double factor) override
 

Public Member Functions

 QwtPlotMagnifier (QWidget *)
 
virtual ~QwtPlotMagnifier ()
 
void setAxisEnabled (QwtAxisId, bool on)
 
bool isAxisEnabled (QwtAxisId) const
 
QWidget * canvas ()
 
const QWidget * canvas () const
 
QwtPlotplot ()
 
const QwtPlotplot () const
 
- Public Member Functions inherited from QwtMagnifier
 QwtMagnifier (QWidget *)
 Constructor.
 
virtual ~QwtMagnifier ()
 Destructor .
 
QWidget * parentWidget ()
 Return the parent widget where the rescaling happens.
 
const QWidget * parentWidget () const
 Return the parent widget where the rescaling happens.
 
void setEnabled (bool)
 En/disable the magnifier.
 
bool isEnabled () const
 Return whether the magnifier is enabled.
 
void setMouseFactor (double)
 Change the mouse factor.
 
double mouseFactor () const
 Return the mouse factor.
 
void setMouseButton (Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)
 Assign the mouse button that is used for zooming in/out.
 
void getMouseButton (Qt::MouseButton &, Qt::KeyboardModifiers &) const
 Get the mouse button and modifiers used for zooming.
 
void setWheelFactor (double)
 Change the wheel factor.
 
double wheelFactor () const
 Return the wheel factor.
 
void setWheelModifiers (Qt::KeyboardModifiers)
 Assign keyboard modifiers for zooming in/out using the wheel.
 
Qt::KeyboardModifiers wheelModifiers () const
 Return the wheel modifiers.
 
void setKeyFactor (double)
 Change the key factor.
 
double keyFactor () const
 Return the key factor.
 
void setZoomInKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
 Assign the key that is used for zooming in.
 
void getZoomInKey (int &key, Qt::KeyboardModifiers &) const
 Retrieve the settings of the zoom in key.
 
void setZoomOutKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
 Assign the key that is used for zooming out.
 
void getZoomOutKey (int &key, Qt::KeyboardModifiers &) const
 Retrieve the settings of the zoom out key.
 
virtual bool eventFilter (QObject *, QEvent *) override
 Event filter.
 

Additional Inherited Members

- Protected Member Functions inherited from QwtMagnifier
virtual void rescale (double factor)=0
 Rescale the parent widget.
 
virtual void widgetMousePressEvent (QMouseEvent *)
 Handle a mouse press event for the observed widget.
 
virtual void widgetMouseReleaseEvent (QMouseEvent *)
 Handle a mouse release event for the observed widget.
 
virtual void widgetMouseMoveEvent (QMouseEvent *)
 Handle a mouse move event for the observed widget.
 
virtual void widgetWheelEvent (QWheelEvent *)
 Handle a wheel event for the observed widget.
 
virtual void widgetKeyPressEvent (QKeyEvent *)
 Handle a key press event for the observed widget.
 
virtual void widgetKeyReleaseEvent (QKeyEvent *)
 Handle a key release event for the observed widget.
 

Detailed Description

QwtPlotMagnifier provides zooming, by magnifying in steps.

Constructor & Destructor Documentation

◆ QwtPlotMagnifier()

QwtPlotMagnifier::QwtPlotMagnifier ( QWidget *  canvas)
explicit

Constructor

Parameters
canvasPlot canvas to be magnified

Creates a magnifier attached to the given plot canvas. All axes are enabled by default.

◆ ~QwtPlotMagnifier()

QwtPlotMagnifier::~QwtPlotMagnifier ( )
virtual

Destructor

Member Function Documentation

◆ canvas() [1/2]

QWidget * QwtPlotMagnifier::canvas ( )

Return the observed plot canvas

Returns
Pointer to the canvas widget

◆ canvas() [2/2]

const QWidget * QwtPlotMagnifier::canvas ( ) const

Return the observed plot canvas (const version)

Returns
Const pointer to the canvas widget

◆ isAxisEnabled()

bool QwtPlotMagnifier::isAxisEnabled ( QwtAxisId  axisId) const

Check if an axis is enabled for magnification

Parameters
axisIdAxis identifier
Returns
true if the axis is enabled, false otherwise
See also
setAxisEnabled()

◆ plot() [1/2]

QwtPlot * QwtPlotMagnifier::plot ( )

Return the plot widget containing the observed canvas

Returns
Pointer to the QwtPlot widget, or nullptr if not found

◆ plot() [2/2]

const QwtPlot * QwtPlotMagnifier::plot ( ) const

Return the plot widget containing the observed canvas (const version)

Returns
Const pointer to the QwtPlot widget, or nullptr if not found

◆ rescale

void QwtPlotMagnifier::rescale ( double  factor)
overridevirtualslot

Rescale the plot axes by the given factor

Parameters
factorMagnification factor. A value < 1.0 zooms in, a value > 1.0 zooms out.

This method zooms in/out the axes scales by applying the given factor to all enabled axes. The zoom is centered around the current viewport center.

For parasite plots, this method does nothing.

The method handles all plots in the plot list, including parasite plots that share the same canvas area.

◆ setAxisEnabled()

void QwtPlotMagnifier::setAxisEnabled ( QwtAxisId  axisId,
bool  on 
)

Enable or disable an axis for magnification

Parameters
axisIdAxis identifier
ontrue to enable, false to disable

Only axes that are enabled will be zoomed when the magnifier is triggered. All other axes will remain unchanged.

All axes are enabled by default.

See also
isAxisEnabled()

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