summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Adams <chris.adams@jollamobile.com>2012-12-19 13:53:12 +1000
committerRobin Burchell <robin+qt@viroteck.net>2013-01-03 12:24:19 +0100
commit374fd40b9c8260185faf051676088deeee9ae8b2 (patch)
tree6f17c7ae8424cb8d88d39cce820d39ee34ec43ee
parent33eb842053c1372d4a5413e76c2bfe669bc6ac75 (diff)
Fix QDeclarativeHapticsEffect::setIntensity()
Previously, the value of the intensity was never modified by setIntensity(). This commit ensures that the result of the value comparison is used correctly to determine whether or not to update the intensity to the new value. Task-number: QTMOBILITY-2084 Change-Id: I53a0ab027c10b0be70761fbac71c5bd2ad4cec7a Reviewed-by: Lorn Potter <lorn.potter@jollamobile.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
-rw-r--r--plugins/declarative/feedback/qdeclarativehapticseffect.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/declarative/feedback/qdeclarativehapticseffect.cpp b/plugins/declarative/feedback/qdeclarativehapticseffect.cpp
index aad15913cc..a089d21e8d 100644
--- a/plugins/declarative/feedback/qdeclarativehapticseffect.cpp
+++ b/plugins/declarative/feedback/qdeclarativehapticseffect.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "qdeclarativehapticseffect_p.h"
+
/*!
\qmlclass HapticsEffect
\brief The HapticsEffect element represents a custom haptic feedback effect.
@@ -94,7 +95,9 @@ int QDeclarativeHapticsEffect::duration() const
*/
void QDeclarativeHapticsEffect::setIntensity(qreal intensity)
{
- if (qFuzzyCompare(intensity, d->intensity())) {
+ qreal newIntensity = intensity + 1.0;
+ qreal oldIntensity = d->intensity() + 1.0;
+ if (!qFuzzyCompare(newIntensity, oldIntensity)) {
d->setIntensity(intensity);
emit intensityChanged();
}