summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qcommonstyle.cpp
diff options
context:
space:
mode:
authorMikolaj Boc <mikolaj.boc@qt.io>2022-10-13 12:34:20 +0200
committerMikolaj Boc <mikolaj.boc@qt.io>2023-02-07 13:33:02 +0100
commit5af0177c9e446a683163b04b7f3b8776b0977e94 (patch)
tree2f28f3a74bb1b739874ba7572bc4c95da3115547 /src/widgets/styles/qcommonstyle.cpp
parent8dc3ee03a42ccb1b047c2a8f34b5bce4e663c9d9 (diff)
Add a platform theme option to affect SH_UnderlineShortcut
The style hint SH_UnderlineShortcut can now be turned on/off via the platform theme. No change in functionality so far on any platform, this behaves the same way it did before the change. The change just adds a possibility for platforms to redefine the default underlining behavior. Task-number: QTBUG-76587 Change-Id: Ibda104f1b733371da19825b96e73c22f42faf853 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/styles/qcommonstyle.cpp')
-rw-r--r--src/widgets/styles/qcommonstyle.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index b4866a84ec..fb6b415f59 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -5156,9 +5156,12 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
ret = 1;
break;
- case SH_UnderlineShortcut:
- ret = 1;
+ case SH_UnderlineShortcut: {
+ const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme();
+ ret = theme ? theme->themeHint(QPlatformTheme::UnderlineShortcut).toInt()
+ : QPlatformTheme::defaultThemeHint(QPlatformTheme::UnderlineShortcut).toInt();
break;
+ }
case SH_SpinBox_ClickAutoRepeatRate:
ret = 150;