diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2018-02-22 12:14:34 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2018-03-20 07:05:24 +0000 |
commit | 52b1993ea43a35983615419d297de903a4188f3e (patch) | |
tree | e63afbb295b643151abc99be4e68d72f2c0999cd /src/qml/qml/qqmlobjectcreator_p.h | |
parent | dc0136b8ba25c60f24fece5959d5487cea18b250 (diff) |
Fix issue with bindings to aliases that cannot yet be resolved
When an alias points to a child object which has not yet been
initialized, it's id won't have been registered yet, so setting up a
binding to it will result in a crash.
The fix is: when setting a binding target fails, and its target property
is an alias, queue them until all bindings have been set up, and try
again.
Task-number: QTBUG-57041
Change-Id: I4dc5a6d25c0a32fed9fd952c955e2006c76be45a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit aa94c6c0469b0595f483f13ac88459f0035deef9)
(cherry picked from commit c3db3cfa296dbc5aa198520c1411830d165cd496)
Diffstat (limited to 'src/qml/qml/qqmlobjectcreator_p.h')
-rw-r--r-- | src/qml/qml/qqmlobjectcreator_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h index 21ee30acd0..bd99c487ff 100644 --- a/src/qml/qml/qqmlobjectcreator_p.h +++ b/src/qml/qml/qqmlobjectcreator_p.h @@ -161,6 +161,9 @@ private: QV4::QmlContext *_qmlContext; friend struct QQmlObjectCreatorRecursionWatcher; + + typedef std::function<bool(QQmlObjectCreatorSharedState *sharedState)> PendingAliasBinding; + std::vector<PendingAliasBinding> pendingAliasBindings; }; struct QQmlObjectCreatorRecursionWatcher |