QwtPlotZoomer - Man Page
Name
QwtPlotZoomer —
QwtPlotZoomer provides stacked zooming for a plot widget.
Synopsis
#include <qwt_plot_zoomer.h>
Inherits QwtPlotPicker.
Public Types
enum DisplayMode { AlwaysOff, AlwaysOn, ActiveOnly }
enum KeyPatternCode { KeySelect1, KeySelect2, KeyAbort, KeyLeft, KeyRight, KeyUp, KeyDown, KeyRedo, KeyUndo, KeyHome, KeyPatternCount }
enum MousePatternCode { MouseSelect1, MouseSelect2, MouseSelect3, MouseSelect4, MouseSelect5, MouseSelect6, MousePatternCount }
enum RectSelectionType { CornerToCorner = 64, CenterToCorner = 128, CenterToRadius = 256 }
enum ResizeMode { Stretch, KeepSize }
enum RubberBand { NoRubberBand = 0, HLineRubberBand, VLineRubberBand, CrossRubberBand, RectRubberBand, EllipseRubberBand, PolygonRubberBand, UserRubberBand = 100 }
enum SelectionMode { ClickSelection = 1024, DragSelection = 2048 }
enum SelectionType { NoSelection = 0, PointSelection = 1, RectSelection = 2, PolygonSelection = 4 }
Public Slots
virtual void move (double x, double y)
void moveBy (double x, double y)
virtual void zoom (const QwtDoubleRect &)
virtual void zoom (int up)
Signals
void appended (const QwtDoublePoint &pos)
void appended (const QPoint &pos)
void changed (const QwtPolygon &pa)
void moved (const QPoint &pos)
void moved (const QwtDoublePoint &pos)
void selected (const QwtDoubleRect &rect)
void selected (const QwtDoublePoint &pos)
void selected (const QwtArray< QwtDoublePoint > &pa)
void selected (const QwtPolygon &pa)
void zoomed (const QwtDoubleRect &rect)
Public Member Functions
QwtPlotCanvas * canvas ()
const QwtPlotCanvas * canvas () const
virtual void drawRubberBand (QPainter *) const
virtual void drawTracker (QPainter *) const
virtual bool eventFilter (QObject *, QEvent *)
void initKeyPattern ()
void initMousePattern (int numButtons)
bool isActive () const
bool isEnabled () const
bool keyMatch (uint pattern, const QKeyEvent *) const
const QwtArray< KeyPattern > & keyPattern () const
QwtArray< KeyPattern > & keyPattern ()
int maxStackDepth () const
bool mouseMatch (uint pattern, const QMouseEvent *) const
const QwtArray< MousePattern > & mousePattern () const
QwtArray< MousePattern > & mousePattern ()
QWidget * parentWidget ()
const QWidget * parentWidget () const
virtual QRect pickRect () const
const QwtPlot * plot () const
QwtPlot * plot ()
QwtPlotZoomer (QwtPlotCanvas *, bool doReplot=true)
QwtPlotZoomer (int xAxis, int yAxis, QwtPlotCanvas *, bool doReplot=true)
QwtPlotZoomer (int xAxis, int yAxis, int selectionFlags, DisplayMode trackerMode, QwtPlotCanvas *, bool doReplot=true)
ResizeMode resizeMode () const
RubberBand rubberBand () const
QPen rubberBandPen () const
const QwtPolygon & selection () const
int selectionFlags () const
virtual void setAxis (int xAxis, int yAxis)
virtual void setEnabled (bool)
void setKeyPattern (uint pattern, int key, int state=Qt::NoButton)
void setKeyPattern (const QwtArray< KeyPattern > &)
void setMaxStackDepth (int)
void setMousePattern (const QwtArray< MousePattern > &)
void setMousePattern (uint pattern, int button, int state=Qt::NoButton)
virtual void setResizeMode (ResizeMode)
virtual void setRubberBand (RubberBand)
virtual void setRubberBandPen (const QPen &)
virtual void setSelectionFlags (int)
virtual void setTrackerFont (const QFont &)
virtual void setTrackerMode (DisplayMode)
virtual void setTrackerPen (const QPen &)
virtual void setZoomBase (bool doReplot=true)
virtual void setZoomBase (const QwtDoubleRect &)
void setZoomStack (const QStack< QwtDoubleRect > &, int zoomRectIndex=-1)
QFont trackerFont () const
DisplayMode trackerMode () const
QPen trackerPen () const
QPoint trackerPosition () const
QRect trackerRect (const QFont &) const
int xAxis () const
int yAxis () const
QwtDoubleRect zoomBase () const
QwtDoubleRect zoomRect () const
uint zoomRectIndex () const
const QStack< QwtDoubleRect > & zoomStack () const
Protected Member Functions
virtual bool accept (QwtPolygon &) const
virtual void append (const QPoint &)
virtual void begin ()
virtual bool end (bool ok=true)
QwtDoubleRect invTransform (const QRect &) const
QwtDoublePoint invTransform (const QPoint &) const
virtual bool keyMatch (const KeyPattern &, const QKeyEvent *) const
virtual QwtDoubleSize minZoomSize () const
virtual bool mouseMatch (const MousePattern &, const QMouseEvent *) const
virtual void move (const QPoint &)
virtual void rescale ()
virtual void reset ()
const QWidget * rubberBandWidget () const
QwtDoubleRect scaleRect () const
virtual QwtPickerMachine * stateMachine (int) const
virtual void stretchSelection (const QSize &oldSize, const QSize &newSize)
virtual QwtText trackerText (const QwtDoublePoint &) const
virtual QwtText trackerText (const QPoint &) const
const QWidget * trackerWidget () const
QRect transform (const QwtDoubleRect &) const
QPoint transform (const QwtDoublePoint &) const
virtual void transition (const QEvent *)
virtual void updateDisplay ()
virtual void widgetKeyPressEvent (QKeyEvent *)
virtual void widgetKeyReleaseEvent (QKeyEvent *)
virtual void widgetLeaveEvent (QEvent *)
virtual void widgetMouseDoubleClickEvent (QMouseEvent *)
virtual void widgetMouseMoveEvent (QMouseEvent *)
virtual void widgetMousePressEvent (QMouseEvent *)
virtual void widgetMouseReleaseEvent (QMouseEvent *)
virtual void widgetWheelEvent (QWheelEvent *)
Detailed Description
QwtPlotZoomer provides stacked zooming for a plot widget.
QwtPlotZoomer offers rubberband selections on the plot canvas, translating the selected rectangles into plot coordinates and adjusting the axes to them. Zooming can repeated as often as possible, limited only by maxStackDepth() or minZoomSize(). Each rectangle is pushed on a stack.
Zoom rectangles can be selected depending on selectionFlags() using the mouse or keyboard (QwtEventPattern, QwtPickerMachine). QwtEventPattern::MouseSelect3/QwtEventPattern::KeyUndo, or QwtEventPattern::MouseSelect6/QwtEventPattern::KeyRedo walk up and down the zoom stack. QwtEventPattern::MouseSelect2 or QwtEventPattern::KeyHome unzoom to the initial size.
QwtPlotZoomer is tailored for plots with one x and y axis, but it is allowed to attach a second QwtPlotZoomer for the other axes.
- Note:
The realtime example includes an derived zoomer class that adds scrollbars to the plot canvas.
Member Enumeration Documentation
enum QwtPicker::DisplayMode [inherited] .IP · 2
AlwaysOff
Display never.
- AlwaysOn
Display always. - ActiveOnly
Display only when the selection is active.
See also:
QwtPicker::setTrackerMode(), QwtPicker::trackerMode(), QwtPicker::isActive()
enum QwtEventPattern::KeyPatternCode [inherited]
Symbolic keyboard input codes. Default initialization:
- KeySelect1
Qt::Key_Return - KeySelect2
Qt::Key_Space - KeyAbort
Qt::Key_Escape - KeyLeft
Qt::Key_Left - KeyRight
Qt::Key_Right - KeyUp
Qt::Key_Up - KeyDown
Qt::Key_Down - KeyUndo
Qt::Key_Minus - KeyRedo
Qt::Key_Plus - KeyHome
Qt::Key_Escape
enum QwtEventPattern::MousePatternCode [inherited]
Symbolic mouse input codes. The default initialization for 3 button mice is:
- MouseSelect1
Qt::LeftButton - MouseSelect2
Qt::RightButton - MouseSelect3
Qt::MidButton - MouseSelect4
Qt::LeftButton + Qt::ShiftButton - MouseSelect5
Qt::RightButton + Qt::ShiftButton - MouseSelect6
Qt::MidButton + Qt::ShiftButton
The default initialization for 2 button mice is:
- MouseSelect1
Qt::LeftButton - MouseSelect2
Qt::RightButton - MouseSelect3
Qt::LeftButton + Qt::AltButton - MouseSelect4
Qt::LeftButton + Qt::ShiftButton - MouseSelect5
Qt::RightButton + Qt::ShiftButton - MouseSelect6
Qt::LeftButton + Qt::AltButton + Qt::ShiftButton
The default initialization for 1 button mice is:
- MouseSelect1
Qt::LeftButton - MouseSelect2
Qt::LeftButton + Qt::ControlButton - MouseSelect3
Qt::LeftButton + Qt::AltButton - MouseSelect4
Qt::LeftButton + Qt::ShiftButton - MouseSelect5
Qt::LeftButton + Qt::ControlButton + Qt::ShiftButton - MouseSelect6
Qt::LeftButton + Qt::AltButton + Qt::ShiftButton
See also:
initMousePattern()
enum QwtPicker::RectSelectionType [inherited]
Selection subtype for RectSelection This enum type describes the type of rectangle selections. It can be or'd with QwtPicker::RectSelectionType and QwtPicker::SelectionMode and passed to QwtPicker::setSelectionFlags().
- CornerToCorner
The first and the second selected point are the corners of the rectangle. - CenterToCorner
The first point is the center, the second a corner of the rectangle. - CenterToRadius
The first point is the center of a quadrat, calculated by the maximum of the x- and y-distance.
The default value is CornerToCorner.
See also:
QwtPicker::setSelectionFlags(), QwtPicker::selectionFlags()
enum QwtPicker::ResizeMode [inherited] Controls what to do with the selected points of an active selection when the observed widget is resized.
- Stretch
All points are scaled according to the new size, - KeepSize
All points remain unchanged.
The default value is Stretch.
See also:
QwtPicker::setResizeMode(), QwtPicker::resize()
enum QwtPicker::RubberBand [inherited] Rubberband style
- NoRubberBand
No rubberband. - HLineRubberBand & PointSelection
A horizontal line. - VLineRubberBand & PointSelection
A vertical line. - CrossRubberBand & PointSelection
A horizontal and a vertical line. - RectRubberBand & RectSelection
A rectangle. - EllipseRubberBand & RectSelection
An ellipse. - PolygonRubberBand &PolygonSelection
A polygon. - UserRubberBand
Values >= UserRubberBand can be used to define additional rubber bands.
The default value is NoRubberBand.
See also:
QwtPicker::setRubberBand(), QwtPicker::rubberBand()
enum QwtPicker::SelectionMode [inherited] Values of this enum type or'd together with a SelectionType value identifies which state machine should be used for the selection.
The default value is ClickSelection.
See also:
stateMachine()
enum QwtPicker::SelectionType [inherited] This enum type describes the type of a selection. It can be or'd with QwtPicker::RectSelectionType and QwtPicker::SelectionMode and passed to QwtPicker::setSelectionFlags()
- NoSelection
Selection is disabled. Note this is different to the disabled state, as you might have a tracker. - PointSelection
Select a single point. - RectSelection
Select a rectangle. - PolygonSelection
Select a polygon.
The default value is NoSelection.
See also:
QwtPicker::setSelectionFlags(), QwtPicker::selectionFlags()
Constructor & Destructor Documentation
QwtPlotZoomer::QwtPlotZoomer (QwtPlotCanvas *canvas, booldoReplot = true) [explicit]
Create a zoomer for a plot canvas. The zoomer is set to those x- and y-axis of the parent plot of the canvas that are enabled. If both or no x-axis are enabled, the picker is set to QwtPlot::xBottom. If both or no y-axis are enabled, it is set to QwtPlot::yLeft.
The selectionFlags() are set to QwtPicker::RectSelection | QwtPicker::ClickSelection, the tracker mode to QwtPicker::ActiveOnly.
- Parameters:
canvas Plot canvas to observe, also the parent object
doReplot Call replot for the attached plot before initializing the zoomer with its scales. This might be necessary, when the plot is in a state with pending scale changes.- See also:
QwtPlot::autoReplot(), QwtPlot::replot(), setZoomBase()
QwtPlotZoomer::QwtPlotZoomer (intxAxis, intyAxis, QwtPlotCanvas *canvas, booldoReplot = true) [explicit]
Create a zoomer for a plot canvas. The selectionFlags() are set to QwtPicker::RectSelection | QwtPicker::ClickSelection, the tracker mode to QwtPicker::ActiveOnly.
- Parameters:
xAxis X axis of the zoomer
yAxis Y axis of the zoomer
canvas Plot canvas to observe, also the parent object
doReplot Call replot for the attached plot before initializing the zoomer with its scales. This might be necessary, when the plot is in a state with pending scale changes.- See also:
QwtPlot::autoReplot(), QwtPlot::replot(), setZoomBase()
QwtPlotZoomer::QwtPlotZoomer (intxAxis, intyAxis, intselectionFlags, DisplayModetrackerMode, QwtPlotCanvas *canvas, booldoReplot = true) [explicit] Create a zoomer for a plot canvas.
- Parameters:
xAxis X axis of the zoomer
yAxis Y axis of the zoomer
selectionFlags Or'd value of QwtPicker::RectSelectionType and QwtPicker::SelectionMode. QwtPicker::RectSelection will be auto added.
trackerMode Tracker mode
canvas Plot canvas to observe, also the parent object
doReplot Call replot for the attached plot before initializing the zoomer with its scales. This might be necessary, when the plot is in a state with pending scale changes.- See also:
QwtPicker, QwtPicker::setSelectionFlags(), QwtPicker::setRubberBand(), QwtPicker::setTrackerMode()
QwtPlot::autoReplot(), QwtPlot::replot(), setZoomBase()
Member Function Documentation
bool QwtPlotZoomer::accept (QwtPolygon &pa) const [protected, virtual]
Check and correct a selected rectangle. Reject rectangles with a hight or width < 2, otherwise expand the selected rectangle to a minimum size of 11x11 and accept it.
- Returns:
true If rect is accepted, or has been changed to a accepted rectangle.
Reimplemented from QwtPicker.
void QwtPlotPicker::append (const QPoint &pos) [protected, virtual, inherited] Append a point to the selection and update rubberband and tracker.
- Parameters:
pos Additional point
- See also:
isActive, begin(), end(), move(), appended()
- Note:
The appended(const QPoint &), appended(const QDoublePoint &) signals are emitted.
Reimplemented from QwtPicker.
void QwtPicker::appended (const QPoint &pos) [signal, inherited] A signal emitted when a point has been appended to the selection
- Parameters:
pos Position of the appended point.
- See also:
append(). moved()
void QwtPlotPicker::appended (const QwtDoublePoint &pos) [signal, inherited] A signal emitted when a point has been appended to the selection
- Parameters:
pos Position of the appended point.
- See also:
append(). moved()
void QwtPlotZoomer::begin () [protected, virtual] Rejects selections, when the stack depth is too deep, or the zoomed rectangle is minZoomSize().
See also:
minZoomSize(), maxStackDepth()
Reimplemented from QwtPicker.
QwtPlotCanvas * QwtPlotPicker::canvas () [inherited]
Return observed plot canvas.
const QwtPlotCanvas * QwtPlotPicker::canvas () const [inherited]
Return Observed plot canvas.
void QwtPicker::changed (const QwtPolygon &pa) [signal, inherited] A signal emitted when the active selection has been changed. This might happen when the observed widget is resized.
- Parameters:
pa Changed selection
- See also:
stretchSelection()
void QwtPicker::drawRubberBand (QPainter *painter) const [virtual, inherited] Draw a rubberband , depending on rubberBand() and selectionFlags()
- Parameters:
painter Painter, initialized with clip rect
- See also:
rubberBand(), RubberBand, selectionFlags()
void QwtPicker::drawTracker (QPainter *painter) const [virtual, inherited] Draw the tracker
- Parameters:
painter Painter
- See also:
trackerRect(), trackerText()
bool QwtPlotZoomer::end (boolok = true) [protected, virtual] Expand the selected rectangle to minZoomSize() and zoom in if accepted.
See also:
accept(), minZoomSize()
Reimplemented from QwtPlotPicker.
bool QwtPicker::eventFilter (QObject *o, QEvent *e) [virtual, inherited]
Event filter. When isEnabled() == true all events of the observed widget are filtered. Mouse and keyboard events are translated into widgetMouse- and widgetKey- and widgetWheel-events. Paint and Resize events are handled to keep rubberband and tracker up to date.
See also:
event(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()
void QwtEventPattern::initKeyPattern () [inherited] Set default mouse patterns.
See also:
KeyPatternCode
QwtDoubleRect QwtPlotPicker::invTransform (const QRect &rect) const [protected, inherited] Translate a rectangle from pixel into plot coordinates
- Returns:
Rectangle in plot coordinates
- See also:
QwtPlotPicker::transform()
QwtDoublePoint QwtPlotPicker::invTransform (const QPoint &pos) const [protected, inherited] Translate a point from pixel into plot coordinates
- Returns:
Point in plot coordinates
- See also:
QwtPlotPicker::transform()
bool QwtPicker::isActive () const [inherited] A picker is active between begin() and end().
- Returns:
true if the selection is active.
bool QwtPicker::isEnabled () const [inherited] Returns
true when enabled, false otherwise
See also:
setEnabled(), eventFilter()
bool QwtEventPattern::keyMatch (uintpattern, const QKeyEvent *e) const [inherited]
Compare a key event with an event pattern. A key event matches the pattern when both have the same key value and in the state value the same key flags (Qt::KeyButtonMask) are set.
- Parameters:
pattern Index of the event pattern
e Key event- Returns:
true if matches
- See also:
mouseMatch()
bool QwtEventPattern::keyMatch (const KeyPattern &pattern, const QKeyEvent *e) const [protected, virtual, inherited]
Compare a key event with an event pattern. A key event matches the pattern when both have the same key value and in the state value the same key flags (Qt::KeyButtonMask) are set.
- Parameters:
pattern Key event pattern
e Key event- Returns:
true if matches
- See also:
mouseMatch()
const QwtArray< QwtEventPattern::KeyPattern > & QwtEventPattern::keyPattern () const [inherited]
Return key patterns.
QwtArray< QwtEventPattern::KeyPattern > & QwtEventPattern::keyPattern () [inherited]
Return Key patterns.
int QwtPlotZoomer::maxStackDepth () const Returns
Maximal depth of the zoom stack.
See also:
setMaxStackDepth()
QwtDoubleSize QwtPlotZoomer::minZoomSize () const [protected, virtual]
Limit zooming by a minimum rectangle. Returns:
zoomBase().width() / 10e4, zoomBase().height() / 10e4
bool QwtEventPattern::mouseMatch (uintpattern, const QMouseEvent *e) const [inherited]
Compare a mouse event with an event pattern. A mouse event matches the pattern when both have the same button value and in the state value the same key flags(Qt::KeyButtonMask) are set.
- Parameters:
pattern Index of the event pattern
e Mouse event- Returns:
true if matches
- See also:
keyMatch()
bool QwtEventPattern::mouseMatch (const MousePattern &pattern, const QMouseEvent *e) const [protected, virtual, inherited]
Compare a mouse event with an event pattern. A mouse event matches the pattern when both have the same button value and in the state value the same key flags(Qt::KeyButtonMask) are set.
- Parameters:
pattern Mouse event pattern
e Mouse event- Returns:
true if matches
- See also:
keyMatch()
QwtArray< QwtEventPattern::MousePattern > & QwtEventPattern::mousePattern () [inherited]
Return ,ouse patterns.
const QwtArray< QwtEventPattern::MousePattern > & QwtEventPattern::mousePattern () const [inherited]
Return mouse patterns.
void QwtPlotPicker::move (const QPoint &pos) [protected, virtual, inherited] Move the last point of the selection
- Parameters:
pos New position
- See also:
isActive, begin(), end(), append()
- Note:
The moved(const QPoint &), moved(const QDoublePoint &) signals are emitted.
Reimplemented from QwtPicker.
void QwtPlotZoomer::move (doublex, doubley) [virtual, slot] Move the the current zoom rectangle.
- Parameters:
x X value
y Y value- See also:
QwtDoubleRect::move()
- Note:
The changed rectangle is limited by the zoom base
void QwtPlotZoomer::moveBy (doubledx, doubledy) [slot] Move the current zoom rectangle.
- Parameters:
dx X offset
dy Y offset- Note:
The changed rectangle is limited by the zoom base
void QwtPicker::moved (const QPoint &pos) [signal, inherited] A signal emitted whenever the last appended point of the selection has been moved.
- Parameters:
pos Position of the moved last point of the selection.
- See also:
move(), appended()
void QwtPlotPicker::moved (const QwtDoublePoint &pos) [signal, inherited] A signal emitted whenever the last appended point of the selection has been moved.
- Parameters:
pos Position of the moved last point of the selection.
- See also:
move(), appended()
QWidget * QwtPicker::parentWidget () [inherited]
Return the parent widget, where the selection happens.
const QWidget * QwtPicker::parentWidget () const [inherited]
Return the parent widget, where the selection happens.
QRect QwtPicker::pickRect () const [virtual, inherited] Find the area of the observed widget, where selection might happen.
- Returns:
QFrame::contentsRect() if it is a QFrame, QWidget::rect() otherwise.
QwtPlot * QwtPlotPicker::plot () [inherited]
Return plot widget, containing the observed plot canvas.
const QwtPlot * QwtPlotPicker::plot () const [inherited]
Return plot widget, containing the observed plot canvas.
void QwtPlotZoomer::rescale () [protected, virtual] Adjust the observed plot to zoomRect()
- Note:
Initiates QwtPlot::replot
void QwtPicker::reset () [protected, virtual, inherited] Reset the state machine and terminate (end(false)) the selection
QwtPicker::ResizeMode QwtPicker::resizeMode () const [inherited] Returns
Resize mode
See also:
setResizeMode(), ResizeMode
QwtPicker::RubberBand QwtPicker::rubberBand () const [inherited] Returns
Rubberband style
See also:
setRubberBand(), RubberBand, rubberBandPen()
QPen QwtPicker::rubberBandPen () const [inherited] Returns
Rubberband pen
See also:
setRubberBandPen(), rubberBand()
const QWidget * QwtPicker::rubberBandWidget () const [protected, inherited] Returns
Widget displaying the rubberband
QwtDoubleRect QwtPlotPicker::scaleRect () const [protected, inherited] Return normalized bounding rect of the axes
See also:
QwtPlot::autoReplot(), QwtPlot::replot().
void QwtPicker::selected (const QwtPolygon &pa) [signal, inherited] A signal emitting the selected points, at the end of a selection.
- Parameters:
pa Selected points
void QwtPlotPicker::selected (const QwtArray< QwtDoublePoint > &pa) [signal, inherited] A signal emitting the selected points, at the end of a selection.
- Parameters:
pa Selected points
void QwtPlotPicker::selected (const QwtDoublePoint &pos) [signal, inherited] A signal emitted in case of selectionFlags() & PointSelection.
- Parameters:
pos Selected point
void QwtPlotPicker::selected (const QwtDoubleRect &rect) [signal, inherited] A signal emitted in case of selectionFlags() & RectSelection.
- Parameters:
rect Selected rectangle
const QwtPolygon & QwtPicker::selection () const [inherited]
Return Selected points.
int QwtPicker::selectionFlags () const [inherited] Returns
Selection flags, an Or'd value of SelectionType, RectSelectionType and SelectionMode.
See also:
setSelectionFlags(), SelectionType, RectSelectionType, SelectionMode
void QwtPlotZoomer::setAxis (intxAxis, intyAxis) [virtual] Reinitialize the axes, and set the zoom base to their scales.
- Parameters:
xAxis X axis
yAxis Y axis
Reimplemented from QwtPlotPicker.
void QwtPicker::setEnabled (boolenabled) [virtual, inherited]
En/disable the picker. When enabled is true an event filter is installed for the observed widget, otherwise the event filter is removed.
- Parameters:
enabled true or false
- See also:
isEnabled(), eventFilter()
void QwtEventPattern::setKeyPattern (const QwtArray< KeyPattern > &pattern) [inherited]
Change the key event patterns.
void QwtEventPattern::setKeyPattern (uintpattern, intkey, intstate = Qt::NoButton) [inherited] Change one key pattern
- Parameters:
pattern Index of the pattern
key Key
state State- See also:
QKeyEvent
void QwtPlotZoomer::setMaxStackDepth (intdepth)
Limit the number of recursive zoom operations to depth. A value of -1 set the depth to unlimited, 0 disables zooming. If the current zoom rectangle is below depth, the plot is unzoomed.
- Parameters:
depth Maximum for the stack depth
- See also:
maxStackDepth()
- Note:
depth doesn't include the zoom base, so zoomStack().count() might be maxStackDepth() + 1.
void QwtEventPattern::setMousePattern (const QwtArray< MousePattern > &pattern) [inherited]
Change the mouse event patterns.
void QwtPicker::setResizeMode (ResizeModemode) [virtual, inherited]
Set the resize mode. The resize mode controls what to do with the selected points of an active selection when the observed widget is resized.
Stretch means the points are scaled according to the new size, KeepSize means the points remain unchanged.
The default mode is Stretch.
- Parameters:
mode Resize mode
- See also:
resizeMode(), ResizeMode
void QwtPicker::setRubberBand (RubberBandrubberBand) [virtual, inherited] Set the rubberband style
- Parameters:
rubberBand Rubberband style The default value is NoRubberBand.
- See also:
rubberBand(), RubberBand, setRubberBandPen()
void QwtPicker::setRubberBandPen (const QPen &pen) [virtual, inherited] Set the pen for the rubberband
- Parameters:
pen Rubberband pen
- See also:
rubberBandPen(), setRubberBand()
void QwtPlotZoomer::setSelectionFlags (intflags) [virtual] Set the selection flags
- Parameters:
flags Or'd value of QwtPicker::RectSelectionType and QwtPicker::SelectionMode. The default value is QwtPicker::RectSelection & QwtPicker::ClickSelection.
- See also:
selectionFlags(), SelectionType, RectSelectionType, SelectionMode
- Note:
QwtPicker::RectSelection will be auto added.
Reimplemented from QwtPicker.
void QwtPicker::setTrackerFont (const QFont &font) [virtual, inherited] Set the font for the tracker
- Parameters:
font Tracker font
- See also:
trackerFont(), setTrackerMode(), setTrackerPen()
void QwtPicker::setTrackerMode (DisplayModemode) [virtual, inherited]
Set the display mode of the tracker. A tracker displays information about current position of the cursor as a string. The display mode controls if the tracker has to be displayed whenever the observed widget has focus and cursor (AlwaysOn), never (AlwaysOff), or only when the selection is active (ActiveOnly).
- Parameters:
mode Tracker display mode
- Warning:
In case of AlwaysOn, mouseTracking will be enabled for the observed widget.
- See also:
trackerMode(), DisplayMode
void QwtPicker::setTrackerPen (const QPen &pen) [virtual, inherited] Set the pen for the tracker
- Parameters:
pen Tracker pen
- See also:
trackerPen(), setTrackerMode(), setTrackerFont()
void QwtPlotZoomer::setZoomBase (booldoReplot = true) [virtual] Reinitialized the zoom stack with scaleRect() as base.
- Parameters:
doReplot Call replot for the attached plot before initializing the zoomer with its scales. This might be necessary, when the plot is in a state with pending scale changes.
- See also:
zoomBase(), scaleRect() QwtPlot::autoReplot(), QwtPlot::replot().
void QwtPlotZoomer::setZoomBase (const QwtDoubleRect &base) [virtual]
Set the initial size of the zoomer. base is united with the current scaleRect() and the zoom stack is reinitalized with it as zoom base. plot is zoomed to scaleRect().
- Parameters:
base Zoom base
- See also:
zoomBase(), scaleRect()
void QwtPlotZoomer::setZoomStack (const QStack< QwtDoubleRect > &, intzoomRectIndex = -1)
Assign a zoom stack. In combination with other types of navigation it might be useful to modify to manipulate the complete zoom stack.
- Parameters:
zoomStack New zoom stack
zoomRectIndex Index of the current position of zoom stack. In case of -1 the current position is at the top of the stack.- Note:
The zoomed signal might be emitted.
- See also:
zoomStack(), zoomRectIndex()
QwtPickerMachine * QwtPicker::stateMachine (intflags) const [protected, virtual, inherited] Create a state machine depending on the selection flags.
- PointSelection | ClickSelection
QwtPickerClickPointMachine() - PointSelection | DragSelection
QwtPickerDragPointMachine() - RectSelection | ClickSelection
QwtPickerClickRectMachine() - RectSelection | DragSelection
QwtPickerDragRectMachine() - PolygonSelection
QwtPickerPolygonMachine()
See also:
setSelectionFlags()
void QwtPicker::stretchSelection (const QSize &oldSize, const QSize &newSize) [protected, virtual, inherited] Scale the selection by the ratios of oldSize and newSize The changed() signal is emitted.
- Parameters:
oldSize Previous size
newSize Current size- See also:
ResizeMode, setResizeMode(), resizeMode()
QFont QwtPicker::trackerFont () const [inherited] Returns
Tracker font
See also:
setTrackerFont(), trackerMode(), trackerPen()
QwtPicker::DisplayMode QwtPicker::trackerMode () const [inherited] Returns
Tracker display mode
See also:
setTrackerMode(), DisplayMode
QPen QwtPicker::trackerPen () const [inherited] Returns
Tracker pen
See also:
setTrackerPen(), trackerMode(), trackerFont()
QPoint QwtPicker::trackerPosition () const [inherited] Returns
Current position of the tracker
QRect QwtPicker::trackerRect (const QFont &font) const [inherited] Calculate the bounding rectangle for the tracker text from the current position of the tracker
- Parameters:
font Font of the tracker text
- Returns:
Bounding rectangle of the tracker text
- See also:
trackerPosition()
QwtText QwtPlotPicker::trackerText (const QwtDoublePoint &pos) const [protected, virtual, inherited]
Translate a position into a position string. In case of HLineRubberBand the label is the value of the y position, in case of VLineRubberBand the value of the x position. Otherwise the label contains x and y position separated by a ',' .
The format for the double to string conversion is '%.4f'.
- Parameters:
pos Position
- Returns:
Position string
QwtText QwtPlotPicker::trackerText (const QPoint &pos) const [protected, virtual, inherited] Translate a pixel position into a position string
- Parameters:
pos Position in pixel coordinates
- Returns:
Position string
Reimplemented from QwtPicker.
const QWidget * QwtPicker::trackerWidget () const [protected, inherited] Returns
Widget displaying the tracker text
QPoint QwtPlotPicker::transform (const QwtDoublePoint &pos) const [protected, inherited] Translate a point from plot into pixel coordinates
- Returns:
Point in pixel coordinates
- See also:
QwtPlotPicker::invTransform()
QRect QwtPlotPicker::transform (const QwtDoubleRect &rect) const [protected, inherited] Translate a rectangle from plot into pixel coordinates
- Returns:
Rectangle in pixel coordinates
- See also:
QwtPlotPicker::invTransform()
void QwtPicker::transition (const QEvent *e) [protected, virtual, inherited] Passes an event to the state machine and executes the resulting commands. Append and Move commands use the current position of the cursor (QCursor::pos()).
- Parameters:
e Event
void QwtPicker::updateDisplay () [protected, virtual, inherited]
Update the state of rubberband and tracker label.
void QwtPlotZoomer::widgetKeyPressEvent (QKeyEvent *ke) [protected, virtual] Qt::Key_Plus zooms in, Qt::Key_Minus zooms out one position on the zoom stack, Qt::Key_Escape zooms out to the zoom base.
Changes the current position on the stack, but doesn't pop any rectangle.
- Note:
The keys codes can be changed, using QwtEventPattern::setKeyPattern: 3, 4, 5
Reimplemented from QwtPicker.
void QwtPicker::widgetKeyReleaseEvent (QKeyEvent *ke) [protected, virtual, inherited] Handle a key release event for the observed widget.
Passes the event to the state machine.
See also:
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyPressEvent(), stateMachine()
void QwtPicker::widgetLeaveEvent (QEvent *) [protected, virtual, inherited] Handle a leave event for the observed widget.
See also:
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()
void QwtPicker::widgetMouseDoubleClickEvent (QMouseEvent *me) [protected, virtual, inherited] Handle mouse double click event for the observed widget.
Empty implementation, does nothing.
See also:
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()
void QwtPicker::widgetMouseMoveEvent (QMouseEvent *e) [protected, virtual, inherited] Handle a mouse move event for the observed widget.
Move the last point of the selection in case of isActive() == true
See also:
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()
void QwtPicker::widgetMousePressEvent (QMouseEvent *e) [protected, virtual, inherited] Handle a mouse press event for the observed widget.
Begin and/or end a selection depending on the selection flags.
See also:
QwtPicker, selectionFlags()
eventFilter(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()
void QwtPlotZoomer::widgetMouseReleaseEvent (QMouseEvent *me) [protected, virtual] Qt::MidButton zooms out one position on the zoom stack, Qt::RightButton to the zoom base.
Changes the current position on the stack, but doesn't pop any rectangle.
- Note:
The mouse events can be changed, using QwtEventPattern::setMousePattern: 2, 1
Reimplemented from QwtPicker.
void QwtPicker::widgetWheelEvent (QWheelEvent *e) [protected, virtual, inherited] Handle a wheel event for the observed widget.
Move the last point of the selection in case of isActive() == true
See also:
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()
int QwtPlotPicker::xAxis () const [inherited]
Return x axis.
int QwtPlotPicker::yAxis () const [inherited]
Return y axis.
void QwtPlotZoomer::zoom (intoffset) [virtual, slot]
Zoom in or out. Activate a rectangle on the zoom stack with an offset relative to the current position. Negative values of offest will zoom out, positive zoom in. A value of 0 zooms out to the zoom base.
- Parameters:
offset Offset relative to the current position of the zoom stack.
- Note:
The zoomed signal is emitted.
- See also:
zoomRectIndex()
void QwtPlotZoomer::zoom (const QwtDoubleRect &rect) [virtual, slot]
Zoom in. Clears all rectangles above the current position of the zoom stack and pushs the intersection of zoomRect() and the normalized rect on it.
- Note:
If the maximal stack depth is reached, zoom is ignored.
The zoomed signal is emitted.
QwtDoubleRect QwtPlotZoomer::zoomBase () const Returns
Initial rectangle of the zoomer
See also:
setZoomBase(), zoomRect()
void QwtPlotZoomer::zoomed (const QwtDoubleRect &rect) [signal] A signal emitting the zoomRect(), when the plot has been zoomed in or out.
- Parameters:
rect Current zoom rectangle.
QwtDoubleRect QwtPlotZoomer::zoomRect () const Rectangle at the current position on the zoom stack.
See also:
zoomRectIndex(), scaleRect().
uint QwtPlotZoomer::zoomRectIndex () const Returns
Index of current position of zoom stack.
const QwtZoomStack & QwtPlotZoomer::zoomStack () const Return the zoom stack. zoomStack()[0] is the zoom base, zoomStack()[1] the first zoomed rectangle.
See also:
setZoomStack(), zoomRectIndex()
Author
Generated automatically by Doxygen for Qwt User's Guide from the source code.