From 54d062160d3a3d1c282cd19b57770611db3ea8eb Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 15 Aug 2018 16:07:25 +0200 Subject: [PATCH 1/9] Document version of copied valgrind, kernel headers Task-number: QTBUG-69276 Change-Id: If2d5d796fd9d414a41036187a178d88c2e93b5ff Reviewed-by: Thiago Macieira --- src/testlib/3rdparty/qt_attribution.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/testlib/3rdparty/qt_attribution.json b/src/testlib/3rdparty/qt_attribution.json index 47625634e55..18522b6cd80 100644 --- a/src/testlib/3rdparty/qt_attribution.json +++ b/src/testlib/3rdparty/qt_attribution.json @@ -8,6 +8,7 @@ "Description": "An instrumentation framework for building dynamic analysis tools.", "Homepage": "http://valgrind.org/", + "Version": "3.3.0", "License": "BSD 4-clause \"Original\" or \"Old\" License", "LicenseId": "BSD-4-Clause", "LicenseFile": "VALGRIND_LICENSE.txt", @@ -36,6 +37,8 @@ Copyright (c) 2003, 2006 Massachusetts Institute of Technology" "Files": "linux_perf_event_p.h", "Description": "Allows access to the Linux kernel's performance events.", + "Homepage": "https://www.kernel.org", + "Version": "3.7", "License": "GNU General Public License v2.0 only with Linux Syscall Note", "LicenseId": "GPL-2.0 WITH Linux-syscall-note", "LicenseFile": "LINUX_LICENSE.txt", From 4932cef5b84d782f51ae7c6f77e09555bceacfee Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 8 Aug 2018 11:43:53 +0200 Subject: [PATCH 2/9] Cast away -Wclass-memaccess warnings in QVarLengthArray methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With g++ 8.2.0, I get warnings when a QVarLengthArray calls remove() or prepend(), as some tests in tst_QVarLengthArray do, as they call memmove() "writing to an object of type ‘class QString’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead"; which may indeed be a good argument for not using QVarLengthArray, but its own tests do. Change-Id: I4f8a64948b32a54e67a285df4ec7788f60739ffb Reviewed-by: Thiago Macieira --- src/corelib/tools/qvarlengtharray.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index a6bd7847a50..b74b1fd123c 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -490,7 +490,7 @@ Q_OUTOFLINE_TEMPLATE typename QVarLengthArray::iterator QVarLengthA } } else { T *b = ptr + offset; - memmove(b + 1, b, (s - offset) * sizeof(T)); + memmove(static_cast(b + 1), static_cast(b), (s - offset) * sizeof(T)); new (b) T(std::move(t)); } s += 1; @@ -518,7 +518,7 @@ Q_OUTOFLINE_TEMPLATE typename QVarLengthArray::iterator QVarLengthA } else { T *b = ptr + offset; T *i = b + n; - memmove(i, b, (s - offset - n) * sizeof(T)); + memmove(static_cast(i), static_cast(b), (s - offset - n) * sizeof(T)); while (i != b) new (--i) T(copy); } @@ -544,7 +544,7 @@ Q_OUTOFLINE_TEMPLATE typename QVarLengthArray::iterator QVarLengthA i->~T(); } } else { - memmove(ptr + f, ptr + l, (s - l) * sizeof(T)); + memmove(static_cast(ptr + f), static_cast(ptr + l), (s - l) * sizeof(T)); } s -= n; return ptr + f; From 2a9223830cd56fa1623d42d939df497eb20001af Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 14 Aug 2018 12:40:07 +0200 Subject: [PATCH 3/9] Doc: Remove duplicate thread-safe documentation from logging macros qdoc now handles \threadsafe also for macros, so we can remove the explicit \note. Change-Id: Iabeb7f69d237e7024a4f584adc516951b06d752b Reviewed-by: Leena Miettinen --- src/corelib/io/qloggingcategory.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index d8402c4eb64..aa84f56368f 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -471,8 +471,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if debug output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qDebug() */ @@ -493,8 +491,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if debug output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qDebug() */ @@ -518,8 +514,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if debug output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qInfo() */ @@ -540,8 +534,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if debug output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qInfo() */ @@ -565,8 +557,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if warning output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qWarning() */ @@ -587,8 +577,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if warning output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qWarning() */ @@ -612,8 +600,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments are not processed if critical output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qCritical() */ @@ -634,8 +620,6 @@ void QLoggingCategory::setFilterRules(const QString &rules) \note Arguments might not be processed if critical output for the category is not enabled, so do not rely on any side effects. - \note Using the macro is thread-safe. - \sa qCritical() */ /*! From 2d3098f77c98a895dad2c2e6c1c3facf712473f5 Mon Sep 17 00:00:00 2001 From: Alexander Shevchenko Date: Sun, 19 Aug 2018 15:44:24 +0300 Subject: [PATCH 4/9] Fix qtbase build for Windows ICC with MSVC 2017 15.8 After 0ef66e98ccf was merged, the same should be done to Windows ICC toolchain. Task-number: QTBUG-69997 Change-Id: I1d76d8b59f87151a9064d9f7dcc3136dc1215633 Reviewed-by: Thiago Macieira --- mkspecs/win32-icc/qmake.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf index 3cb0d58824f..2447c712b19 100644 --- a/mkspecs/win32-icc/qmake.conf +++ b/mkspecs/win32-icc/qmake.conf @@ -12,6 +12,7 @@ include(../common/msvc-desktop.conf) # modifications to msvc-desktop.conf QMAKE_COMPILER += intel_icl +DEFINES += _ENABLE_EXTENDED_ALIGNED_STORAGE QMAKE_CFLAGS_OPTIMIZE_FULL = -O3 From 76c328b2b39617310993ce76e65665943b8c111c Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 21 Aug 2018 15:52:52 +0200 Subject: [PATCH 5/9] Fix spacing in << operator for QEvent Turns QNativeGestureEvent(ZoomNativeGesturelocalPos=686.855,312.836, value=0.0259857) into QNativeGestureEvent(ZoomNativeGesture, localPos=686.855,312.836, value=0.0259857) Change-Id: Id30860a3c7a1b6da583369126a31934ddb32d4b9 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index d7727d97b8d..adc83302cff 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -4119,7 +4119,7 @@ QDebug operator<<(QDebug dbg, const QEvent *e) const QNativeGestureEvent *ne = static_cast(e); dbg << "QNativeGestureEvent("; QtDebugUtils::formatQEnum(dbg, ne->gestureType()); - dbg << "localPos="; + dbg << ", localPos="; QtDebugUtils::formatQPoint(dbg, ne->localPos()); dbg << ", value=" << ne->value() << ')'; } From 02b3d43fd4661271e6e8dc8940d84cb2ba352fe0 Mon Sep 17 00:00:00 2001 From: Luca Beldi Date: Wed, 22 Aug 2018 08:21:01 +0100 Subject: [PATCH 6/9] _q_interpolate is unsafe with unsigned template arguments _q_interpolate subtracts 2 arguments of type T, for unsigned types this can cause wrapping around Task-number: QTBUG-57925 Change-Id: Iffa59f413579a3d5de8cb728fe71443d8e8a04aa Reviewed-by: Giuseppe D'Angelo --- src/corelib/animation/qvariantanimation_p.h | 14 ++++++++++- .../tst_qvariantanimation.cpp | 25 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/corelib/animation/qvariantanimation_p.h b/src/corelib/animation/qvariantanimation_p.h index 37318a5339d..9f0f2e30307 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 + #ifndef QT_NO_ANIMATION QT_BEGIN_NAMESPACE @@ -104,7 +106,17 @@ public: }; //this should make the interpolation faster -template inline T _q_interpolate(const T &f, const T &t, qreal progress) +template +typename std::enable_if::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 std::enable_if::value, T>::type +_q_interpolate(const T &f, const T &t, qreal progress) { return T(f + (t - f) * progress); } diff --git a/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp b/tests/auto/corelib/animation/qvariantanimation/tst_qvariantanimation.cpp index 00962afa729..ac20fb35ec5 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" From 972dd1c54484179ef0213598e85da981a7d7601f Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 21 Aug 2018 14:52:24 +0200 Subject: [PATCH 7/9] Doc: fix typo in QNativeGestureEvent docs Change-Id: I83ac3463752488d7dbb758ea767ba186ddd3fa2a Reviewed-by: Friedemann Kleint --- src/gui/kernel/qevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index adc83302cff..4207697c01c 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -2750,7 +2750,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. From dc7e775c9c6ecc66f76af8139b8dfc3ee101c7ff Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 22 Aug 2018 20:30:57 +0200 Subject: [PATCH 8/9] Test for fractional part of Costa Rican currency CLDR up to somewhere between v29 (used by 5.9) and v31.0.1 (used by 5.10 and later) claimed Costa Ricans don't include fractions in their currency; now it claims they expec two digits. Apparently one of them does expect those digits, so this is the regression test I'll be cherry-picking back to LTS, to accompany the CLDR updates they need. Task-number: QTBUG-70093 Change-Id: I138772cc6013fa74de4f7c54b836cac83421eab2 Reviewed-by: Thiago Macieira --- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 4131c44c840..b7cb8a1bdc6 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -2385,6 +2385,10 @@ void tst_QLocale::currency() QCOMPARE(de_DE.toCurrencyString(double(-1234.56)), QString::fromUtf8("-1.234,56\xc2\xa0\xe2\x82\xac")); 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"))); } From bd42e2f0cebb2fe8de77a054e9d30aa803749a61 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 24 Aug 2018 17:03:03 +0200 Subject: [PATCH 9/9] Blacklist two tests on macOS that a planned CI change shall break MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have #if-ery on Q_OS_DARWIN controlling an expectation of gettign "GMT+1" and "GMT+2" instead of "CET" and "CEST" in two tests; this turns out to not be a deficiency of macOS so much as of how we configure Coin's VMs. While we fix that, we need to ignore failures in these tests, so that we can pull the #if-ery out and clear the blacklist once the VMs are set up properly. Task-number: QTBUG-70149 Change-Id: If3577200cf980b3329161ab3eea7bd2e9d0124e0 Reviewed-by: Tony Sarajärvi --- tests/auto/corelib/tools/qdatetime/BLACKLIST | 2 ++ tests/auto/corelib/tools/qlocale/BLACKLIST | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 tests/auto/corelib/tools/qdatetime/BLACKLIST create mode 100644 tests/auto/corelib/tools/qlocale/BLACKLIST diff --git a/tests/auto/corelib/tools/qdatetime/BLACKLIST b/tests/auto/corelib/tools/qdatetime/BLACKLIST new file mode 100644 index 00000000000..3a42ee066b6 --- /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 00000000000..3eac7c10ed7 --- /dev/null +++ b/tests/auto/corelib/tools/qlocale/BLACKLIST @@ -0,0 +1,2 @@ +[formatTimeZone] +osx