QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
QwtPlotCanvasZoomState Struct Reference

Struct that stores zoom states for all four axes. More...

#include <qwt_plot_canvas_zoomer.h>

Public Member Functions

 QwtPlotCanvasZoomState ()
 Default constructor creating an invalid zoom state.
 
 QwtPlotCanvasZoomState (QwtPlot *p, const QwtInterval &yLeft, const QwtInterval &yRight, const QwtInterval &xBottom, const QwtInterval &xTop)
 Constructor creating a zoom state with specified axis intervals.
 
void apply () const
 Apply this zoom state to the associated plot.
 
bool operator== (const QwtPlotCanvasZoomState &other) const
 Compare two zoom states for equality.
 
bool operator!= (const QwtPlotCanvasZoomState &other) const
 Compare two zoom states for inequality.
 
bool isValid () const
 Check if this zoom state is valid.
 

Static Public Member Functions

static QwtPlotCanvasZoomState fromPlot (QwtPlot *plot)
 Create a zoom state from the current axis ranges of a plot.
 

Public Attributes

QPointer< QwtPlotplot
 
QwtInterval axisInterval [QwtAxis::AxisPositions]
 

Detailed Description

Struct that stores zoom states for all four axes.

Constructor & Destructor Documentation

◆ QwtPlotCanvasZoomState()

QwtPlotCanvasZoomState::QwtPlotCanvasZoomState ( QwtPlot p,
const QwtInterval yLeft,
const QwtInterval yRight,
const QwtInterval xBottom,
const QwtInterval xTop 
)

Constructor creating a zoom state with specified axis intervals.

Parameters
[in]pPlot widget associated with this zoom state
[in]yLeftInterval for the left Y axis
[in]yRightInterval for the right Y axis
[in]xBottomInterval for the bottom X axis
[in]xTopInterval for the top X axis

Member Function Documentation

◆ apply()

void QwtPlotCanvasZoomState::apply ( ) const

Apply this zoom state to the associated plot.

Sets all four axis scales to the intervals stored in this zoom state. Does nothing if the plot pointer is null.

◆ fromPlot()

QwtPlotCanvasZoomState QwtPlotCanvasZoomState::fromPlot ( QwtPlot p)
static

Create a zoom state from the current axis ranges of a plot.

Parameters
[in]pPlot widget to capture axis ranges from
Returns
QwtPlotCanvasZoomState containing current axis intervals

This static method captures the current scale divisions of all four axes from the given plot and stores them in a new zoom state object.

◆ isValid()

bool QwtPlotCanvasZoomState::isValid ( ) const

Check if this zoom state is valid.

Returns
true if the zoom state has an associated plot pointer

◆ operator!=()

bool QwtPlotCanvasZoomState::operator!= ( const QwtPlotCanvasZoomState other) const

Compare two zoom states for inequality.

Parameters
[in]otherAnother zoom state to compare with
Returns
true if the states differ in plot or any axis interval

◆ operator==()

bool QwtPlotCanvasZoomState::operator== ( const QwtPlotCanvasZoomState other) const

Compare two zoom states for equality.

Parameters
[in]otherAnother zoom state to compare with
Returns
true if both states have the same plot and axis intervals

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