Scroll to navigation

QwtEventPattern(3) Qwt User's Guide QwtEventPattern(3)

NAME

QwtEventPattern - A collection of event patterns.

SYNOPSIS

#include <qwt_event_pattern.h>

Inherited by QwtPicker.

Classes


class KeyPattern
A pattern for key events. class MousePattern
A pattern for mouse events.

Public Types


enum MousePatternCode { MouseSelect1, MouseSelect2, MouseSelect3, MouseSelect4, MouseSelect5, MouseSelect6, MousePatternCount }
Symbolic mouse input codes. enum KeyPatternCode { KeySelect1, KeySelect2, KeyAbort, KeyLeft, KeyRight, KeyUp, KeyDown, KeyRedo, KeyUndo, KeyHome, KeyPatternCount }
Symbolic keyboard input codes.

Public Member Functions


QwtEventPattern ()
virtual ~QwtEventPattern ()
Destructor. void initMousePattern (int numButtons)
void initKeyPattern ()
void setMousePattern (MousePatternCode, Qt::MouseButton button, Qt::KeyboardModifiers=Qt::NoModifier)
void setKeyPattern (KeyPatternCode, int key, Qt::KeyboardModifiers modifiers=Qt::NoModifier)
void setMousePattern (const QVector< MousePattern > &)
Change the mouse event patterns. void setKeyPattern (const QVector< KeyPattern > &)
Change the key event patterns. const QVector< MousePattern > & mousePattern () const
const QVector< KeyPattern > & keyPattern () const
QVector< MousePattern > & mousePattern ()
QVector< KeyPattern > & keyPattern ()
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.

Protected Member Functions


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.

Detailed Description

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.

See also

QwtPicker, QwtPickerMachine, QwtPlotZoomer

Definition at line 30 of file qwt_event_pattern.h.

Member Enumeration Documentation

enum QwtEventPattern::KeyPatternCode

Symbolic keyboard input codes. Individual settings can be configured using setKeyPattern()

See also

setKeyPattern(), setMousePattern()

Enumerator

Qt::Key_Return.
Qt::Key_Space.
Qt::Key_Escape.
Qt::Key_Left.
Qt::Key_Right.
Qt::Key_Up.
Qt::Key_Down.
Qt::Key_Plus.
Qt::Key_Minus.
Qt::Key_Escape.
Number of key patterns.

Definition at line 112 of file qwt_event_pattern.h.

enum QwtEventPattern::MousePatternCode

Symbolic mouse input codes. QwtEventPattern implements 3 different settings for mice with 1, 2, or 3 buttons that can be activated using initMousePattern(). The default setting is for 3 button mice.

Individual settings can be configured using setMousePattern().

See also

initMousePattern(), setMousePattern(), setKeyPattern()

Enumerator

The default setting for 1, 2 and 3 button mice is:
  • Qt::LeftButton
  • Qt::LeftButton
  • Qt::LeftButton
The default setting for 1, 2 and 3 button mice is:
  • Qt::LeftButton + Qt::ControlModifier
  • Qt::RightButton
  • Qt::RightButton
The default setting for 1, 2 and 3 button mice is:
  • Qt::LeftButton + Qt::AltModifier
  • Qt::LeftButton + Qt::AltModifier
  • Qt::MidButton
The default setting for 1, 2 and 3 button mice is:
  • Qt::LeftButton + Qt::ShiftModifier
  • Qt::LeftButton + Qt::ShiftModifier
  • Qt::LeftButton + Qt::ShiftModifier
The default setting for 1, 2 and 3 button mice is:
  • Qt::LeftButton + Qt::ControlButton | Qt::ShiftModifier
  • Qt::RightButton + Qt::ShiftModifier
  • Qt::RightButton + Qt::ShiftModifier
The default setting for 1, 2 and 3 button mice is:
  • Qt::LeftButton + Qt::AltModifier + Qt::ShiftModifier
  • Qt::LeftButton + Qt::AltModifier | Qt::ShiftModifier
  • Qt::MidButton + Qt::ShiftModifier
Number of mouse patterns.

Definition at line 45 of file qwt_event_pattern.h.

Constructor & Destructor Documentation

QwtEventPattern::QwtEventPattern ()

Constructor

See also

MousePatternCode, KeyPatternCode

Definition at line 19 of file qwt_event_pattern.cpp.

Member Function Documentation

void QwtEventPattern::initKeyPattern ()

Set default mouse patterns.

See also

KeyPatternCode

Definition at line 81 of file qwt_event_pattern.cpp.

void QwtEventPattern::initMousePattern (int numButtons)

Set default mouse patterns, depending on the number of mouse buttons

Parameters

numButtons Number of mouse buttons ( <= 3 )

See also

MousePatternCode

Definition at line 38 of file qwt_event_pattern.cpp.

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.

Parameters

pattern Key event pattern
event Key event

Returns

true if matches

See also

mouseMatch()

Definition at line 257 of file qwt_event_pattern.cpp.

bool QwtEventPattern::keyMatch (KeyPatternCode code, 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.

Parameters

code Index of the event pattern
event Key event

Returns

true if matches

See also

mouseMatch()

Definition at line 234 of file qwt_event_pattern.cpp.

QVector< QwtEventPattern::KeyPattern > & QwtEventPattern::keyPattern ()

Returns

Key pattern

Definition at line 170 of file qwt_event_pattern.cpp.

const QVector< QwtEventPattern::KeyPattern > & QwtEventPattern::keyPattern () const

Returns

Key pattern

Definition at line 158 of file qwt_event_pattern.cpp.

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.

Parameters

pattern Mouse event pattern
event Mouse event

Returns

true if matches

See also

keyMatch()

Definition at line 211 of file qwt_event_pattern.cpp.

bool QwtEventPattern::mouseMatch (MousePatternCode code, 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.

Parameters

code Index of the event pattern
event Mouse event

Returns

true if matches

See also

keyMatch()

Definition at line 188 of file qwt_event_pattern.cpp.

QVector< QwtEventPattern::MousePattern > & QwtEventPattern::mousePattern ()

Returns

Mouse pattern

Definition at line 164 of file qwt_event_pattern.cpp.

const QVector< QwtEventPattern::MousePattern > & QwtEventPattern::mousePattern () const

Returns

Mouse pattern

Definition at line 151 of file qwt_event_pattern.cpp.

void QwtEventPattern::setKeyPattern (KeyPatternCode pattern, int key, Qt::KeyboardModifiers modifiers = Qt::NoModifier)

Change one key pattern

Parameters

pattern Index of the pattern
key Key
modifiers Keyboard modifiers

See also

QKeyEvent

Definition at line 127 of file qwt_event_pattern.cpp.

void QwtEventPattern::setMousePattern (MousePatternCode pattern, Qt::MouseButton button, Qt::KeyboardModifiers modifiers = Qt::NoModifier)

Change one mouse pattern

Parameters

pattern Index of the pattern
button Button
modifiers Keyboard modifiers

See also

QMouseEvent

Definition at line 108 of file qwt_event_pattern.cpp.

Author

Generated automatically by Doxygen for Qwt User's Guide from the source code.

Sun Jul 18 2021 Version 6.2.0