diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2011-07-25 16:03:57 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-25 08:05:07 +0200 |
commit | 9f9b23fd7943a3d125cb1cc9f333ce430b2706ea (patch) | |
tree | 739aae21cb8a5cfff3111b3e99ee8b2c667c05d5 /tests/auto/declarative/qdeclarativeproperty | |
parent | 4453c2c0aea512f56da5a2ba0ac55b1bbd59cb35 (diff) |
Use engine where appropriate in QDeclarativeProperty
Task-number: QTBUG-14697
Change-Id: Id15def75271666699b1fe23e39991710afebff59
Reviewed-on: http://codereview.qt.nokia.com/2077
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeproperty')
-rw-r--r-- | tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp index a15032909d..5218093ceb 100644 --- a/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp +++ b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp @@ -133,6 +133,7 @@ private slots: // Bugs void crashOnValueProperty(); void aliasPropertyBindings(); + void noContext(); void copy(); private: @@ -1481,6 +1482,22 @@ void tst_qdeclarativeproperty::copy() QCOMPARE(p2.propertyType(), (int)QVariant::Int); } +void tst_qdeclarativeproperty::noContext() +{ + QDeclarativeComponent compA(&engine, TEST_FILE("NoContextTypeA.qml")); + QDeclarativeComponent compB(&engine, TEST_FILE("NoContextTypeB.qml")); + + QObject *a = compA.create(); + QVERIFY(a != 0); + QObject *b = compB.create(); + QVERIFY(b != 0); + + QVERIFY(QDeclarativeProperty::write(b, "myTypeA", QVariant::fromValue(a), &engine)); + + delete a; + delete b; +} + void tst_qdeclarativeproperty::initTestCase() { qmlRegisterType<MyQmlObject>("Test",1,0,"MyQmlObject"); @@ -1488,7 +1505,6 @@ void tst_qdeclarativeproperty::initTestCase() qmlRegisterType<MyContainer>("Test",1,0,"MyContainer"); } - QTEST_MAIN(tst_qdeclarativeproperty) #include "tst_qdeclarativeproperty.moc" |