QwtEventPattern(3)

πŸ“¦ version 5.2.3a, in epel 9, fedora 43, fedora 44

πŸ’– QwtEventPattern πŸ’–

okay bestie, we're in the Qwt User's Guide and today's main character is QwtEventPattern β€” a whole baddie of a class that handles mouse + keyboard event patterns. let's get into it fr fr ✨


πŸŽ€ NAME πŸŽ€

QwtEventPattern β€” (yes that's literally it, the name section is just vibing there, no description, we move)


🌈 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 KeyPatternCode { KeySelect1, KeySelect2, KeyAbort, KeyLeft,
    KeyRight, KeyUp, KeyDown, KeyRedo, KeyUndo, KeyHome, KeyPatternCount
}
enum MousePatternCode { MouseSelect1, MouseSelect2, MouseSelect3,
    MouseSelect4, MouseSelect5, MouseSelect6, MousePatternCount }

πŸ¦‹ Public Member Functions πŸ¦‹

QwtEventPattern ()
virtual ~QwtEventPattern ()
void initKeyPattern ()
void initMousePattern (int numButtons)
bool keyMatch (uint pattern, const QKeyEvent *) const
const QwtArray< KeyPattern > & keyPattern () const
QwtArray< KeyPattern > & keyPattern ()
bool mouseMatch (uint pattern, const QMouseEvent *) const
const QwtArray< MousePattern > & mousePattern () const
QwtArray< MousePattern > & mousePattern ()
void setKeyPattern (uint pattern, int key, int state=Qt::NoButton)
void setKeyPattern (const QwtArray< KeyPattern > &)
void setMousePattern (uint pattern, int button, int state=Qt::NoButton)
void setMousePattern (const QwtArray< MousePattern > &)

🫢 Protected Member Functions 🫢

virtual bool keyMatch (const KeyPattern &, const QKeyEvent *) const
virtual bool mouseMatch (const MousePattern &, const QMouseEvent *)
    const

πŸ‘‘ 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. it's giving ✨decoupling✨, it's giving πŸ’…flexibilityπŸ’…

See also: QwtPicker, QwtPickerMachine, QwtPlotZoomer


πŸ’€ Member Enumeration Documentation πŸ’€

πŸ“ enum QwtEventPattern::KeyPatternCode

Symbolic keyboard input codes. Default initialization:

  • KeySelect1 β†’ Qt::Key_Return
  • KeySelect2 β†’ Qt::Key_Space
  • KeyAbort β†’ Qt::Key_Escape
  • KeyLeft β†’ Qt::Key_Left
  • KeyRight β†’ Qt::Key_Right
  • KeyUp β†’ Qt::Key_Up
  • KeyDown β†’ Qt::Key_Down
  • KeyUndo β†’ Qt::Key_Minus
  • KeyRedo β†’ Qt::Key_Plus
  • KeyHome β†’ Qt::Key_Escape
not KeyAbort and KeyHome both being Qt::Key_Escape by default πŸ’€ that's just how it is bestie, don't come for me, I don't make the rules

🧚 enum QwtEventPattern::MousePatternCode

Symbolic mouse input codes. The default initialization for 3 button mice is:

  • MouseSelect1 β†’ Qt::LeftButton
  • MouseSelect2 β†’ Qt::RightButton
  • MouseSelect3 β†’ Qt::MidButton
  • MouseSelect4 β†’ Qt::LeftButton + Qt::ShiftButton
  • MouseSelect5 β†’ Qt::RightButton + Qt::ShiftButton
  • MouseSelect6 β†’ Qt::MidButton + Qt::ShiftButton

The default initialization for 2 button mice is:

  • MouseSelect1 β†’ Qt::LeftButton
  • MouseSelect2 β†’ Qt::RightButton
  • MouseSelect3 β†’ Qt::LeftButton + Qt::AltButton
  • MouseSelect4 β†’ Qt::LeftButton + Qt::ShiftButton
  • MouseSelect5 β†’ Qt::RightButton + Qt::ShiftButton
  • MouseSelect6 β†’ Qt::LeftButton + Qt::AltButton + Qt::ShiftButton

The default initialization for 1 button mice is:

  • MouseSelect1 β†’ Qt::LeftButton
  • MouseSelect2 β†’ Qt::LeftButton + Qt::ControlButton
  • MouseSelect3 β†’ Qt::LeftButton + Qt::AltButton
  • MouseSelect4 β†’ Qt::LeftButton + Qt::ShiftButton
  • MouseSelect5 β†’ Qt::LeftButton + Qt::ControlButton + Qt::ShiftButton
  • MouseSelect6 β†’ Qt::LeftButton + Qt::AltButton + Qt::ShiftButton

See also: initMousePattern()


🌸 Constructor & Destructor Documentation 🌸

πŸŽ€ QwtEventPattern::QwtEventPattern ()

Constructor

See also: MousePatternCode, KeyPatternCode


πŸ’œ Member Function Documentation πŸ’œ

⭐ void QwtEventPattern::initKeyPattern ()

Set default mouse patterns.

See also: KeyPatternCode

okay yes the docs say "mouse patterns" here in the key pattern function, and I am simply reporting the facts, no cap πŸ™ˆ

⭐ 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

⭐ bool QwtEventPattern::keyMatch (uint pattern, const QKeyEvent *e) 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:

  • pattern β€” Index of the event pattern
  • e β€” Key event

Returns: true if matches

See also: mouseMatch()

⭐ 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.

Parameters:

  • pattern β€” Key event pattern
  • e β€” Key event

Returns: true if matches

See also: mouseMatch()

⭐ 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.

Parameters:

  • pattern β€” Index of the event pattern
  • e β€” Mouse event

Returns: true if matches

See also: keyMatch()

⭐ 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.

Parameters:

  • pattern β€” Mouse event pattern
  • e β€” Mouse event

Returns: true if matches

See also: keyMatch()

⭐ void QwtEventPattern::setKeyPattern (uint pattern, int key, int state = Qt::NoButton)

Change one key pattern

Parameters:

  • pattern β€” Index of the pattern
  • key β€” Key
  • state β€” State

See also: QKeyEvent

⭐ void QwtEventPattern::setMousePattern (uint pattern, int button, int state = Qt::NoButton)

Change one mouse pattern

Parameters:

  • pattern β€” Index of the pattern
  • button β€” Button
  • state β€” State

See also: QMouseEvent


🌈 Author 🌈

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


and that's the whole page bestie, you ate that πŸ’…βœ¨

this was Version 5.2.3, dated Tue Nov 20 2012 β€” yes it's a lil vintage, we respect our elders πŸ‘‘ go forth and pattern-match your events, mwah πŸŽ€πŸ’–πŸ¦‹

πŸ“¦ where this page comes from