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 | Protected Member Functions | List of all members
QwtPlotCachePanner Class Reference

QwtPlotCachePanner provides panning of a plot canvas. More...

#include <qwt_plot_cache_panner.h>

Inheritance diagram for QwtPlotCachePanner:
QwtCachePanner

Classes

class  PrivateData
 

Public Slots

virtual void moveCanvas (int dx, int dy)
 Move the canvas by the specified offset.
 

Public Member Functions

 QwtPlotCachePanner (QWidget *)
 Constructor.
 
virtual ~QwtPlotCachePanner ()
 Destructor.
 
QWidget * canvas ()
 Get the canvas widget.
 
const QWidget * canvas () const
 Get the canvas widget (const version)
 
QwtPlotplot ()
 Get the plot widget.
 
const QwtPlotplot () const
 Get the plot widget (const version)
 
void setAxisEnabled (QwtAxisId axisId, bool on)
 Enable or disable an axis for panning.
 
bool isAxisEnabled (QwtAxisId) const
 Check if an axis is enabled for panning.
 
- Public Member Functions inherited from QwtCachePanner
 QwtCachePanner (QWidget *parent)
 Creates a panner that is enabled for the left mouse button.
 
virtual ~QwtCachePanner ()
 Destructor .
 
void setEnabled (bool)
 En/disable the panner.
 
bool isEnabled () const
 Return whether the panner is enabled.
 
void setMouseButton (Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)
 Change the mouse button and modifiers used for panning.
 
void getMouseButton (Qt::MouseButton &button, Qt::KeyboardModifiers &) const
 Get mouse button and modifiers used for panning.
 
void setAbortKey (int key, Qt::KeyboardModifiers=Qt::NoModifier)
 Change the abort key.
 
void getAbortKey (int &key, Qt::KeyboardModifiers &) const
 Get the abort key and modifiers.
 
void setCursor (const QCursor &)
 Change the cursor that is active while panning.
 
const QCursor cursor () const
 Return the cursor that is active while panning.
 
void setOrientations (Qt::Orientations)
 Set the orientations where panning is enabled.
 
Qt::Orientations orientations () const
 Return the orientation where panning is enabled.
 
bool isOrientationEnabled (Qt::Orientation) const
 Check if an orientation is enabled.
 
virtual bool eventFilter (QObject *, QEvent *) override
 Event filter.
 

Protected Member Functions

virtual QBitmap contentsMask () const override
 Get the contents mask.
 
virtual QPixmap grab () const override
 Grab the canvas.
 
- Protected Member Functions inherited from QwtCachePanner
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 widgetKeyPressEvent (QKeyEvent *)
 Handle a key press event for the observed widget.
 
virtual void widgetKeyReleaseEvent (QKeyEvent *)
 Handle a key release event for the observed widget.
 
virtual void paintEvent (QPaintEvent *) override
 Paint event.
 

Additional Inherited Members

- Signals inherited from QwtCachePanner
void panned (int dx, int dy)
 Signal emitted when panning is done.
 
void moved (int dx, int dy)
 Signal emitted while the widget moved, but panning is not finished.
 

Detailed Description

QwtPlotCachePanner provides panning of a plot canvas.

Constructor & Destructor Documentation

◆ QwtPlotCachePanner()

QwtPlotCachePanner::QwtPlotCachePanner ( QWidget *  canvas)
explicit

Constructor.

Constructs a panner for the canvas of a QwtPlot

Creates a QwtPlotCachePanner object attached to the given canvas. The panner is enabled for all axes by default.

Parameters
canvasPlot canvas to pan, also becomes the parent object
See also
setAxisEnabled()

◆ ~QwtPlotCachePanner()

QwtPlotCachePanner::~QwtPlotCachePanner ( )
virtual

Destructor.

Destructor

Releases all resources held by the panner.

Member Function Documentation

◆ canvas() [1/2]

QWidget * QwtPlotCachePanner::canvas ( )

Get the canvas widget.

Returns the observed plot canvas

Returns
Pointer to the canvas widget

◆ canvas() [2/2]

const QWidget * QwtPlotCachePanner::canvas ( ) const

Get the canvas widget (const version)

Returns the observed plot canvas (const version)

Returns
Const pointer to the canvas widget

◆ contentsMask()

QBitmap QwtPlotCachePanner::contentsMask ( ) const
overrideprotectedvirtual

Get the contents mask.

Calculate a mask from the border path of the canvas.

Returns
Mask as bitmap
See also
QwtPlotCanvas::borderPath()

Reimplemented from QwtCachePanner.

◆ grab()

QPixmap QwtPlotCachePanner::grab ( ) const
overrideprotectedvirtual

Grab the canvas.

Returns
Pixmap with the content of the canvas

Reimplemented from QwtCachePanner.

◆ isAxisEnabled()

bool QwtPlotCachePanner::isAxisEnabled ( QwtAxisId  axisId) const

Check if an axis is enabled for panning.

Tests if an axis is enabled for panning

Parameters
axisIdAxis identifier to test
Returns
True if the axis is enabled, false otherwise
See also
setAxisEnabled(), moveCanvas()

◆ moveCanvas

void QwtPlotCachePanner::moveCanvas ( int  dx,
int  dy 
)
virtualslot

Move the canvas by the specified offset.

Adjusts the enabled axes according to the pixel offset

Moves the canvas by the specified pixel offset and updates the axis scales accordingly. Only enabled axes are affected.

Parameters
dxPixel offset in x direction
dyPixel offset in y direction
See also
QwtPanner::panned(), setAxisEnabled()

◆ plot() [1/2]

QwtPlot * QwtPlotCachePanner::plot ( )

Get the plot widget.

Returns the plot widget containing the observed canvas

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

◆ plot() [2/2]

const QwtPlot * QwtPlotCachePanner::plot ( ) const

Get the plot widget (const version)

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

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

◆ setAxisEnabled()

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

Enable or disable an axis for panning.

Enables or disables an axis for panning

Axes that are enabled will be synchronized to the result of panning. All other axes will remain unchanged.

Parameters
axisIdAxis identifier
onTrue to enable, false to disable
See also
isAxisEnabled(), moveCanvas()

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