QwtPlotPicker - QwtPlotPicker provides selections on a plot canvas.
Contents
Constructor & Destructor Documentation
QwtPlotPicker::QwtPlotPicker(QWidget*canvas)[explicit]
Create a plot picker. The picker is set to those x- and y-axis of the plot 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.
Parameters:canvas Plot canvas to observe, also the parent object
Seealso:QwtPlot::autoReplot(), QwtPlot::replot(), scaleRect()QwtPlotPicker::QwtPlotPicker(intxAxis,intyAxis,QWidget*canvas)[explicit]
Create a plot picker
Parameters:xAxis Set the x axis of the picker
yAxis Set the y axis of the picker
canvas Plot canvas to observe, also the parent object
Seealso:QwtPlot::autoReplot(), QwtPlot::replot(), scaleRect()QwtPlotPicker::QwtPlotPicker(intxAxis,intyAxis,RubberBandrubberBand,DisplayModetrackerMode,QWidget*canvas)[explicit]
Create a plot picker
Parameters:xAxis X axis of the picker
yAxis Y axis of the picker
rubberBand Rubber band style
trackerMode Tracker mode
canvas Plot canvas to observe, also the parent object
Seealso:QwtPicker, QwtPicker::setSelectionFlags(), QwtPicker::setRubberBand(), QwtPicker::setTrackerModeQwtPlot::autoReplot(), QwtPlot::replot(), scaleRect()Detailed Description
QwtPlotPicker provides selections on a plot canvas.
QwtPlotPicker is a QwtPicker tailored for selections on a plot canvas. It is set to a x-Axis and y-Axis
and translates all pixel coordinates into this coordinate system.
Member Function Documentation
voidQwtPlotPicker::append(constQPoint&pos)[protected],[virtual]
Append a point to the selection and update rubber band and tracker.
Parameters:pos Additional point
Seealso:isActive, begin(), end(), move(), appended()Note:
The appended(constQPoint&), appended(const QDoublePoint &) signals are emitted.
Reimplemented from QwtPicker.
voidQwtPlotPicker::appended(constQPointF&pos)[signal]
A signal emitted when a point has been appended to the selection
Parameters:pos Position of the appended point.
Seealso:append(). moved()QWidget*QwtPlotPicker::canvas()Returns:
Observed plot canvas
constQWidget*QwtPlotPicker::canvas()constReturns:
Observed plot canvas
boolQwtPlotPicker::end(boolok=true)[protected],[virtual]
Close a selection setting the state to inactive.
Parameters:ok If true, complete the selection and emit selected signals otherwise discard the selection.
Returns:
True if the selection has been accepted, false otherwise
Reimplemented from QwtPicker.
Reimplemented in QwtPlotZoomer.
QRectFQwtPlotPicker::invTransform(constQRect&rect)const[protected]
Translate a rectangle from pixel into plot coordinates
Returns:
Rectangle in plot coordinates
Seealso:transform()QPointFQwtPlotPicker::invTransform(constQPoint&pos)const[protected]
Translate a point from pixel into plot coordinates
Returns:
Point in plot coordinates
Seealso:transform()voidQwtPlotPicker::move(constQPoint&pos)[protected],[virtual]
Move the last point of the selection
Parameters:pos New position
Seealso:isActive, begin(), end(), append()Note:
The moved(constQPoint&), moved(const QDoublePoint &) signals are emitted.
Reimplemented from QwtPicker.
voidQwtPlotPicker::moved(constQPointF&pos)[signal]
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.
Seealso:move(), appended()QwtPlot*QwtPlotPicker::plot()Returns:
Plot widget, containing the observed plot canvas
constQwtPlot*QwtPlotPicker::plot()constReturns:
Plot widget, containing the observed plot canvas
QRectFQwtPlotPicker::scaleRect()const[protected]Returns:
Normalized bounding rectangle of the axes
Seealso:QwtPlot::autoReplot(), QwtPlot::replot().
voidQwtPlotPicker::selected(constQPointF&pos)[signal]
A signal emitted in case of QwtPickerMachine::PointSelection.
Parameters:pos Selected point
voidQwtPlotPicker::selected(constQRectF&rect)[signal]
A signal emitted in case of QwtPickerMachine::RectSelection.
Parameters:rect Selected rectangle
voidQwtPlotPicker::selected(constQVector<QPointF>&pa)[signal]
A signal emitting the selected points, at the end of a selection.
Parameters:pa Selected points
voidQwtPlotPicker::setAxis(intxAxis,intyAxis)[virtual]
Set the x and y axes of the picker
Parameters:xAxis X axis
yAxis Y axis
Reimplemented in QwtPlotZoomer.
QwtTextQwtPlotPicker::trackerText(constQPoint&pos)const[protected],[virtual]
Translate a pixel position into a position string
Parameters:pos Position in pixel coordinates
Returns:
Position string
Reimplemented from QwtPicker.
QwtTextQwtPlotPicker::trackerTextF(constQPointF&pos)const[protected],[virtual]
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
QRectQwtPlotPicker::transform(constQRectF&rect)const[protected]
Translate a rectangle from plot into pixel coordinates
Returns:
Rectangle in pixel coordinates
Seealso:invTransform()QPointQwtPlotPicker::transform(constQPointF&pos)const[protected]
Translate a point from plot into pixel coordinates
Returns:
Point in pixel coordinates
Seealso:invTransform()Name
QwtPlotPicker - QwtPlotPicker provides selections on a plot canvas.
Synopsis
#include <qwt_plot_picker.h>
Inherits QwtPicker.
Inherited by QwtPlotZoomer.
Signals
void selected (const QPointF &pos)
void selected (const QRectF &rect)
void selected (const QVector< QPointF > &pa)
void appended (const QPointF &pos)
void moved (const QPointF &pos)
PublicMemberFunctionsQwtPlotPicker (QWidget *canvas)
Create a plot picker.
virtual ~QwtPlotPicker ()
Destructor.
QwtPlotPicker (int xAxis, int yAxis, QWidget *)
QwtPlotPicker (int xAxis, int yAxis, RubberBandrubberBand, DisplayModetrackerMode, QWidget *)
virtual void setAxis (int xAxis, int yAxis)
int xAxis () const
Return x axis.
int yAxis () const
Return y axis.
QwtPlot * plot ()
const QwtPlot * plot () const
QWidget * canvas ()
const QWidget * canvas () const
ProtectedMemberFunctions
QRectF scaleRect () const
QRectF invTransform (const QRect &) const
QRect transform (const QRectF &) const
QPointF invTransform (const QPoint &) const
QPoint transform (const QPointF &) const
virtual QwtTexttrackerText (const QPoint &) const
virtual QwtTexttrackerTextF (const QPointF &) const
Translate a position into a position string.
virtual void move (const QPoint &)
virtual void append (const QPoint &)
virtual bool end (bool ok=true)
AdditionalInheritedMembers