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
23
QT_REQUIRE_CONFIG
(
shortcut
);
24
25
QT_BEGIN_NAMESPACE
26
27
// To enable dump output uncomment below
28
//#define Dump_QShortcutMap
29
30
class
QKeyEvent
;
31
struct
QShortcutEntry
;
32
class
QShortcutMapPrivate
;
33
class
QObject
;
34
35
class
Q_GUI_EXPORT
QShortcutMap
36
{
37
Q_DECLARE_PRIVATE(
QShortcutMap
)
38
public
:
39
QShortcutMap
();
40
~QShortcutMap
();
41
42
typedef
bool (*
ContextMatcher
)(
QObject
*
object
,
Qt::ShortcutContext
context
);
43
44
int
addShortcut(
QObject
*owner,
const
QKeySequence
&
key
,
Qt::ShortcutContext
context
,
ContextMatcher
matcher
);
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
49
QKeySequence::SequenceMatch
state
();
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
59
private
:
60
void
resetState();
61
QKeySequence::SequenceMatch
nextState(
QKeyEvent
*
e
);
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
;
66
QList<const QShortcutEntry *>
matches
()
const
;
67
void
createNewSequences(
QKeyEvent
*
e
,
QList<QKeySequence>
&ksl,
int
ignoredModifiers);
68
void
clearSequence(
QList<QKeySequence>
&ksl);
69
int
translateModifiers(Qt::KeyboardModifiers
modifiers
);
70
71
QScopedPointer<QShortcutMapPrivate>
d_ptr;
72
};
73
74
QT_END_NAMESPACE
75
76
#endif
// QSHORTCUTMAP_P_H
QKeyEvent
The QKeyEvent class describes a key event.
Definition
qevent.h:423
QKeySequence
The QKeySequence class encapsulates a key sequence as used by shortcuts.
Definition
qkeysequence.h:35
QKeySequence::SequenceMatch
SequenceMatch
\value NoMatch The key sequences are different; not even partially matching.
Definition
qkeysequence.h:133
QList
Definition
qlist.h:74
QObject
\inmodule QtCore
Definition
qobject.h:90
QScopedPointer
\inmodule QtCore
Definition
qscopedpointer.h:71
QShortcutMapPrivate
Definition
qshortcutmap.cpp:79
QShortcutMap
Definition
qshortcutmap_p.h:36
modifiers
EGLImageKHR int int EGLuint64KHR * modifiers
Definition
dmabufserverbufferintegration.h:34
e
double e
Definition
doc_src_qalgorithms.cpp:6
state
else opt state
[0]
Definition
doc_src_styles.cpp:11
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1545
Qt::ShortcutContext
ShortcutContext
Definition
qnamespace.h:1287
context
static void * context
Definition
qandroidaudiosource.cpp:42
matches
static bool matches(const QJsonObject &object, const QString &osName, const QVersionNumber &kernelVersion, const QString &osRelease, const QOpenGLConfig::Gpu &gpu)
Definition
qopengl.cpp:270
key
GLuint64 key
Definition
qopengles2ext.h:2268
object
GLuint object
[3]
Definition
qopengles2ext.h:1248
enable
GLboolean enable
Definition
qopengles2ext.h:855
ContextMatcher
bool(* ContextMatcher)(QObject *, Qt::ShortcutContext)
Definition
qquickshortcut.cpp:75
QT_REQUIRE_CONFIG
#define QT_REQUIRE_CONFIG(feature)
Definition
qtconfigmacros.h:66
matcher
static const auto matcher
[0]
Definition
src_corelib_text_qbytearraymatcher.cpp:5
shortcut
shortcut
[0]
Definition
src_gui_kernel_qshortcut.cpp:5
QShortcutEntry
Definition
qshortcutmap.cpp:30
qtbase
src
gui
kernel
qshortcutmap_p.h
Generated by
1.9.7