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
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 QList<const QShortcutEntry *> matches() const;
66 void createNewSequences(QKeyEvent *e, QList<QKeySequence> &ksl, int ignoredModifiers);
67 void clearSequence(QList<QKeySequence> &ksl);
68 int translateModifiers(Qt::KeyboardModifiers modifiers);
69
70 QScopedPointer<QShortcutMapPrivate> d_ptr;
71};
72
74
75#endif // QSHORTCUTMAP_P_H
The QKeyEvent class describes a key event.
Definition qevent.h:424
The QKeySequence class encapsulates a key sequence as used by shortcuts.
SequenceMatch
\value NoMatch The key sequences are different; not even partially matching.
\inmodule QtCore
Definition qobject.h:103
EGLImageKHR int int EGLuint64KHR * modifiers
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]