diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qplatformintegration.cpp | 2 | ||||
-rw-r--r-- | src/gui/kernel/qplatformtheme.cpp | 8 | ||||
-rw-r--r-- | src/gui/kernel/qplatformtheme.h | 3 | ||||
-rw-r--r-- | src/gui/kernel/qstylehints.cpp | 2 |
4 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 4d4f501ae4..29dfba8155 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -393,7 +393,7 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const case UseRtlExtensions: return QVariant(false); case SetFocusOnTouchRelease: - return QVariant(false); + return QPlatformTheme::defaultThemeHint(QPlatformTheme::SetFocusOnTouchRelease); case MousePressAndHoldInterval: return QPlatformTheme::defaultThemeHint(QPlatformTheme::MousePressAndHoldInterval); case TabFocusBehavior: diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index 993836fa59..10cf8e0ca4 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -143,6 +143,10 @@ QT_BEGIN_NAMESPACE \value ButtonPressKeys (QList<Qt::Key>) A list of keys that can be used to press buttons via keyboard input. + \value SetFocusOnTouchRelease (bool) Whether focus objects (line edits etc) should receive + input focus after a touch/mouse release. + This enum value has been added in Qt 6.5. + \sa themeHint(), QStyle::pixelMetric() */ @@ -507,6 +511,8 @@ QVariant QPlatformTheme::themeHint(ThemeHint hint) const return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::UiEffects); case QPlatformTheme::ShowShortcutsInContextMenus: return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::ShowShortcutsInContextMenus); + case QPlatformTheme::SetFocusOnTouchRelease: + return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::SetFocusOnTouchRelease); default: return QPlatformTheme::defaultThemeHint(hint); } @@ -605,6 +611,8 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) return false; case ButtonPressKeys: return QVariant::fromValue(QList<Qt::Key>({ Qt::Key_Space, Qt::Key_Select })); + case SetFocusOnTouchRelease: + return false; } return QVariant(); } diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h index 94d9a82fd3..11f57dab20 100644 --- a/src/gui/kernel/qplatformtheme.h +++ b/src/gui/kernel/qplatformtheme.h @@ -87,7 +87,8 @@ public: InteractiveResizeAcrossScreens, ShowDirectoriesFirst, PreselectFirstFileInDirectory, - ButtonPressKeys + ButtonPressKeys, + SetFocusOnTouchRelease }; Q_ENUM(ThemeHint) diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index 8374379d5a..f932caaae5 100644 --- a/src/gui/kernel/qstylehints.cpp +++ b/src/gui/kernel/qstylehints.cpp @@ -445,7 +445,7 @@ bool QStyleHints::useRtlExtensions() const */ bool QStyleHints::setFocusOnTouchRelease() const { - return hint(QPlatformIntegration::SetFocusOnTouchRelease).toBool(); + return themeableHint(QPlatformTheme::SetFocusOnTouchRelease, QPlatformIntegration::SetFocusOnTouchRelease).toBool(); } /*! |