diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-02-27 17:47:04 +0100 |
---|---|---|
committer | Qt CI Bot <qt_ci_bot@qt-project.org> | 2021-03-05 14:38:41 +0000 |
commit | bcedeb6d3d8e0e72aac16acbc519d09aa99f23fd (patch) | |
tree | 98bbcecb9e4f23843484271fc1da6ab30cdac2e2 | |
parent | 684d44024f71b66994687d632cde5b10c92e6d21 (diff) | |
parent | 48f685f5e51a98ea0e57e95724d801d249d30c0d (diff) |
Merge "QPoint(F): declare as PRIMITIVE, not RELOCATABLE"
-rw-r--r-- | src/corelib/tools/qpoint.h | 4 | ||||
-rw-r--r-- | src/gui/math3d/qquaternion.h | 2 | ||||
-rw-r--r-- | tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 11 |
3 files changed, 13 insertions, 4 deletions
diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h index 8fff462487..f2c562393a 100644 --- a/src/corelib/tools/qpoint.h +++ b/src/corelib/tools/qpoint.h @@ -129,7 +129,7 @@ private: } }; -Q_DECLARE_TYPEINFO(QPoint, Q_RELOCATABLE_TYPE); +Q_DECLARE_TYPEINFO(QPoint, Q_PRIMITIVE_TYPE); /***************************************************************************** QPoint stream functions @@ -326,7 +326,7 @@ private: } }; -Q_DECLARE_TYPEINFO(QPointF, Q_RELOCATABLE_TYPE); +Q_DECLARE_TYPEINFO(QPointF, Q_PRIMITIVE_TYPE); size_t qHash(QPointF, size_t seed = 0) = delete; diff --git a/src/gui/math3d/qquaternion.h b/src/gui/math3d/qquaternion.h index 76fa237afd..4d04ac6ad9 100644 --- a/src/gui/math3d/qquaternion.h +++ b/src/gui/math3d/qquaternion.h @@ -169,7 +169,7 @@ private: float wp, xp, yp, zp; }; -Q_DECLARE_TYPEINFO(QQuaternion, Q_RELOCATABLE_TYPE); +Q_DECLARE_TYPEINFO(QQuaternion, Q_PRIMITIVE_TYPE); inline QQuaternion::QQuaternion() : wp(1.0f), xp(0.0f), yp(0.0f), zp(0.0f) {} diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 81a67f1b78..df9beabe73 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -1092,9 +1092,18 @@ void tst_QMetaType::flagsBinaryCompatibility6_0() QFETCH(quint32, id); QFETCH(quint32, flags); + const auto currentFlags = QMetaType::typeFlags(id); + auto expectedFlags = QMetaType::TypeFlags(flags); + if (!(currentFlags.testFlag(QMetaType::NeedsConstruction) && currentFlags.testFlag(QMetaType::NeedsDestruction))) { + if (expectedFlags.testFlag(QMetaType::NeedsConstruction) && expectedFlags.testFlag(QMetaType::NeedsDestruction)) { + // If type changed from RELOCATABLE to trivial, that's fine + expectedFlags.setFlag(QMetaType::NeedsConstruction, false); + expectedFlags.setFlag(QMetaType::NeedsDestruction, false); + } + } quint32 mask_5_0 = 0x1fb; // Only compare the values that were already defined in 5.0 - QCOMPARE(quint32(QMetaType::typeFlags(id)) & mask_5_0, flags & mask_5_0); + QCOMPARE(quint32(currentFlags) & mask_5_0, quint32(expectedFlags) & mask_5_0); } void tst_QMetaType::construct_data() |