aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmldata_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-12-07 14:04:12 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-12-10 10:06:28 +0100
commit2aa118c118500c98a9caec76624877e27994acaf (patch)
treea4fb8865b9a38afbfe8f07271fc660d90f8137d6 /src/qml/qml/qqmldata_p.h
parent5b57aae8ba7896281c616e547f3d1f7604c9a5f5 (diff)
QQmlJSAotContext: flushPendingBinding() before capturing a property
This avoids duplicate evaluation and binding loops. Pick-to: 6.2 Change-Id: I5eba42d9dca0782dd964bd64c088c2e158faa9b3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmldata_p.h')
-rw-r--r--src/qml/qml/qqmldata_p.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/qml/qml/qqmldata_p.h b/src/qml/qml/qqmldata_p.h
index e745dac6e2..62671f9e63 100644
--- a/src/qml/qml/qqmldata_p.h
+++ b/src/qml/qml/qqmldata_p.h
@@ -278,7 +278,8 @@ public:
static void markAsDeleted(QObject *);
static void setQueuedForDeletion(QObject *);
- static inline void flushPendingBinding(QObject *, QQmlPropertyIndex propertyIndex);
+ static inline void flushPendingBinding(QObject *object, int coreIndex);
+ void flushPendingBinding(int coreIndex);
static QQmlRefPointer<QQmlPropertyCache> ensurePropertyCache(QJSEngine *engine, QObject *object)
{
@@ -300,8 +301,6 @@ private:
Q_NEVER_INLINE static QQmlRefPointer<QQmlPropertyCache> createPropertyCache(
QJSEngine *engine, QObject *object);
- void flushPendingBindingImpl(QQmlPropertyIndex index);
-
Q_ALWAYS_INLINE bool hasBitSet(int bit) const
{
uint offset = offsetForBit(bit);
@@ -425,11 +424,11 @@ void QQmlData::clearPendingBindingBit(int coreIndex)
clearBit(coreIndex * 2 + 1);
}
-void QQmlData::flushPendingBinding(QObject *o, QQmlPropertyIndex propertyIndex)
+void QQmlData::flushPendingBinding(QObject *object, int coreIndex)
{
- QQmlData *data = QQmlData::get(o, false);
- if (data && data->hasPendingBindingBit(propertyIndex.coreIndex()))
- data->flushPendingBindingImpl(propertyIndex);
+ QQmlData *data = QQmlData::get(object, false);
+ if (data && data->hasPendingBindingBit(coreIndex))
+ data->flushPendingBinding(coreIndex);
}
QT_END_NAMESPACE