diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-02-04 10:52:26 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-04-19 13:04:15 +0200 |
commit | 7fa4c31d535cc36ec6f9347d5bbdd2417b878645 (patch) | |
tree | b30bfd53e202d352414a32c61e7571417bb96a71 /src/qml/types/qqmlbind.cpp | |
parent | e824db7f1ea1372b620632d4eac5d048470658d0 (diff) |
Adjust to QProperty using eager evaluation
Besides API changes, we need to
- adjust QQmlBind to unlink the binding properly (that probably was
broken already before, but did not cause issues so far, as the old
binding would not have been evaluated without a read access) and
- skip tests in tst_qmlcompiler_manual, as the bindings are executed
before the engine is correctly set.
Change-Id: I97b0ac32b428c1a033664fe8593effadb69cd348
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/types/qqmlbind.cpp')
-rw-r--r-- | src/qml/types/qqmlbind.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/types/qqmlbind.cpp b/src/qml/types/qqmlbind.cpp index 37fa40d993..8e74711776 100644 --- a/src/qml/types/qqmlbind.cpp +++ b/src/qml/types/qqmlbind.cpp @@ -492,8 +492,8 @@ void QQmlBind::eval() //save any set binding for restoration if (!d->prevBindingSet() && d->v4Value.isEmpty() && !d->prevIsVariant) { - // try binding first - d->prevBind = QQmlAnyBinding::ofProperty(d->prop); + // try binding first; we need to use takeFrom to properly unlink the binding + d->prevBind = QQmlAnyBinding::takeFrom(d->prop); if (!d->prevBindingSet()) { // nope, try a V4 value next auto propPriv = QQmlPropertyPrivate::get(d->prop); |