summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcontextscriptclass.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2010-02-23 08:24:31 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2010-02-23 08:24:31 (GMT)
commita948f901b196bab121cb8b5736204b4ce0c09e94 (patch)
treee87ac8e797b93203998c1bbb32c2e1120567b137 /src/declarative/qml/qmlcontextscriptclass.cpp
parentac99b3e243b331d26815b80aab97cdaf0ed06b0f (diff)
parent2e417e2a3963151a2b3a3033e6f5bb0e106d8db4 (diff)
downloadQt-a948f901b196bab121cb8b5736204b4ce0c09e94.zip
Qt-a948f901b196bab121cb8b5736204b4ce0c09e94.tar.gz
Qt-a948f901b196bab121cb8b5736204b4ce0c09e94.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/oslo-staging-2
Diffstat (limited to 'src/declarative/qml/qmlcontextscriptclass.cpp')
-rw-r--r--src/declarative/qml/qmlcontextscriptclass.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlcontextscriptclass.cpp b/src/declarative/qml/qmlcontextscriptclass.cpp
index be3bbc3..4c71903 100644
--- a/src/declarative/qml/qmlcontextscriptclass.cpp
+++ b/src/declarative/qml/qmlcontextscriptclass.cpp
@@ -44,6 +44,7 @@
#include "qmlengine_p.h"
#include "qmlcontext_p.h"
#include "qmltypenamescriptclass_p.h"
+#include "qmllistscriptclass_p.h"
#include "qmlguard_p.h"
QT_BEGIN_NAMESPACE
@@ -227,8 +228,12 @@ QmlContextScriptClass::property(Object *object, const Identifier &name)
if (lastPropertyIndex < cp->idValueCount) {
rv = ep->objectClass->newQObject(cp->idValues[lastPropertyIndex].data());
} else {
- QVariant value = cp->propertyValues.at(lastPropertyIndex);
- rv = ep->scriptValueFromVariant(value);
+ const QVariant &value = cp->propertyValues.at(lastPropertyIndex);
+ if (value.userType() == qMetaTypeId<QList<QObject*> >()) {
+ rv = ep->listClass->newList(QmlListProperty<QObject>(bindContext, (void*)lastPropertyIndex, 0, QmlContextPrivate::context_count, QmlContextPrivate::context_at), qMetaTypeId<QmlListProperty<QObject> >());
+ } else {
+ rv = ep->scriptValueFromVariant(value);
+ }
}
ep->capturedProperties <<