KXmlGui

kshortcutwidget.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 2007 Andreas Hartmetz <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 #ifndef KSHORTCUTWIDGET_H
8 #define KSHORTCUTWIDGET_H
9 
10 #include <kxmlgui_export.h>
11 
12 #include <QKeySequence>
13 #include <QList>
14 #include <QWidget>
15 
16 class KActionCollection;
17 class KShortcutWidgetPrivate;
18 
24 class KXMLGUI_EXPORT KShortcutWidget : public QWidget
25 {
26  Q_OBJECT
27  Q_PROPERTY(bool modifierlessAllowed READ isModifierlessAllowed WRITE setModifierlessAllowed)
28 public:
29  KShortcutWidget(QWidget *parent = nullptr);
30  ~KShortcutWidget();
31 
32  void setModifierlessAllowed(bool allow);
33  bool isModifierlessAllowed();
34 
35  void setClearButtonsShown(bool show);
36 
37  QList<QKeySequence> shortcut() const;
38 
52  void setCheckActionCollections(const QList<KActionCollection *> &actionCollections);
53 
54 #if KXMLGUI_ENABLE_DEPRECATED_SINCE(4, 1)
55 
61  KXMLGUI_DEPRECATED_VERSION(4, 1, "Use KShortcutWidget::setCheckActionCollections(const QList<KActionCollection *> &)")
62  void setCheckActionList(const QList<QAction *> &checkList);
63 #endif
64 
65 Q_SIGNALS:
66  void shortcutChanged(const QList<QKeySequence> &cut);
67 
68 public Q_SLOTS:
69  void setShortcut(const QList<QKeySequence> &cut);
70  void clearShortcut();
71 
79  void applyStealShortcut();
80 
81 private:
82  Q_PRIVATE_SLOT(d, void priKeySequenceChanged(const QKeySequence &))
83  Q_PRIVATE_SLOT(d, void altKeySequenceChanged(const QKeySequence &))
84 
85 private:
86  friend class KShortcutWidgetPrivate;
87  KShortcutWidgetPrivate *const d;
88 };
89 
90 #endif //KSHORTCUTWIDGET_H
A container for a set of QAction objects.
Q_PROPERTY(...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 22:50:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.