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

Event filter for parasitic plots, handling axis interactions. More...

#include <qwt_plot_scale_event_dispatcher.h>

Inheritance diagram for QwtPlotScaleEventDispatcher:

Classes

class  PrivateData
 

Public Slots

void updateCache ()
 Update cache.
 
void setEnable (bool on=true)
 Set enabled state.
 

Public Member Functions

 QwtPlotScaleEventDispatcher (QwtPlot *plot, QObject *par=nullptr)
 Constructor.
 
 ~QwtPlotScaleEventDispatcher () override
 Destructor.
 
bool isEnable () const
 Check if enabled.
 

Static Public Member Functions

static QwtAxisId findAxisIdByScaleWidget (const QwtPlot *plot, const QwtScaleWidget *scaleWidget)
 Find axis ID corresponding to QwtScaleWidget.
 

Protected Member Functions

virtual bool eventFilter (QObject *obj, QEvent *e) override
 
void rebuildCache ()
 Rebuild all cache data; must be called when a new parasite plot is added to cache the plot's axes.
 
virtual bool handleMousePress (QwtPlot *bindPlot, QMouseEvent *e)
 
virtual bool handleMouseMove (QwtPlot *bindPlot, QMouseEvent *e)
 
virtual bool handleMouseRelease (QwtPlot *bindPlot, QMouseEvent *e)
 
virtual bool handleWheelEvent (QwtPlot *bindPlot, QWheelEvent *e)
 
QwtScaleWidgetfindTargetOnScale (const QPoint &pos)
 

Detailed Description

Event filter for parasitic plots, handling axis interactions.

Since parasitic plots are child windows of host plots, events from multiple parasitic plots' widgets cannot be passed to other parasitic plots' widgets. For example, with 2 parasitic plots, their axis areas overlap. The top-level parasitic plot's axis widget has the same size as the lower-level and host plot's axis widgets. Only the top-level parasitic axis widget receives events. Even if ignored, events only fall to the current parasitic plot window, not the next level's axis widget. This class is designed to solve this problem. Axis actions are executed here as event handlers rather than event propagators.

Constructor & Destructor Documentation

◆ QwtPlotScaleEventDispatcher()

QwtPlotScaleEventDispatcher::QwtPlotScaleEventDispatcher ( QwtPlot plot,
QObject *  par = nullptr 
)
explicit

Constructor.

Parameters
[in]plotPlot widget
[in]parParent object

Destructor

Member Function Documentation

◆ findAxisIdByScaleWidget()

QwtAxisId QwtPlotScaleEventDispatcher::findAxisIdByScaleWidget ( const QwtPlot plot,
const QwtScaleWidget scaleWidget 
)
static

Find axis ID corresponding to QwtScaleWidget.

Parameters
[in]plotQwtPlot pointer
[in]scaleWidgetQwtScaleWidget to find
Returns
Axis ID, returns QwtAxis::AxisPositions if not found

◆ isEnable()

bool QwtPlotScaleEventDispatcher::isEnable ( ) const

Check if enabled.

Returns
True if enabled

◆ setEnable

void QwtPlotScaleEventDispatcher::setEnable ( bool  on = true)
slot

Set enabled state.

Parameters
[in]onEnable/disable

◆ updateCache

void QwtPlotScaleEventDispatcher::updateCache ( )
slot

Update cache.

Update cache, rebuild if necessary.

Called when cache is dirty or needs refresh.


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