QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 类型 | Public 成员函数 | Protected 成员函数 | 所有成员列表
QwtPlotSeriesDataPicker类 参考

这是一个绘图数据拾取显示类,用于显示当前的y值,或者显示最近点 更多...

#include <qwt_plot_series_data_picker.h>

类 QwtPlotSeriesDataPicker 继承关系图:
QwtCanvasPicker QwtPicker QwtEventPattern

struct  FeaturePoint
 特征点结构 更多...
 
class  PrivateData
 

Public 类型

enum  PickSeriesMode { PickYValue , PickNearestPoint }
 拾取模式 更多...
 
enum  TextPlacement {
  TextPlaceAuto , TextFollowOnTop , TextFollowOnBottom , TextFollowMouse ,
  TextOnCanvasTopRight , TextOnCanvasTopLeft , TextOnCanvasBottomRight , TextOnCanvasBottomLeft ,
  TextOnCanvasTopAuto , TextOnCanvasBottomAuto
}
 文本放置选项 更多...
 
enum  InterpolationMode { NoInterpolation , LinearInterpolation }
 插值模式 更多...
 
- Public 类型 继承自 QwtPicker
enum  RubberBand {
  NoRubberBand = 0 , HLineRubberBand , VLineRubberBand , CrossRubberBand ,
  RectRubberBand , EllipseRubberBand , PolygonRubberBand , UserRubberBand = 100
}
 橡皮筋样式 更多...
 
enum  DisplayMode { AlwaysOff , AlwaysOn , ActiveOnly }
 显示模式 更多...
 
enum  ResizeMode { Stretch , KeepSize }
 控制当观察部件调整大小时对选定点的处理方式 更多...
 
- Public 类型 继承自 QwtEventPattern
enum  MousePatternCode {
  MouseSelect1 , MouseSelect2 , MouseSelect3 , MouseSelect4 ,
  MouseSelect5 , MouseSelect6 , MousePatternCount
}
 Symbolic mouse input codes 更多...
 
enum  KeyPatternCode {
  KeySelect1 , KeySelect2 , KeyAbort , KeyLeft ,
  KeyRight , KeyUp , KeyDown , KeyRedo ,
  KeyUndo , KeyHome , KeyPatternCount
}
 Symbolic keyboard input codes 更多...
 

Public 成员函数

 QwtPlotSeriesDataPicker (QWidget *canvas)
 Constructor
 
 ~QwtPlotSeriesDataPicker ()
 Destructor
 
void setPickMode (PickSeriesMode mode)
 Set pick mode
 
PickSeriesMode pickMode () const
 Get pick mode
 
void setTextArea (TextPlacement t)
 Set text placement
 
TextPlacement textArea () const
 Get text placement
 
void setInterpolationMode (InterpolationMode mode)
 Set interpolation mode
 
InterpolationMode interpolationMode () const
 Get interpolation mode
 
bool isInterpolation () const
 Check if interpolation is enabled
 
void setNearestSearchWindowSize (int windowSize)
 Set nearest search window size
 
int nearestSearchWindowSize () const
 Get nearest search window size
 
void setEnableDrawFeaturePoint (bool on=true)
 Enable/disable feature point drawing
 
bool isEnableDrawFeaturePoint () const
 Check if feature point drawing is enabled
 
void setDrawFeaturePointSize (int px)
 Set feature point size
 
int drawFeaturePointSize () const
 Get feature point size
 
void setTextBackgroundBrush (const QBrush &br)
 Set text background brush
 
QBrush textBackgroundBrush () const
 Get text background brush
 
void setTextAlignment (Qt::Alignment al)
 Set text alignment
 
Qt::Alignment textAlignment () const
 Get text alignment
 
void setEnableShowXValue (bool on)
 设置是否显示x值
 
bool isEnableShowXValue () const
 是否显示x值
 
void setTextTrackerOffset (const QPoint &offset)
 设置文本跟随鼠标模式下追踪矩形的偏移量
 
QPoint textTrackerOffset () const
 获取当前文本跟随鼠标模式下追踪矩形的偏移量
 
