aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertybinding_p.h
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-05-03 10:31:05 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2021-05-10 23:00:40 +0200
commit9da03da2e3fec3cfc9c4e6bfcf7f433845723d65 (patch)
tree086a148ec8128c086a125b3fc842d6032c517c74 /src/qml/qml/qqmlpropertybinding_p.h
parent1b5463ccfbe3fde74adf8e0651662cad1979c216 (diff)
Apply constant binding removal optimization to QProperty bindings
This applies the logic from 7cb6dce1f3e140ea68d6b05281950f212fc99d38 to non-QQmlAbstractBinding bindings, too. The logic to detect whether a binding has no dependencies has consider the QPropertyBindingPrivate's dependency observer count. In addition, change the existing detection logic to remove properties without a context, too. The original logic probably wanted to guard against accessing binding->context()->unresolvedNames when context was nullptr; however, the check should have tested "context -> unresolvedNames", not "context and unresolvedNames". And after the refactoring which introduced hasUnresolvedNames() as a function, the context check became completely superfluous. Fixes: QTBUG-92996 Change-Id: Ia3bc39e184f431210b3bb2d38154acf820525e98 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlpropertybinding_p.h')
-rw-r--r--src/qml/qml/qqmlpropertybinding_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlpropertybinding_p.h b/src/qml/qml/qqmlpropertybinding_p.h
index 6220dce06a..83c58f8254 100644
--- a/src/qml/qml/qqmlpropertybinding_p.h
+++ b/src/qml/qml/qqmlpropertybinding_p.h
@@ -131,6 +131,8 @@ public:
return reinterpret_cast<QQmlPropertyBinding *>(address)->evaluate(metaType, dataPtr);
}
+ bool hasDependencies();
+
private:
bool evaluate(QMetaType metaType, void *dataPtr);