diff options
author | Chris Adams <christopher.adams@nokia.com> | 2011-12-15 12:01:39 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-19 01:13:53 +0100 |
commit | 8460eae44c241d5975b3041eedf6e08c9638fd41 (patch) | |
tree | 0e342e789966b86b2d320ecccee22477192ccfc0 /tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | |
parent | 6859056a0924b3da52b045aa14a34fae59a5c75e (diff) |
Correctly resolve elements of QList<QUrl> properties
Previously, the value of a QList<QUrl> sequence was only resolved if
there was only one element in the sequence. This commit ensures that
all elements in the sequence are resolved correctly.
Task-number: QTBUG-23131
Change-Id: Id27748853fe01ae22800fbd02d062e268ad7ec70
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 10ae0ccd09..251b89dd87 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -4709,6 +4709,25 @@ void tst_qdeclarativeecmascript::assignSequenceTypes() QCOMPARE(object->urlListProperty(), (QList<QUrl>() << QUrl(TEST_FILE("example.html")))); delete object; } + + // test QList<QUrl> literal assignment and binding assignment causes url resolution when required + { + QDeclarativeComponent component(&engine, TEST_FILE("assignSequenceTypes.7.qml")); + QObject *object = component.create(); + QVERIFY(object != 0); + MySequenceConversionObject *msco1 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco1")); + MySequenceConversionObject *msco2 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco2")); + MySequenceConversionObject *msco3 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco3")); + MySequenceConversionObject *msco4 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco4")); + MySequenceConversionObject *msco5 = object->findChild<MySequenceConversionObject *>(QLatin1String("msco5")); + QVERIFY(msco1 != 0 && msco2 != 0 && msco3 != 0 && msco4 != 0 && msco5 != 0); + QCOMPARE(msco1->urlListProperty(), (QList<QUrl>() << QUrl(TEST_FILE("example.html")))); + QCOMPARE(msco2->urlListProperty(), (QList<QUrl>() << QUrl(TEST_FILE("example.html")))); + QCOMPARE(msco3->urlListProperty(), (QList<QUrl>() << QUrl(TEST_FILE("example.html")) << QUrl(TEST_FILE("example2.html")))); + QCOMPARE(msco4->urlListProperty(), (QList<QUrl>() << QUrl(TEST_FILE("example.html")) << QUrl(TEST_FILE("example2.html")))); + QCOMPARE(msco5->urlListProperty(), (QList<QUrl>() << QUrl(TEST_FILE("example.html")) << QUrl(TEST_FILE("example2.html")))); + delete object; + } } // Test that assigning a null object works |