QWT 7.0.1
Loading...
Searching...
No Matches
Classes | Public Slots | Public Member Functions | Protected Member Functions | List of all members
QwtPlotCachePanner Class Reference

QwtPlotPanner 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)
 Adjust the enabled axes according to dx/dy.
 

Public Member Functions

 QwtPlotCachePanner (QWidget *)
 A panner for the canvas of a QwtPlot.
 
virtual ~QwtPlotCachePanner ()
 Destructor.
 
QWidget * canvas ()
 Return observed plot canvas.
 
const QWidget * canvas () const
 Return Observed plot canvas.
 
QwtPlotplot ()
 Return plot widget, containing the observed plot canvas.
 
const QwtPlotplot () const
 Return plot widget, containing the observed plot canvas.
 
void setAxisEnabled (QwtAxisId axisId, bool on)
 En/Disable an axis.
 
bool isAxisEnabled (QwtAxisId) const
 Test if an axis is enabled.
 
- Public Member Functions inherited from QwtCachePanner
 QwtCachePanner (QWidget *parent)
 Creates an panner that is enabled for the left mouse button.
 
virtual ~QwtCachePanner ()
 Destructor.
 
void setEnabled (bool)
 En/disable the panner.
 
bool isEnabled () const
 
void setMouseButton (Qt::MouseButton, Qt::KeyboardModifiers=Qt::NoModifier)
 Change the mouse button and modifiers used for panning The defaults are Qt::LeftButton and Qt::NoModifier.
 
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 The defaults are Qt::Key_Escape and Qt::NoModifiers.
 
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 The default is the cursor of the parent widget.
 
const QCursor cursor () const
 
void setOrientations (Qt::Orientations)
 Set the orientations, where panning is enabled The default value is in both directions: Qt::Horizontal | Qt::Vertical.
 
Qt::Orientations orientations () const
 Return the orientation, where panning is enabled.
 
bool isOrientationEnabled (Qt::Orientation) const
 
virtual bool eventFilter (QObject *, QEvent *) QWT_OVERRIDE
 Event filter.
 

Protected Member Functions

virtual QBitmap contentsMask () const QWT_OVERRIDE
 Calculate a mask from the border path of the canvas.
 
virtual QPixmap grab () const QWT_OVERRIDE
 
- 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 *) QWT_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

QwtPlotPanner provides panning of a plot canvas.

QwtPlotPanner is a panner for a plot canvas, that adjusts the scales of the axes after dropping the canvas on its new position.

Together with QwtPlotZoomer and QwtPlotMagnifier powerful ways of navigating on a QwtPlot widget can be implemented easily.

Note
The axes are not updated, while dragging the canvas
See also
QwtPlotZoomer, QwtPlotMagnifier

Constructor & Destructor Documentation

◆ QwtPlotCachePanner()

QwtPlotCachePanner::QwtPlotCachePanner ( QWidget *  canvas)
explicit

A panner for the canvas of a QwtPlot.

The panner is enabled for all axes

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

Member Function Documentation

◆ contentsMask()

QBitmap QwtPlotCachePanner::contentsMask ( ) const
protectedvirtual

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
protectedvirtual
Returns
Pixmap with the content of the canvas

Reimplemented from QwtCachePanner.

◆ isAxisEnabled()

bool QwtPlotCachePanner::isAxisEnabled ( QwtAxisId  axisId) const

Test if an axis is enabled.

Parameters
axisIdAxis
Returns
True, if the axis is enabled
See also
setAxisEnabled(), moveCanvas()

◆ moveCanvas

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

Adjust the enabled axes according to dx/dy.

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

◆ setAxisEnabled()

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

En/Disable an axis.

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

Parameters
axisIdAxis id
onOn/Off
See also
isAxisEnabled(), moveCanvas()

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