QwtText trackerText (const QPoint &pos) const override
 返回位置的标签
 
QRect trackerRect (const QFont &f) const override
 从追踪器当前位置计算追踪器文本的边界矩形
 
virtual void drawRubberBand (QPainter *painter) const override
 根据橡皮筋样式绘制橡皮筋
 
virtual void setTrackerPosition (const QPoint &pos) override
 手动设置追踪器位置
 
- Public 成员函数 继承自 QwtCanvasPicker
 QwtCanvasPicker (QWidget *canvas)
 构造函数,带画布控件
 
 ~QwtCanvasPicker ()
 析构函数
 
QwtPlotplot ()
 获取关联的绘图
 
const QwtPlotplot () const
 获取关联的绘图(const 版本)
 
QWidget * canvas ()
 获取画布控件
 
const QWidget * canvas () const
 获取画布控件(const 版本)
 
- Public 成员函数 继承自 QwtPicker
 QwtPicker (QWidget *parent)
 构造函数
 
 QwtPicker (RubberBand rubberBand, DisplayMode trackerMode, QWidget *)
 
void setStateMachine (QwtPickerMachine *)
 设置状态机并删除前一个
 
const QwtPickerMachinestateMachine () const
 返回分配的状态机(const)
 
QwtPickerMachinestateMachine ()
 返回分配的状态机
 
void setRubberBand (RubberBand)
 设置橡皮筋样式
 
RubberBand rubberBand () const
 返回橡皮筋样式
 
void setTrackerMode (DisplayMode)
 设置追踪器的显示模式
 
DisplayMode trackerMode () const
 返回追踪器显示模式
 
void setResizeMode (ResizeMode)
 设置调整大小模式
 
ResizeMode resizeMode () const
 返回调整大小模式
 
void setRubberBandPen (const QPen &)
 设置橡皮筋的画笔
 
QPen rubberBandPen () const
 返回橡皮筋画笔
 
void setTrackerPen (const QPen &)
 设置追踪器的画笔
 
QPen trackerPen () const
 返回追踪器画笔
 
void setTrackerFont (const QFont &)
 设置追踪器的字体
 
QFont trackerFont () const
 返回追踪器字体
 
bool isEnabled () const
 启用时返回 true,否则返回 false
 
bool isActive () const
 选择器在 begin()end() 之间处于活动状态
 
virtual bool eventFilter (QObject *, QEvent *) override
 处理事件的事件过滤器
 
QWidget * parentWidget ()
 返回发生选择的父控件
 
const QWidget * parentWidget () const
 返回发生选择的父控件(const)
 
virtual QPainterPath pickArea () const
 找到观察部件上可能发生选择的区域
 
virtual void drawTracker (QPainter *) const
 绘制追踪器
 
virtual QRegion trackerMask () const
 计算追踪器覆盖层的掩码
 
virtual QRegion rubberBandMask () const
 计算橡皮筋覆盖层的掩码
 
QPoint trackerPosition () const
 返回追踪器的当前位置
 
QPolygon selection () const
 返回选定的点
 
void update ()
 
void setActive (bool on)
 
- Public 成员函数 继承自 QwtEventPattern
 QwtEventPattern ()
 构造函数
 
virtual ~QwtEventPattern ()
 析构函数
 
void initMousePattern (int numButtons)
 根据鼠标按钮数量设置默认鼠标模式
 
void initKeyPattern ()
 设置默认按键模式
 
void setMousePattern (MousePatternCode, Qt::MouseButton button, Qt::KeyboardModifiers=Qt::NoModifier)
 更改一个鼠标模式
 
void setKeyPattern (KeyPatternCode, int key, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
 更改一个按键模式
 
void setMousePattern (const QVector< MousePattern > &)
 更改鼠标事件模式
 
void setKeyPattern (const QVector< KeyPattern > &)
 更改按键事件模式
 
const QVector< MousePattern > & mousePattern () const
 返回鼠标模式向量
 
const QVector< KeyPattern > & keyPattern () const
 返回按键模式向量
 
QVector< MousePattern > & mousePattern ()
 返回鼠标模式向量
 
QVector< KeyPattern > & keyPattern ()
 返回按键模式向量
 
bool mouseMatch (MousePatternCode, const QMouseEvent *) const
 将鼠标事件与事件模式进行比较
 
bool keyMatch (KeyPatternCode, const QKeyEvent *) const
 将按键事件与事件模式进行比较
 

Protected 成员函数

virtual int pickYValue (const QwtPlot *p, const QPoint &pos, bool interpolate=false)
 获取绘图区域指定屏幕位置上所有可拾取的Y值
 
virtual int pickNearestPoint (const QwtPlot *plot, const QPoint &pos, int windowSize=-5)
 获取绘图区域指定屏幕位置上最近的可拾取点
 
virtual QString valueString (const QList< FeaturePoint > &fps) const
 
virtual void drawFeaturePoint (QPainter *painter, const QwtPlot *plot, const QwtPlotItem *item, const QPointF &itemPoint) const
 在绘图区域绘制单个特征点
 
virtual void move (const QPoint &pos) override
 Move the last point of the selection The moved() signal is emitted.
 
QString formatAxisValue (double value, int axisId, QwtPlot *plot) const
 
- Protected 成员函数 继承自 QwtPicker
virtual QPolygon adjustedPoints (const QPolygon &) const
 pickedPoints() 映射为 selection()
 
virtual void transition (const QEvent *)
 Passes an event to the state machine and executes the resulting commands.
 
virtual void begin ()
 Open a selection setting the state to active
 
virtual void append (const QPoint &)
 Append a point to the selection and update rubber band and tracker.
 
virtual void remove ()
 Remove the last point of the selection The removed() signal is emitted.
 
virtual bool end (bool ok=true)
 Close a selection setting the state to inactive.
 
virtual bool accept (QPolygon &) const
 Validate and fix up the selection
 
virtual void reset ()
 Reset the state machine and terminate ( end(false) ) the selection
 
virtual void widgetMousePressEvent (QMouseEvent *)
 Handle a mouse press event for the observed widget.
 
virtual void widgetMouseReleaseEvent (QMouseEvent *)
 Handle a mouse release event for the observed widget.
 
virtual void widgetMouseDoubleClickEvent (QMouseEvent *)
 Handle mouse double click event for the observed widget.
 
virtual void widgetMouseMoveEvent (QMouseEvent *)
 Handle a mouse move event for the observed widget.
 
virtual void widgetWheelEvent (QWheelEvent *)
 Handle a wheel event for the observed widget.
 
virtual void widgetKeyPressEvent (QKeyEvent *)
 Handle a key press event for the observed widget.
 
virtual void widgetKeyReleaseEvent (QKeyEvent *)
 Handle a key release event for the observed widget.
 
virtual void widgetEnterEvent (QEvent *)
 Handle a enter event for the observed widget.
 
virtual void widgetLeaveEvent (QEvent *)
 Handle a leave event for the observed widget.
 
virtual void stretchSelection (const QSize &oldSize, const QSize &newSize)
 Scale the selection by the ratios of oldSize and newSize The changed() signal is emitted.
 
virtual void updateDisplay ()
 Update the state of rubber band and tracker label
 
const QwtWidgetOverlayrubberBandOverlay () const
 返回显示橡皮筋的覆盖层
 
const QwtWidgetOverlaytrackerOverlay () const
 返回显示追踪器文本的覆盖层
 
const QPolygon & pickedPoints () const
 返回到目前为止收集的点
 
- Protected 成员函数 继承自 QwtEventPattern
virtual bool mouseMatch (const MousePattern &, const QMouseEvent *) const
 Compare a mouse event with an event pattern.
 
virtual bool keyMatch (const KeyPattern &, const QKeyEvent *) const
 Compare a key event with an event pattern.
 

额外继承的成员函数

- Public 槽 继承自 QwtPicker
void setEnabled (bool)
 启用或禁用选择器
 
- 信号 继承自 QwtPicker
void activated (bool on)
 当选择器被激活时发出的信号
 
void selected (const QPolygon &polygon)
 在选择结束时发出选定点的信号
 
void appended (const QPoint &pos)
 当一个点被添加到选择时发出的信号
 
void moved (const QPoint &pos)
 当选择的最后一个添加点被移动时发出的信号
 
void removed (const QPoint &pos)
 当选择的最后一个添加点被移除时发出的信号
 
void changed (const QPolygon &selection)
 当活动选择被更改时发出的信号
 
- 属性 继承自 QwtPicker
bool isEnabled
 
ResizeMode resizeMode
 
DisplayMode trackerMode
 
QPen trackerPen
 
QFont trackerFont
 
RubberBand rubberBand
 
QPen rubberBandPen
 

详细描述

这是一个绘图数据拾取显示类,用于显示当前的y值,或者显示最近点

成员枚举类型说明

◆ InterpolationMode

插值模式

枚举值
NoInterpolation 

No interpolation, use nearest data point

LinearInterpolation 

Linear interpolation between adjacent data points

◆ PickSeriesMode

拾取模式

枚举值
PickYValue 

Pick y-value (default)

PickNearestPoint 

Pick the nearest point to the mouse cursor position (this mode may be time-consuming, use with caution when there are many curve points)

◆ TextPlacement

文本放置选项

枚举值
TextPlaceAuto 

Auto placement (top for pick y, follow mouse for pick nearest)

TextFollowOnTop 

On top of the plot area (default)

TextFollowOnBottom 

On bottom of the plot area

TextFollowMouse 

Follow mouse pointer

TextOnCanvasTopRight 

Text on canvas top right

TextOnCanvasTopLeft 

Text on canvas top left

TextOnCanvasBottomRight 

Text on canvas bottom right

TextOnCanvasBottomLeft 

Text on canvas bottom left

TextOnCanvasTopAuto 

Text on canvas top, left or right auto-detected based on mouse position

TextOnCanvasBottomAuto 

Text on canvas bottom, left or right auto-detected based on mouse position

成员函数说明

◆ drawFeaturePoint()

void QwtPlotSeriesDataPicker::drawFeaturePoint ( QPainter *  painter,
const QwtPlot plot,
const QwtPlotItem item,
const QPointF &  itemPoint 
) const
protectedvirtual

在绘图区域绘制单个特征点

◆ drawFeaturePointSize()

int QwtPlotSeriesDataPicker::drawFeaturePointSize ( ) const

Get feature point size

设置绘制的特征点的大小

◆ drawRubberBand()

void QwtPlotSeriesDataPicker::drawRubberBand ( QPainter *  painter) const
overridevirtual

根据橡皮筋样式绘制橡皮筋

重载 QwtPicker .

◆ interpolationMode()

QwtPlotSeriesDataPicker::InterpolationMode QwtPlotSeriesDataPicker::interpolationMode ( ) const

Get interpolation mode

获取插值模式

◆ isEnableDrawFeaturePoint()

bool QwtPlotSeriesDataPicker::isEnableDrawFeaturePoint ( ) const

Check if feature point drawing is enabled

是否绘制特征点

◆ isEnableShowXValue()

bool QwtPlotSeriesDataPicker::isEnableShowXValue ( ) const

是否显示x值

◆ isInterpolation()

bool QwtPlotSeriesDataPicker::isInterpolation ( ) const

Check if interpolation is enabled

判断是否进行插值

◆ move()

void QwtPlotSeriesDataPicker::move ( const QPoint &  pos)
overrideprotectedvirtual

Move the last point of the selection The moved() signal is emitted.

参数
posNew position
参见
isActive(), begin(), end(), append()

重载 QwtPicker .

◆ nearestSearchWindowSize()

int QwtPlotSeriesDataPicker::nearestSearchWindowSize ( ) const

Get nearest search window size

临近点搜索窗口大小

◆ pickMode()

QwtPlotSeriesDataPicker::PickSeriesMode QwtPlotSeriesDataPicker::pickMode ( ) const

Get pick mode

获取当前的拾取模式

◆ pickNearestPoint()

int QwtPlotSeriesDataPicker::pickNearestPoint ( const QwtPlot plot,
const QPoint &  pos,
int  windowSize = -5 
)
protectedvirtual

获取绘图区域指定屏幕位置上最近的可拾取点

参数
plot绘图对象
pos屏幕位置
windowSize窗口尺寸
  • 0: 不使用窗口,搜索整个曲线
  • 正数: 固定的窗口大小(数据点数量)
  • 负数: 自适应窗口,使用曲线数据点总数的百分比(取绝对值,如-5表示5%,-10代表10)
返回
包含最近绘图项和对应数据点的配对
注解
此函数考虑了寄生绘图,可以传入宿主绘图或寄生绘图,它会把全部绘图的数据进行获取

◆ pickYValue()

int QwtPlotSeriesDataPicker::pickYValue ( const QwtPlot p,
const QPoint &  pos,
bool  interpolate = false 
)
protectedvirtual

获取绘图区域指定屏幕位置上所有可拾取的Y值

◆ setDrawFeaturePointSize()

void QwtPlotSeriesDataPicker::setDrawFeaturePointSize ( int  px)

Set feature point size

设置绘制的特征点的大小

◆ setEnableDrawFeaturePoint()

void QwtPlotSeriesDataPicker::setEnableDrawFeaturePoint ( bool  on = true)

Enable/disable feature point drawing

设置是否绘制特征点

◆ setEnableShowXValue()

void QwtPlotSeriesDataPicker::setEnableShowXValue ( bool  on)

设置是否显示x值

◆ setInterpolationMode()

void QwtPlotSeriesDataPicker::setInterpolationMode ( QwtPlotSeriesDataPicker::InterpolationMode  mode)

Set interpolation mode

设置插值模式

◆ setNearestSearchWindowSize()

void QwtPlotSeriesDataPicker::setNearestSearchWindowSize ( int  windowSize)

Set nearest search window size

临近点搜索窗口大小

◆ setPickMode()

void QwtPlotSeriesDataPicker::setPickMode ( PickSeriesMode  mode)

Set pick mode

设置拾取模式

◆ setTextAlignment()

void QwtPlotSeriesDataPicker::setTextAlignment ( Qt::Alignment  al)

Set text alignment

设置文字的对齐方式

◆ setTextArea()

void QwtPlotSeriesDataPicker::setTextArea ( QwtPlotSeriesDataPicker::TextPlacement  t)

Set text placement

设置文字显示的区域

◆ setTextBackgroundBrush()

void QwtPlotSeriesDataPicker::setTextBackgroundBrush ( const QBrush &  br)

Set text background brush

设置文本区域的背景颜色

◆ setTextTrackerOffset()

void QwtPlotSeriesDataPicker::setTextTrackerOffset ( const QPoint &  offset)

设置文本跟随鼠标模式下追踪矩形的偏移量

◆ setTrackerPosition()

void QwtPlotSeriesDataPicker::setTrackerPosition ( const QPoint &  pos)
overridevirtual

手动设置追踪器位置

重载 QwtPicker .

◆ textAlignment()

Qt::Alignment QwtPlotSeriesDataPicker::textAlignment ( ) const

Get text alignment

文字的对齐方式

◆ textArea()

QwtPlotSeriesDataPicker::TextPlacement QwtPlotSeriesDataPicker::textArea ( ) const

Get text placement

文字显示的位置

◆ textBackgroundBrush()

QBrush QwtPlotSeriesDataPicker::textBackgroundBrush ( ) const

Get text background brush

文本区域的背景颜色

◆ textTrackerOffset()

QPoint QwtPlotSeriesDataPicker::textTrackerOffset ( ) const

获取当前文本跟随鼠标模式下追踪矩形的偏移量

◆ trackerRect()

QRect QwtPlotSeriesDataPicker::trackerRect ( const QFont &  font) const
overridevirtual

从追踪器当前位置计算追踪器文本的边界矩形

重载 QwtPicker .

◆ trackerText()

QwtText QwtPlotSeriesDataPicker::trackerText ( const QPoint &  pos) const
overridevirtual

返回位置的标签

重载 QwtPicker .


该类的文档由以下文件生成: