diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-28 05:54:33 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-01-28 05:54:33 (GMT) |
commit | 5f1d7d1e73edd1c2ff3e1ad244100fdbc3495458 (patch) | |
tree | 55d084dfdd94a1d1bf7e5732a7eb732b83a3cb30 /tests/auto | |
parent | 044c93a48213e325f486c3076837a2a7cebbe9aa (diff) | |
download | Qt-5f1d7d1e73edd1c2ff3e1ad244100fdbc3495458.zip Qt-5f1d7d1e73edd1c2ff3e1ad244100fdbc3495458.tar.gz Qt-5f1d7d1e73edd1c2ff3e1ad244100fdbc3495458.tar.bz2 |
Convert lists to variants on assignment.
QTBUG-5675
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/declarative/qmlecmascript/testtypes.h | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/tests/auto/declarative/qmlecmascript/testtypes.h b/tests/auto/declarative/qmlecmascript/testtypes.h index a800a98..09c850d 100644 --- a/tests/auto/declarative/qmlecmascript/testtypes.h +++ b/tests/auto/declarative/qmlecmascript/testtypes.h @@ -162,7 +162,7 @@ QML_DECLARE_TYPE(MyQmlObject); class MyQmlContainer : public QObject { Q_OBJECT - Q_PROPERTY(QList<MyQmlObject*>* children READ children) + Q_PROPERTY(QList<MyQmlObject*>* children READ children CONSTANT) public: MyQmlContainer() {} diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index bcad045..c41e248 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -118,6 +118,7 @@ private slots: void compositePropertyType(); void jsObject(); void undefinedResetsProperty(); + void listToVariant(); void bug1(); @@ -1593,6 +1594,25 @@ void tst_qmlecmascript::callQtInvokables() QCOMPARE(o.actuals().at(1), QVariant(11)); } +// QTBUG-5675 +void tst_qmlecmascript::listToVariant() +{ + QmlComponent component(&engine, TEST_FILE("listToVariant.qml")); + + MyQmlContainer container; + + QmlContext context(engine.rootContext()); + context.addDefaultObject(&container); + + QObject *object = component.create(&context); + QVERIFY(object != 0); + + QCOMPARE(object->property("test"), QVariant::fromValue(container.children())); + + delete object; + +} + QTEST_MAIN(tst_qmlecmascript) #include "tst_qmlecmascript.moc" |