Eneboo - Documentación para desarrolladores
|
A collection of event patterns. Más...
#include <qwt_event_pattern.h>
Clases | |
class | KeyPattern |
A pattern for key events. Más... | |
class | MousePattern |
A pattern for mouse events. Más... | |
Tipos públicos | |
enum | MousePatternCode { MouseSelect1, MouseSelect2, MouseSelect3, MouseSelect4, MouseSelect5, MouseSelect6, MousePatternCount } |
Symbolic mouse input codes. Más... | |
enum | KeyPatternCode { KeySelect1, KeySelect2, KeyAbort, KeyLeft, KeyRight, KeyUp, KeyDown, KeyRedo, KeyUndo, KeyHome, KeyPatternCount } |
Symbolic keyboard input codes. Más... | |
Métodos públicos | |
QwtEventPattern () | |
virtual | ~QwtEventPattern () |
Destructor. | |
void | initMousePattern (int numButtons) |
void | initKeyPattern () |
void | setMousePattern (uint pattern, int button, int state=Qt::NoButton) |
void | setKeyPattern (uint pattern, int key, int state=Qt::NoButton) |
void | setMousePattern (const QwtArray< MousePattern > &) |
Change the mouse event patterns. | |
void | setKeyPattern (const QwtArray< KeyPattern > &) |
Change the key event patterns. | |
const QwtArray< MousePattern > & | mousePattern () const |
Return mouse patterns. | |
const QwtArray< KeyPattern > & | keyPattern () const |
Return key patterns. | |
QwtArray< MousePattern > & | mousePattern () |
Return ,ouse patterns. | |
QwtArray< KeyPattern > & | keyPattern () |
Return Key patterns. | |
bool | mouseMatch (uint pattern, const QMouseEvent *) const |
Compare a mouse event with an event pattern. | |
bool | keyMatch (uint pattern, const QKeyEvent *) const |
Compare a key event with an event pattern. | |
Métodos protegidos | |
virtual bool | mouseMatch (const MousePattern &, const QMouseEvent *) const |
Compare a mouse event with an event pattern. | |
virtual bool | keyMatch (const KeyPattern &, const QKeyEvent *) const |
Compare a key event with an event pattern. |
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 ) |
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 |
e | Key event |
bool QwtEventPattern::keyMatch | ( | const KeyPattern & | pattern, |
const QKeyEvent * | e | ||
) | 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 |
e | Key event |
const QwtArray< QwtEventPattern::KeyPattern > & QwtEventPattern::keyPattern | ( | ) | const |
Return key patterns.
QwtArray< QwtEventPattern::KeyPattern > & QwtEventPattern::keyPattern | ( | ) |
Return Key patterns.
bool QwtEventPattern::mouseMatch | ( | uint | pattern, |
const QMouseEvent * | e | ||
) | 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 |
e | Mouse event |
bool QwtEventPattern::mouseMatch | ( | const MousePattern & | pattern, |
const QMouseEvent * | e | ||
) | 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 |
e | Mouse event |
QwtArray< QwtEventPattern::MousePattern > & QwtEventPattern::mousePattern | ( | ) |
Return ,ouse patterns.
const QwtArray< QwtEventPattern::MousePattern > & QwtEventPattern::mousePattern | ( | ) | const |
Return mouse patterns.
void QwtEventPattern::setKeyPattern | ( | const QwtArray< KeyPattern > & | pattern | ) |
Change the key event patterns.
Change one mouse pattern
pattern | Index of the pattern |
button | Button |
state | State |
void QwtEventPattern::setMousePattern | ( | const QwtArray< MousePattern > & | pattern | ) |
Change the mouse event patterns.