summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qmllistaccessor.cpp13
-rw-r--r--src/declarative/util/qmllistaccessor.h3
2 files changed, 12 insertions, 4 deletions
diff --git a/src/declarative/util/qmllistaccessor.cpp b/src/declarative/util/qmllistaccessor.cpp
index 1228952..ef21ebf 100644
--- a/src/declarative/util/qmllistaccessor.cpp
+++ b/src/declarative/util/qmllistaccessor.cpp
@@ -44,6 +44,9 @@
#include <qmlmetatype.h>
#include <QtCore/qdebug.h>
+// ### Remove me
+#include <private/qmlengine_p.h>
+
QT_BEGIN_NAMESPACE
QmlListAccessor::QmlListAccessor()
@@ -60,10 +63,12 @@ QVariant QmlListAccessor::list() const
return d;
}
-void QmlListAccessor::setList(const QVariant &v)
+void QmlListAccessor::setList(const QVariant &v, QmlEngine *engine)
{
d = v;
+ QmlEnginePrivate *enginePrivate = engine?QmlEnginePrivate::get(engine):0;
+
if (!d.isValid()) {
m_type = Invalid;
} else if (d.type() == QVariant::StringList) {
@@ -75,12 +80,14 @@ void QmlListAccessor::setList(const QVariant &v)
m_type = Integer;
} else if (d.type() != QVariant::UserType) {
m_type = Instance;
- } else if (QmlMetaType::isObject(d.userType())) {
+ } else if ((!enginePrivate && QmlMetaType::isObject(d.userType())) ||
+ (enginePrivate && enginePrivate->isObject(d.userType()))) {
QObject *data = 0;
data = *(QObject **)v.constData();
d = QVariant::fromValue(data);
m_type = Instance;
- } else if (QmlMetaType::isQmlList(d.userType())) {
+ } else if ((!enginePrivate && QmlMetaType::isQmlList(d.userType())) ||
+ (enginePrivate && enginePrivate->isQmlList(d.userType()))) {
m_type = QmlList;
} else if (QmlMetaType::isList(d.userType())) {
qDebug() << "list";
diff --git a/src/declarative/util/qmllistaccessor.h b/src/declarative/util/qmllistaccessor.h
index f0d293f..c3ff632 100644
--- a/src/declarative/util/qmllistaccessor.h
+++ b/src/declarative/util/qmllistaccessor.h
@@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
+class QmlEngine;
class Q_DECLARATIVE_EXPORT QmlListAccessor
{
public:
@@ -57,7 +58,7 @@ public:
virtual ~QmlListAccessor();
QVariant list() const;
- void setList(const QVariant &);
+ void setList(const QVariant &, QmlEngine * = 0);
bool isValid() const;