Changeset View
Changeset View
Standalone View
Standalone View
src/qmlcontrols/kquickcontrols/private/keysequencehelper.h
Show All 15 Lines | |||||
16 | * License along with this library; if not, write to the Free Software | 16 | * License along with this library; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | * | 18 | * | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef KEYSEQUENCEHELPER_H | 21 | #ifndef KEYSEQUENCEHELPER_H | ||
22 | #define KEYSEQUENCEHELPER_H | 22 | #define KEYSEQUENCEHELPER_H | ||
23 | 23 | | |||
24 | #include <QObject> | 24 | #include <QQuickItem> | ||
25 | #include <QKeySequence> | 25 | #include <QKeySequence> | ||
26 | 26 | | |||
27 | /** | 27 | /** | ||
28 | * This class is a clone of Key from XMLGUI | 28 | * This class is a clone of Key from XMLGUI | ||
29 | * It performs only the logic of building shortcuts | 29 | * It performs only the logic of building shortcuts | ||
30 | * It is a private class to be used by KeySequenceItem | 30 | * It is a private class to be used by KeySequenceItem | ||
31 | * | 31 | * | ||
32 | */ | 32 | */ | ||
33 | 33 | | |||
34 | class KeySequenceHelperPrivate; | 34 | class KeySequenceHelperPrivate; | ||
35 | 35 | | |||
36 | class KeySequenceHelper : public QObject | 36 | class KeySequenceHelper : public QQuickItem | ||
37 | { | 37 | { | ||
38 | Q_OBJECT | 38 | Q_OBJECT | ||
39 | 39 | | |||
40 | Q_PROPERTY( | 40 | Q_PROPERTY( | ||
41 | QKeySequence keySequence | 41 | QKeySequence keySequence | ||
42 | READ keySequence | 42 | READ keySequence | ||
43 | WRITE setKeySequence | 43 | WRITE setKeySequence | ||
44 | NOTIFY keySequenceChanged) | 44 | NOTIFY keySequenceChanged) | ||
Show All 10 Lines | |||||
55 | 55 | | |||
56 | Q_PROPERTY( | 56 | Q_PROPERTY( | ||
57 | bool modifierlessAllowed | 57 | bool modifierlessAllowed | ||
58 | READ isModifierlessAllowed | 58 | READ isModifierlessAllowed | ||
59 | WRITE setModifierlessAllowed) | 59 | WRITE setModifierlessAllowed) | ||
60 | 60 | | |||
61 | public: | 61 | public: | ||
62 | 62 | | |||
63 | enum ShortcutType { | 63 | enum ShortcutType { | ||
broulik: this needs a `NOTIFY` argument, corresponding `signal` and `emit` in the setter | |||||
64 | None = 0x00, //!< No checking for conflicts | 64 | None = 0x00, //!< No checking for conflicts | ||
65 | StandardShortcuts = 0x01, //!< Check against standard shortcuts. @see KStandardShortcut | 65 | StandardShortcuts = 0x01, //!< Check against standard shortcuts. @see KStandardShortcut | ||
66 | GlobalShortcuts = 0x02 //!< Check against global shortcuts. @see KGlobalAccel | 66 | GlobalShortcuts = 0x02 //!< Check against global shortcuts. @see KGlobalAccel | ||
67 | }; | 67 | }; | ||
68 | Q_DECLARE_FLAGS(ShortcutTypes, ShortcutType) | 68 | Q_DECLARE_FLAGS(ShortcutTypes, ShortcutType) | ||
69 | Q_FLAG(ShortcutTypes) | 69 | Q_FLAG(ShortcutTypes) | ||
70 | 70 | | |||
71 | /** | 71 | /** | ||
72 | * Constructor. | 72 | * Constructor. | ||
73 | */ | 73 | */ | ||
74 | explicit KeySequenceHelper(QObject* parent = nullptr); | 74 | explicit KeySequenceHelper(QQuickItem* parent = nullptr); | ||
75 | 75 | | |||
76 | /** | 76 | /** | ||
77 | * Destructs the widget. | 77 | * Destructs the widget. | ||
78 | */ | 78 | */ | ||
79 | virtual ~KeySequenceHelper(); | 79 | virtual ~KeySequenceHelper(); | ||
80 | 80 | | |||
81 | /** | 81 | /** | ||
82 | * Allow multikey shortcuts? | 82 | * Allow multikey shortcuts? | ||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |
this needs a NOTIFY argument, corresponding signal and emit in the setter