diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-02-13 12:02:19 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2015-02-19 10:49:03 +0000 |
commit | 373ce8878321aa561b55131bada78ad4a2ce8427 (patch) | |
tree | 0b64429ea79163f1f13b4073bbe60040047d0540 /src/quick/util/qquicksmoothedanimation.cpp | |
parent | 6f264b755501fd322d1e357187b42120210a7ba3 (diff) |
Cleanup math function includes and usage
Use std::math on floats and doubles, and qMath on qreals, and only
include the math headers actually needed.
Change-Id: I1d511d7b1bac0050eaa947c7baee760b736858bf
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/quick/util/qquicksmoothedanimation.cpp')
-rw-r--r-- | src/quick/util/qquicksmoothedanimation.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quick/util/qquicksmoothedanimation.cpp b/src/quick/util/qquicksmoothedanimation.cpp index a94ddbfada..55011f5a46 100644 --- a/src/quick/util/qquicksmoothedanimation.cpp +++ b/src/quick/util/qquicksmoothedanimation.cpp @@ -37,6 +37,7 @@ #include "qquickanimation_p_p.h" #include "private/qcontinuinganimationgroupjob_p.h" +#include <qmath.h> #include <qqmlproperty.h> #include <private/qqmlproperty_p.h> @@ -44,7 +45,6 @@ #include <QtCore/qdebug.h> -#include <math.h> #define DELAY_STOP_TIMER_INTERVAL 32 @@ -157,7 +157,7 @@ bool QSmoothedAnimation::recalc() return false; } - finalDuration = ceil(tf * 1000.0); + finalDuration = qCeil(tf * 1000.0); if (maximumEasingTime == 0) { a = 0; @@ -191,7 +191,7 @@ bool QSmoothedAnimation::recalc() qreal c2 = 0.5 * vi * tf - s; qreal c3 = -0.25 * vi * vi; - qreal a1 = (-c2 + sqrt(c2 * c2 - 4 * c1 * c3)) / (2. * c1); + qreal a1 = (-c2 + qSqrt(c2 * c2 - 4 * c1 * c3)) / (2. * c1); qreal tp1 = 0.5 * tf - 0.5 * vi / a1; qreal vp1 = a1 * tp1 + vi; |