10#include "qwt_picker_machine.h"
11#include "qwt_event_pattern.h"
17 : m_selectionType( type )
30 return m_selectionType;
66 case QEvent::MouseMove:
105 switch ( event->type() )
107 case QEvent::MouseButtonPress:
110 static_cast< const QMouseEvent*
>( event ) ) )
118 case QEvent::KeyPress:
120 const QKeyEvent* keyEvent =
static_cast< const QKeyEvent*
> ( event );
123 if ( !keyEvent->isAutoRepeat() )
151 switch ( event->type() )
153 case QEvent::MouseButtonPress:
156 static_cast< const QMouseEvent*
>( event ) ) )
167 case QEvent::MouseMove:
174 case QEvent::MouseButtonRelease:
183 case QEvent::KeyPress:
185 const QKeyEvent* keyEvent =
static_cast< const QKeyEvent*
> ( event );
188 if ( !keyEvent->isAutoRepeat() )
224 switch ( event->type() )
226 case QEvent::MouseButtonPress:
229 static_cast< const QMouseEvent*
>( event ) ) )
254 case QEvent::MouseMove:
261 case QEvent::MouseButtonRelease:
264 static_cast< const QMouseEvent*
>( event ) ) )
274 case QEvent::KeyPress:
276 const QKeyEvent* keyEvent =
static_cast< const QKeyEvent*
> ( event );
279 if ( !keyEvent->isAutoRepeat() )
294 else if (
state() == 2 )
323 switch ( event->type() )
325 case QEvent::MouseButtonPress:
328 static_cast< const QMouseEvent*
>( event ) ) )
340 case QEvent::MouseMove:
347 case QEvent::MouseButtonRelease:
356 case QEvent::KeyPress:
359 static_cast< const QKeyEvent*
> ( event ) ) )
395 switch ( event->type() )
397 case QEvent::MouseButtonPress:
400 static_cast< const QMouseEvent*
>( event ) ) )
415 static_cast< const QMouseEvent*
>( event ) ) )
425 case QEvent::MouseMove:
432 case QEvent::KeyPress:
434 const QKeyEvent* keyEvent =
static_cast< const QKeyEvent*
> ( event );
437 if ( !keyEvent->isAutoRepeat() )
454 if ( !keyEvent->isAutoRepeat() )
484 switch( event->type() )
486 case QEvent::MouseButtonPress:
489 static_cast< const QMouseEvent*
>( event ) ) )
501 case QEvent::KeyPress:
504 static_cast< const QKeyEvent*
> ( event ) ) )
521 case QEvent::MouseMove:
529 case QEvent::MouseButtonRelease:
A collection of event patterns.
bool mouseMatch(MousePatternCode, const QMouseEvent *) const
Compare a mouse event with an event pattern.
bool keyMatch(KeyPatternCode, const QKeyEvent *) const
Compare a key event with an event pattern.
@ KeySelect1
Qt::Key_Return.
@ KeySelect2
Qt::Key_Space.
virtual QList< Command > transition(const QwtEventPattern &, const QEvent *) override
Transition.
QwtPickerClickPointMachine()
Constructor.
QwtPickerClickRectMachine()
Constructor.
virtual QList< Command > transition(const QwtEventPattern &, const QEvent *) override
Transition.
virtual QList< Command > transition(const QwtEventPattern &, const QEvent *) override
Transition.
QwtPickerDragLineMachine()
Constructor.
virtual QList< Command > transition(const QwtEventPattern &, const QEvent *) override
Transition.
QwtPickerDragPointMachine()
Constructor.
QwtPickerDragRectMachine()
Constructor.
virtual QList< Command > transition(const QwtEventPattern &, const QEvent *) override
Transition.
A state machine for QwtPicker selections.
int state() const
Return the current state.
void setState(int)
Change the current state.
SelectionType selectionType() const
Return the selection type.
virtual ~QwtPickerMachine()
Destructor.
QwtPickerMachine(SelectionType)
Constructor.
void reset()
Set the current state to 0.
QwtPickerPolygonMachine()
Constructor.
virtual QList< Command > transition(const QwtEventPattern &, const QEvent *) override
Transition.
QwtPickerTrackerMachine()
Constructor.
virtual QList< Command > transition(const QwtEventPattern &, const QEvent *) override
Transition.