diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-05-11 15:22:51 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-05-18 10:08:30 +0000 |
commit | 72515ebe5a63c201fde09471bc646dbe15110a6b (patch) | |
tree | 22588014a613d0c2d72b909e28b1667a1c5dc9ec /tests/auto/qml/qqmlcomponent/data | |
parent | 74628af12aa8f72a56635bf27e7361861c50f796 (diff) |
Fix crashes when incubating objects asynchronously with initial properties
This is a regression from commit 94e337fa95425d259e81b4d21f4d0853108553bd where
we accidentally ended up not having a calling QML context set anymore when
initializing the properties on newly incubated objects as provided by the
caller. The QML context is necessary as for example when we set a URL property,
the URL can be relative and it will be resolved to the base url of the context
when written, such as in in QQmlPropertyPrivate::write.
Change-Id: I1d896381fc92f653a7d76f4d82174bca48828f5e
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'tests/auto/qml/qqmlcomponent/data')
-rw-r--r-- | tests/auto/qml/qqmlcomponent/data/callingQmlContext.qml | 13 | ||||
-rw-r--r-- | tests/auto/qml/qqmlcomponent/data/callingQmlContextComponent.qml | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcomponent/data/callingQmlContext.qml b/tests/auto/qml/qqmlcomponent/data/callingQmlContext.qml new file mode 100644 index 0000000000..8193d0f36c --- /dev/null +++ b/tests/auto/qml/qqmlcomponent/data/callingQmlContext.qml @@ -0,0 +1,13 @@ +import QtQml 2.0 +import qqmlcomponenttest 1.0 +QtObject { + property Component factory + property QtObject incubatedObject + + Component.onCompleted: { + var incubatorState = factory.incubateObject(null, { value: 42 }) + incubatorState.onStatusChanged = function(status) { + incubatedObject = incubatorState.object + } + } +} diff --git a/tests/auto/qml/qqmlcomponent/data/callingQmlContextComponent.qml b/tests/auto/qml/qqmlcomponent/data/callingQmlContextComponent.qml new file mode 100644 index 0000000000..adf491c87e --- /dev/null +++ b/tests/auto/qml/qqmlcomponent/data/callingQmlContextComponent.qml @@ -0,0 +1,3 @@ +import qqmlcomponenttest 1.0 +CallingContextCheckingClass { +} |