summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-08-25 04:11:12 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2018-08-25 04:11:12 +0000
commit563c9eb4eefe758ed101ef246dbcbece8877d77c (patch)
treedb852ae83e95171b510d9c20c6583c39072943b6 /src
parent4d38f225220bef8e66948afdcc10701d7fc65e81 (diff)
parent1d077120f48cc1ad10fc31c2381b0b65a085c217 (diff)
Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12
Diffstat (limited to 'src')
-rw-r--r--src/corelib/animation/qvariantanimation_p.h14
-rw-r--r--src/gui/kernel/qevent.cpp2
2 files changed, 14 insertions, 2 deletions
diff --git a/src/corelib/animation/qvariantanimation_p.h b/src/corelib/animation/qvariantanimation_p.h
index 37318a5339..9f0f2e3030 100644
--- a/src/corelib/animation/qvariantanimation_p.h
+++ b/src/corelib/animation/qvariantanimation_p.h
@@ -58,6 +58,8 @@
#include "private/qabstractanimation_p.h"
+#include <type_traits>
+
#ifndef QT_NO_ANIMATION
QT_BEGIN_NAMESPACE
@@ -104,7 +106,17 @@ public:
};
//this should make the interpolation faster
-template<typename T> inline T _q_interpolate(const T &f, const T &t, qreal progress)
+template<typename T>
+typename std::enable_if<std::is_unsigned<T>::value, T>::type
+_q_interpolate(const T &f, const T &t, qreal progress)
+{
+ return T(f + t * progress - f * progress);
+}
+
+// the below will apply also to all non-arithmetic types
+template<typename T>
+typename std::enable_if<!std::is_unsigned<T>::value, T>::type
+_q_interpolate(const T &f, const T &t, qreal progress)
{
return T(f + (t - f) * progress);
}
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 6f8ea6dc70..0e35fb7d7b 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -2789,7 +2789,7 @@ Qt::MouseButtons QTabletEvent::buttons() const
\header
\li Event Type
\li Description
- \li Touch equence
+ \li Touch sequence
\row
\li Qt::ZoomNativeGesture
\li Magnification delta in percent.