Qwt User's Guide svn
Signals | Public Member Functions | Protected Slots | Protected Member Functions
QwtPlotPanner Class Reference

#include <qwt_plot_panner.h>

Inherits QwtPanner.

List of all members.

Signals

void moved (int dx, int dy)
void panned (int dx, int dy)

Public Member Functions

QwtPlotCanvas * canvas ()
const QwtPlotCanvas * canvas () const
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
QwtPlot * plot ()
const QwtPlot * plot () const
 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 *)

Detailed Description

QwtPlotPanner provides panning of a plot canvas.

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.

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

Constructor & Destructor Documentation

QwtPlotPanner::QwtPlotPanner ( QwtPlotCanvas *  canvas) [explicit]

Create a plot panner.

The panner is enabled for all axes

Parameters:
canvasPlot canvas to pan, also the parent object
See also:
setAxisEnabled()
QwtPlotPanner::~QwtPlotPanner ( ) [virtual]

Destructor.


Member Function Documentation

QwtPlotCanvas * QwtPlotPanner::canvas ( )

Return observed plot canvas.

const QwtPlotCanvas * QwtPlotPanner::canvas ( ) const

Return Observed plot canvas.

QBitmap QwtPlotPanner::contentsMask ( ) const [protected, virtual]

Calculate a mask from the border mask of the canvas

See also:
QwtPlotCanvas::borderMask()

Reimplemented from QwtPanner.

const QCursor QwtPanner::cursor ( ) const [inherited]
Returns:
Cursor that is active while panning
See also:
setCursor()
bool QwtPanner::eventFilter ( QObject *  object,
QEvent *  event 
) [virtual, inherited]

Event filter.

When isEnabled() the mouse events of the observed widget are filtered.

Parameters:
objectObject to be filtered
eventEvent
See also:
widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseMoveEvent()
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

Parameters:
axisAxis, see QwtPlot::Axis
Returns:
True, if the axis is enabled
See also:
setAxisEnabled(), moveCanvas()
bool QwtPanner::isEnabled ( ) const [inherited]
Returns:
true when enabled, false otherwise
See also:
setEnabled, eventFilter()
bool QwtPanner::isOrientationEnabled ( Qt::Orientation  o) const [inherited]

Return true if a orientatio is enabled

See also:
orientations(), setOrientations()
void QwtPlotPanner::moveCanvas ( int  dx,
int  dy 
) [protected, virtual, slot]

Adjust the enabled axes according to dx/dy

Parameters:
dxPixel offset in x direction
dyPixel offset in y direction
See also:
QwtPanner::panned()
void QwtPanner::moved ( int  dx,
int  dy 
) [signal, inherited]

Signal emitted, while the widget moved, but panning is not finished.

Parameters:
dxOffset in horizontal direction
dyOffset 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.

Parameters:
pePaint event
void QwtPanner::panned ( int  dx,
int  dy 
) [signal, inherited]

Signal emitted, when panning is done

Parameters:
dxOffset in horizontal direction
dyOffset in vertical direction
QwtPlot * QwtPlotPanner::plot ( )

Return plot widget, containing the observed plot canvas.

const QwtPlot * QwtPlotPanner::plot ( ) const

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

Parameters:
keyKey ( See Qt::Keycode )
stateState
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.

Parameters:
axisAxis, see QwtPlot::Axis
onOn/Off
See also:
isAxisEnabled(), moveCanvas()
void QwtPanner::setCursor ( const QCursor &  cursor) [inherited]

Change the cursor, that is active while panning The default is the cursor of the parent widget.

Parameters:
cursorNew cursor
See also:
setCursor()
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.

Parameters:
ontrue or false
See also:
isEnabled(), eventFilter()
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.

Parameters:
keyEventKey event
See also:
eventFilter(), widgetKeyReleaseEvent()
void QwtPanner::widgetKeyReleaseEvent ( QKeyEvent *  keyEvent) [protected, virtual, inherited]

Handle a key release event for the observed widget.

Parameters:
keyEventKey event
See also:
eventFilter(), widgetKeyReleaseEvent()
void QwtPanner::widgetMouseMoveEvent ( QMouseEvent *  mouseEvent) [protected, virtual, inherited]

Handle a mouse move event for the observed widget.

Parameters:
mouseEventMouse event
See also:
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent()
void QwtPanner::widgetMousePressEvent ( QMouseEvent *  mouseEvent) [protected, virtual, inherited]

Handle a mouse press event for the observed widget.

Parameters:
mouseEventMouse event
See also:
eventFilter(), widgetMouseReleaseEvent(), widgetMouseMoveEvent(),
void QwtPanner::widgetMouseReleaseEvent ( QMouseEvent *  mouseEvent) [protected, virtual, inherited]

Handle a mouse release event for the observed widget.

Parameters:
mouseEventMouse event
See also:
eventFilter(), widgetMousePressEvent(), widgetMouseMoveEvent(),
qmi style