QwtEventPattern - A collection of event patterns.
Contents
Constructor & Destructor Documentation
QwtEventPattern::QwtEventPattern()
Constructor
Seealso:MousePatternCode, KeyPatternCodeDetailed 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.
Seealso:QwtPicker, QwtPickerMachine, QwtPlotZoomerMember Enumeration Documentation
enumQwtEventPattern::KeyPatternCode
Symbolic keyboard input codes. Individual settings can be configured using setKeyPattern()Seealso:setKeyPattern(), setMousePattern()EnumeratorKeySelect1
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.
KeyRedo
Qt::Key_Plus.
KeyUndo
Qt::Key_Minus.
KeyHome
Qt::Key_Escape.
KeyPatternCount
Number of key patterns.
enumQwtEventPattern::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().
Seealso:initMousePattern(), setMousePattern(), setKeyPattern()EnumeratorMouseSelect1
The default setting for 1, 2 and 3 button mice is:
• Qt::LeftButton
• Qt::LeftButton
• Qt::LeftButton
MouseSelect2
The default setting for 1, 2 and 3 button mice is:
• Qt::LeftButton + Qt::ControlModifier
• Qt::RightButton
• Qt::RightButton
MouseSelect3
The default setting for 1, 2 and 3 button mice is:
• Qt::LeftButton + Qt::AltModifier
• Qt::LeftButton + Qt::AltModifier
• Qt::MidButton
MouseSelect4
The default setting for 1, 2 and 3 button mice is:
• Qt::LeftButton + Qt::ShiftModifier
• Qt::LeftButton + Qt::ShiftModifier
• Qt::LeftButton + Qt::ShiftModifier
MouseSelect5
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
MouseSelect6
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
MousePatternCount
Number of mouse patterns.
Member Function Documentation
voidQwtEventPattern::initKeyPattern()
Set default mouse patterns.
Seealso:KeyPatternCodevoidQwtEventPattern::initMousePattern(intnumButtons)
Set default mouse patterns, depending on the number of mouse buttons
Parameters:numButtons Number of mouse buttons ( <= 3 )
Seealso:MousePatternCodeboolQwtEventPattern::keyMatch(KeyPatternCodecode,constQKeyEvent*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
Seealso:mouseMatch()boolQwtEventPattern::keyMatch(constKeyPattern&pattern,constQKeyEvent*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
Seealso:mouseMatch()constQVector<QwtEventPattern::KeyPattern>&QwtEventPattern::keyPattern()constReturns:
Key pattern
QVector<QwtEventPattern::KeyPattern>&QwtEventPattern::keyPattern()Returns:
Key pattern
boolQwtEventPattern::mouseMatch(MousePatternCodecode,constQMouseEvent*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
Seealso:keyMatch()boolQwtEventPattern::mouseMatch(constMousePattern&pattern,constQMouseEvent*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
Seealso:keyMatch()constQVector<QwtEventPattern::MousePattern>&QwtEventPattern::mousePattern()constReturns:
Mouse pattern
QVector<QwtEventPattern::MousePattern>&QwtEventPattern::mousePattern()Returns:
Mouse pattern
voidQwtEventPattern::setKeyPattern(KeyPatternCodepattern,intkey,Qt::KeyboardModifiersmodifiers=Qt::NoModifier)
Change one key pattern
Parameters:pattern Index of the pattern
key Key
modifiers Keyboard modifiers
Seealso:
QKeyEvent
voidQwtEventPattern::setMousePattern(MousePatternCodepattern,Qt::MouseButtonbutton,Qt::KeyboardModifiersmodifiers=Qt::NoModifier)
Change one mouse pattern
Parameters:pattern Index of the pattern
button Button
modifiers Keyboard modifiers
Seealso:
QMouseEvent
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.
PublicTypes
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.
PublicMemberFunctionsQwtEventPattern ()
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.
ProtectedMemberFunctions
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.
