From 1ccfcadf2b94cae5ea986b2824e60af6993aa8fc Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Thu, 11 Apr 2024 14:19:01 +0400 Subject: [PATCH] Fixed the fullscreen keyboard shortcut `Qt::Key_F11` and `QKeySequence::FullScreen` are of different enum types (`Qt::Key` and `QKeySequence::StandardKey`, respectively) with overlapping value ranges. Using a standard integral type (int, unsigned, long, etc) as a common type for them results in the type information being lost and an ensuing impossibility to take advantage of overloaded constructors of `QKeySequence`. The simple fix is to use `QKeySequence` as the common type of the conditional expression. --- src/kiwixapp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kiwixapp.cpp b/src/kiwixapp.cpp index 761e23d..fb59a93 100644 --- a/src/kiwixapp.cpp +++ b/src/kiwixapp.cpp @@ -446,8 +446,8 @@ void KiwixApp::createActions() this, [=]() { getTabWidget()->openFindInPageBar(); }); const auto fullScreenKeySeq = QKeySequence(QKeySequence::FullScreen).isEmpty() - ? (int) Qt::Key_F11 - : (int) QKeySequence::FullScreen; + ? QKeySequence(Qt::Key_F11) + : QKeySequence(QKeySequence::FullScreen); CREATE_ACTION_ICON_SHORTCUT(ToggleFullscreenAction, "full-screen-enter", gt("set-fullscreen"), fullScreenKeySeq); connect(mpa_actions[ToggleFullscreenAction], &QAction::toggled, this, [=](bool checked) {