Krita Source Code Documentation
Loading...
Searching...
No Matches
kkeysequencewidget.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 SPDX-FileCopyrightText: 2001, 2002 Ellis Whitehead <ellis@kde.org>
3 SPDX-FileCopyrightText: 2007 Andreas Hartmetz <ahartmetz@gmail.com>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KKEYSEQUENCEWIDGET_H
9#define KKEYSEQUENCEWIDGET_H
10
11#include <kritawidgetutils_export.h>
12
13#include <QList>
14#include <QObject>
15#include <QWidget>
16
18class QAction;
20
36class KRITAWIDGETUTILS_EXPORT KisKKeySequenceWidget: public QWidget
37{
38 Q_OBJECT
39
40 Q_FLAGS(ShortcutTypes)
41
42 Q_PROPERTY(
43 bool multiKeyShortcutsAllowed
44 READ multiKeyShortcutsAllowed
45 WRITE setMultiKeyShortcutsAllowed)
46
47 Q_PROPERTY(
48 ShortcutTypes checkForConflictsAgainst
49 READ checkForConflictsAgainst
50 WRITE setCheckForConflictsAgainst)
51
52 Q_PROPERTY(
53 bool modifierlessAllowed
54 READ isModifierlessAllowed
55 WRITE setModifierlessAllowed)
56
57public:
62 Validate = 0,
64 NoValidate = 1
65 };
66
70 explicit KisKKeySequenceWidget(QWidget *parent = 0);
71
75 ~KisKKeySequenceWidget() override;
76
83
85 None = 0x00,
86 LocalShortcuts = 0x01,
87 StandardShortcuts = 0x02,
88 GlobalShortcuts = 0x04
89 };
90 Q_DECLARE_FLAGS(ShortcutTypes, ShortcutType)
91
92
146 void setCheckForConflictsAgainst(ShortcutTypes types);
147
154 ShortcutTypes checkForConflictsAgainst() const;
155
159 void setMultiKeyShortcutsAllowed(bool);
160 bool multiKeyShortcutsAllowed() const;
161
169 void setModifierlessAllowed(bool allow);
170
174 bool isModifierlessAllowed();
175
180 void setClearButtonShown(bool show);
181
183
193 bool isKeySequenceAvailable(const QKeySequence &seq) const;
194
198 QKeySequence keySequence() const;
199
212 void setCheckActionCollections(const QList<KisKActionCollection *> &actionCollections);
213
218 void setComponentName(const QString &componentName);
219
220Q_SIGNALS:
221
226 void keySequenceChanged(const QKeySequence &seq);
227
237 void stealShortcut(const QKeySequence &seq, QAction *action);
238
239public Q_SLOTS:
240
248 void captureKeySequence();
249
256 void setKeySequence(const QKeySequence &seq, Validation val = NoValidate);
257
261 void clearKeySequence();
262
275 void applyStealShortcut();
276
277private:
278 Q_PRIVATE_SLOT(d, void doneRecording())
279
280private:
283
284 Q_DISABLE_COPY(KisKKeySequenceWidget)
285};
286
288
289#endif //KKEYSEQUENCEWIDGET_H
Q_DECLARE_FLAGS(KisUpdaterContextSnapshotEx, KisUpdaterContextSnapshotExTag)
A container for a set of QAction objects.
A widget to input a QKeySequence.
void keySequenceChanged(const QKeySequence &seq)
void stealShortcut(const QKeySequence &seq, QAction *action)
Q_DECLARE_OPERATORS_FOR_FLAGS(KisBaseRectsWalker::SubtreeVisitFlags)