Coverage Report

Created: 2026-03-31 07:41

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/qtbase/src/gui/kernel/qplatformkeymapper.cpp
Line
Count
Source
1
// Copyright (C) 2023 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
// Qt-Security score:significant reason:default
4
5
#include "qplatformkeymapper.h"
6
7
#include <private/qguiapplication_p.h>
8
#include <qpa/qplatformintegration.h>
9
10
QT_BEGIN_NAMESPACE
11
12
Q_LOGGING_CATEGORY(lcQpaKeyMapper, "qt.qpa.keymapper")
13
14
QPlatformKeyMapper::~QPlatformKeyMapper()
15
0
{
16
0
}
17
18
/*
19
    Should return a list of possible key combinations for the given key event.
20
21
    For example, given a US English keyboard layout, the key event Shift+5
22
    can represent both a "Shift+5" key combination, as well as just "%".
23
*/
24
QList<QKeyCombination> QPlatformKeyMapper::possibleKeyCombinations(const QKeyEvent *event) const
25
0
{
26
0
    auto *platformIntegration = QGuiApplicationPrivate::platformIntegration();
27
0
    QList<int> possibleKeys = platformIntegration->possibleKeys(event);
28
0
    QList<QKeyCombination> combinations;
29
0
    for (int key : possibleKeys)
30
0
        combinations << QKeyCombination::fromCombined(key);
31
0
    return combinations;
32
0
}
33
34
Qt::KeyboardModifiers QPlatformKeyMapper::queryKeyboardModifiers() const
35
0
{
36
0
    return QGuiApplicationPrivate::platformIntegration()->queryKeyboardModifiers();
37
0
}
38
39
QT_END_NAMESPACE