diff options
author | Christopher Ham <christopher.ham@nokia.com> | 2011-01-28 05:57:12 (GMT) |
---|---|---|
committer | Christopher Ham <christopher.ham@nokia.com> | 2011-01-28 06:01:20 (GMT) |
commit | 281f449dfcb533448c0f2df955b4f5c059db7ba2 (patch) | |
tree | 6c199e8e6eae964e2f22bbcb402363effdbbebbc /src | |
parent | feabbd82912ff39b42d02ee669aefd93a81eed11 (diff) | |
download | Qt-281f449dfcb533448c0f2df955b4f5c059db7ba2.zip Qt-281f449dfcb533448c0f2df955b4f5c059db7ba2.tar.gz Qt-281f449dfcb533448c0f2df955b4f5c059db7ba2.tar.bz2 |
Adding support for group properties in Component::CreateObject()
The QScriptValue overload for Component::CreateObject() should be able
to set group properties. This change also allows for property
binding from Javascript to continue to function.
Task-number: QTBUG-13087
Reviewed-by: Bea Lam
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qdeclarativecomponent.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index b634a7a..06bf3fd 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -715,7 +715,11 @@ QScriptValue QDeclarativeComponentPrivate::createObject(QObject *publicParent, c QScriptValueIterator it(valuemap); while (it.hasNext()) { it.next(); - newObject.setProperty(it.name(), it.value(), QScriptValue::KeepExistingFlags); + if (it.value().isFunction()) { // To allow property binding from javascript to work + newObject.setProperty(it.name(), it.value()); + } else { + QDeclarativeProperty::write(ret,it.name(),it.value().toVariant()); + } } } |