From a3768cb3bd27213a262518535d2d9edc88754dd9 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 4 Jun 2012 14:18:32 +0300 Subject: Add StartDragVelocity to style hints This will be used by Flickable in combination with the drag distance to improve the drag start detection logic. Change-Id: Ica30042ef3d15041d857b07fa4173dde3d3f900f Reviewed-by: Lars Knoll --- src/gui/kernel/qplatformintegration.h | 3 ++- src/gui/kernel/qplatformintegration_qpa.cpp | 2 ++ src/gui/kernel/qstylehints.cpp | 5 +++++ src/gui/kernel/qstylehints.h | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h index 2c67664b00..3990adb3fe 100644 --- a/src/gui/kernel/qplatformintegration.h +++ b/src/gui/kernel/qplatformintegration.h @@ -132,7 +132,8 @@ public: KeyboardAutoRepeatRate, ShowIsFullScreen, PasswordMaskDelay, - FontSmoothingGamma + FontSmoothingGamma, + StartDragVelocity }; virtual QVariant styleHint(StyleHint hint) const; diff --git a/src/gui/kernel/qplatformintegration_qpa.cpp b/src/gui/kernel/qplatformintegration_qpa.cpp index 819f31efea..3021f6373e 100644 --- a/src/gui/kernel/qplatformintegration_qpa.cpp +++ b/src/gui/kernel/qplatformintegration_qpa.cpp @@ -296,6 +296,8 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const return 0; case FontSmoothingGamma: return qreal(1.7); + case StartDragVelocity: + return 0; // no limit } return 0; diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index a98e5fbd76..53c5a07f6b 100644 --- a/src/gui/kernel/qstylehints.cpp +++ b/src/gui/kernel/qstylehints.cpp @@ -76,6 +76,11 @@ int QStyleHints::startDragTime() const return hint(QPlatformIntegration::StartDragTime).toInt(); } +int QStyleHints::startDragVelocity() const +{ + return hint(QPlatformIntegration::StartDragVelocity).toInt(); +} + int QStyleHints::keyboardInputInterval() const { return hint(QPlatformIntegration::KeyboardInputInterval).toInt(); diff --git a/src/gui/kernel/qstylehints.h b/src/gui/kernel/qstylehints.h index 301b51868f..f15679b7d6 100644 --- a/src/gui/kernel/qstylehints.h +++ b/src/gui/kernel/qstylehints.h @@ -58,6 +58,7 @@ public: int mouseDoubleClickInterval() const; int startDragDistance() const; int startDragTime() const; + int startDragVelocity() const; int keyboardInputInterval() const; int keyboardAutoRepeatRate() const; int cursorFlashTime() const; -- cgit v1.2.3