diff options
Diffstat (limited to 'tests/auto/qml/qqmlcomponent/data/jsmodule')
-rw-r--r-- | tests/auto/qml/qqmlcomponent/data/jsmodule/Dynamic.qml | 5 | ||||
-rw-r--r-- | tests/auto/qml/qqmlcomponent/data/jsmodule/module.mjs | 6 | ||||
-rw-r--r-- | tests/auto/qml/qqmlcomponent/data/jsmodule/test.qml | 10 |
3 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcomponent/data/jsmodule/Dynamic.qml b/tests/auto/qml/qqmlcomponent/data/jsmodule/Dynamic.qml new file mode 100644 index 0000000000..0d894eb3fe --- /dev/null +++ b/tests/auto/qml/qqmlcomponent/data/jsmodule/Dynamic.qml @@ -0,0 +1,5 @@ +import QtQml + +QtObject { + property int value +} diff --git a/tests/auto/qml/qqmlcomponent/data/jsmodule/module.mjs b/tests/auto/qml/qqmlcomponent/data/jsmodule/module.mjs new file mode 100644 index 0000000000..3dd3507d45 --- /dev/null +++ b/tests/auto/qml/qqmlcomponent/data/jsmodule/module.mjs @@ -0,0 +1,6 @@ +export function withProp(root) { + const component = Qt.createComponent("data/jsmodule/Dynamic.qml"); + const el = component.createObject(root, { value: 42 }); + return el.value; +} + diff --git a/tests/auto/qml/qqmlcomponent/data/jsmodule/test.qml b/tests/auto/qml/qqmlcomponent/data/jsmodule/test.qml new file mode 100644 index 0000000000..123c857180 --- /dev/null +++ b/tests/auto/qml/qqmlcomponent/data/jsmodule/test.qml @@ -0,0 +1,10 @@ +import "./module.mjs" as MJ +import QtQml 2.15 + +QtObject { + id: root + property bool ok: false + Component.onCompleted: { + root.ok = MJ.withProp(root) == 42 + } +} |