diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index b7f01ca5ca..3b8f8e7166 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -1627,7 +1627,7 @@ namespace QtPrivate { template struct QMetaTypeTypeFlags { - enum { Flags = (!QTypeInfo::isStatic ? QMetaType::MovableType : 0) + enum { Flags = (QTypeInfoQuery::isRelocatable ? QMetaType::MovableType : 0) | (QTypeInfo::isComplex ? QMetaType::NeedsConstruction : 0) | (QTypeInfo::isComplex ? QMetaType::NeedsDestruction : 0) | (IsPointerToTypeDerivedFromQObject::Value ? QMetaType::PointerToQObject : 0) diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h index 3b30b1286d..d84d702982 100644 --- a/src/corelib/kernel/qvariant_p.h +++ b/src/corelib/kernel/qvariant_p.h @@ -58,7 +58,7 @@ template struct QVariantIntegrator { static const bool CanUseInternalSpace = sizeof(T) <= sizeof(QVariant::Private::Data) - && ((!QTypeInfo::isStatic) || Q_IS_ENUM(T)); + && ((QTypeInfoQuery::isRelocatable) || Q_IS_ENUM(T)); }; Q_STATIC_ASSERT(QVariantIntegrator::CanUseInternalSpace); Q_STATIC_ASSERT(QVariantIntegrator::CanUseInternalSpace); diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 9cdb1f47f8..10ffa06245 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -972,7 +972,7 @@ QT_FOR_EACH_STATIC_CORE_POINTER(ADD_METATYPE_TEST_ROW) QTest::newRow("QPair") << ::qMetaTypeId >() << false << true << false << false; QTest::newRow("QPair") << ::qMetaTypeId >() << true << true << false << false; QTest::newRow("QPair") << ::qMetaTypeId >() << true << false << false << false; - QTest::newRow("FlagsDataEnum") << ::qMetaTypeId() << false << true << false << true; + QTest::newRow("FlagsDataEnum") << ::qMetaTypeId() << true << true << false << true; // invalid ids. QTest::newRow("-1") << -1 << false << false << false << false; @@ -1052,9 +1052,9 @@ void tst_QMetaType::flagsBinaryCompatibility5_0() QFETCH(quint32, id); QFETCH(quint32, flags); - quint32 mask_5_0 = 0x1ff; // Only compare the values that were already defined in 5.0 + 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); + QCOMPARE(quint32(QMetaType::typeFlags(id)) & mask_5_0, flags & mask_5_0); } void tst_QMetaType::construct_data()