From abb58c58a004d1b8c453009e43c4079db1c9c59f Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 17 Feb 2025 08:30:09 +0000 Subject: [PATCH] QPlatformKeyMapper -> QKeyMapper --- .../settings/settings_shortcuts.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Telegram/SourceFiles/settings/settings_shortcuts.cpp b/Telegram/SourceFiles/settings/settings_shortcuts.cpp index 82693c726..0fd7cf5fb 100644 --- a/Telegram/SourceFiles/settings/settings_shortcuts.cpp +++ b/Telegram/SourceFiles/settings/settings_shortcuts.cpp @@ -21,12 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_menu_icons.h" #include "styles/style_settings.h" -#include -#include - -#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) -#include -#endif +#include namespace Settings { namespace { @@ -388,7 +383,6 @@ struct Labeled { } const auto key = static_cast(e.get()); const auto m = key->modifiers(); - const auto integration = QGuiApplicationPrivate::platformIntegration(); const auto k = key->key(); const auto clear = !m && (k == Qt::Key_Backspace || k == Qt::Key_Delete); @@ -407,22 +401,18 @@ struct Labeled { const auto r = [&] { auto result = int(k); if (m & Qt::ShiftModifier) { + const auto keys = QKeyMapper::possibleKeys(key); + for (const auto &possible : keys) { #if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0) - const auto mapper = integration->keyMapper(); - const auto list = mapper->possibleKeyCombinations(key); - for (const auto &possible : list) { if (possible.keyboardModifiers() == m) { return int(possible.key()); } - } #else // Qt >= 6.7.0 - const auto keys = integration->possibleKeys(key); - for (const auto possible : keys) { if (possible > int(m)) { return possible - int(m); } - } #endif // Qt < 6.7.0 + } } return result; }();