A state machine for point selections. More...
#include <qwt_picker_machine.h>


Public Member Functions | |
| virtual CommandList | transition (const QwtEventPattern &, const QEvent *) |
| Transition. | |
A state machine for point selections.
Pressing QwtEventPattern::MouseSelect1 or QwtEventPattern::KeySelect1 selects a point.
Definition at line 75 of file qwt_picker_machine.h.
| QwtPickerMachine::CommandList QwtPickerClickPointMachine::transition | ( | const QwtEventPattern & | eventPattern, |
| const QEvent * | e | ||
| ) | [virtual] |
Transition.
Implements QwtPickerMachine.
Definition at line 44 of file qwt_picker_machine.cpp.
References QwtPickerMachine::Append, QwtPickerMachine::Begin, QwtPickerMachine::End, QwtEventPattern::keyMatch(), QwtEventPattern::KeySelect1, QwtEventPattern::mouseMatch(), and QwtEventPattern::MouseSelect1.
{
QwtPickerMachine::CommandList cmdList;
switch(e->type())
{
case QEvent::MouseButtonPress:
{
if ( eventPattern.mouseMatch(
QwtEventPattern::MouseSelect1, (const QMouseEvent *)e) )
{
cmdList += Begin;
cmdList += Append;
cmdList += End;
}
break;
}
case QEvent::KeyPress:
{
if ( eventPattern.keyMatch(
QwtEventPattern::KeySelect1, (const QKeyEvent *)e) )
{
cmdList += Begin;
cmdList += Append;
cmdList += End;
}
break;
}
default:
break;
}
return cmdList;
}
1.7.2