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

QwtPicker 在一个部件上提供选择功能 更多...

#include <qwt_picker.h>

类 QwtPicker 继承关系图:
QwtEventPattern QwtCanvasPicker QwtPlotPanner QwtPlotPicker QwtPolarPicker QwtPlotCanvasZoomer QwtPlotSeriesDataPicker QwtPlotAxisZoomer

class  PrivateData
 

Public 类型

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 槽

void setEnabled (bool)
 启用或禁用选择器
 

信号

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)
 当活动选择被更改时发出的信号
 

Public 成员函数

 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 drawRubberBand (QPainter *) const
 根据橡皮筋样式绘制橡皮筋
 
virtual void drawTracker (QPainter *) const
 绘制追踪器
 
virtual QRegion trackerMask () const
 计算追踪器覆盖层的掩码
 
virtual QRegion rubberBandMask () const
 计算橡皮筋覆盖层的掩码
 
virtual QwtText trackerText (const QPoint &pos) const
 返回位置的标签
 
virtual QRect trackerRect (const QFont &) const
 从追踪器当前位置计算追踪器文本的边界矩形
 
virtual void setTrackerPosition (const QPoint &pos)
 手动设置追踪器位置
 
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 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 move (const QPoint &)
 Move the last point of the selection The moved() signal is emitted.
 
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.
 

属性

bool isEnabled
 
ResizeMode resizeMode
 
DisplayMode trackerMode
 
QPen trackerPen
 
QFont trackerFont
 
RubberBand rubberBand
 
QPen rubberBandPen
 

详细描述

QwtPicker 在一个部件上提供选择功能

成员枚举类型说明

◆ DisplayMode

显示模式

枚举值
AlwaysOff 

Display never

AlwaysOn 

Display always

ActiveOnly 

Display only when the selection is active

◆ ResizeMode

控制当观察部件调整大小时对选定点的处理方式

枚举值
Stretch 

All points are scaled according to the new size,

KeepSize 

All points remain unchanged.

◆ RubberBand

橡皮筋样式

枚举值
NoRubberBand 

No rubberband.

HLineRubberBand 

A horizontal line ( only for QwtPickerMachine::PointSelection )

VLineRubberBand 

A vertical line ( only for QwtPickerMachine::PointSelection )

CrossRubberBand 

A crosshair ( only for QwtPickerMachine::PointSelection )

RectRubberBand 

A rectangle ( only for QwtPickerMachine::RectSelection )

EllipseRubberBand 

An ellipse ( only for QwtPickerMachine::RectSelection )

PolygonRubberBand 

A polygon ( only for QwtPickerMachine::PolygonSelection )

UserRubberBand 

值 >= UserRubberBand 可用于定义额外的橡皮筋

构造及析构函数说明

◆ QwtPicker()

QwtPicker::QwtPicker ( QWidget *  parent)
explicit

构造函数

成员函数说明

◆ accept()

bool QwtPicker::accept ( QPolygon &  selection) const
protectedvirtual

Validate and fix up the selection

Accepts all selections unmodified

参数
selectionSelection to validate and fix up
返回
true, when accepted, false otherwise

QwtPlotAxisZoomer , 以及 QwtPlotCanvasZoomer 重载.

◆ activated

void QwtPicker::activated ( bool  on)
signal

当选择器被激活时发出的信号

◆ adjustedPoints()

QPolygon QwtPicker::adjustedPoints ( const QPolygon &  points) const
protectedvirtual

pickedPoints() 映射为 selection()

◆ append()

void QwtPicker::append ( const QPoint &  pos)
protectedvirtual

Append a point to the selection and update rubber band and tracker.

The appended() signal is emitted.

参数
posAdditional point
参见
isActive(), begin(), end(), move(), appended()

QwtPlotPicker , 以及 QwtPolarPicker 重载.

◆ appended

void QwtPicker::appended ( const QPoint &  pos)
signal

当一个点被添加到选择时发出的信号

◆ begin()

void QwtPicker::begin ( )
protectedvirtual

Open a selection setting the state to active

参见
isActive(), end(), append(), move()

QwtPlotAxisZoomer , 以及 QwtPlotCanvasZoomer 重载.

◆ changed

void QwtPicker::changed ( const QPolygon &  selection)
signal

当活动选择被更改时发出的信号

◆ drawRubberBand()

void QwtPicker::drawRubberBand ( QPainter *  painter) const
virtual

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

QwtPlotSeriesDataPicker 重载.

◆ drawTracker()

