QwtPlotPicker
-
QwtPlotPicker ------------- >QwtPicker
-
NoRubberBand No rubberband.
HLineRubberBand A horizontal line ( only for QwtPicker::PointSelection )
VLineRubberBand A vertical line ( only for QwtPicker::PointSelection )
CrossRubberBand A crosshair ( only for QwtPicker::PointSelection )
RectRubberBand A rectangle ( only for QwtPicker::RectSelection )
EllipseRubberBand An ellipse ( only for QwtPicker::RectSelection )
PolygonRubberBand A polygon ( only for QwtPicker::&PolygonSelection )
UserRubberBand Values >= UserRubberBand can be used to define additional rubber bands.
-
- 但是必须与下面的machine对应,
QwtPicker的核心有三个:
1、Tracker
2、StateMachine 3、RubberBand
简单来说tracker就是在鼠标光标处显示当前坐标。
rubberBand则与stateMachine有关了。 rubberBand有很多种:
Enumerator:
QwtPicker filters all enter, leave, mouse and keyboard events of a widget and translates them into an array of selected points.
The way how the points are collected depends on type of state machine that is connected to the picker. Qwt offers a couple of predefined state machines for selecting:
- Nothing
QwtPickerTrackerMachine - Single points
QwtPickerClickPointMachine,QwtPickerDragPointMachine - Rectangles
QwtPickerClickRectMachine,QwtPickerDragRectMachine - Polygons
QwtPickerPolygonMachine
While these state machines cover the most common ways to collect points it is also possible to implement individual machines as well.