| 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 <QtCore/qbasictimer.h> |
| 23 | #include <private/qwidget_p.h> |
| 24 | #include <private/qkeysequence_p.h> |
| 25 | |
| 26 | QT_REQUIRE_CONFIG(keysequenceedit); |
| 27 | |
| 28 | QT_BEGIN_NAMESPACE |
| 29 | |
| 30 | class QLineEdit; |
| 31 | |
| 32 | class QKeySequenceEditPrivate : public QWidgetPrivate |
| 33 | { |
| 34 | Q_DECLARE_PUBLIC(QKeySequenceEdit) |
| 35 | public: |
| 36 | void init(); |
| 37 | int translateModifiers(Qt::KeyboardModifiers state, const QString &text); |
| 38 | void resetState(); |
| 39 | void finishEditing(); |
| 40 | void rebuildKeySequence() |
| 41 | { keySequence = QKeySequence(key[0], key[1], key[2], key[3]); } |
| 42 | |
| 43 | QLineEdit *lineEdit; |
| 44 | QKeySequence keySequence; |
| 45 | int keyNum; |
| 46 | int maximumSequenceLength = QKeySequencePrivate::MaxKeyCount; |
| 47 | QKeyCombination key[QKeySequencePrivate::MaxKeyCount]; |
| 48 | int prevKey; |
| 49 | QBasicTimer releaseTimer; |
| 50 | QList<QKeyCombination> finishingKeyCombinations; |
| 51 | }; |
| 52 | |
| 53 | QT_END_NAMESPACE |
| 54 | |
| 55 | #endif // QKEYSEQUENCEEDIT_P_H |
| 56 |
