summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-08-24 23:59:45 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-08-24 23:59:46 +0200
commit1d077120f48cc1ad10fc31c2381b0b65a085c217 (patch)
treef815cd94a96aa006d9fb38ee70958691ad6c2155
parent7af0ea5b0f883415927727c8ed10bb6256d1f12d (diff)
parentbd42e2f0cebb2fe8de77a054e9d30aa803749a61 (diff)
Merge remote-tracking branch 'origin/5.11' into 5.12
-rw-r--r--src/corelib/animation/qvariantanimation_p.h14
-rw-r--r--src/gui/kernel/qevent.cpp2
-rw-r--r--tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp25
-rw-r--r--tests/auto/corelib/tools/qdatetime/BLACKLIST2
-rw-r--r--tests/auto/corelib/tools/qlocale/BLACKLIST2
-rw-r--r--tests/auto/corelib/tools/qlocale/tst_qlocale.cpp4
6 files changed, 47 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.
diff --git a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp
index 00962afa72..ac20fb35ec 100644
--- a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp
+++ b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp
@@ -43,6 +43,7 @@ private slots:
void keyValueAt();
void keyValues();
void duration();
+ void interpolation();
};
class TestableQVariantAnimation : public QVariantAnimation
@@ -129,6 +130,30 @@ void tst_QVariantAnimation::duration()
QCOMPARE(anim.duration(), 500);
}
+void tst_QVariantAnimation::interpolation()
+{
+ QVariantAnimation unsignedAnim;
+ unsignedAnim.setStartValue(100u);
+ unsignedAnim.setEndValue(0u);
+ unsignedAnim.setDuration(100);
+ unsignedAnim.setCurrentTime(50);
+ QCOMPARE(unsignedAnim.currentValue().toUInt(), 50u);
+
+ QVariantAnimation signedAnim;
+ signedAnim.setStartValue(100);
+ signedAnim.setEndValue(0);
+ signedAnim.setDuration(100);
+ signedAnim.setCurrentTime(50);
+ QCOMPARE(signedAnim.currentValue().toInt(), 50);
+
+ QVariantAnimation pointAnim;
+ pointAnim.setStartValue(QPoint(100, 100));
+ pointAnim.setEndValue(QPoint(0, 0));
+ pointAnim.setDuration(100);
+ pointAnim.setCurrentTime(50);
+ QCOMPARE(pointAnim.currentValue().toPoint(), QPoint(50, 50));
+}
+
QTEST_MAIN(tst_QVariantAnimation)
#include "tst_qvariantanimation.moc"
diff --git a/tests/auto/corelib/tools/qdatetime/BLACKLIST b/tests/auto/corelib/tools/qdatetime/BLACKLIST
new file mode 100644
index 0000000000..3a42ee066b
--- /dev/null
+++ b/tests/auto/corelib/tools/qdatetime/BLACKLIST
@@ -0,0 +1,2 @@
+[timeZoneAbbreviation]
+osx
diff --git a/tests/auto/corelib/tools/qlocale/BLACKLIST b/tests/auto/corelib/tools/qlocale/BLACKLIST
new file mode 100644
index 0000000000..3eac7c10ed
--- /dev/null
+++ b/tests/auto/corelib/tools/qlocale/BLACKLIST
@@ -0,0 +1,2 @@
+[formatTimeZone]
+osx
diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
index 130ac4ce59..6132dabeea 100644
--- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp
@@ -2467,6 +2467,10 @@ void tst_QLocale::currency()
QCOMPARE(de_DE.toCurrencyString(double(-1234.56), QLatin1String("BAZ")),
QString::fromUtf8("-1.234,56\xc2\xa0" "BAZ"));
+ const QLocale es_CR(QLocale::Spanish, QLocale::CostaRica);
+ QCOMPARE(es_CR.toCurrencyString(double(1565.25)),
+ QString::fromUtf8("\xE2\x82\xA1" "1\xC2\xA0" "565,25"));
+
const QLocale system = QLocale::system();
QVERIFY(system.toCurrencyString(1, QLatin1String("FOO")).contains(QLatin1String("FOO")));
}