path: root/src/gui/kernel/qstylehints.h
diff options
authorShawn Rutledge <>2019-07-08 14:59:43 +0200
committerShawn Rutledge <>2019-07-08 20:29:17 +0200
commit8f75910deaf5a41506dc5cb0fe412a8f4674be0d (patch)
tree361469a377b0762e4668960ce4b3896df86400c9 /src/gui/kernel/qstylehints.h
parent6c136973fd9b82420c818668086abe93f534993d (diff)
Add mouseDoubleClickDistance and touchDoubleTapDistance to QStyleHints
Amends ca280bfe3bc551f814d59d25079e098798fbdad7 and 705e3f68df83dca165e3cddb914d3816155323f8 which added these enums only to QPlatformTheme::ThemeHint but not to QPlatformIntegration::StyleHint. Those patches did not add accessors to QStyleHints, probably because the accessors in QStyleHints use the themeableHint() function which takes both enums; so to have an accessor implemented this way, we need it in both enums. But it's getting too silly, since the only platform plugin that modifies MouseDoubleClickDistance is Android, implemented by QAndroidPlatformTheme overriding QPlatformTheme::themeHint(), and thus illustrating that adding the enum to QPlatformIntegration::StyleHint is not the only way to allow a platform plugin to customize the hint. So it seems we need a new way of writing these accessors without needing to duplicate the enum value in QPlatformIntegration::StyleHint. The new version of themeableHint(QPlatformTheme::ThemeHint) falls back on the static QPlatformTheme::defaultThemeHint() accessor. Users should at least be able to see what the default value is; and having these getters will also provide link targets for QtQuick's TapHandler docs. Change-Id: I0f8560062bcd0ca5e6d580071d9fbcf3f07f625f Reviewed-by: Tor Arne Vestbø <>
Diffstat (limited to 'src/gui/kernel/qstylehints.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qstylehints.h b/src/gui/kernel/qstylehints.h
index 9091db9624..30d8fdc64d 100644
--- a/src/gui/kernel/qstylehints.h
+++ b/src/gui/kernel/qstylehints.h
@@ -74,10 +74,14 @@ class Q_GUI_EXPORT QStyleHints : public QObject
Q_PROPERTY(bool useHoverEffects READ useHoverEffects WRITE setUseHoverEffects NOTIFY useHoverEffectsChanged FINAL)
Q_PROPERTY(int wheelScrollLines READ wheelScrollLines NOTIFY wheelScrollLinesChanged FINAL)
Q_PROPERTY(int mouseQuickSelectionThreshold READ mouseQuickSelectionThreshold WRITE setMouseQuickSelectionThreshold NOTIFY mouseQuickSelectionThresholdChanged FINAL)
+ Q_PROPERTY(int mouseDoubleClickDistance READ mouseDoubleClickDistance STORED false CONSTANT FINAL)
+ Q_PROPERTY(int touchDoubleTapDistance READ touchDoubleTapDistance STORED false CONSTANT FINAL)
void setMouseDoubleClickInterval(int mouseDoubleClickInterval);
int mouseDoubleClickInterval() const;
+ int mouseDoubleClickDistance() const;
+ int touchDoubleTapDistance() const;
void setMousePressAndHoldInterval(int mousePressAndHoldInterval);
int mousePressAndHoldInterval() const;
void setStartDragDistance(int startDragDistance);