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_P_H |
6 | #define QKEYSEQUENCEEDIT_P_H |
7 | |
8 | // |
9 | // W A R N I N G |
10 | // ------------- |
11 | // |
12 | // This file is not part of the Qt API. It exists purely as an |
13 | // implementation detail. This header file may change from version to |
14 | // version without notice, or even be removed. |
15 | // |
16 | // We mean it. |
17 | // |
18 | |
19 | #include <QtWidgets/private/qtwidgetsglobal_p.h> |
20 | #include "qkeysequenceedit.h" |
21 | |
22 | #include <private/qwidget_p.h> |
23 | #include <private/qkeysequence_p.h> |
24 | |
25 | QT_REQUIRE_CONFIG(keysequenceedit); |
26 | |
27 | QT_BEGIN_NAMESPACE |
28 | |
29 | class QLineEdit; |
30 | |
31 | class QKeySequenceEditPrivate : public QWidgetPrivate |
32 | { |
33 | Q_DECLARE_PUBLIC(QKeySequenceEdit) |
34 | public: |
35 | void init(); |
36 | int translateModifiers(Qt::KeyboardModifiers state, const QString &text); |
37 | void resetState(); |
38 | void finishEditing(); |
39 | void rebuildKeySequence() |
40 | { keySequence = QKeySequence(key[0], key[1], key[2], key[3]); } |
41 | |
42 | QLineEdit *lineEdit; |
43 | QKeySequence keySequence; |
44 | int keyNum; |
45 | int maximumSequenceLength = QKeySequencePrivate::MaxKeyCount; |
46 | QKeyCombination key[QKeySequencePrivate::MaxKeyCount]; |
47 | int prevKey; |
48 | int releaseTimer; |
49 | QList<QKeyCombination> finishingKeyCombinations; |
50 | }; |
51 | |
52 | QT_END_NAMESPACE |
53 | |
54 | #endif // QKEYSEQUENCEEDIT_P_H |
55 |