diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-23 01:25:23 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-09-23 01:25:23 (GMT) |
commit | 1206562c6be4098de8a9fdda5c7ff5c8fdd6bc01 (patch) | |
tree | 4805291611955bf1e18c36c028bf6b32061a4129 /src/declarative/qml/qmlmetaproperty.cpp | |
parent | 30379e098ef31a8a1f670bdeab212ed419e80b5b (diff) | |
download | Qt-1206562c6be4098de8a9fdda5c7ff5c8fdd6bc01.zip Qt-1206562c6be4098de8a9fdda5c7ff5c8fdd6bc01.tar.gz Qt-1206562c6be4098de8a9fdda5c7ff5c8fdd6bc01.tar.bz2 |
Use a bitmask to track bound properties
Diffstat (limited to 'src/declarative/qml/qmlmetaproperty.cpp')
-rw-r--r-- | src/declarative/qml/qmlmetaproperty.cpp | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index 8f76240..91769d3 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -531,6 +531,9 @@ QmlAbstractBinding *QmlMetaProperty::binding() const if (!data) return 0; + if (!data->hasBindingBit(d->coreIdx)) + return 0; + QmlAbstractBinding *binding = data->bindings; while (binding) { // ### This wont work for value types @@ -559,20 +562,22 @@ QmlMetaProperty::setBinding(QmlAbstractBinding *newBinding) const QmlDeclarativeData *data = QmlDeclarativeData::get(d->object, true); - QmlAbstractBinding *binding = data->bindings; - while (binding) { - // ### This wont work for value types - if (binding->propertyIndex() == d->coreIdx) { - binding->setEnabled(false); + if (data->hasBindingBit(d->coreIdx)) { + QmlAbstractBinding *binding = data->bindings; + while (binding) { + // ### This wont work for value types + if (binding->propertyIndex() == d->coreIdx) { + binding->setEnabled(false); - if (newBinding) - newBinding->setEnabled(true); + if (newBinding) + newBinding->setEnabled(true); - return binding; // ### QmlAbstractBinding; - } + return binding; // ### QmlAbstractBinding; + } - binding = binding->m_nextBinding; - } + binding = binding->m_nextBinding; + } + } if (newBinding) newBinding->setEnabled(true); @@ -727,7 +732,8 @@ void QmlMetaPropertyPrivate::writeSignalProperty(const QVariant &value) } } -void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) +void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value, + QmlMetaProperty::WriteSource source) { QObject *object = this->object; int coreIdx = this->coreIdx; @@ -987,6 +993,11 @@ void QmlMetaPropertyPrivate::writeValueProperty(const QVariant &value) */ void QmlMetaProperty::write(const QVariant &value) const { + write(value, Other); +} + +void QmlMetaProperty::write(const QVariant &value, WriteSource source) const +{ if (!d->object) return; @@ -996,7 +1007,7 @@ void QmlMetaProperty::write(const QVariant &value) const } else if (d->coreIdx != -1) { - d->writeValueProperty(value); + d->writeValueProperty(value, source); } } |