Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qkeysequenceedit.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// Copyright (C) 2013 Ivan Komissarov.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QKEYSEQUENCEEDIT_H
6#define QKEYSEQUENCEEDIT_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtWidgets/qwidget.h>
10
11QT_REQUIRE_CONFIG(keysequenceedit);
12
14
16class Q_WIDGETS_EXPORT QKeySequenceEdit : public QWidget
17{
19 Q_PROPERTY(QKeySequence keySequence READ keySequence WRITE setKeySequence
20 NOTIFY keySequenceChanged USER true)
21 Q_PROPERTY(bool clearButtonEnabled READ isClearButtonEnabled WRITE setClearButtonEnabled)
22 Q_PROPERTY(qsizetype maximumSequenceLength READ maximumSequenceLength WRITE setMaximumSequenceLength)
23 Q_PROPERTY(QList<QKeyCombination> finishingKeyCombinations READ finishingKeyCombinations WRITE setFinishingKeyCombinations)
24
25public:
26 explicit QKeySequenceEdit(QWidget *parent = nullptr);
27 explicit QKeySequenceEdit(const QKeySequence &keySequence, QWidget *parent = nullptr);
29
30 QKeySequence keySequence() const;
31 qsizetype maximumSequenceLength() const;
32
33 void setClearButtonEnabled(bool enable);
34 bool isClearButtonEnabled() const;
35
36 void setFinishingKeyCombinations(const QList<QKeyCombination> &finishingKeyCombinations);
37 QList<QKeyCombination> finishingKeyCombinations() const;
38
39public Q_SLOTS:
40 void setKeySequence(const QKeySequence &keySequence);
41 void clear();
42 void setMaximumSequenceLength(qsizetype count);
43
46 void keySequenceChanged(const QKeySequence &keySequence);
47
48protected:
50
51 bool event(QEvent *) override;
52 void keyPressEvent(QKeyEvent *) override;
53 void keyReleaseEvent(QKeyEvent *) override;
54 void timerEvent(QTimerEvent *) override;
55 void focusOutEvent(QFocusEvent *) override;
56
57private:
58 Q_DISABLE_COPY(QKeySequenceEdit)
59 Q_DECLARE_PRIVATE(QKeySequenceEdit)
60};
61
63
64#endif // QKEYSEQUENCEEDIT_H
\inmodule QtCore
Definition qcoreevent.h:45
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:469
The QKeyEvent class describes a key event.
Definition qevent.h:423
The QKeySequenceEdit widget allows to input a QKeySequence.
void editingFinished()
This signal is emitted when the user finishes entering the shortcut.
void keySequenceChanged(const QKeySequence &keySequence)
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Definition qlist.h:74
virtual void timerEvent(QTimerEvent *event)
This event handler can be reimplemented in a subclass to receive timer events for the object.
Definition qobject.cpp:1433
\inmodule QtCore
Definition qcoreevent.h:359
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
virtual void keyReleaseEvent(QKeyEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive key release events...
Definition qwidget.cpp:9687
virtual void focusOutEvent(QFocusEvent *event)
This event handler can be reimplemented in a subclass to receive keyboard focus events (focus lost) f...
Definition qwidget.cpp:9737
virtual void keyPressEvent(QKeyEvent *event)
This event handler, for event event, can be reimplemented in a subclass to receive key press events f...
Definition qwidget.cpp:9652
b clear()
Combined button and popup list for selecting options.
GLenum GLenum GLsizei count
GLfloat GLfloat f
GLboolean enable
struct _cl_event * event
#define QT_REQUIRE_CONFIG(feature)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
ptrdiff_t qsizetype
Definition qtypes.h:70
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent