summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-10-21 22:42:36 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-10-23 13:04:02 +0200
commita8c6958a875a6c6ad67b5741a5daa89f5340710c (patch)
tree67ed6e301af89c3f817f7bb90beacf03d164e8f3 /src/gui/kernel
parentc3e2a624fbaa63979eecfc0b9346f4b54cb65264 (diff)
Add QPlatformTheme::MenuBarFocusOnAltPressRelease
On Windows, pressing and releasing the Alt key moves focus to the menubar. This is implemented in widgets, but not in Qt Quick. Add a new theme hint so that we can make Qt behave natively on all platforms, and make the common style's respective styleHint default to the theme hint. Change-Id: I101bec56afd51e81ebb128c288f8a1e9b7efedb4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qplatformtheme.cpp2
-rw-r--r--src/gui/kernel/qplatformtheme.h3
2 files changed, 4 insertions, 1 deletions
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)