summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativecomponent.cpp
diff options
context:
space:
mode:
authorChristopher Ham <christopher.ham@nokia.com>2011-01-28 15:57:12 +1000
committerChristopher Ham <christopher.ham@nokia.com>2011-01-28 16:01:20 +1000
commit281f449dfcb533448c0f2df955b4f5c059db7ba2 (patch)
tree6c199e8e6eae964e2f22bbcb402363effdbbebbc /src/declarative/qml/qdeclarativecomponent.cpp
parentfeabbd82912ff39b42d02ee669aefd93a81eed11 (diff)
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/declarative/qml/qdeclarativecomponent.cpp')
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index b634a7aa30..06bf3fd18f 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());
+ }
}
}