diff options
author | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-08-03 16:17:19 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-08-09 08:06:16 +0000 |
commit | 107a52b8a7019b66b4cb3279e7bf070d5b57c2e0 (patch) | |
tree | c633860d4345d6629fa066d56b99fe9335dba474 /src/qml/jsruntime/qv4qobjectwrapper.cpp | |
parent | c3cbbf362c769b065fd0586b0510d043cbae92a4 (diff) |
QML: Split off value type information from property data
Change-Id: I2ae2fb0f18af9b866cc9482fd4f42d9d4269f8cb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 9cfc5dcb1f..8fef45891a 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -328,7 +328,7 @@ ReturnedValue QObjectWrapper::getQmlProperty(QQmlContextData *qmlContext, String ReturnedValue QObjectWrapper::getProperty(ExecutionEngine *engine, QObject *object, QQmlPropertyData *property, bool captureRequired) { - QQmlData::flushPendingBinding(object, property->encodedIndex()); + QQmlData::flushPendingBinding(object, QQmlPropertyIndex(property->coreIndex)); if (property->isFunction() && !property->isVarProperty()) { if (property->isVMEFunction()) { @@ -466,14 +466,14 @@ void QObjectWrapper::setProperty(ExecutionEngine *engine, QObject *object, QQmlP bindingFunction->initBindingLocation(); newBinding = QQmlBinding::create(property, value, object, callingQmlContext); - newBinding->setTarget(object, *property); + newBinding->setTarget(object, *property, nullptr); } } if (newBinding) QQmlPropertyPrivate::setBinding(newBinding); else - QQmlPropertyPrivate::removeBinding(object, property->encodedIndex()); + QQmlPropertyPrivate::removeBinding(object, QQmlPropertyIndex(property->coreIndex)); if (!newBinding && property->isVarProperty()) { // allow assignment of "special" values (null, undefined, function) to var properties @@ -648,6 +648,9 @@ void QObjectWrapper::setProperty(ExecutionEngine *engine, int propertyIndex, con void QObjectWrapper::setProperty(ExecutionEngine *engine, QObject *object, int propertyIndex, const Value &value) { + Q_ASSERT(propertyIndex < 0xffff); + Q_ASSERT(propertyIndex >= 0); + if (QQmlData::wasDeleted(object)) return; QQmlData *ddata = QQmlData::get(object, /*create*/false); |