Qwt User's Guide 6.3.0

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
QwtPickerMachine Class Referenceabstract

A state machine for QwtPicker selections. More...

`#include <qwt_picker_machine.h>`

Inheritance diagram for QwtPickerMachine:

## Public Types
enum | SelectionType { NoSelection = -1 , PointSelection , RectSelection , PolygonSelection }
enum | Command { Begin , Append , Move , Remove , End }
| Commands - the output of a state machine. More...

## Public Member Functions
| QwtPickerMachine (SelectionType)
| Constructor.
virtual | ~QwtPickerMachine ()
| Destructor.
virtual QList< Command > | transition (const QwtEventPattern &, const QEvent *)=0
| Transition.
void | reset ()
| Set the current state to 0.
int | state () const
| Return the current state.
void | setState (int)
| Change the current state.
SelectionType | selectionType () const
| Return the selection type.

## Detailed Description

A state machine for QwtPicker selections.

QwtPickerMachine accepts key and mouse events and translates them into selection commands.

See also
  QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode

Definition at line 28 of file qwt_picker_machine.h.

## Member Enumeration Documentation

## ◆ Command

enum QwtPickerMachine::Command

Commands - the output of a state machine.

Definition at line 51 of file qwt_picker_machine.h.

## ◆ SelectionType

enum QwtPickerMachine::SelectionType

Type of a selection.

See also
  selectionType()

Enumerator
NoSelection | The state machine not usable for any type of selection.
PointSelection | The state machine is for selecting a single point.
RectSelection | The state machine is for selecting a rectangle (2 points).
PolygonSelection | The state machine is for selecting a polygon (many points).

Definition at line 35 of file qwt_picker_machine.h.

## Constructor & Destructor Documentation

## ◆ QwtPickerMachine()

QwtPickerMachine::QwtPickerMachine | ( | SelectionType | type | ) |
| explicit

Constructor.

Definition at line 16 of file qwt_picker_machine.cpp.

## ◆ ~QwtPickerMachine()

QwtPickerMachine::~QwtPickerMachine | ( |  | ) |
| virtual

Destructor.

Definition at line 23 of file qwt_picker_machine.cpp.

## Member Function Documentation

## ◆ reset()

void QwtPickerMachine::reset | ( |  | ) |

Set the current state to 0.

Definition at line 46 of file qwt_picker_machine.cpp.

## ◆ selectionType()

QwtPickerMachine::SelectionType QwtPickerMachine::selectionType | ( |  | ) | const

Return the selection type.

Definition at line 28 of file qwt_picker_machine.cpp.

## ◆ setState()

void QwtPickerMachine::setState | ( | int | state | ) |

Change the current state.

Definition at line 40 of file qwt_picker_machine.cpp.

## ◆ state()

int QwtPickerMachine::state | ( |  | ) | const

Return the current state.

Definition at line 34 of file qwt_picker_machine.cpp.

## ◆ transition()

virtual QList< Command > QwtPickerMachine::transition | ( | const QwtEventPattern & | ,
|  | const QEvent * | )
| pure virtual

Transition.

Implemented in QwtPickerTrackerMachine, QwtPickerClickPointMachine, QwtPickerDragPointMachine, QwtPickerClickRectMachine, QwtPickerDragRectMachine, QwtPickerDragLineMachine, and QwtPickerPolygonMachine.