diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-06-25 03:42:06 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-06-25 03:42:06 (GMT) |
commit | e0913d038b3df628bc180d397681b9e6ec53a75c (patch) | |
tree | 7a729aad7e91e3542a9fa521a4437360dc3dd171 /tests | |
parent | 5272bfe03522e671e832a8cbd9e5b2d4d71a18f2 (diff) | |
download | Qt-e0913d038b3df628bc180d397681b9e6ec53a75c.zip Qt-e0913d038b3df628bc180d397681b9e6ec53a75c.tar.gz Qt-e0913d038b3df628bc180d397681b9e6ec53a75c.tar.bz2 |
Allow components to be created from .pragma library JS files
QTBUG-11507
Diffstat (limited to 'tests')
3 files changed, 8 insertions, 4 deletions
diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js index c165e29..30499e9 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js +++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js @@ -5,3 +5,7 @@ function loadComponent() { return component.status; } +function createComponent() { + var component = Qt.createComponent("createComponentData.qml"); + return component.createObject(null); +} diff --git a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml index aae7a91..33203c7 100644 --- a/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml +++ b/tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml @@ -3,8 +3,10 @@ import "createComponent_lib.js" as Test Item { property int status: Component.Null + property int readValue: 0 Component.onCompleted: { status = Test.loadComponent() + readValue = Test.createComponent().test; } } diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp index fb100a5..895ee6c 100644 --- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp +++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp @@ -365,14 +365,12 @@ void tst_qdeclarativeqt::createComponent() void tst_qdeclarativeqt::createComponent_pragmaLibrary() { // Currently, just loading createComponent_lib.qml causes crash on some platforms - /* QDeclarativeComponent component(&engine, TEST_FILE("createComponent_lib.qml")); QObject *object = component.create(); QVERIFY(object != 0); - - QEXPECT_FAIL("", "QTBUG-11507", Continue); QCOMPARE(object->property("status").toInt(), int(QDeclarativeComponent::Ready)); - */ + QCOMPARE(object->property("readValue").toInt(), int(1913)); + delete object; } void tst_qdeclarativeqt::createQmlObject() |