39QList<QKeyCombination> QKeyMapper::possibleKeys(
const QKeyEvent *e)
41 qCDebug(lcQpaKeyMapper).verbosity(3) <<
"Computing possible key combinations for" << e;
43 const auto *platformIntegration = QGuiApplicationPrivate::platformIntegration();
44 const auto *platformKeyMapper = platformIntegration->keyMapper();
45 QList<QKeyCombination> result = platformKeyMapper->possibleKeyCombinations(e);
47 if (result.isEmpty()) {
48 if (e->key() && (e->key() != Qt::Key_unknown))
49 result << e->keyCombination();
50 else if (!e->text().isEmpty())
51 result << (Qt::Key(e->text().at(0).unicode()) | e->modifiers());
54#if QT_CONFIG(shortcut)
55 if (lcQpaKeyMapper().isDebugEnabled()) {
56 qCDebug(lcQpaKeyMapper) <<
"Resulting possible key combinations:";
57 for (
auto keyCombination : result) {
58 auto keySequence = QKeySequence(keyCombination);
59 qCDebug(lcQpaKeyMapper).verbosity(0) <<
"\t-"
60 << keyCombination <<
"/" << keySequence <<
"/"
61 << 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