summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/qml/qmlengine.cpp10
-rw-r--r--src/declarative/qml/qmlengine_p.h1
-rw-r--r--src/declarative/qml/qmlpropertycache.cpp7
-rw-r--r--src/declarative/qml/qmlpropertycache_p.h2
4 files changed, 16 insertions, 4 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index 6b66095..f541631 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -1527,6 +1527,16 @@ int QmlEnginePrivate::qmlListType(int t) const
return QmlMetaType::qmlListType(t);
}
+QmlMetaType::TypeCategory QmlEnginePrivate::typeCategory(int t) const
+{
+ if (m_compositeTypes.contains(t))
+ return QmlMetaType::Object;
+ else if (m_qmlLists.contains(t))
+ return QmlMetaType::QmlList;
+ else
+ return QmlMetaType::typeCategory(t);
+}
+
const QMetaObject *QmlEnginePrivate::rawMetaObjectForType(int t) const
{
QHash<int, QmlCompiledData*>::ConstIterator iter = m_compositeTypes.find(t);
diff --git a/src/declarative/qml/qmlengine_p.h b/src/declarative/qml/qmlengine_p.h
index c3db6cf..96297ea 100644
--- a/src/declarative/qml/qmlengine_p.h
+++ b/src/declarative/qml/qmlengine_p.h
@@ -263,6 +263,7 @@ public:
bool isQmlList(int) const;
bool isObject(int);
int qmlListType(int) const;
+ QmlMetaType::TypeCategory typeCategory(int) const;
const QMetaObject *rawMetaObjectForType(int) const;
const QMetaObject *metaObjectForType(int) const;
QHash<int, int> m_qmlLists;
diff --git a/src/declarative/qml/qmlpropertycache.cpp b/src/declarative/qml/qmlpropertycache.cpp
index 6ba6028..bc7d7de 100644
--- a/src/declarative/qml/qmlpropertycache.cpp
+++ b/src/declarative/qml/qmlpropertycache.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_METATYPE(QScriptValue);
-void QmlPropertyCache::Data::load(const QMetaProperty &p)
+void QmlPropertyCache::Data::load(const QMetaProperty &p, QmlEngine *engine)
{
propType = p.userType();
if (QVariant::Type(propType) == QVariant::LastType)
@@ -69,7 +69,8 @@ void QmlPropertyCache::Data::load(const QMetaProperty &p)
} else if (p.isEnumType()) {
flags |= Data::IsEnumType;
} else {
- QmlMetaType::TypeCategory cat = QmlMetaType::typeCategory(propType);
+ QmlMetaType::TypeCategory cat = engine ? QmlEnginePrivate::get(engine)->typeCategory(propType)
+ : QmlMetaType::typeCategory(propType);
if (cat == QmlMetaType::Object)
flags |= Data::IsQObjectDerived;
else if (cat == QmlMetaType::List)
@@ -174,7 +175,7 @@ void QmlPropertyCache::update(QmlEngine *engine, const QMetaObject *metaObject)
RData *data = new RData;
data->identifier = enginePriv->objectClass->createPersistentIdentifier(propName);
- data->load(p);
+ data->load(p, engine);
indexCache[ii] = data;
diff --git a/src/declarative/qml/qmlpropertycache_p.h b/src/declarative/qml/qmlpropertycache_p.h
index 613f4dd..50b4cf2 100644
--- a/src/declarative/qml/qmlpropertycache_p.h
+++ b/src/declarative/qml/qmlpropertycache_p.h
@@ -97,7 +97,7 @@ public:
int coreIndex;
int notifyIndex;
- void load(const QMetaProperty &);
+ void load(const QMetaProperty &, QmlEngine *engine = 0);
void load(const QMetaMethod &);
QString name(QObject *);
QString name(const QMetaObject *);