• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • widgets
kkeysequencewidget.h
Go to the documentation of this file.
1// vim: noexpandtab ts=4 sw=4
2/* This file is part of the KDE libraries
3 Copyright (C) 2001, 2002 Ellis Whitehead <ellis@kde.org>
4 Copyright (C) 2007 Andreas Hartmetz <ahartmetz@gmail.com>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
20*/
21
22#ifndef KKEYSEQUENCEWIDGET_H
23#define KKEYSEQUENCEWIDGET_H
24
25#include <QtCore/QList>
26#include <QtGui/QPushButton>
27
28#include <kshortcut.h>
29
30
31class KKeySequenceWidgetPrivate;
32class QAction;
33class KAction;
34class KActionCollection;
35
51class KDEUI_EXPORT KKeySequenceWidget: public QWidget
52{
53 Q_OBJECT
54
55 Q_FLAGS(ShortcutTypes)
56
57 Q_PROPERTY(
58 bool multiKeyShortcutsAllowed
59 READ multiKeyShortcutsAllowed
60 WRITE setMultiKeyShortcutsAllowed )
61
62 Q_PROPERTY(
63 ShortcutTypes checkForConflictsAgainst
64 READ checkForConflictsAgainst
65 WRITE setCheckForConflictsAgainst )
66
67 Q_PROPERTY(
68 bool modifierlessAllowed
69 READ isModifierlessAllowed
70 WRITE setModifierlessAllowed )
71
72public:
75 enum Validation {
77 Validate = 0,
79 NoValidate = 1
80 };
81
85 explicit KKeySequenceWidget(QWidget *parent = 0);
86
90 virtual ~KKeySequenceWidget();
91
98
99 enum ShortcutType {
100 None = 0x00,
101 LocalShortcuts = 0x01,
102 StandardShortcuts = 0x02,
103 GlobalShortcuts = 0x03
104 };
105 Q_DECLARE_FLAGS(ShortcutTypes, ShortcutType)
106
107
161 void setCheckForConflictsAgainst( ShortcutTypes types );
162
169 ShortcutTypes checkForConflictsAgainst() const;
170
174 void setMultiKeyShortcutsAllowed(bool);
175 bool multiKeyShortcutsAllowed() const;
176
184 void setModifierlessAllowed(bool allow);
185
189 bool isModifierlessAllowed();
190
195 void setClearButtonShown(bool show);
196
198
208 bool isKeySequenceAvailable(const QKeySequence &seq) const;
209
213 QKeySequence keySequence() const;
214
227 void setCheckActionCollections(const QList<KActionCollection *>& actionCollections);
228
235#ifndef KDE_NO_DEPRECATED
236 KDE_DEPRECATED void setCheckActionList(const QList<QAction*> &checkList);
237#endif
238
243 void setComponentName(const QString &componentName);
244
245
246Q_SIGNALS:
247
252 void keySequenceChanged(const QKeySequence &seq);
253
263 void stealShortcut(const QKeySequence &seq, KAction *action);
264
265public Q_SLOTS:
266
274 void captureKeySequence();
275
282 void setKeySequence(const QKeySequence &seq, Validation val = NoValidate);
283
287 void clearKeySequence();
288
301 void applyStealShortcut();
302
303private:
304 Q_PRIVATE_SLOT(d, void doneRecording())
305
306private:
307 friend class KKeySequenceWidgetPrivate;
308 KKeySequenceWidgetPrivate *const d;
309
310 Q_DISABLE_COPY(KKeySequenceWidget)
311};
312
313Q_DECLARE_OPERATORS_FOR_FLAGS(KKeySequenceWidget::ShortcutTypes)
314
315#endif //KKEYSEQUENCEWIDGET_H
KActionCollection
A container for a set of QAction objects.
Definition: kactioncollection.h:57
KAction
Class to encapsulate user-driven action or event.
Definition: kaction.h:217
KKeySequenceWidget
A widget to input a QKeySequence.
Definition: kkeysequencewidget.h:52
KKeySequenceWidget::ShortcutType
ShortcutType
Definition: kkeysequencewidget.h:99
KKeySequenceWidget::keySequenceChanged
void keySequenceChanged(const QKeySequence &seq)
This signal is emitted when the current key sequence has changed, be it by user input or programmatic...
KKeySequenceWidget::stealShortcut
void stealShortcut(const QKeySequence &seq, KAction *action)
This signal is emitted after the user agreed to steal a shortcut from an action.
KKeySequenceWidget::Validation
Validation
An enum about validation when setting a key sequence.
Definition: kkeysequencewidget.h:75
QAction
QList
QWidget
kshortcut.h
Defines platform-independent classes for keyboard shortcut handling.
None
None
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal