Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qshortcutmap_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QSHORTCUTMAP_P_H
5#define QSHORTCUTMAP_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/private/qtguiglobal_p.h>
19#include "QtGui/qkeysequence.h"
20#include "QtCore/qlist.h"
21#include "QtCore/qscopedpointer.h"
22
24
26
27// To enable dump output uncomment below
28//#define Dump_QShortcutMap
29
30class QKeyEvent;
31struct QShortcutEntry;
33class QObject;
34
35class Q_GUI_EXPORT QShortcutMap
36{
37 Q_DECLARE_PRIVATE(QShortcutMap)
38public:
41
43
45 int removeShortcut(int id, QObject *owner, const QKeySequence &key = QKeySequence());
46 int setShortcutEnabled(bool enable, int id, QObject *owner, const QKeySequence &key = QKeySequence());
47 int setShortcutAutoRepeat(bool on, int id, QObject *owner, const QKeySequence &key = QKeySequence());
48
50
51 bool tryShortcut(QKeyEvent *e);
52 bool hasShortcutForKeySequence(const QKeySequence &seq) const;
53 QList<QKeySequence> keySequences(bool getAll = false) const;
54
55#ifdef Dump_QShortcutMap
56 void dumpMap() const;
57#endif
58
59private:
60 void resetState();
62 void dispatchEvent(QKeyEvent *e);
63
64 QKeySequence::SequenceMatch find(QKeyEvent *e, int ignoredModifiers = 0);
65 QKeySequence::SequenceMatch matches(const QKeySequence &seq1, const QKeySequence &seq2) const;
67 void createNewSequences(QKeyEvent *e, QList<QKeySequence> &ksl, int ignoredModifiers);
68 void clearSequence(QList<QKeySequence> &ksl);
69 int translateModifiers(Qt::KeyboardModifiers modifiers);
70
72};
73
75
76#endif // QSHORTCUTMAP_P_H
The QKeyEvent class describes a key event.
Definition qevent.h:423
The QKeySequence class encapsulates a key sequence as used by shortcuts.
SequenceMatch
\value NoMatch The key sequences are different; not even partially matching.
Definition qlist.h:74
\inmodule QtCore
Definition qobject.h:90
\inmodule QtCore
EGLImageKHR int int EGLuint64KHR * modifiers
double e
else opt state
[0]
Combined button and popup list for selecting options.
ShortcutContext
static void * context
static bool matches(const QJsonObject &object, const QString &osName, const QVersionNumber &kernelVersion, const QString &osRelease, const QOpenGLConfig::Gpu &gpu)
Definition qopengl.cpp:270
GLuint64 key
GLuint object
[3]
GLboolean enable
bool(* ContextMatcher)(QObject *, Qt::ShortcutContext)
#define QT_REQUIRE_CONFIG(feature)
static const auto matcher
[0]