void QDeclarativeAbstractBinding::destroy() { removeFromObject(); clear(); delete this; }
void QDeclarativeAbstractBinding::addToObject(QObject *object) { Q_ASSERT(object); if (m_object == object) return; int index = propertyIndex(); removeFromObject(); Q_ASSERT(!m_prevBinding); m_object = object; QDeclarativeData *data = QDeclarativeData::get(object, true); if (index & 0xFF000000) { // Value type int coreIndex = index & 0xFFFFFF; // Find the value type proxy (if there is one) QDeclarativeValueTypeProxyBinding *proxy = 0; if (data->hasBindingBit(coreIndex)) { QDeclarativeAbstractBinding *b = data->bindings; while (b && b->propertyIndex() != coreIndex) b = b->m_nextBinding; Q_ASSERT(b && b->bindingType() == QDeclarativeAbstractBinding::ValueTypeProxy); proxy = static_cast<QDeclarativeValueTypeProxyBinding *>(b); } if (!proxy) proxy = new QDeclarativeValueTypeProxyBinding(object, coreIndex); proxy->addToObject(object); m_nextBinding = proxy->m_bindings; if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding; m_prevBinding = &proxy->m_bindings; proxy->m_bindings = this; } else { m_nextBinding = data->bindings; if (m_nextBinding) m_nextBinding->m_prevBinding = &m_nextBinding; m_prevBinding = &data->bindings; data->bindings = this; data->setBindingBit(m_object, index); } }
void QDeclarativeBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags) { Q_D(QDeclarativeBinding); d->enabled = e; setNotifyOnValueChanged(e); QDeclarativeAbstractBinding::setEnabled(e, flags); if (e) { addToObject(d->property.object()); update(flags); } else { removeFromObject(); } }
void QDeclarativeValueTypeProxyBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags) { if (e) { addToObject(m_object); QDeclarativeAbstractBinding *bindings = m_bindings; m_bindings = 0; recursiveEnable(bindings, flags); } else { removeFromObject(); QDeclarativeAbstractBinding *bindings = m_bindings; m_bindings = 0; recursiveDisable(bindings); } }
QQmlBoundSignal::~QQmlBoundSignal() { removeFromObject(); }
QQmlAbstractBoundSignal::~QQmlAbstractBoundSignal() { removeFromObject(); }