summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlcontextscriptclass.cpp
diff options
context:
space:
mode:
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 <<