void QwtPicker::drawTracker ( QPainter *  painter) const
virtual

绘制追踪器

◆ end()

bool QwtPicker::end ( bool  ok = true)
protectedvirtual

Close a selection setting the state to inactive.

The selection is validated and maybe fixed by accept().

参数
okIf true, complete the selection and emit a selected signal otherwise discard the selection.
返回
true if the selection is accepted, false otherwise
参见
isActive(), begin(), append(), move(), selected(), accept()

QwtPlotAxisZoomer, QwtPlotCanvasZoomer, QwtPlotPanner, QwtPlotPicker , 以及 QwtPolarPicker 重载.

◆ eventFilter()

bool QwtPicker::eventFilter ( QObject *  object,
QEvent *  event 
)
overridevirtual

处理事件的事件过滤器

◆ isActive()

bool QwtPicker::isActive ( ) const

选择器在 begin()end() 之间处于活动状态

◆ isEnabled()

bool QwtPicker::isEnabled ( ) const

启用时返回 true,否则返回 false

◆ move()

void QwtPicker::move ( const QPoint &  pos)
protectedvirtual

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

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

QwtPlotPanner, QwtPlotPicker, QwtPolarPicker , 以及 QwtPlotSeriesDataPicker 重载.

◆ moved

void QwtPicker::moved ( const QPoint &  pos)
signal

当选择的最后一个添加点被移动时发出的信号

◆ parentWidget() [1/2]

QWidget * QwtPicker::parentWidget ( )

返回发生选择的父控件

◆ parentWidget() [2/2]

const QWidget * QwtPicker::parentWidget ( ) const

返回发生选择的父控件(const)

◆ pickArea()

QPainterPath QwtPicker::pickArea ( ) const
virtual

找到观察部件上可能发生选择的区域

◆ pickedPoints()

const QPolygon & QwtPicker::pickedPoints ( ) const
protected

返回到目前为止收集的点

◆ remove()

void QwtPicker::remove ( )
protectedvirtual

Remove the last point of the selection The removed() signal is emitted.

参见
isActive(), begin(), end(), append(), move()

◆ removed

void QwtPicker::removed ( const QPoint &  pos)
signal

当选择的最后一个添加点被移除时发出的信号

◆ resizeMode()

QwtPicker::ResizeMode QwtPicker::resizeMode ( ) const

返回调整大小模式

◆ rubberBand()

QwtPicker::RubberBand QwtPicker::rubberBand ( ) const

返回橡皮筋样式

◆ rubberBandMask()

QRegion QwtPicker::rubberBandMask ( ) const
virtual

计算橡皮筋覆盖层的掩码

◆ rubberBandOverlay()

const QwtWidgetOverlay * QwtPicker::rubberBandOverlay ( ) const
protected

返回显示橡皮筋的覆盖层

◆ rubberBandPen()

QPen QwtPicker::rubberBandPen ( ) const

返回橡皮筋画笔

◆ selected

void QwtPicker::selected ( const QPolygon &  polygon)
signal

在选择结束时发出选定点的信号

◆ selection()

QPolygon QwtPicker::selection ( ) const

返回选定的点

◆ setEnabled

void QwtPicker::setEnabled ( bool  enabled)
slot

启用或禁用选择器

◆ setResizeMode()

void QwtPicker::setResizeMode ( ResizeMode  mode)

设置调整大小模式

◆ setRubberBand()

void QwtPicker::setRubberBand ( RubberBand  rubberBand)

设置橡皮筋样式

◆ setRubberBandPen()

void QwtPicker::setRubberBandPen ( const QPen &  pen)

设置橡皮筋的画笔

◆ setStateMachine()

void QwtPicker::setStateMachine ( QwtPickerMachine stateMachine)

设置状态机并删除前一个

◆ setTrackerFont()

void QwtPicker::setTrackerFont ( const QFont &  font)

设置追踪器的字体

◆ setTrackerMode()

void QwtPicker::setTrackerMode ( DisplayMode  mode)

设置追踪器的显示模式

◆ setTrackerPen()

void QwtPicker::setTrackerPen ( const QPen &  pen)

设置追踪器的画笔

◆ setTrackerPosition()

void QwtPicker::setTrackerPosition ( const QPoint &  pos)
virtual

手动设置追踪器位置

QwtPlotSeriesDataPicker 重载.

◆ stateMachine() [1/2]

QwtPickerMachine * QwtPicker::stateMachine ( )

返回分配的状态机

◆ stateMachine() [2/2]

const QwtPickerMachine * QwtPicker::stateMachine ( ) const

返回分配的状态机(const)

◆ stretchSelection()

void QwtPicker::stretchSelection ( const QSize &  oldSize,
const QSize &  newSize 
)
protectedvirtual

Scale the selection by the ratios of oldSize and newSize The changed() signal is emitted.

参数
oldSizePrevious size
newSizeCurrent size
参见
ResizeMode, setResizeMode(), resizeMode()

◆ trackerFont()

QFont QwtPicker::trackerFont ( ) const

返回追踪器字体

◆ trackerMask()

QRegion QwtPicker::trackerMask ( ) const
virtual

计算追踪器覆盖层的掩码

◆ trackerMode()

QwtPicker::DisplayMode QwtPicker::trackerMode ( ) const

返回追踪器显示模式

◆ trackerOverlay()

const QwtWidgetOverlay * QwtPicker::trackerOverlay ( ) const
protected

返回显示追踪器文本的覆盖层

◆ trackerPen()

QPen QwtPicker::trackerPen ( ) const

返回追踪器画笔

◆ trackerPosition()

QPoint QwtPicker::trackerPosition ( ) const

返回追踪器的当前位置

◆ trackerRect()

QRect QwtPicker::trackerRect ( const QFont &  font) const
virtual

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

QwtPlotSeriesDataPicker 重载.

◆ trackerText()

QwtText QwtPicker::trackerText ( const QPoint &  pos) const
virtual

返回位置的标签

QwtPlotPicker, QwtPolarPicker , 以及 QwtPlotSeriesDataPicker 重载.

◆ transition()

void QwtPicker::transition ( const QEvent *  event)
protectedvirtual

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() ).

参数
eventEvent

◆ widgetEnterEvent()

void QwtPicker::widgetEnterEvent ( QEvent *  event)
protectedvirtual

◆ widgetKeyPressEvent()

void QwtPicker::widgetKeyPressEvent ( QKeyEvent *  keyEvent)
protectedvirtual

Handle a key press event for the observed widget.

Selections can be completely done by the keyboard. The arrow keys move the cursor, the abort key aborts a selection. All other keys are handled by the current state machine.

参数
keyEventKey event
参见
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyReleaseEvent(), stateMachine(), QwtEventPattern::KeyPatternCode

QwtPlotAxisZoomer , 以及 QwtPlotCanvasZoomer 重载.

◆ widgetKeyReleaseEvent()

void QwtPicker::widgetKeyReleaseEvent ( QKeyEvent *  keyEvent)
protectedvirtual

Handle a key release event for the observed widget.

Passes the event to the state machine.

参数
keyEventKey event
参见
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyPressEvent(), stateMachine()

◆ widgetLeaveEvent()

void QwtPicker::widgetLeaveEvent ( QEvent *  event)
protectedvirtual

◆ widgetMouseDoubleClickEvent()

void QwtPicker::widgetMouseDoubleClickEvent ( QMouseEvent *  mouseEvent)
protectedvirtual

Handle mouse double click event for the observed widget.

参数
mouseEventMouse event
参见
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()

◆ widgetMouseMoveEvent()

void QwtPicker::widgetMouseMoveEvent ( QMouseEvent *  mouseEvent)
protectedvirtual

◆ widgetMousePressEvent()

void QwtPicker::widgetMousePressEvent ( QMouseEvent *  mouseEvent)
protectedvirtual

Handle a mouse press event for the observed widget.

参数
mouseEventMouse event
参见
eventFilter(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()

QwtPlotPanner 重载.

◆ widgetMouseReleaseEvent()

void QwtPicker::widgetMouseReleaseEvent ( QMouseEvent *  mouseEvent)
protectedvirtual

Handle a mouse release event for the observed widget.

参数
mouseEventMouse event
参见
eventFilter(), widgetMousePressEvent(), widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(), widgetWheelEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()

QwtPlotAxisZoomer , 以及 QwtPlotCanvasZoomer 重载.

◆ widgetWheelEvent()

void QwtPicker::widgetWheelEvent ( QWheelEvent *  wheelEvent)
protectedvirtual

Handle a wheel event for the observed widget.

Move the last point of the selection in case of isActive() == true

参数
wheelEventWheel event
参见
eventFilter(), widgetMousePressEvent(), widgetMouseReleaseEvent(), widgetMouseDoubleClickEvent(), widgetMouseMoveEvent(), widgetKeyPressEvent(), widgetKeyReleaseEvent()

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