diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-07-22 10:08:17 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-08-04 12:11:05 +0000 |
commit | 1534dd6d97c49f5c7e0392df9c95198311b5b817 (patch) | |
tree | dad42c0c12c0ef3005b26645df6cc21832f54315 /src/qml/qml/qqmlengine.cpp | |
parent | fdc3dcd43f8944eb33e778627c43ab9487a26960 (diff) |
QML: Introduce QQmlPropertyIndex
This helps in making it clear when an index is a plain old number and
when it consists of an encoded value type index.
Change-Id: Ic50d95caf244ed0ee2d62bdba53910a371cfee04
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index 5cfb546718..48832f3b07 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -837,16 +837,18 @@ void QQmlData::setQueuedForDeletion(QObject *object) } } -void QQmlData::flushPendingBindingImpl(int coreIndex) +void QQmlData::flushPendingBindingImpl(QQmlPropertyIndex index) { - clearPendingBindingBit(coreIndex); + clearPendingBindingBit(index.coreIndex()); // Find the binding QQmlAbstractBinding *b = bindings; - while (b && b->targetPropertyIndex() != coreIndex) + while (b && (b->targetPropertyIndex().coreIndex() != index.coreIndex() || + b->targetPropertyIndex().hasValueTypeIndex())) b = b->nextBinding(); - if (b && b->targetPropertyIndex() == coreIndex) + if (b && b->targetPropertyIndex().coreIndex() == index.coreIndex() && + !b->targetPropertyIndex().hasValueTypeIndex()) b->setEnabled(true, QQmlPropertyData::BypassInterceptor | QQmlPropertyData::DontRemoveBinding); } @@ -1788,21 +1790,29 @@ static void QQmlData_clearBit(QQmlData *data, int bit) void QQmlData::clearBindingBit(int coreIndex) { + Q_ASSERT(coreIndex >= 0); + Q_ASSERT(coreIndex <= 0xffff); QQmlData_clearBit(this, coreIndex * 2); } void QQmlData::setBindingBit(QObject *obj, int coreIndex) { + Q_ASSERT(coreIndex >= 0); + Q_ASSERT(coreIndex <= 0xffff); QQmlData_setBit(this, obj, coreIndex * 2); } void QQmlData::clearPendingBindingBit(int coreIndex) { + Q_ASSERT(coreIndex >= 0); + Q_ASSERT(coreIndex <= 0xffff); QQmlData_clearBit(this, coreIndex * 2 + 1); } void QQmlData::setPendingBindingBit(QObject *obj, int coreIndex) { + Q_ASSERT(coreIndex >= 0); + Q_ASSERT(coreIndex <= 0xffff); QQmlData_setBit(this, obj, coreIndex * 2 + 1); } |