Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
45 void editingFinished();
46 void keySequenceChanged(const QKeySequence &keySequence);
47
48protected:
49 QKeySequenceEdit(QKeySequenceEditPrivate &d, QWidget *parent, Qt::WindowFlags f);
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
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:470
The QKeyEvent class describes a key event.
Definition qevent.h:424
The QKeySequenceEdit widget allows to input a QKeySequence.
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Definition qlist.h:75
\inmodule QtCore
Definition qcoreevent.h:366
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
b clear()
Combined button and popup list for selecting options.
Definition qcompare.h:63
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:165
#define explicit