: A class to handle QKeyEvent in an eventFilter and send high level signals. More...
#include <pqKeyEventFilter.h>
Inherits QObject.
Public Types | |
enum | KeyCategory { Accept, Reject, TextInput, Motion, Focus } |
An enum for the key events categories. More... | |
Signals | |
void | textChanged (int key) |
Emited on text key pressed, without modifier. More... | |
void | accepted (bool modified) |
Emited on enter or return pressed modified is true if Shift is pressed. More... | |
void | rejected () |
Emited on Escape. More... | |
void | motion (int key) |
Emited on a motion key was pressed. More... | |
void | focusChanged () |
Emited on Tab press. More... | |
Public Member Functions | |
pqKeyEventFilter (QObject *parent) | |
~pqKeyEventFilter () override | |
void | filter (QObject *monitored) |
install event filter on monitored object. More... | |
void | forwardTypes (QObject *monitored, QList< int > types) |
Filter monitored object but still forward event that fall under the given type. More... | |
void | forwardType (QObject *monitored, int type) |
Filter monitored object but still forward event that fall under the given type. More... | |
Protected Member Functions | |
bool | eventFilter (QObject *obj, QEvent *event) override |
Reimplemented to handled QKeyEvent. More... | |
: A class to handle QKeyEvent in an eventFilter and send high level signals.
: pqKeyEventFilter is a configurable class that reimplements eventFilter() and emit high level signals to communicate about key events.
This is specially useful when a container widget wants to know about key events regardless of which of its child receive the event.
Definition at line 26 of file pqKeyEventFilter.h.
An enum for the key events categories.
Enumerator | |
---|---|
Accept | |
Reject | |
TextInput | |
Motion | |
Focus |
Definition at line 38 of file pqKeyEventFilter.h.
pqKeyEventFilter::pqKeyEventFilter | ( | QObject * | parent | ) |
|
override |
void pqKeyEventFilter::filter | ( | QObject * | monitored | ) |
install event filter on monitored object.
void pqKeyEventFilter::forwardTypes | ( | QObject * | monitored, |
QList< int > | types | ||
) |
Filter monitored object but still forward event that fall under the given type.
void pqKeyEventFilter::forwardType | ( | QObject * | monitored, |
int | type | ||
) |
Filter monitored object but still forward event that fall under the given type.
|
signal |
Emited on text key pressed, without modifier.
Text keys:
As defined by QChar::isLetterOrNumber and QChar::isSpace
|
signal |
Emited on enter or return pressed modified is true if Shift is pressed.
|
signal |
Emited on Escape.
|
signal |
Emited on a motion key was pressed.
Motion keys: the four arrows, home, end, page down and page up.
|
signal |
Emited on Tab press.
reverse is true on Shift + Tab.
|
overrideprotected |
Reimplemented to handled QKeyEvent.