5#ifndef QWT_PLOT_SERIES_DATA_PICKER_H
6#define QWT_PLOT_SERIES_DATA_PICKER_H
10#include "qwt_canvas_picker.h"
48 TextOnCanvasBottomAuto
66 QPointF feature { 0, 0 };
92 bool isInterpolation()
const;
95 void setNearestSearchWindowSize(
int windowSize);
97 int nearestSearchWindowSize()
const;
100 void setEnableDrawFeaturePoint(
bool on =
true);
102 bool isEnableDrawFeaturePoint()
const;
105 void setDrawFeaturePointSize(
int px);
107 int drawFeaturePointSize()
const;
113 void setTextBackgroundBrush(
const QBrush& br);
115 QBrush textBackgroundBrush()
const;
118 void setTextAlignment(Qt::Alignment al);
120 Qt::Alignment textAlignment()
const;
123 void setEnableShowXValue(
bool on);
124 bool isEnableShowXValue()
const;
127 void setTextTrackerOffset(
const QPoint& offset);
128 QPoint textTrackerOffset()
const;
144 virtual int pickYValue(
const QwtPlot* p,
const QPoint& pos,
bool interpolate =
false);
146 virtual int pickNearestPoint(
const QwtPlot* plot,
const QPoint& pos,
int windowSize = -5);
171 void onPlotItemDetached(
QwtPlotItem* item,
bool on);
172 void onParasitePlotAttached(
QwtPlot* parasiteplot,
bool on);
179 drawFeaturePoint(QPainter* painter,
const QwtPlot* plot,
const QwtPlotItem* item,
const QPointF& itemPoint)
const;
181 virtual void move(
const QPoint& pos)
override;
183 QString formatAxisValue(
double value,
int axisId,
QwtPlot* plot)
const;
187 void drawAllFeaturePoints(QPainter* painter)
const;
189 void updateFeaturePoint(
const QPoint& pos);
191 QRect ensureRectInBounds(
const QRect& rect,
const QRect& bounds)
const;
Definition qwt_raster_data.h:38
Base picker class specifically for canvas
Definition qwt_canvas_picker.h:20
virtual void drawRubberBand(QPainter *) const
Draw a rubber band, depending on rubberBand()
Definition qwt_picker.cpp:607
virtual void setTrackerPosition(const QPoint &pos)
Set the tracker position manually
Definition qwt_picker.cpp:809
virtual void widgetMousePressEvent(QMouseEvent *)
Handle a mouse press event for the observed widget.
Definition qwt_picker.cpp:905
virtual void move(const QPoint &)
Move the last point of the selection The moved() signal is emitted.
Definition qwt_picker.cpp:1241
virtual QwtText trackerText(const QPoint &pos) const
Return the label for a position
Definition qwt_picker.cpp:485
virtual QRect trackerRect(const QFont &) const
Calculate the bounding rectangle for the tracker text from the current position of the tracker
Definition qwt_picker.cpp:748
virtual void widgetMouseDoubleClickEvent(QMouseEvent *)
Handle mouse double click event for the observed widget.
Definition qwt_picker.cpp:987
Base class for items on the plot canvas
Definition qwt_plot_item.h:85
A plot data picker class for displaying current y-values or nearest points
Definition qwt_plot_series_data_picker.h:21
void doubleClicked(QwtPlotSeriesDataPicker *picker, const QPoint &pos)
Emitted when the user double-left-clicks on the plot canvas
InterpolationMode
Interpolation modes
Definition qwt_plot_series_data_picker.h:55
@ NoInterpolation
No interpolation, use nearest data point
Definition qwt_plot_series_data_picker.h:56
TextPlacement
Text placement options
Definition qwt_plot_series_data_picker.h:38
@ TextOnCanvasTopRight
Text on canvas top right
Definition qwt_plot_series_data_picker.h:43
@ TextOnCanvasTopAuto
Text on canvas top, left or right auto-detected based on mouse position
Definition qwt_plot_series_data_picker.h:47
@ TextOnCanvasBottomRight
Text on canvas bottom right
Definition qwt_plot_series_data_picker.h:45
@ TextOnCanvasBottomLeft
Text on canvas bottom left
Definition qwt_plot_series_data_picker.h:46
@ TextPlaceAuto
Auto placement (top for pick y, follow mouse for pick nearest)
Definition qwt_plot_series_data_picker.h:39
@ TextFollowOnTop
On top of the plot area (default)
Definition qwt_plot_series_data_picker.h:40
@ TextFollowOnBottom
On bottom of the plot area
Definition qwt_plot_series_data_picker.h:41
@ TextOnCanvasTopLeft
Text on canvas top left
Definition qwt_plot_series_data_picker.h:44
@ TextFollowMouse
Follow mouse pointer
Definition qwt_plot_series_data_picker.h:42
PickSeriesMode
Pick modes
Definition qwt_plot_series_data_picker.h:29
@ PickYValue
Pick y-value (default)
Definition qwt_plot_series_data_picker.h:30
void clicked(QwtPlotSeriesDataPicker *picker, const QPoint &pos)
Emitted when the user left-clicks on the plot canvas
~QwtPlotSeriesDataPicker() override
Destructor
A 2-D plotting widget
Definition qwt_plot.h:99
A class representing a text
Definition qwt_text.h:70
Feature point structure
Definition qwt_plot_series_data_picker.h:64
QVariant sampleData
Full sample data (QwtOHLCSample, QwtIntervalSample, etc.)
Definition qwt_plot_series_data_picker.h:67