From b05a072e389359dd7a7603d0b59049b87c76d4e6 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Tue, 30 Mar 2010 10:10:01 +1000 Subject: Fix qdeclarativedom::loadDynamicProperty test --- src/declarative/qml/qdeclarativedom.cpp | 6 ++++++ tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp | 10 ++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/declarative/qml/qdeclarativedom.cpp b/src/declarative/qml/qdeclarativedom.cpp index 366750e..dec30a1 100644 --- a/src/declarative/qml/qdeclarativedom.cpp +++ b/src/declarative/qml/qdeclarativedom.cpp @@ -480,9 +480,15 @@ int QDeclarativeDomDynamicProperty::propertyType() const case QDeclarativeParser::Object::DynamicProperty::Color: return QMetaType::type("QColor"); + case QDeclarativeParser::Object::DynamicProperty::Time: + return QMetaType::type("QTime"); + case QDeclarativeParser::Object::DynamicProperty::Date: return QMetaType::type("QDate"); + case QDeclarativeParser::Object::DynamicProperty::DateTime: + return QMetaType::type("QDateTime"); + case QDeclarativeParser::Object::DynamicProperty::Int: return QMetaType::type("int"); diff --git a/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp index 16efba9..79b0c36 100644 --- a/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp +++ b/tests/auto/declarative/qdeclarativedom/tst_qdeclarativedom.cpp @@ -451,8 +451,7 @@ void tst_qdeclarativedom::loadDynamicProperty() " property color g\n" " property date h\n" " property var i\n" - " property variant j\n" - " property QtObject k\n" + " property QtObject j\n" "}"; QDeclarativeDomDocument document; @@ -461,7 +460,7 @@ void tst_qdeclarativedom::loadDynamicProperty() QDeclarativeDomObject rootObject = document.rootObject(); QVERIFY(rootObject.isValid()); - QCOMPARE(rootObject.dynamicProperties().count(), 11); + QCOMPARE(rootObject.dynamicProperties().count(), 10); #define DP_TEST(index, name, type, test_position, test_length, propTypeName) \ { \ @@ -483,10 +482,9 @@ void tst_qdeclarativedom::loadDynamicProperty() DP_TEST(4, e, QVariant::String, 106, 17, "string"); DP_TEST(5, f, QVariant::Url, 128, 14, "url"); DP_TEST(6, g, QVariant::Color, 147, 16, "color"); - DP_TEST(7, h, QVariant::Date, 168, 15, "date"); + DP_TEST(7, h, QVariant::DateTime, 168, 15, "date"); DP_TEST(8, i, qMetaTypeId(), 188, 14, "var"); - DP_TEST(9, j, qMetaTypeId(), 207, 18, "variant"); - DP_TEST(10, k, -1, 230, 19, "QtObject"); + DP_TEST(9, j, -1, 207, 19, "QtObject"); } { -- cgit v0.12