diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index fb1c27a15a..ec4b9c2b86 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -625,6 +625,8 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) return QVariant(2500); case FlickDeceleration: return QVariant(5000); + case MenuBarFocusOnAltPressRelease: + return false; } return QVariant(); } diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 1fa8c12b48..1b7fc85c81 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -91,7 +91,8 @@ public: SetFocusOnTouchRelease, FlickStartDistance, FlickMaximumVelocity, - FlickDeceleration + FlickDeceleration, + MenuBarFocusOnAltPressRelease }; Q_ENUM(ThemeHint) diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index 3704fce15e..eeb4ac4067 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -558,6 +558,8 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const } case MouseDoubleClickDistance: return GetSystemMetrics(SM_CXDOUBLECLK); + case MenuBarFocusOnAltPressRelease: + return true; default: break; } diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 01fb688469..2cb9bc00ba 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -5384,7 +5384,6 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_Menu_AllowActiveAndDisabled: case SH_Menu_SpaceActivatesItem: case SH_ScrollView_FrameOnlyAroundContents: - case SH_MenuBar_AltKeyNavigation: case SH_ComboBox_ListMouseTracking: case SH_Menu_MouseTracking: case SH_MenuBar_MouseTracking: @@ -5410,6 +5409,10 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_Table_AlwaysDrawLeftTopGridLines: ret = false; break; + case SH_MenuBar_AltKeyNavigation: + if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) + ret = theme->themeHint(QPlatformTheme::MenuBarFocusOnAltPressRelease).toBool(); + break; case SH_CustomBase: // Added to get compiler errors when a style hint is missing ret = false;