diff options
author | Chris Adams <christopher.adams@nokia.com> | 2011-09-30 11:14:10 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-06 05:29:00 +0200 |
commit | 752cd2aca42f6625f1cfc364937e0d39828cf954 (patch) | |
tree | dcb8891d7ff0d99d7bcbf948ed6339c4cce6b257 /src/declarative/qml/v8/qv8qobjectwrapper.cpp | |
parent | 6bd1704c42f564980677682e1d47e91129d94e5c (diff) |
Add JavaScript "var" property type to QML
This commit adds a new syntax which allows "var" type properties
which can have JavaScript objects (as well as other basic types)
assigned to them. Such JavaScript objects cannot be bound to.
Task-number: QMLNG-18
Change-Id: If7f5045f4669e0d5c1b8d0891ed765128d0bc1c6
Reviewed-on: http://codereview.qt-project.org/1466
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src/declarative/qml/v8/qv8qobjectwrapper.cpp')
-rw-r--r-- | src/declarative/qml/v8/qv8qobjectwrapper.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/declarative/qml/v8/qv8qobjectwrapper.cpp b/src/declarative/qml/v8/qv8qobjectwrapper.cpp index 9481bb54fe..0c0481f1fc 100644 --- a/src/declarative/qml/v8/qv8qobjectwrapper.cpp +++ b/src/declarative/qml/v8/qv8qobjectwrapper.cpp @@ -522,6 +522,9 @@ v8::Handle<v8::Value> QV8QObjectWrapper::GetProperty(QV8Engine *engine, QObject ep->capturedProperties << CapturedProperty(object, result->coreIndex, result->notifyIndex); } + if (result->isVMEProperty()) + return static_cast<QDeclarativeVMEMetaObject *>(const_cast<QMetaObject*>(object->metaObject()))->vmeProperty(result->coreIndex); + if (result->isDirect()) { return LoadPropertyDirect(engine, object, *result); } else { @@ -589,6 +592,8 @@ static inline void StoreProperty(QV8Engine *engine, QObject *object, QDeclarativ PROPERTY_STORE(double, double(value->ToNumber()->Value())); } else if (property->propType == QMetaType::QString && value->IsString()) { PROPERTY_STORE(QString, engine->toString(value->ToString())); + } else if (property->isVMEProperty()) { + static_cast<QDeclarativeVMEMetaObject *>(const_cast<QMetaObject *>(object->metaObject()))->setVMEProperty(property->coreIndex, value); } else { QVariant v; if (property->isQList()) |