Qwt User's Guide
svn
|
#include <qwt_event_pattern.h>
Inherited by QwtPicker.
Classes | |
class | KeyPattern |
A pattern for key events. More... | |
class | MousePattern |
A pattern for mouse events. More... | |
Public Types | |
enum | KeyPatternCode { KeySelect1, KeySelect2, KeyAbort, KeyLeft, KeyRight, KeyUp, KeyDown, KeyRedo, KeyUndo, KeyHome, KeyPatternCount } |
enum | MousePatternCode { MouseSelect1, MouseSelect2, MouseSelect3, MouseSelect4, MouseSelect5, MouseSelect6, MousePatternCount } |
Public Member Functions | |
void | initKeyPattern () |
void | initMousePattern (int numButtons) |
bool | keyMatch (uint pattern, const QKeyEvent *) const |
const QVector< KeyPattern > & | keyPattern () const |
QVector< KeyPattern > & | keyPattern () |
bool | mouseMatch (uint pattern, const QMouseEvent *) const |
const QVector< MousePattern > & | mousePattern () const |
QVector< MousePattern > & | mousePattern () |
QwtEventPattern () | |
void | setKeyPattern (uint pattern, int key, int state=Qt::NoButton) |
void | setKeyPattern (const QVector< KeyPattern > &) |
void | setMousePattern (uint pattern, int button, int state=Qt::NoButton) |
void | setMousePattern (const QVector< MousePattern > &) |
virtual | ~QwtEventPattern () |
Protected Member Functions | |
virtual bool | keyMatch (const KeyPattern &, const QKeyEvent *) const |
virtual bool | mouseMatch (const MousePattern &, const QMouseEvent *) const |
A collection of event patterns.
QwtEventPattern introduces an level of indirection for mouse and keyboard inputs. Those are represented by symbolic names, so the application code can be configured by individual mappings.
Symbolic keyboard input codes.
Default initialization:
Symbolic mouse input codes.
The default initialization for 3 button mice is:
The default initialization for 2 button mice is:
The default initialization for 1 button mice is:
QwtEventPattern::QwtEventPattern | ( | ) |
Constructor
QwtEventPattern::~QwtEventPattern | ( | ) | [virtual] |
Destructor.
void QwtEventPattern::initKeyPattern | ( | ) |
Set default mouse patterns.
void QwtEventPattern::initMousePattern | ( | int | numButtons | ) |
Set default mouse patterns, depending on the number of mouse buttons
numButtons | Number of mouse buttons ( <= 3 ) |
bool QwtEventPattern::keyMatch | ( | uint | pattern, |
const QKeyEvent * | event | ||
) | const |
Compare a key event with an event pattern.
A key event matches the pattern when both have the same key value and in the state value the same key flags (Qt::KeyButtonMask) are set.
pattern | Index of the event pattern |
event | Key event |
bool QwtEventPattern::keyMatch | ( | const KeyPattern & | pattern, |
const QKeyEvent * | event | ||
) | const [protected, virtual] |
Compare a key event with an event pattern.
A key event matches the pattern when both have the same key value and in the state value the same key flags (Qt::KeyButtonMask) are set.
pattern | Key event pattern |
event | Key event |
const QVector< QwtEventPattern::KeyPattern > & QwtEventPattern::keyPattern | ( | ) | const |
Return key patterns.
QVector< QwtEventPattern::KeyPattern > & QwtEventPattern::keyPattern | ( | ) |
Return Key patterns.
bool QwtEventPattern::mouseMatch | ( | uint | pattern, |
const QMouseEvent * | event | ||
) | const |
Compare a mouse event with an event pattern.
A mouse event matches the pattern when both have the same button value and in the state value the same key flags(Qt::KeyButtonMask) are set.
pattern | Index of the event pattern |
event | Mouse event |
bool QwtEventPattern::mouseMatch | ( | const MousePattern & | pattern, |
const QMouseEvent * | event | ||
) | const [protected, virtual] |
Compare a mouse event with an event pattern.
A mouse event matches the pattern when both have the same button value and in the state value the same key flags(Qt::KeyButtonMask) are set.
pattern | Mouse event pattern |
event | Mouse event |
const QVector< QwtEventPattern::MousePattern > & QwtEventPattern::mousePattern | ( | ) | const |
Return mouse patterns.
QVector< QwtEventPattern::MousePattern > & QwtEventPattern::mousePattern | ( | ) |
Return ,ouse patterns.
void QwtEventPattern::setKeyPattern | ( | uint | pattern, |
int | key, | ||
int | state = Qt::NoButton |
||
) |
Change one key pattern
pattern | Index of the pattern |
key | Key |
state | State |
void QwtEventPattern::setKeyPattern | ( | const QVector< KeyPattern > & | pattern | ) |
Change the key event patterns.
void QwtEventPattern::setMousePattern | ( | uint | pattern, |
int | button, | ||
int | state = Qt::NoButton |
||
) |
Change one mouse pattern
pattern | Index of the pattern |
button | Button |
state | State |
void QwtEventPattern::setMousePattern | ( | const QVector< MousePattern > & | pattern | ) |
Change the mouse event patterns.