Coverage Report

Created: 2025-07-16 07:53

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