#include <qwt_plot_panner.h>
Signals | |
void | moved (int dx, int dy) |
void | panned (int dx, int dy) |
Public Member Functions | |
const QwtPlotCanvas * | canvas () const |
QwtPlotCanvas * | canvas () |
const QCursor | cursor () const |
virtual bool | eventFilter (QObject *, QEvent *) |
void | getAbortKey (int &key, int &state) const |
void | getMouseButton (int &button, int &buttonState) const |
bool | isAxisEnabled (int axis) const |
bool | isEnabled () const |
bool | isOrientationEnabled (Qt::Orientation) const |
Qt::Orientations | orientations () const |
const QwtPlot * | plot () const |
QwtPlot * | plot () |
QwtPlotPanner (QwtPlotCanvas *) | |
void | setAbortKey (int key, int state=Qt::NoButton) |
void | setAxisEnabled (int axis, bool on) |
void | setCursor (const QCursor &) |
void | setEnabled (bool) |
void | setMouseButton (int button, int buttonState=Qt::NoButton) |
void | setOrientations (Qt::Orientations) |
virtual | ~QwtPlotPanner () |
Protected Slots | |
virtual void | moveCanvas (int dx, int dy) |
Protected Member Functions | |
virtual QBitmap | contentsMask () const |
virtual QPixmap | grab () const |
virtual void | paintEvent (QPaintEvent *) |
virtual void | widgetKeyPressEvent (QKeyEvent *) |
virtual void | widgetKeyReleaseEvent (QKeyEvent *) |
virtual void | widgetMouseMoveEvent (QMouseEvent *) |
virtual void | widgetMousePressEvent (QMouseEvent *) |
virtual void | widgetMouseReleaseEvent (QMouseEvent *) |
QwtPlotPanner is a panner for a QwtPlotCanvas, 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.
QwtPlotPanner::QwtPlotPanner | ( | QwtPlotCanvas * | canvas | ) | [explicit] |
Create a plot panner.
The panner is enabled for all axes
canvas | Plot canvas to pan, also the parent object |
QwtPlotPanner::~QwtPlotPanner | ( | ) | [virtual] |
Destructor.
const QwtPlotCanvas * QwtPlotPanner::canvas | ( | ) | const |
Return Observed plot canvas.
QwtPlotCanvas * QwtPlotPanner::canvas | ( | ) |
Return observed plot canvas.
QBitmap QwtPlotPanner::contentsMask | ( | ) | const [protected, virtual] |
Calculate a mask from the border mask of the canvas
Reimplemented from QwtPanner.
const QCursor QwtPanner::cursor | ( | ) | const [inherited] |
bool QwtPanner::eventFilter | ( | QObject * | object, | |
QEvent * | event | |||
) | [virtual, inherited] |
Event filter.
When isEnabled() the mouse events of the observed widget are filtered.
object | Object to be filtered | |
event | Event |
void QwtPanner::getAbortKey | ( | int & | key, | |
int & | state | |||
) | const [inherited] |
Get the abort key.
void QwtPanner::getMouseButton | ( | int & | button, | |
int & | buttonState | |||
) | const [inherited] |
Get the mouse button.
QPixmap QwtPanner::grab | ( | ) | const [protected, virtual, inherited] |
Grab the widget into a pixmap.
bool QwtPlotPanner::isAxisEnabled | ( | int | axis | ) | const |
Test if an axis is enabled
axis | Axis, see QwtPlot::Axis |
bool QwtPanner::isEnabled | ( | ) | const [inherited] |
bool QwtPanner::isOrientationEnabled | ( | Qt::Orientation | o | ) | const [inherited] |
Return true if a orientatio is enabled
void QwtPlotPanner::moveCanvas | ( | int | dx, | |
int | dy | |||
) | [protected, virtual, slot] |
Adjust the enabled axes according to dx/dy
dx | Pixel offset in x direction | |
dy | Pixel offset in y direction |
void QwtPanner::moved | ( | int | dx, | |
int | dy | |||
) | [signal, inherited] |
Signal emitted, while the widget moved, but panning is not finished.
dx | Offset in horizontal direction | |
dy | Offset in vertical direction |
Qt::Orientations QwtPanner::orientations | ( | ) | const [inherited] |
Return the orientation, where paning is enabled.
void QwtPanner::paintEvent | ( | QPaintEvent * | pe | ) | [protected, virtual, inherited] |
Paint event.
Repaint the grabbed pixmap on its current position and fill the empty spaces by the background of the parent widget.
pe | Paint event |
void QwtPanner::panned | ( | int | dx, | |
int | dy | |||
) | [signal, inherited] |
Signal emitted, when panning is done
dx | Offset in horizontal direction | |
dy | Offset in vertical direction |
const QwtPlot * QwtPlotPanner::plot | ( | ) | const |
Return plot widget, containing the observed plot canvas.
QwtPlot * QwtPlotPanner::plot | ( | ) |
Return plot widget, containing the observed plot canvas.
void QwtPanner::setAbortKey | ( | int | key, | |
int | state = Qt::NoButton | |||
) | [inherited] |
Change the abort key The defaults are Qt::Key_Escape and Qt::NoButton
key | Key ( See Qt::Keycode ) | |
state | State |
void QwtPlotPanner::setAxisEnabled | ( | int | axis, | |
bool | on | |||
) |
En/Disable an axis.
Axes that are enabled will be synchronized to the result of panning. All other axes will remain unchanged.
axis | Axis, see QwtPlot::Axis | |
on | On/Off |
void QwtPanner::setCursor | ( | const QCursor & | cursor | ) | [inherited] |
Change the cursor, that is active while panning The default is the cursor of the parent widget.
cursor | New cursor |
void QwtPanner::setEnabled | ( | bool | on | ) | [inherited] |
En/disable the panner.
When enabled is true an event filter is installed for the observed widget, otherwise the event filter is removed.
on | true or false |
void QwtPanner::setMouseButton | ( | int | button, | |
int | buttonState = Qt::NoButton | |||
) | [inherited] |
Change the mouse button The defaults are Qt::LeftButton and Qt::NoButton
void QwtPanner::setOrientations | ( | Qt::Orientations | o | ) | [inherited] |
Set the orientations, where panning is enabled The default value is in both directions: Qt::Horizontal | Qt::Vertical
/param o Orientation
void QwtPanner::widgetKeyPressEvent | ( | QKeyEvent * | keyEvent | ) | [protected, virtual, inherited] |
Handle a key press event for the observed widget.
keyEvent | Key event |
void QwtPanner::widgetKeyReleaseEvent | ( | QKeyEvent * | keyEvent | ) | [protected, virtual, inherited] |
Handle a key release event for the observed widget.
keyEvent | Key event |
void QwtPanner::widgetMouseMoveEvent | ( | QMouseEvent * | mouseEvent | ) | [protected, virtual, inherited] |
Handle a mouse move event for the observed widget.
mouseEvent | Mouse event |
void QwtPanner::widgetMousePressEvent | ( | QMouseEvent * | mouseEvent | ) | [protected, virtual, inherited] |
Handle a mouse press event for the observed widget.
mouseEvent | Mouse event |
void QwtPanner::widgetMouseReleaseEvent | ( | QMouseEvent * | mouseEvent | ) | [protected, virtual, inherited] |
Handle a mouse release event for the observed widget.
mouseEvent | Mouse event |