10#include "qwt_event_pattern.h"
20 : m_mousePattern( MousePatternCount )
21 , m_keyPattern( KeyPatternCount )
67 m_mousePattern[
MouseSelect1].modifiers | Qt::ShiftModifier );
70 m_mousePattern[
MouseSelect2].modifiers | Qt::ShiftModifier );
73 m_mousePattern[
MouseSelect3].modifiers | Qt::ShiftModifier );
109 Qt::MouseButton button, Qt::KeyboardModifiers modifiers )
113 m_mousePattern[ pattern ].button = button;
114 m_mousePattern[ pattern ].modifiers = modifiers;
128 int key, Qt::KeyboardModifiers modifiers )
132 m_keyPattern[ pattern ].key = key;
133 m_keyPattern[ pattern ].modifiers = modifiers;
140 m_mousePattern = pattern;
146 m_keyPattern = pattern;
153 return m_mousePattern;
166 return m_mousePattern;
189 const QMouseEvent* event )
const
192 return mouseMatch( m_mousePattern[ code ], event );
212 const QMouseEvent* event )
const
235 const QKeyEvent* event )
const
238 return keyMatch( m_keyPattern[ code ], event );
258 const KeyPattern& pattern,
const QKeyEvent* event )
const
A pattern for key events.
A pattern for mouse events.
void setMousePattern(MousePatternCode, Qt::MouseButton button, Qt::KeyboardModifiers=Qt::NoModifier)
const QVector< MousePattern > & mousePattern() const
bool mouseMatch(MousePatternCode, const QMouseEvent *) const
Compare a mouse event with an event pattern.
virtual ~QwtEventPattern()
Destructor.
const QVector< KeyPattern > & keyPattern() const
bool keyMatch(KeyPatternCode, const QKeyEvent *) const
Compare a key event with an event pattern.
KeyPatternCode
Symbolic keyboard input codes.
@ KeySelect1
Qt::Key_Return.
@ KeyAbort
Qt::Key_Escape.
@ KeyPatternCount
Number of key patterns.
@ KeySelect2
Qt::Key_Space.
void initMousePattern(int numButtons)
MousePatternCode
Symbolic mouse input codes.
@ MousePatternCount
Number of mouse patterns.
void setKeyPattern(KeyPatternCode, int key, Qt::KeyboardModifiers modifiers=Qt::NoModifier)