Public Member Functions

QwtPickerClickPointMachine Class Reference

A state machine for point selections. More...

#include <qwt_picker_machine.h>

Inheritance diagram for QwtPickerClickPointMachine:
Inheritance graph
[legend]
Collaboration diagram for QwtPickerClickPointMachine:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual CommandList transition (const QwtEventPattern &, const QEvent *)
 Transition.

Detailed Description

A state machine for point selections.

Pressing QwtEventPattern::MouseSelect1 or QwtEventPattern::KeySelect1 selects a point.

See also:
QwtEventPattern::MousePatternCode, QwtEventPattern::KeyPatternCode

Definition at line 75 of file qwt_picker_machine.h.


Member Function Documentation

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;
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines