From 4e6dd1c50a08877189891806ed0dc977aafceade Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 29 Jun 2016 15:58:23 +0200 Subject: Add QStyleHints::useHoverEffects The delivery of hover events creates unnecessary overhead on touch platforms. This allows Qt Quick Controls 2 to determine whether the underlying platform wants hover effects. The hover effects are enabled by default for the classic desktop platforms: Linux, Windows & macOS. Change-Id: Ia4e7b5c0fcb7af8f1c47e06fb28086cffdf35976 Task-number: QTBUG-50003 Reviewed-by: Friedemann Kleint Reviewed-by: Mitch Curtis Reviewed-by: Shawn Rutledge --- src/plugins/platforms/cocoa/qcocoatheme.mm | 2 ++ src/plugins/platforms/windows/qwindowstheme.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 9e2fca23a1..aa9eb38384 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -329,6 +329,8 @@ QVariant QCocoaTheme::themeHint(ThemeHint hint) const } case QPlatformTheme::PasswordMaskCharacter: return QVariant(QChar(kBulletUnicode)); + case QPlatformTheme::UiEffects: + return QVariant(int(HoverEffect)); default: break; } diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index 6c6eb42d63..397da61604 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -347,7 +347,7 @@ static inline QStringList styleNames() static inline int uiEffects() { - int result = 0; + int result = QPlatformTheme::HoverEffect; if (booleanSystemParametersInfo(SPI_GETUIEFFECTS, false)) result |= QPlatformTheme::GeneralUiEffect; if (booleanSystemParametersInfo(SPI_GETMENUANIMATION, false)) -- cgit v1.2.3