38QList<QKeyCombination> QKeyMapper::possibleKeys(
const QKeyEvent *e)
40 qCDebug(lcQpaKeyMapper).verbosity(3) <<
"Computing possible key combinations for" << e;
42 const auto *platformIntegration = QGuiApplicationPrivate::platformIntegration();
43 const auto *platformKeyMapper = platformIntegration->keyMapper();
44 QList<QKeyCombination> result = platformKeyMapper->possibleKeyCombinations(e);
46 if (result.isEmpty()) {
47 if (e->key() && (e->key() != Qt::Key_unknown))
48 result << e->keyCombination();
49 else if (!e->text().isEmpty())
50 result << (Qt::Key(e->text().at(0).unicode()) | e->modifiers());
53#if QT_CONFIG(shortcut)
54 if (lcQpaKeyMapper().isDebugEnabled()) {
55 qCDebug(lcQpaKeyMapper) <<
"Resulting possible key combinations:";
56 for (
auto keyCombination : result) {
57 auto keySequence = QKeySequence(keyCombination);
58 qCDebug(lcQpaKeyMapper).verbosity(0) <<
"\t-"
59 << keyCombination <<
"/" << keySequence <<
"/"
60 << qUtf8Printable(keySequence.toString(QKeySequence::NativeText));
Q_GLOBAL_STATIC(DefaultRoleNames, qDefaultRoleNames, { { Qt::DisplayRole, "display" }, { Qt::DecorationRole, "decoration" }, { Qt::EditRole, "edit" }, { Qt::ToolTipRole, "toolTip" }, { Qt::StatusTipRole, "statusTip" }, { Qt::WhatsThisRole, "whatsThis" }, }) const QHash< int