summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-02-24 07:03:42 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-02-24 07:04:27 (GMT)
commit7eb5fc91a30a360507a65c19b6a3b96f757c2c4e (patch)
tree390b0010e1f7be48aeb8cf143d6ec1aaa1a80b7d
parent40256d682e1a552c9566a744a66cc6fe008b578b (diff)
downloadQt-7eb5fc91a30a360507a65c19b6a3b96f757c2c4e.zip
Qt-7eb5fc91a30a360507a65c19b6a3b96f757c2c4e.tar.gz
Qt-7eb5fc91a30a360507a65c19b6a3b96f757c2c4e.tar.bz2
Simplify QML element registration headers
-rw-r--r--src/declarative/qml/qdeclarative.h212
-rw-r--r--src/declarative/qml/qdeclarativebinding_p.h1
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp12
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h1
-rw-r--r--src/declarative/qml/qdeclarativeguard_p.h1
-rw-r--r--src/declarative/qml/qdeclarativelist.h6
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp127
-rw-r--r--src/declarative/qml/qdeclarativemetatype.h147
-rw-r--r--src/declarative/qml/qdeclarativeparser_p.h6
-rw-r--r--src/declarative/qml/qdeclarativeprivate.cpp48
-rw-r--r--src/declarative/qml/qdeclarativeprivate.h68
-rw-r--r--src/declarative/qml/qml.pri1
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp1
-rw-r--r--src/declarative/util/qdeclarativebind.cpp1
-rw-r--r--src/declarative/util/qdeclarativeconnection.cpp1
-rw-r--r--src/declarative/util/qdeclarativefontloader.cpp1
-rw-r--r--src/declarative/util/qdeclarativefontloader_p.h1
-rw-r--r--src/declarative/util/qdeclarativestate_p.h2
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel.cpp1
-rw-r--r--src/declarative/util/qdeclarativexmllistmodel_p.h2
-rw-r--r--src/declarative/util/qnumberformat.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/testtypes.h1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/testtypes.h1
-rw-r--r--tools/qml/qdeclarativefolderlistmodel.h2
-rw-r--r--tools/qml/qfxtester.h2
28 files changed, 335 insertions, 315 deletions
diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h
index ee5a27a..3133d27 100644
--- a/src/declarative/qml/qdeclarative.h
+++ b/src/declarative/qml/qdeclarative.h
@@ -39,18 +39,16 @@
**
****************************************************************************/
-#ifndef QML_H
-#define QML_H
+#ifndef QDECLARATIVE_H
+#define QDECLARATIVE_H
-#include "qdeclarativemetatype.h"
-#include "qdeclarativemetaproperty.h"
+#include "qdeclarativeprivate.h"
#include "qdeclarativeparserstatus.h"
#include "qdeclarativepropertyvaluesource.h"
+#include "qdeclarativepropertyvalueinterceptor.h"
#include "qdeclarativelist.h"
#include <QtCore/qbytearray.h>
-#include <QtCore/qstringlist.h>
-#include <QtCore/qurl.h>
#include <QtCore/qmetaobject.h>
QT_BEGIN_HEADER
@@ -88,6 +86,195 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
+template<typename T>
+int qmlRegisterType(const char *typeName)
+{
+ QByteArray name(typeName);
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ 0,
+
+ 0, 0, 0, 0, &T::staticMetaObject,
+
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ 0, 0,
+
+ 0
+ };
+
+ return QDeclarativePrivate::registerType(type);
+}
+
+template<typename T>
+int qmlRegisterType(const char *uri, int versionMajor, int versionMinor, const char *qmlName, const char *typeName)
+{
+ QByteArray name(typeName);
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ QDeclarativePrivate::create<T>,
+
+ uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
+
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ 0, 0,
+
+ 0
+ };
+
+ return QDeclarativePrivate::registerType(type);
+}
+
+template<typename T, typename E>
+int qmlRegisterExtendedType(const char *typeName)
+{
+ QByteArray name(typeName);
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ 0,
+
+ 0, 0, 0, 0, &T::staticMetaObject,
+
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ QDeclarativePrivate::createParent<E>, &E::staticMetaObject,
+
+ 0
+ };
+
+ return QDeclarativePrivate::registerType(type);
+}
+
+template<typename T, typename E>
+int qmlRegisterExtendedType(const char *uri, int versionMajor, int versionMinor,
+ const char *qmlName, const char *typeName)
+{
+ QByteArray name(typeName);
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativeAttachedPropertiesFunc attached = QDeclarativePrivate::attachedPropertiesFunc<E>();
+ const QMetaObject * attachedMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<E>();
+ if (!attached) {
+ attached = QDeclarativePrivate::attachedPropertiesFunc<T>();
+ attachedMetaObject = QDeclarativePrivate::attachedPropertiesMetaObject<T>();
+ }
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ QDeclarativePrivate::create<T>,
+
+ uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
+
+ attached,
+ attachedMetaObject,
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ QDeclarativePrivate::createParent<E>, &E::staticMetaObject,
+
+ 0
+ };
+
+ return QDeclarativePrivate::registerType(type);
+}
+
+template<typename T>
+int qmlRegisterInterface(const char *typeName)
+{
+ QByteArray name(typeName);
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterInterface interface = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+
+ qobject_interface_iid<T *>()
+ };
+
+ return QDeclarativePrivate::registerType(interface);
+}
+
+template<typename T>
+int qmlRegisterCustomType(const char *uri, int versionMajor, int versionMinor,
+ const char *qmlName, const char *typeName, QDeclarativeCustomParser *parser)
+{
+ QByteArray name(typeName);
+
+ QByteArray pointerName(name + '*');
+ QByteArray listName("QDeclarativeListProperty<" + name + ">");
+
+ QDeclarativePrivate::RegisterType type = {
+ 0,
+
+ qRegisterMetaType<T *>(pointerName.constData()),
+ qRegisterMetaType<QDeclarativeListProperty<T> >(listName.constData()),
+ QDeclarativePrivate::create<T>,
+
+ uri, versionMajor, versionMinor, qmlName, &T::staticMetaObject,
+
+ QDeclarativePrivate::attachedPropertiesFunc<T>(),
+ QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
+
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
+ QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
+
+ 0, 0,
+
+ parser
+ };
+
+ return QDeclarativePrivate::registerType(type);
+}
+
#define QML_REGISTER_INTERFACE(INTERFACE) \
qmlRegisterInterface<INTERFACE>(#INTERFACE)
@@ -106,20 +293,13 @@ Q_DECLARATIVE_EXPORT void qmlExecuteDeferred(QObject *);
Q_DECLARATIVE_EXPORT QDeclarativeContext *qmlContext(const QObject *);
Q_DECLARATIVE_EXPORT QDeclarativeEngine *qmlEngine(const QObject *);
Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObjectById(int, const QObject *, bool create = true);
+Q_DECLARATIVE_EXPORT QObject *qmlAttachedPropertiesObject(int *, const QObject *, const QMetaObject *, bool create);
template<typename T>
QObject *qmlAttachedPropertiesObject(const QObject *obj, bool create = true)
{
- // ### is this threadsafe?
static int idx = -1;
-
- if (idx == -1)
- idx = QDeclarativeMetaType::attachedPropertiesFuncId(&T::staticMetaObject);
-
- if (idx == -1 || !obj)
- return 0;
-
- return qmlAttachedPropertiesObjectById(idx, obj, create);
+ return qmlAttachedPropertiesObject(&idx, obj, &T::staticMetaObject, create);
}
QT_END_NAMESPACE
@@ -129,4 +309,4 @@ Q_DECLARE_METATYPE(QVariant)
QT_END_HEADER
-#endif // QML_H
+#endif // QDECLARATIVE_H
diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h
index 432bf22..7c79b8c 100644
--- a/src/declarative/qml/qdeclarativebinding_p.h
+++ b/src/declarative/qml/qdeclarativebinding_p.h
@@ -56,6 +56,7 @@
#include "qdeclarative.h"
#include "qdeclarativepropertyvaluesource.h"
#include "qdeclarativeexpression.h"
+#include "qdeclarativemetaproperty.h"
#include <QtCore/QObject>
#include <QtCore/QMetaProperty>
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index 4575536..39b8a22 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -721,6 +721,18 @@ QObject *qmlAttachedPropertiesObjectById(int id, const QObject *object, bool cre
return rv;
}
+QObject *qmlAttachedPropertiesObject(int *idCache, const QObject *object,
+ const QMetaObject *attachedMetaObject, bool create)
+{
+ if (*idCache == -1)
+ *idCache = QDeclarativeMetaType::attachedPropertiesFuncId(attachedMetaObject);
+
+ if (*idCache == -1 || !object)
+ return 0;
+
+ return qmlAttachedPropertiesObjectById(*idCache, object, create);
+}
+
void QDeclarativeDeclarativeData::destroyed(QObject *object)
{
if (deferredComponent)
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index 7c9d833..1a858d4 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -67,6 +67,7 @@
#include "qdeclarativeobjectscriptclass_p.h"
#include "qdeclarativecontextscriptclass_p.h"
#include "qdeclarativevaluetypescriptclass_p.h"
+#include "qdeclarativemetatype.h"
#include <QtScript/QScriptClass>
#include <QtScript/QScriptValue>
diff --git a/src/declarative/qml/qdeclarativeguard_p.h b/src/declarative/qml/qdeclarativeguard_p.h
index 9d82d01..0861e9a 100644
--- a/src/declarative/qml/qdeclarativeguard_p.h
+++ b/src/declarative/qml/qdeclarativeguard_p.h
@@ -54,6 +54,7 @@
//
#include <QtCore/qglobal.h>
+#include <QtCore/qvariant.h>
QT_BEGIN_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativelist.h b/src/declarative/qml/qdeclarativelist.h
index fb877b4..8d59384 100644
--- a/src/declarative/qml/qdeclarativelist.h
+++ b/src/declarative/qml/qdeclarativelist.h
@@ -42,7 +42,9 @@
#ifndef QDECLARATIVELIST_H
#define QDECLARATIVELIST_H
-#include "qdeclarativeprivate.h"
+#include <QtCore/qglobal.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qvariant.h>
QT_BEGIN_HEADER
@@ -50,6 +52,8 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
+class QObject;
+class QMetaObject;
template<typename T>
struct QDeclarativeListProperty {
typedef void (*AppendFunction)(QDeclarativeListProperty<T> *, T*);
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index 8f78843..7ae5a83 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -131,7 +131,7 @@ public:
int m_parserStatusCast;
int m_propertyValueSourceCast;
int m_propertyValueInterceptorCast;
- QDeclarativePrivate::CreateFunc m_extFunc;
+ QObject *(*m_extFunc)(QObject *);
const QMetaObject *m_extMetaObject;
int m_index;
QDeclarativeCustomParser *m_customParser;
@@ -148,13 +148,13 @@ QDeclarativeTypePrivate::QDeclarativeTypePrivate()
}
-QDeclarativeType::QDeclarativeType(int type, int listType, const char *iid, int index)
+QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::RegisterInterface &interface)
: d(new QDeclarativeTypePrivate)
{
d->m_isInterface = true;
- d->m_iid = iid;
- d->m_typeId = type;
- d->m_listId = listType;
+ d->m_iid = interface.iid;
+ d->m_typeId = interface.typeId;
+ d->m_listId = interface.listId;
d->m_newFunc = 0;
d->m_index = index;
d->m_isSetup = true;
@@ -162,36 +162,31 @@ QDeclarativeType::QDeclarativeType(int type, int listType, const char *iid, int
d->m_version_min = 0;
}
-QDeclarativeType::QDeclarativeType(int type, int listType,
- QObject *(*newFunc)(), const char *qmlName,
- int version_maj, int version_min,
- const QMetaObject *metaObject,
- QDeclarativeAttachedPropertiesFunc attachedPropertiesFunc,
- const QMetaObject *attachedType,
- int parserStatusCast, int propertyValueSourceCast, int propertyValueInterceptorCast,
- QDeclarativePrivate::CreateFunc extFunc,
- const QMetaObject *extMetaObject, int index,
- QDeclarativeCustomParser *customParser)
+QDeclarativeType::QDeclarativeType(int index, const QDeclarativePrivate::RegisterType &type)
: d(new QDeclarativeTypePrivate)
{
- d->m_name = qmlName;
- d->m_version_maj = version_maj;
- d->m_version_min = version_min;
- d->m_typeId = type;
- d->m_listId = listType;
- d->m_newFunc = newFunc;
- d->m_baseMetaObject = metaObject;
- d->m_attachedPropertiesFunc = attachedPropertiesFunc;
- d->m_attachedPropertiesType = attachedType;
- d->m_parserStatusCast = parserStatusCast;
- d->m_propertyValueSourceCast = propertyValueSourceCast;
- d->m_propertyValueInterceptorCast = propertyValueInterceptorCast;
- d->m_extFunc = extFunc;
+ QByteArray name = type.uri;
+ if (type.uri) name += '/';
+ name += type.elementName;
+
+ d->m_name = name;
+ d->m_version_maj = type.versionMajor;
+ d->m_version_min = type.versionMinor;
+ d->m_typeId = type.typeId;
+ d->m_listId = type.listId;
+ d->m_newFunc = type.create;
+ d->m_baseMetaObject = type.metaObject;
+ d->m_attachedPropertiesFunc = type.attachedPropertiesFunction;
+ d->m_attachedPropertiesType = type.attachedPropertiesMetaObject;
+ d->m_parserStatusCast = type.parserStatusCast;
+ d->m_propertyValueSourceCast = type.valueSourceCast;
+ d->m_propertyValueInterceptorCast = type.valueInterceptorCast;
+ d->m_extFunc = type.extensionObjectCreate;
d->m_index = index;
- d->m_customParser = customParser;
+ d->m_customParser = type.customParser;
- if (extMetaObject)
- d->m_extMetaObject = extMetaObject;
+ if (type.extensionMetaObject)
+ d->m_extMetaObject = type.extensionMetaObject;
}
QDeclarativeType::~QDeclarativeType()
@@ -357,15 +352,19 @@ int QDeclarativeType::index() const
return d->m_index;
}
-int QDeclarativeMetaType::registerInterface(const QDeclarativePrivate::MetaTypeIds &id,
- const char *iid)
+int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterface &interface)
{
+ if (interface.version > 0) {
+ qWarning("Cannot mix incompatible QML versions.");
+ return -1;
+ }
+
QWriteLocker lock(metaTypeDataLock());
QDeclarativeMetaTypeData *data = metaTypeData();
int index = data->types.count();
- QDeclarativeType *type = new QDeclarativeType(id.typeId, id.listId, iid, index);
+ QDeclarativeType *type = new QDeclarativeType(index, interface);
data->types.append(type);
data->idToType.insert(type->typeId(), type);
@@ -374,27 +373,22 @@ int QDeclarativeMetaType::registerInterface(const QDeclarativePrivate::MetaTypeI
if (!type->qmlTypeName().isEmpty())
data->nameToType.insert(type->qmlTypeName(), type);
- if (data->interfaces.size() <= id.typeId)
- data->interfaces.resize(id.typeId + 16);
- if (data->lists.size() <= id.listId)
- data->lists.resize(id.listId + 16);
- data->interfaces.setBit(id.typeId, true);
- data->lists.setBit(id.listId, true);
+ if (data->interfaces.size() <= interface.typeId)
+ data->interfaces.resize(interface.typeId + 16);
+ if (data->lists.size() <= interface.listId)
+ data->lists.resize(interface.listId + 16);
+ data->interfaces.setBit(interface.typeId, true);
+ data->lists.setBit(interface.listId, true);
return index;
}
-int QDeclarativeMetaType::registerType(const QDeclarativePrivate::MetaTypeIds &id, QObject *(*func)(),
- const char *uri, int version_maj, int version_min, const char *cname,
- const QMetaObject *mo, QDeclarativeAttachedPropertiesFunc attach, const QMetaObject *attachMo,
- int pStatus, int object, int valueSource, int valueInterceptor, QDeclarativePrivate::CreateFunc extFunc, const QMetaObject *extmo, QDeclarativeCustomParser *parser)
+int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &type)
{
- Q_UNUSED(object);
-
- if (cname) {
- for (int ii = 0; cname[ii]; ++ii) {
- if (!isalnum(cname[ii])) {
- qWarning("QDeclarativeMetaType: Invalid QML name %s", cname);
+ if (type.elementName) {
+ for (int ii = 0; type.elementName[ii]; ++ii) {
+ if (!isalnum(type.elementName[ii])) {
+ qWarning("QDeclarativeMetaType: Invalid QML element name %s", type.elementName);
return -1;
}
}
@@ -404,30 +398,23 @@ int QDeclarativeMetaType::registerType(const QDeclarativePrivate::MetaTypeIds &i
QDeclarativeMetaTypeData *data = metaTypeData();
int index = data->types.count();
- QByteArray name = uri;
- if (uri)
- name += '/';
- name += cname;
+ QDeclarativeType *dtype = new QDeclarativeType(index, type);
- QDeclarativeType *type = new QDeclarativeType(id.typeId, id.listId,
- func, name, version_maj, version_min, mo, attach, attachMo, pStatus,
- valueSource, valueInterceptor, extFunc, extmo, index, parser);
+ data->types.append(dtype);
+ data->idToType.insert(dtype->typeId(), dtype);
+ data->idToType.insert(dtype->qListTypeId(), dtype);
- data->types.append(type);
- data->idToType.insert(type->typeId(), type);
- data->idToType.insert(type->qListTypeId(), type);
-
- if (!type->qmlTypeName().isEmpty())
- data->nameToType.insertMulti(type->qmlTypeName(), type);
+ if (!dtype->qmlTypeName().isEmpty())
+ data->nameToType.insertMulti(dtype->qmlTypeName(), dtype);
- data->metaObjectToType.insert(type->baseMetaObject(), type);
+ data->metaObjectToType.insert(dtype->baseMetaObject(), dtype);
- if (data->objects.size() <= id.typeId)
- data->objects.resize(id.typeId + 16);
- if (data->lists.size() <= id.listId)
- data->lists.resize(id.listId + 16);
- data->objects.setBit(id.typeId, true);
- data->lists.setBit(id.listId, true);
+ if (data->objects.size() <= type.typeId)
+ data->objects.resize(type.typeId + 16);
+ if (data->lists.size() <= type.listId)
+ data->lists.resize(type.listId + 16);
+ data->objects.setBit(type.typeId, true);
+ data->lists.setBit(type.listId, true);
return index;
}
diff --git a/src/declarative/qml/qdeclarativemetatype.h b/src/declarative/qml/qdeclarativemetatype.h
index 0634939..4cddf1c 100644
--- a/src/declarative/qml/qdeclarativemetatype.h
+++ b/src/declarative/qml/qdeclarativemetatype.h
@@ -43,10 +43,6 @@
#define QDECLARATIVEMETATYPE_H
#include "qdeclarativeprivate.h"
-#include "qdeclarativeparserstatus.h"
-#include "qdeclarativepropertyvaluesource.h"
-#include "qdeclarativepropertyvalueinterceptor.h"
-#include "qdeclarativelist.h"
#include <QtCore/qglobal.h>
#include <QtCore/qvariant.h>
@@ -63,9 +59,6 @@ class QDeclarativeCustomParser;
class Q_DECLARATIVE_EXPORT QDeclarativeMetaType
{
public:
- static int registerType(const QDeclarativePrivate::MetaTypeIds &, QObject *(*)(), const char *, int vmaj, int vmin, const char *qmlName, const QMetaObject *, QDeclarativeAttachedPropertiesFunc, const QMetaObject *, int pStatus, int object, int valueSource, int valueInterceptor, QDeclarativePrivate::CreateFunc extFunc, const QMetaObject *extmo, QDeclarativeCustomParser *);
- static int registerInterface(const QDeclarativePrivate::MetaTypeIds &, const char *);
-
static bool copy(int type, void *data, const void *copy = 0);
static QList<QByteArray> qmlTypeNames();
@@ -132,147 +125,17 @@ public:
int index() const;
private:
- friend class QDeclarativeMetaType;
friend class QDeclarativeTypePrivate;
- friend struct QDeclarativeMetaTypeData;
- QDeclarativeType(int, int, const char *, int);
- QDeclarativeType(int, int, QObject *(*)(), const char *, int, int, const QMetaObject *, QDeclarativeAttachedPropertiesFunc, const QMetaObject *, int, int, int, QDeclarativePrivate::CreateFunc, const QMetaObject *, int, QDeclarativeCustomParser *);
+ friend class QDeclarativeMetaTypeData;
+ friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterInterface &);
+ friend int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &);
+ QDeclarativeType(int, const QDeclarativePrivate::RegisterInterface &);
+ QDeclarativeType(int, const QDeclarativePrivate::RegisterType &);
~QDeclarativeType();
QDeclarativeTypePrivate *d;
};
-template<typename T>
-int qmlRegisterType(const char *typeName)
-{
- QByteArray name(typeName);
- QDeclarativePrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
- };
-
- return QDeclarativeMetaType::registerType(ids, 0, 0, 0, 0, 0,
- &T::staticMetaObject,
- QDeclarativePrivate::attachedPropertiesFunc<T>(),
- QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QObject>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
- 0, 0, 0);
-}
-
-template<typename T>
-int qmlRegisterType(const char *uri, int version_maj, int version_min, const char *qmlName, const char *typeName)
-{
- QByteArray name(typeName);
- QDeclarativePrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
- };
-
- return QDeclarativeMetaType::registerType(ids, QDeclarativePrivate::create<T>,
- uri, version_maj, version_min, qmlName,
- &T::staticMetaObject,
- QDeclarativePrivate::attachedPropertiesFunc<T>(),
- QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QObject>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
- 0, 0, 0);
-}
-
-template<typename T, typename E>
-int qmlRegisterExtendedType(const char *typeName)
-{
- QByteArray name(typeName);
- QDeclarativePrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
- };
-
- QDeclarativeAttachedPropertiesFunc attached =
- QDeclarativePrivate::attachedPropertiesFunc<E>();
- const QMetaObject * attachedMo =
- QDeclarativePrivate::attachedPropertiesMetaObject<E>();
- if (!attached) {
- attached = QDeclarativePrivate::attachedPropertiesFunc<T>();
- attachedMo = QDeclarativePrivate::attachedPropertiesMetaObject<T>();
- }
-
- return QDeclarativeMetaType::registerType(ids, 0, 0, 0, 0, 0,
- &T::staticMetaObject, attached, attachedMo,
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QObject>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
- &QDeclarativePrivate::CreateParent<E>::create, &E::staticMetaObject, 0);
-}
-
-template<typename T, typename E>
-int qmlRegisterExtendedType(const char *uri, int version_maj, int version_min, const char *qmlName, const char *typeName)
-{
- QByteArray name(typeName);
- QDeclarativePrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
- };
-
- QDeclarativeAttachedPropertiesFunc attached =
- QDeclarativePrivate::attachedPropertiesFunc<E>();
- const QMetaObject * attachedMo =
- QDeclarativePrivate::attachedPropertiesMetaObject<E>();
- if (!attached) {
- attached = QDeclarativePrivate::attachedPropertiesFunc<T>();
- attachedMo = QDeclarativePrivate::attachedPropertiesMetaObject<T>();
- }
-
- return QDeclarativeMetaType::registerType(ids, QDeclarativePrivate::create<T>,
- uri, version_maj, version_min, qmlName,
- &T::staticMetaObject,
- attached, attachedMo,
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QObject>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
- &QDeclarativePrivate::CreateParent<E>::create,
- &E::staticMetaObject, 0);
-}
-
-template<typename T>
-int qmlRegisterInterface(const char *typeName)
-{
- QByteArray name(typeName);
- QDeclarativePrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
- };
-
- return QDeclarativeMetaType::registerInterface(ids, qobject_interface_iid<T *>());
-}
-
-template<typename T>
-int qmlRegisterCustomType(const char *uri, int version_maj, int version_min, const char *qmlName, const char *typeName, QDeclarativeCustomParser *parser)
-{
- QByteArray name(typeName);
- QDeclarativePrivate::MetaTypeIds ids = {
- qRegisterMetaType<T *>(QByteArray(name + '*').constData()),
- qRegisterMetaType<QDeclarativeListProperty<T> >(QByteArray("QDeclarativeListProperty<" + name + ">").constData()),
- };
-
- return QDeclarativeMetaType::registerType(ids, QDeclarativePrivate::create<T>,
- uri, version_maj, version_min, qmlName,
- &T::staticMetaObject,
- QDeclarativePrivate::attachedPropertiesFunc<T>(),
- QDeclarativePrivate::attachedPropertiesMetaObject<T>(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativeParserStatus>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QObject>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueSource>::cast(),
- QDeclarativePrivate::StaticCastSelector<T,QDeclarativePropertyValueInterceptor>::cast(),
- 0, 0, parser);
-}
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/declarative/qml/qdeclarativeparser_p.h b/src/declarative/qml/qdeclarativeparser_p.h
index cfd0b87..aae507e 100644
--- a/src/declarative/qml/qdeclarativeparser_p.h
+++ b/src/declarative/qml/qdeclarativeparser_p.h
@@ -56,9 +56,11 @@
#include "qdeclarative.h"
#include "qdeclarativerefcount_p.h"
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
+#include <QtCore/qbytearray.h>
+#include <QtCore/qlist.h>
+#include <QtCore/qurl.h>
#include <QtCore/qstring.h>
+#include <QtCore/qstringlist.h>
#include <private/qobject_p.h>
diff --git a/src/declarative/qml/qdeclarativeprivate.cpp b/src/declarative/qml/qdeclarativeprivate.cpp
deleted file mode 100644
index 444fe56..0000000
--- a/src/declarative/qml/qdeclarativeprivate.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the QtDeclarative module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qdeclarativeprivate.h"
-
-QT_BEGIN_NAMESPACE
-
-QDeclarativePrivate::InstanceType::InstanceType(int) {}
-
-QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeprivate.h b/src/declarative/qml/qdeclarativeprivate.h
index c8a8c74..e8bbff4 100644
--- a/src/declarative/qml/qdeclarativeprivate.h
+++ b/src/declarative/qml/qdeclarativeprivate.h
@@ -43,10 +43,6 @@
#define QDECLARATIVEPRIVATE_H
#include <QtCore/qglobal.h>
-
-#ifndef Q_OS_WIN
-#include <stdint.h>
-#endif
#include <QtCore/qvariant.h>
QT_BEGIN_HEADER
@@ -57,9 +53,6 @@ QT_MODULE(Declarative)
typedef QObject *(*QDeclarativeAttachedPropertiesFunc)(QObject *);
-//template<typename T>
-//struct qml_hasAttached { static bool const value = false; };
-
template <typename TYPE>
class QDeclarativeTypeInfo
{
@@ -70,11 +63,15 @@ public:
};
+class QDeclarativeCustomParser;
namespace QDeclarativePrivate
{
template<typename T>
QObject *create() { return new T; }
+ template<typename T>
+ QObject *createParent(QObject *p) { return new T(p); }
+
template<class From, class To, int N>
struct StaticCastSelectorClass
{
@@ -167,41 +164,44 @@ namespace QDeclarativePrivate
return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::metaObject();
}
- struct MetaTypeIds {
+ struct RegisterType {
+ int version;
+
int typeId;
int listId;
- };
- typedef QObject *(*CreateFunc)(QObject *);
+ QObject *(*create)();
- template<typename T>
- struct CreateParent {
- static QObject *create(QObject *other) {
- return new T(other);
- }
- };
+ const char *uri;
+ int versionMajor;
+ int versionMinor;
+ const char *elementName;
+ const QMetaObject *metaObject;
- template<typename T>
- struct CreateNoParent {
- static QObject *create() {
- return new T;
- }
- };
+ QDeclarativeAttachedPropertiesFunc attachedPropertiesFunction;
+ const QMetaObject *attachedPropertiesMetaObject;
- struct Q_DECLARATIVE_EXPORT InstanceType {
- InstanceType(int);
- };
+ int parserStatusCast;
+ int valueSourceCast;
+ int valueInterceptorCast;
+
+ QObject *(*extensionObjectCreate)(QObject *);
+ const QMetaObject *extensionMetaObject;
- template<typename T, int VMAJ, int VMIN>
- struct Define {
- static InstanceType instance;
+ QDeclarativeCustomParser *customParser;
};
-
- template<typename T>
- struct ExtCreate {
- static QObject *create(QObject *other) {
- return new T(other);
- }
+
+ struct RegisterInterface {
+ int version;
+
+ int typeId;
+ int listId;
+
+ const char *iid;
};
+
+ int Q_DECLARATIVE_EXPORT registerType(const RegisterType &);
+ int Q_DECLARATIVE_EXPORT registerType(const RegisterInterface &);
+
}
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri
index 0d5fcb0..8285bb9 100644
--- a/src/declarative/qml/qml.pri
+++ b/src/declarative/qml/qml.pri
@@ -19,7 +19,6 @@ SOURCES += \
$$PWD/qdeclarativeboundsignal.cpp \
$$PWD/qdeclarativedom.cpp \
$$PWD/qdeclarativerefcount.cpp \
- $$PWD/qdeclarativeprivate.cpp \
$$PWD/qdeclarativemetatype.cpp \
$$PWD/qdeclarativestringconverters.cpp \
$$PWD/qdeclarativeclassfactory.cpp \
diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp
index 82e0d02..88b64fd 100644
--- a/src/declarative/util/qdeclarativeanimation.cpp
+++ b/src/declarative/util/qdeclarativeanimation.cpp
@@ -51,6 +51,7 @@
#include <qdeclarativeexpression.h>
#include <qdeclarativestringconverters_p.h>
#include <qdeclarativeglobal_p.h>
+#include <qdeclarativemetatype.h>
#include <qvariant.h>
#include <qcolor.h>
diff --git a/src/declarative/util/qdeclarativebind.cpp b/src/declarative/util/qdeclarativebind.cpp
index 934030c..d75e98d 100644
--- a/src/declarative/util/qdeclarativebind.cpp
+++ b/src/declarative/util/qdeclarativebind.cpp
@@ -45,6 +45,7 @@
#include <qdeclarativeengine.h>
#include <qdeclarativecontext.h>
+#include <qdeclarativemetaproperty.h>
#include <QtCore/qfile.h>
#include <QtCore/qdebug.h>
diff --git a/src/declarative/util/qdeclarativeconnection.cpp b/src/declarative/util/qdeclarativeconnection.cpp
index 89f8a77..a7cfc79 100644
--- a/src/declarative/util/qdeclarativeconnection.cpp
+++ b/src/declarative/util/qdeclarativeconnection.cpp
@@ -46,6 +46,7 @@
#include <qdeclarativecontext.h>
#include <QtCore/qdebug.h>
+#include <QtCore/qstringlist.h>
#include <private/qobject_p.h>
diff --git a/src/declarative/util/qdeclarativefontloader.cpp b/src/declarative/util/qdeclarativefontloader.cpp
index 391eadab..ac30384 100644
--- a/src/declarative/util/qdeclarativefontloader.cpp
+++ b/src/declarative/util/qdeclarativefontloader.cpp
@@ -44,6 +44,7 @@
#include <qdeclarativecontext.h>
#include <qdeclarativeengine.h>
+#include <QStringList>
#include <QUrl>
#include <QDebug>
#include <QNetworkRequest>
diff --git a/src/declarative/util/qdeclarativefontloader_p.h b/src/declarative/util/qdeclarativefontloader_p.h
index 8a9131c..14335ab 100644
--- a/src/declarative/util/qdeclarativefontloader_p.h
+++ b/src/declarative/util/qdeclarativefontloader_p.h
@@ -45,6 +45,7 @@
#include <qdeclarative.h>
#include <QtCore/qobject.h>
+#include <QtCore/qurl.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qdeclarativestate_p.h b/src/declarative/util/qdeclarativestate_p.h
index a370f18..4a62481 100644
--- a/src/declarative/util/qdeclarativestate_p.h
+++ b/src/declarative/util/qdeclarativestate_p.h
@@ -43,7 +43,7 @@
#define QDECLARATIVESTATE_H
#include <qdeclarative.h>
-
+#include <qdeclarativemetaproperty.h>
#include <QtCore/qobject.h>
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qdeclarativexmllistmodel.cpp b/src/declarative/util/qdeclarativexmllistmodel.cpp
index 63bf02b..386df46 100644
--- a/src/declarative/util/qdeclarativexmllistmodel.cpp
+++ b/src/declarative/util/qdeclarativexmllistmodel.cpp
@@ -45,6 +45,7 @@
#include <qdeclarativeengine.h>
#include <QDebug>
+#include <QStringList>
#include <QApplication>
#include <QThread>
#include <QMutex>
diff --git a/src/declarative/util/qdeclarativexmllistmodel_p.h b/src/declarative/util/qdeclarativexmllistmodel_p.h
index f23a85b..132a53c 100644
--- a/src/declarative/util/qdeclarativexmllistmodel_p.h
+++ b/src/declarative/util/qdeclarativexmllistmodel_p.h
@@ -45,6 +45,8 @@
#include <qdeclarative.h>
#include <qdeclarativeinfo.h>
+#include <QtCore/qurl.h>
+
#include "../3rdparty/qlistmodelinterface_p.h"
QT_BEGIN_HEADER
diff --git a/src/declarative/util/qnumberformat.cpp b/src/declarative/util/qnumberformat.cpp
index 2e83874..81d0b90 100644
--- a/src/declarative/util/qnumberformat.cpp
+++ b/src/declarative/util/qnumberformat.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "qnumberformat_p.h"
+#include <QtCore/qstringlist.h>
QT_BEGIN_NAMESPACE
diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
index 1a8bd11..fc1ede7 100644
--- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h
+++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
@@ -52,6 +52,7 @@
#include <QtDeclarative/qdeclarativeparserstatus.h>
#include <QtDeclarative/qdeclarativepropertyvaluesource.h>
#include <QtDeclarative/qdeclarativescriptstring.h>
+#include <QtDeclarative/qdeclarativemetaproperty.h>
QVariant myCustomVariantTypeConverter(const QString &data);
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index 9d68ba9..16af0d9 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -41,6 +41,7 @@
#include <qtest.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
+#include <QtDeclarative/qdeclarativemetatype.h>
#include <QtCore/qfile.h>
#include <QtCore/qdebug.h>
#include <QtCore/qfileinfo.h>
diff --git a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp
index 03d641d..5c6ceef 100644
--- a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp
+++ b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp
@@ -47,6 +47,7 @@
#include <QDeclarativeComponent>
#include <QtDeclarative/qdeclarative.h>
#include <QtDeclarative/qdeclarativeprivate.h>
+#include <QtDeclarative/qdeclarativemetaproperty.h>
#include <QDebug>
inline QUrl TEST_FILE(const QString &filename)
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp
index 6433791..154693c 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp
@@ -38,6 +38,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+#include <QStringList>
#include <QtDeclarative/qdeclarativeextensionplugin.h>
#include <QtDeclarative/qdeclarative.h>
#include <QDebug>
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
index c4a9187..8b80e16 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
+++ b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
@@ -52,6 +52,7 @@
#include <QFont>
#include <qdeclarative.h>
#include <QDeclarativePropertyValueSource>
+#include <QDeclarativeMetaProperty>
class MyTypeObject : public QObject
{
diff --git a/tools/qml/qdeclarativefolderlistmodel.h b/tools/qml/qdeclarativefolderlistmodel.h
index c16b44c..57b7fe5 100644
--- a/tools/qml/qdeclarativefolderlistmodel.h
+++ b/tools/qml/qdeclarativefolderlistmodel.h
@@ -43,6 +43,8 @@
#define QDECLARATIVEFOLDERLISTMODEL_H
#include <qdeclarative.h>
+#include <QStringList>
+#include <QUrl>
#include "../../src/declarative/3rdparty/qlistmodelinterface_p.h"
QT_BEGIN_NAMESPACE
diff --git a/tools/qml/qfxtester.h b/tools/qml/qfxtester.h
index 3b935d8..1a9f077 100644
--- a/tools/qml/qfxtester.h
+++ b/tools/qml/qfxtester.h
@@ -45,6 +45,8 @@
#include <QEvent>
#include <QMouseEvent>
#include <QKeyEvent>
+#include <QImage>
+#include <QUrl>
#include <qmlruntime.h>
QT_BEGIN_NAMESPACE