Fix breakage due to meta-type id reordering in qtbase
authorKent Hansen <kent.hansen@nokia.com>
Thu, 26 Jan 2012 14:04:51 +0000 (15:04 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 26 Jan 2012 14:35:12 +0000 (15:35 +0100)
Commit aee1f6cc413f56bf4962324799ee3887c3dd037f in qtbase changed the
order/IDs of the "extended" meta-types, so that they are not
bigger than QVariant::UserType (127) anymore. This caused autotests
in qtdeclarative to assert/fail.

Ths commit adapts the logic in qtdeclarative accordingly, in
particular so that QVariant/QObjectStar aren't treated as value
types.

Change-Id: I3e6c0b2c9fb04bfd7f7fd94da2741f9536229b87
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
src/declarative/qml/qdeclarativevaluetype.cpp
tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp

index 9e5dc90..12ee78e 100644 (file)
@@ -92,8 +92,14 @@ QDeclarativeValueTypeFactory::~QDeclarativeValueTypeFactory()
 
 bool QDeclarativeValueTypeFactory::isValueType(int idx)
 {
-    if ((uint)idx < QVariant::UserType && (uint)idx != QVariant::StringList)
+    if ((uint)idx < QVariant::UserType
+            && idx != QVariant::StringList
+            && idx != QMetaType::QObjectStar
+            && idx != QMetaType::QWidgetStar
+            && idx != QMetaType::VoidStar
+            && idx != QMetaType::QVariant) {
         return true;
+    }
     return false;
 }
 
index 83c092b..446ad8b 100644 (file)
@@ -229,7 +229,7 @@ void tst_QDeclarativeEngineDebug::recursiveObjectTest(QObject *o, const QDeclara
 
         QCOMPARE(p.name(), QString::fromUtf8(pmeta.name()));
 
-        if (pmeta.type() < QVariant::UserType) // TODO test complex types
+        if (pmeta.type() < QVariant::UserType && pmeta.userType() != QMetaType::QVariant) // TODO test complex types
             QCOMPARE(p.value(), pmeta.read(o));
 
         if (p.name() == "parent")