QwtEventPattern(3)
π 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_ReturnKeySelect2βQt::Key_SpaceKeyAbortβQt::Key_EscapeKeyLeftβQt::Key_LeftKeyRightβQt::Key_RightKeyUpβQt::Key_UpKeyDownβQt::Key_DownKeyUndoβQt::Key_MinusKeyRedoβQt::Key_PlusKeyHomeβQt::Key_Escape
notKeyAbortandKeyHomeboth beingQt::Key_Escapeby 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::LeftButtonMouseSelect2βQt::RightButtonMouseSelect3βQt::MidButtonMouseSelect4βQt::LeftButton + Qt::ShiftButtonMouseSelect5βQt::RightButton + Qt::ShiftButtonMouseSelect6βQt::MidButton + Qt::ShiftButton
The default initialization for 2 button mice is:
MouseSelect1βQt::LeftButtonMouseSelect2βQt::RightButtonMouseSelect3βQt::LeftButton + Qt::AltButtonMouseSelect4βQt::LeftButton + Qt::ShiftButtonMouseSelect5βQt::RightButton + Qt::ShiftButtonMouseSelect6βQt::LeftButton + Qt::AltButton + Qt::ShiftButton
The default initialization for 1 button mice is:
MouseSelect1βQt::LeftButtonMouseSelect2βQt::LeftButton + Qt::ControlButtonMouseSelect3βQt::LeftButton + Qt::AltButtonMouseSelect4βQt::LeftButton + Qt::ShiftButtonMouseSelect5βQt::LeftButton + Qt::ControlButton + Qt::ShiftButtonMouseSelect6β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 patterneβ 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 patterneβ 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 patterneβ 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 patterneβ 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 patternkeyβ Keystateβ State
See also: QKeyEvent
β void QwtEventPattern::setMousePattern (uint pattern, int button, int state = Qt::NoButton)
Change one mouse pattern
Parameters:
patternβ Index of the patternbuttonβ Buttonstateβ 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
- epel 9: qwt5-qt5-devel 5.2.3a-12.20210522gita2b11e3.el9 Β· LGPLv2+ with exceptions
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms