|
Krita Source Code Documentation
|
The KisCustomModifiersCatcher class is a special utility class that tracks custom modifiers pressed. Its main purpose is to avoid manual tracking of KeyPress/KeyRelease/FocusIn events in the class and reuse the common code in multiple widgets. More...
#include <kis_custom_modifiers_catcher.h>
Inheritance diagram for KisCustomModifiersCatcher:Classes | |
| struct | Private |
Public Member Functions | |
| void | addModifier (const QString &id, Qt::Key modifier) |
| addModifier registers a custom modifier | |
| bool | eventFilter (QObject *object, QEvent *event) override |
| KisCustomModifiersCatcher (QObject *parent) | |
| bool | modifierPressed (const QString &id) |
| modifierPressed returns the state of the tracked modifier | |
| ~KisCustomModifiersCatcher () override | |
Private Attributes | |
| const QScopedPointer< Private > | m_d |
The KisCustomModifiersCatcher class is a special utility class that tracks custom modifiers pressed. Its main purpose is to avoid manual tracking of KeyPress/KeyRelease/FocusIn events in the class and reuse the common code in multiple widgets.
Definition at line 33 of file kis_custom_modifiers_catcher.h.
| KisCustomModifiersCatcher::KisCustomModifiersCatcher | ( | QObject * | parent | ) |
Create the catcher and connect to the passed widget/object to track its key events
Definition at line 34 of file kis_custom_modifiers_catcher.cpp.
References m_d.
|
override |
Definition at line 43 of file kis_custom_modifiers_catcher.cpp.
| void KisCustomModifiersCatcher::addModifier | ( | const QString & | id, |
| Qt::Key | modifier ) |
addModifier registers a custom modifier
| id | a unique id string associated with the modifier. Later, you will use this string to fetch the modifier state. |
| modifier | the key to track |
Definition at line 47 of file kis_custom_modifiers_catcher.cpp.
References m_d.
|
override |
Definition at line 64 of file kis_custom_modifiers_catcher.cpp.
References eventFilter(), m_d, KisExtendedModifiersMapper::queryExtendedModifiers(), KisExtendedModifiersMapper::queryStandardModifiers(), and KisExtendedModifiersMapper::workaroundShiftAltMetaHell().
| bool KisCustomModifiersCatcher::modifierPressed | ( | const QString & | id | ) |
modifierPressed returns the state of the tracked modifier
Definition at line 55 of file kis_custom_modifiers_catcher.cpp.
References m_d.
|
private |
Definition at line 59 of file kis_custom_modifiers_catcher.h.