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/gui/kernel/qstylehints.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui/kernel/qstylehints.h') diff --git a/src/gui/kernel/qstylehints.h b/src/gui/kernel/qstylehints.h index 7be8b3a33a..fb55cc7ed6 100644 --- a/src/gui/kernel/qstylehints.h +++ b/src/gui/kernel/qstylehints.h @@ -70,6 +70,7 @@ class Q_GUI_EXPORT QStyleHints : public QObject Q_PROPERTY(bool useRtlExtensions READ useRtlExtensions STORED false CONSTANT FINAL) Q_PROPERTY(Qt::TabFocusBehavior tabFocusBehavior READ tabFocusBehavior NOTIFY tabFocusBehaviorChanged FINAL) Q_PROPERTY(bool singleClickActivation READ singleClickActivation STORED false CONSTANT FINAL) + Q_PROPERTY(bool useHoverEffects READ useHoverEffects WRITE setUseHoverEffects NOTIFY useHoverEffectsChanged FINAL) public: void setMouseDoubleClickInterval(int mouseDoubleClickInterval); @@ -96,6 +97,8 @@ public: Qt::TabFocusBehavior tabFocusBehavior() const; void setTabFocusBehavior(Qt::TabFocusBehavior tabFocusBehavior); bool singleClickActivation() const; + bool useHoverEffects() const; + void setUseHoverEffects(bool useHoverEffects); Q_SIGNALS: void cursorFlashTimeChanged(int cursorFlashTime); @@ -105,6 +108,7 @@ Q_SIGNALS: void startDragDistanceChanged(int startDragDistance); void startDragTimeChanged(int startDragTime); void tabFocusBehaviorChanged(Qt::TabFocusBehavior tabFocusBehavior); + void useHoverEffectsChanged(bool useHoverEffects); private: friend class QGuiApplication; -- cgit v1.2.3