aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qdeclarative.h3
-rw-r--r--src/declarative/qml/qdeclarativeboundsignal_p.h4
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecontext_p.h2
-rw-r--r--src/declarative/qml/qdeclarativedata_p.h2
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp27
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h3
-rw-r--r--src/declarative/qml/qdeclarativefastproperties.cpp14
-rw-r--r--src/declarative/qml/qdeclarativefastproperties_p.h11
-rw-r--r--src/declarative/qml/qdeclarativeimport.cpp103
-rw-r--r--src/declarative/qml/qdeclarativemetatype.cpp66
-rw-r--r--src/declarative/qml/qdeclarativemetatype_p.h1
-rw-r--r--src/declarative/qml/qdeclarativenotifier_p.h2
-rw-r--r--src/declarative/qml/qdeclarativenullablevalue_p_p.h81
-rw-r--r--src/declarative/qml/qdeclarativepropertycache_p.h2
-rw-r--r--src/declarative/qml/qdeclarativevaluetype.cpp13
-rw-r--r--src/declarative/qml/qdeclarativevaluetype_p.h1
-rw-r--r--src/declarative/qml/qml.pri2
-rw-r--r--src/declarative/qml/rewriter/textwriter_p.h2
-rw-r--r--src/declarative/qml/v4/qdeclarativev4bindings.cpp16
-rw-r--r--src/declarative/qml/v4/qdeclarativev4compiler.cpp14
-rw-r--r--src/declarative/qml/v4/qdeclarativev4compiler_p.h2
-rw-r--r--src/declarative/qml/v4/qdeclarativev4compiler_p_p.h32
-rw-r--r--src/declarative/qml/v4/qdeclarativev4irbuilder.cpp4
-rw-r--r--src/declarative/qml/v8/qv8engine_p.h2
-rw-r--r--src/declarative/qml/v8/qv8qobjectwrapper_p.h2
-rw-r--r--src/declarative/qml/v8/qv8stringwrapper_p.h2
27 files changed, 273 insertions, 142 deletions
diff --git a/src/declarative/qml/qdeclarative.h b/src/declarative/qml/qdeclarative.h
index da9fc76f4a..9c434ea557 100644
--- a/src/declarative/qml/qdeclarative.h
+++ b/src/declarative/qml/qdeclarative.h
@@ -410,6 +410,9 @@ QObject *qmlAttachedPropertiesObject(const QObject *obj, bool create = true)
return qmlAttachedPropertiesObject(&idx, obj, &T::staticMetaObject, create);
}
+// For the use of QtQuick1 module
+Q_DECLARATIVE_EXPORT void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor);
+
/*!
This function may be used to register a module API provider \a callback in a particular \a uri
with a version specified in \a versionMajor and \a versionMinor.
diff --git a/src/declarative/qml/qdeclarativeboundsignal_p.h b/src/declarative/qml/qdeclarativeboundsignal_p.h
index bc1cd3ba49..42852131f5 100644
--- a/src/declarative/qml/qdeclarativeboundsignal_p.h
+++ b/src/declarative/qml/qdeclarativeboundsignal_p.h
@@ -61,7 +61,7 @@
QT_BEGIN_NAMESPACE
-class QDeclarativeAbstractBoundSignal : public QObject
+class Q_DECLARATIVE_EXPORT QDeclarativeAbstractBoundSignal : public QObject
{
Q_OBJECT
public:
@@ -70,7 +70,7 @@ public:
};
class QDeclarativeBoundSignalParameters;
-class QDeclarativeBoundSignal : public QDeclarativeAbstractBoundSignal
+class Q_DECLARATIVE_EXPORT QDeclarativeBoundSignal : public QDeclarativeAbstractBoundSignal
{
public:
QDeclarativeBoundSignal(QObject *scope, const QMetaMethod &signal, QObject *parent);
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 7571704f19..d0fd3ae4f4 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -1356,7 +1356,7 @@ bool QDeclarativeCompiler::buildSubObject(QDeclarativeParser::Object *obj, const
int QDeclarativeCompiler::componentTypeRef()
{
- QDeclarativeType *t = QDeclarativeMetaType::qmlType("QtQuick/Component",1,0);
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType("QtQuick/Component",2,0);
for (int ii = output->types.count() - 1; ii >= 0; --ii) {
if (output->types.at(ii).type == t)
return ii;
diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h
index 59d886c366..bb9c2ada02 100644
--- a/src/declarative/qml/qdeclarativecontext_p.h
+++ b/src/declarative/qml/qdeclarativecontext_p.h
@@ -110,7 +110,7 @@ public:
class QDeclarativeComponentAttached;
class QDeclarativeGuardedContextData;
-class Q_AUTOTEST_EXPORT QDeclarativeContextData
+class Q_DECLARATIVE_EXPORT QDeclarativeContextData
{
public:
QDeclarativeContextData();
diff --git a/src/declarative/qml/qdeclarativedata_p.h b/src/declarative/qml/qdeclarativedata_p.h
index 65f49268e9..b7b68b20cf 100644
--- a/src/declarative/qml/qdeclarativedata_p.h
+++ b/src/declarative/qml/qdeclarativedata_p.h
@@ -72,7 +72,7 @@ class QDeclarativeDataExtended;
// default state for elemental object allocations. This is crucial in the
// workings of the QDeclarativeInstruction::CreateSimpleObject instruction.
// Don't change anything here without first considering that case!
-class Q_AUTOTEST_EXPORT QDeclarativeData : public QAbstractDeclarativeData
+class Q_DECLARATIVE_EXPORT QDeclarativeData : public QAbstractDeclarativeData
{
public:
QDeclarativeData()
diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp
index ab85b2d273..2117f063fc 100644
--- a/src/declarative/qml/qdeclarativeengine.cpp
+++ b/src/declarative/qml/qdeclarativeengine.cpp
@@ -96,7 +96,6 @@
#include <private/qobject_p.h>
-#include <private/qdeclarativeitemsmodule_p.h>
#include <private/qdeclarativeutilmodule_p.h>
#include <private/qsgitemsmodule_p.h>
#include <private/qsgparticlesmodule_p.h>
@@ -114,6 +113,13 @@ Q_DECLARE_METATYPE(QDeclarativeProperty)
QT_BEGIN_NAMESPACE
+void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor)
+{
+ QDeclarativeEnginePrivate::registerBaseTypes(uri, versionMajor, versionMinor);
+ QDeclarativeValueTypeFactory::registerBaseTypes(uri, versionMajor, versionMinor);
+ QDeclarativeUtilModule::registerBaseTypes(uri, versionMajor, versionMinor);
+}
+
/*!
\qmlclass QtObject QObject
\ingroup qml-utility-elements
@@ -178,18 +184,16 @@ struct StaticQtMetaObject : public QObject
static bool qt_QmlQtModule_registered = false;
bool QDeclarativeEnginePrivate::qml_debugging_enabled = false;
-void QDeclarativeEnginePrivate::defineModule()
+void QDeclarativeEnginePrivate::registerBaseTypes(const char *uri, int versionMajor, int versionMinor)
{
- qmlRegisterType<QDeclarativeComponent>("QtQuick",1,0,"Component");
- qmlRegisterType<QObject>("QtQuick",1,0,"QtObject");
- qmlRegisterType<QDeclarativeWorkerScript>("QtQuick",1,0,"WorkerScript");
-
-#ifndef QT_NO_IMPORT_QT47_QML
- qmlRegisterType<QDeclarativeComponent>("Qt",4,7,"Component");
- qmlRegisterType<QObject>("Qt",4,7,"QtObject");
- qmlRegisterType<QDeclarativeWorkerScript>("Qt",4,7,"WorkerScript");
-#endif
+ qmlRegisterType<QDeclarativeComponent>(uri,versionMajor,versionMinor,"Component");
+ qmlRegisterType<QObject>(uri,versionMajor,versionMinor,"QtObject");
+ qmlRegisterType<QDeclarativeWorkerScript>(uri,versionMajor,versionMinor,"WorkerScript");
+}
+void QDeclarativeEnginePrivate::defineModule()
+{
+ registerBaseTypes("QtQuick", 2, 0);
qmlRegisterType<QDeclarativeBinding>();
}
@@ -352,7 +356,6 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e)
{
if (!qt_QmlQtModule_registered) {
qt_QmlQtModule_registered = true;
- QDeclarativeItemModule::defineModule();
QDeclarativeUtilModule::defineModule();
QDeclarativeEnginePrivate::defineModule();
QSGItemsModule::defineModule();
diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h
index ba22ba95c0..538e8a05a0 100644
--- a/src/declarative/qml/qdeclarativeengine_p.h
+++ b/src/declarative/qml/qdeclarativeengine_p.h
@@ -101,7 +101,7 @@ class QDir;
class QSGTexture;
class QSGContext;
-class Q_AUTOTEST_EXPORT QDeclarativeEnginePrivate : public QObjectPrivate
+class Q_DECLARATIVE_EXPORT QDeclarativeEnginePrivate : public QObjectPrivate
{
Q_DECLARE_PUBLIC(QDeclarativeEngine)
public:
@@ -264,6 +264,7 @@ public:
static QString urlToLocalFileOrQrc(const QUrl& url);
+ static void registerBaseTypes(const char *uri, int versionMajor, int versionMinor);
static void defineModule();
static bool qml_debugging_enabled;
diff --git a/src/declarative/qml/qdeclarativefastproperties.cpp b/src/declarative/qml/qdeclarativefastproperties.cpp
index 5c447eef41..93703e2bdc 100644
--- a/src/declarative/qml/qdeclarativefastproperties.cpp
+++ b/src/declarative/qml/qdeclarativefastproperties.cpp
@@ -41,7 +41,8 @@
#include "private/qdeclarativefastproperties_p.h"
-#include <private/qdeclarativeitem_p.h>
+#include <private/qdeclarativedata_p.h>
+#include <private/qdeclarativenotifier_p.h>
QT_BEGIN_NAMESPACE
@@ -51,6 +52,13 @@ QT_BEGIN_NAMESPACE
// primarily read from bindings is a candidate for inclusion as a fast
// property.
+Q_GLOBAL_STATIC(QDeclarativeFastProperties, fastProperties)
+
+QDeclarativeFastProperties *QDeclarativeFastProperties::instance()
+{
+ return fastProperties();
+}
+
static void QObject_objectName(QObject *object, void *output, QDeclarativeNotifierEndpoint *endpoint)
{
if (endpoint)
@@ -60,8 +68,6 @@ static void QObject_objectName(QObject *object, void *output, QDeclarativeNotifi
QDeclarativeFastProperties::QDeclarativeFastProperties()
{
- add(&QDeclarativeItem::staticMetaObject, QDeclarativeItem::staticMetaObject.indexOfProperty("parent"),
- QDeclarativeItemPrivate::parentProperty);
add(&QObject::staticMetaObject, QObject::staticMetaObject.indexOfProperty("objectName"),
QObject_objectName);
}
@@ -75,6 +81,7 @@ int QDeclarativeFastProperties::accessorIndexForProperty(const QMetaObject *meta
while (metaObject->propertyOffset() > propertyIndex)
metaObject = metaObject->superClass();
+ QReadLocker lock(&m_lock);
QHash<QPair<const QMetaObject *, int>, int>::Iterator iter =
m_index.find(qMakePair(metaObject, propertyIndex));
if (iter != m_index.end())
@@ -93,6 +100,7 @@ void QDeclarativeFastProperties::add(const QMetaObject *metaObject, int property
metaObject = metaObject->superClass();
QPair<const QMetaObject *, int> data = qMakePair(metaObject, propertyIndex);
+ QWriteLocker lock(&m_lock);
int accessorIndex = m_accessors.count();
m_accessors.append(accessor);
m_index.insert(data, accessorIndex);
diff --git a/src/declarative/qml/qdeclarativefastproperties_p.h b/src/declarative/qml/qdeclarativefastproperties_p.h
index ed4975f2f8..1e09131222 100644
--- a/src/declarative/qml/qdeclarativefastproperties_p.h
+++ b/src/declarative/qml/qdeclarativefastproperties_p.h
@@ -44,6 +44,7 @@
#include <QtCore/qvector.h>
#include <QtCore/qhash.h>
+#include <QtCore/QReadWriteLock>
QT_BEGIN_HEADER
@@ -51,21 +52,23 @@ QT_BEGIN_NAMESPACE
class QObject;
class QDeclarativeNotifierEndpoint;
-class QDeclarativeFastProperties
+class Q_DECLARATIVE_EXPORT QDeclarativeFastProperties
{
public:
typedef void (*Accessor)(QObject *object, void *output, QDeclarativeNotifierEndpoint *endpoint);
-
QDeclarativeFastProperties();
- Accessor accessor(int index) const { return m_accessors.at(index); }
+ Accessor accessor(int index) const { QReadLocker lock(&m_lock); return m_accessors.at(index); }
int accessorIndexForProperty(const QMetaObject *, int);
-private:
void add(const QMetaObject *, int, Accessor);
+ static QDeclarativeFastProperties *instance();
+
+private:
QHash<QPair<const QMetaObject *, int>, int> m_index;
QVector<Accessor> m_accessors;
+ mutable QReadWriteLock m_lock;
};
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp
index 16b2fa2886..b2fa071f91 100644
--- a/src/declarative/qml/qdeclarativeimport.cpp
+++ b/src/declarative/qml/qdeclarativeimport.cpp
@@ -195,7 +195,7 @@ cacheForNamespace(QDeclarativeEngine *engine, const QDeclarativeImportedNamespac
foreach (QDeclarativeType *type, types) {
if (type->qmlTypeName().startsWith(base) &&
type->qmlTypeName().lastIndexOf('/') == (base.length() - 1) &&
- type->availableInVersion(major,minor))
+ (major < 0 || type->availableInVersion(major,minor)))
{
QString name = QString::fromUtf8(type->qmlTypeName().mid(base.length()));
@@ -295,17 +295,19 @@ bool QDeclarativeImportedNamespace::find_helper(int i, const QByteArray& type, i
int vmaj = majversions.at(i);
int vmin = minversions.at(i);
- QByteArray qt = uris.at(i).toUtf8();
- qt += '/';
- qt += type;
-
- QDeclarativeType *t = QDeclarativeMetaType::qmlType(qt,vmaj,vmin);
- if (t) {
- if (vmajor) *vmajor = vmaj;
- if (vminor) *vminor = vmin;
- if (type_return)
- *type_return = t;
- return true;
+ if (vmaj >= 0 && vmin >= 0) {
+ QByteArray qt = uris.at(i).toUtf8();
+ qt += '/';
+ qt += type;
+
+ QDeclarativeType *t = QDeclarativeMetaType::qmlType(qt,vmaj,vmin);
+ if (t) {
+ if (vmajor) *vmajor = vmaj;
+ if (vminor) *vminor = vmin;
+ if (type_return)
+ *type_return = t;
+ return true;
+ }
}
QUrl url = QUrl(urls.at(i) + QLatin1Char('/') + QString::fromUtf8(type) + QLatin1String(".qml"));
@@ -319,7 +321,7 @@ bool QDeclarativeImportedNamespace::find_helper(int i, const QByteArray& type, i
typeWasDeclaredInQmldir = true;
// importing version -1 means import ALL versions
- if ((vmaj == -1) || (c.majorVersion < vmaj || (c.majorVersion == vmaj && vmin >= c.minorVersion))) {
+ if ((vmaj == -1) || (c.majorVersion == vmaj && vmin >= c.minorVersion)) {
QUrl candidate = url.resolved(QUrl(c.fileName));
if (c.internal && base) {
if (base->resolved(QUrl(c.fileName)) != candidate)
@@ -501,53 +503,53 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
if (!s)
set.insert(prefix,(s=new QDeclarativeImportedNamespace));
}
-
QString url = uri;
bool versionFound = false;
if (importType == QDeclarativeScriptParser::Import::Library) {
+
+ Q_ASSERT(vmaj >= 0 && vmin >= 0); // Versions are always specified for libraries
+
url.replace(QLatin1Char('.'), QLatin1Char('/'));
bool found = false;
QString dir;
// step 1: search for extension with fully encoded version number
- if (vmaj >= 0 && vmin >= 0) {
- foreach (const QString &p, database->fileImportPath) {
- dir = p+QLatin1Char('/')+url;
+ foreach (const QString &p, database->fileImportPath) {
+ dir = p+QLatin1Char('/')+url;
- QFileInfo fi(dir+QString(QLatin1String(".%1.%2")).arg(vmaj).arg(vmin)+QLatin1String("/qmldir"));
- const QString absoluteFilePath = fi.absoluteFilePath();
+ QFileInfo fi(dir+QString(QLatin1String(".%1.%2")).arg(vmaj).arg(vmin)+QLatin1String("/qmldir"));
+ const QString absoluteFilePath = fi.absoluteFilePath();
- if (fi.isFile()) {
- found = true;
+ if (fi.isFile()) {
+ found = true;
- url = QUrl::fromLocalFile(fi.absolutePath()).toString();
- uri = resolvedUri(dir, database);
- if (!importExtension(absoluteFilePath, uri, database, &qmldircomponents, errors))
- return false;
- break;
- }
+ url = QUrl::fromLocalFile(fi.absolutePath()).toString();
+ uri = resolvedUri(dir, database);
+ if (!importExtension(absoluteFilePath, uri, database, &qmldircomponents, errors))
+ return false;
+ break;
}
}
+
// step 2: search for extension with encoded version major
- if (vmaj >= 0 && vmin >= 0) {
- foreach (const QString &p, database->fileImportPath) {
- dir = p+QLatin1Char('/')+url;
+ foreach (const QString &p, database->fileImportPath) {
+ dir = p+QLatin1Char('/')+url;
- QFileInfo fi(dir+QString(QLatin1String(".%1")).arg(vmaj)+QLatin1String("/qmldir"));
- const QString absoluteFilePath = fi.absoluteFilePath();
+ QFileInfo fi(dir+QString(QLatin1String(".%1")).arg(vmaj)+QLatin1String("/qmldir"));
+ const QString absoluteFilePath = fi.absoluteFilePath();
- if (fi.isFile()) {
- found = true;
+ if (fi.isFile()) {
+ found = true;
- url = QUrl::fromLocalFile(fi.absolutePath()).toString();
- uri = resolvedUri(dir, database);
- if (!importExtension(absoluteFilePath, uri, database, &qmldircomponents, errors))
- return false;
- break;
- }
+ url = QUrl::fromLocalFile(fi.absolutePath()).toString();
+ uri = resolvedUri(dir, database);
+ if (!importExtension(absoluteFilePath, uri, database, &qmldircomponents, errors))
+ return false;
+ break;
}
}
+
if (!found) {
// step 3: search for extension without version number
@@ -569,12 +571,13 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
}
}
- if (QDeclarativeMetaType::isModule(uri.toUtf8(), vmaj, vmin))
+ if (QDeclarativeMetaType::isModule(uri.toUtf8(), vmaj, vmin)) {
versionFound = true;
+ }
if (!versionFound && qmldircomponents.isEmpty()) {
if (errors) {
- bool anyversion = QDeclarativeMetaType::isModule(uri.toUtf8(), -1, -1);
+ bool anyversion = QDeclarativeMetaType::isAnyModule(uri.toUtf8());
QDeclarativeError error; // we don't set the url or line or column as these will be set by the loader.
if (anyversion)
error.setDescription(QDeclarativeImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin));
@@ -636,23 +639,15 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp
if (!versionFound && vmaj > -1 && vmin > -1 && !qmldircomponents.isEmpty()) {
QList<QDeclarativeDirParser::Component>::ConstIterator it = qmldircomponents.begin();
- int lowest_maj = INT_MAX;
int lowest_min = INT_MAX;
- int highest_maj = INT_MIN;
int highest_min = INT_MIN;
for (; it != qmldircomponents.end(); ++it) {
- if (it->majorVersion > highest_maj || (it->majorVersion == highest_maj && it->minorVersion > highest_min)) {
- highest_maj = it->majorVersion;
- highest_min = it->minorVersion;
- }
- if (it->majorVersion < lowest_maj || (it->majorVersion == lowest_maj && it->minorVersion < lowest_min)) {
- lowest_maj = it->majorVersion;
- lowest_min = it->minorVersion;
+ if (it->majorVersion == vmaj) {
+ lowest_min = qMin(lowest_min, it->minorVersion);
+ highest_min = qMax(highest_min, it->minorVersion);
}
}
- if (lowest_maj > vmaj || (lowest_maj == vmaj && lowest_min > vmin)
- || highest_maj < vmaj || (highest_maj == vmaj && highest_min < vmin))
- {
+ if (lowest_min > vmin || highest_min < vmin) {
if (errors) {
QDeclarativeError error; // we don't set the url or line or column information, as these will be set by the loader.
error.setDescription(QDeclarativeImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri_arg).arg(vmaj).arg(vmin));
diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp
index aab5f63f08..4884d1cc4a 100644
--- a/src/declarative/qml/qdeclarativemetatype.cpp
+++ b/src/declarative/qml/qdeclarativemetatype.cpp
@@ -110,13 +110,13 @@ struct QDeclarativeMetaTypeData
struct ModuleInfo {
ModuleInfo(int major, int minor)
- : vmajor_min(major), vminor_min(minor), vmajor_max(major), vminor_max(minor) {}
- ModuleInfo(int major_min, int minor_min, int major_max, int minor_max)
- : vmajor_min(major_min), vminor_min(minor_min), vmajor_max(major_max), vminor_max(minor_max) {}
- int vmajor_min, vminor_min;
- int vmajor_max, vminor_max;
+ : vmajor(major), vminor_min(minor), vminor_max(minor) {}
+ ModuleInfo(int major, int minor_min, int minor_max)
+ : vmajor(major), vminor_min(minor_min), vminor_max(minor_max) {}
+ int vmajor;
+ int vminor_min, vminor_max;
};
- typedef QHash<QByteArray, ModuleInfo> ModuleInfoHash;
+ typedef QHash<QPair<QByteArray,int>, ModuleInfo> ModuleInfoHash;
ModuleInfoHash modules;
QBitArray objects;
@@ -268,12 +268,12 @@ int QDeclarativeType::minorVersion() const
bool QDeclarativeType::availableInVersion(int vmajor, int vminor) const
{
- return vmajor > d->m_version_maj || (vmajor == d->m_version_maj && vminor >= d->m_version_min);
+ return vmajor == d->m_version_maj && vminor >= d->m_version_min;
}
bool QDeclarativeType::availableInVersion(const QByteArray &module, int vmajor, int vminor) const
{
- return module == d->m_module && (vmajor > d->m_version_maj || (vmajor == d->m_version_maj && vminor >= d->m_version_min));
+ return module == d->m_module && vmajor == d->m_version_maj && vminor >= d->m_version_min;
}
// returns the nearest _registered_ super class
@@ -662,16 +662,19 @@ int registerType(const QDeclarativePrivate::RegisterType &type)
if (type.uri) {
QByteArray mod(type.uri);
- QDeclarativeMetaTypeData::ModuleInfoHash::Iterator it = data->modules.find(mod);
+ QPair<QByteArray,int> key(mod,type.versionMajor);
+ QDeclarativeMetaTypeData::ModuleInfoHash::Iterator it = data->modules.find(key);
if (it == data->modules.end()) {
// New module
- data->modules.insert(mod, QDeclarativeMetaTypeData::ModuleInfo(type.versionMajor,type.versionMinor));
- } else if ((*it).vmajor_max < type.versionMajor || ((*it).vmajor_max == type.versionMajor && (*it).vminor_max < type.versionMinor)) {
- // Newer module
- data->modules.insert(mod, QDeclarativeMetaTypeData::ModuleInfo((*it).vmajor_min, (*it).vminor_min, type.versionMajor, type.versionMinor));
- } else if ((*it).vmajor_min > type.versionMajor || ((*it).vmajor_min == type.versionMajor && (*it).vminor_min > type.versionMinor)) {
- // Older module
- data->modules.insert(mod, QDeclarativeMetaTypeData::ModuleInfo(type.versionMajor, type.versionMinor, (*it).vmajor_min, (*it).vminor_min));
+ data->modules.insert(key, QDeclarativeMetaTypeData::ModuleInfo(type.versionMajor,type.versionMinor));
+ } else {
+ if ((*it).vminor_max < type.versionMinor) {
+ // Newer module
+ data->modules.insert(key, QDeclarativeMetaTypeData::ModuleInfo((*it).vmajor, (*it).vminor_min, type.versionMinor));
+ } else if ((*it).vminor_min > type.versionMinor) {
+ // Older module
+ data->modules.insert(key, QDeclarativeMetaTypeData::ModuleInfo((*it).vmajor, type.versionMinor, (*it).vminor_min));
+ }
}
}
@@ -724,34 +727,41 @@ int QDeclarativePrivate::qmlregister(RegistrationType type, void *data)
return -1;
}
+bool QDeclarativeMetaType::isAnyModule(const QByteArray &module)
+{
+ QDeclarativeMetaTypeData *data = metaTypeData();
+
+ QDeclarativeMetaTypeData::ModuleInfoHash::Iterator it = data->modules.begin();
+ while (it != data->modules.end()) {
+ if (it.key().first == module)
+ return true;
+ ++it;
+ }
+
+ return false;
+}
+
/*
Returns true if any type or API has been registered for the given \a module with at least
versionMajor.versionMinor, or if types have been registered for \a module with at most
versionMajor.versionMinor.
So if only 4.7 and 4.9 have been registered, 4.7,4.8, and 4.9 are valid, but not 4.6 nor 4.10.
-
- Passing -1 for both \a versionMajor \a versionMinor will return true if any version is installed.
*/
bool QDeclarativeMetaType::isModule(const QByteArray &module, int versionMajor, int versionMinor)
{
QDeclarativeMetaTypeData *data = metaTypeData();
// first, check Types
- QDeclarativeMetaTypeData::ModuleInfoHash::Iterator it = data->modules.find(module);
- if (it != data->modules.end()
- && ((versionMajor<0 && versionMinor<0) ||
- (((*it).vmajor_max > versionMajor ||
- ((*it).vmajor_max == versionMajor && (*it).vminor_max >= versionMinor))
- && ((*it).vmajor_min < versionMajor ||
- ((*it).vmajor_min == versionMajor && (*it).vminor_min <= versionMinor))))) {
- return true;
+ QDeclarativeMetaTypeData::ModuleInfoHash::Iterator it = data->modules.find(QPair<QByteArray,int>(module,versionMajor));
+ if (it != data->modules.end()) {
+ if (((*it).vminor_max >= versionMinor && (*it).vminor_min <= versionMinor))
+ return true;
}
// then, check ModuleApis
foreach (const QDeclarativeMetaType::ModuleApi &mApi, data->moduleApis.value(module).moduleApis) {
- if ((versionMajor<0 && versionMinor<0)
- || (mApi.major == versionMajor && mApi.minor == versionMinor)) {
+ if (mApi.major == versionMajor && mApi.minor == versionMinor) {
return true;
}
}
diff --git a/src/declarative/qml/qdeclarativemetatype_p.h b/src/declarative/qml/qdeclarativemetatype_p.h
index ba2d445826..cfc4f077f8 100644
--- a/src/declarative/qml/qdeclarativemetatype_p.h
+++ b/src/declarative/qml/qdeclarativemetatype_p.h
@@ -104,6 +104,7 @@ public:
static void registerCustomStringConverter(int, StringConverter);
static StringConverter customStringConverter(int);
+ static bool isAnyModule(const QByteArray &module);
static bool isModule(const QByteArray &module, int versionMajor, int versionMinor);
static QList<QDeclarativePrivate::AutoParentFunction> parentFunctions();
diff --git a/src/declarative/qml/qdeclarativenotifier_p.h b/src/declarative/qml/qdeclarativenotifier_p.h
index 5f70f7d138..0781886ea2 100644
--- a/src/declarative/qml/qdeclarativenotifier_p.h
+++ b/src/declarative/qml/qdeclarativenotifier_p.h
@@ -47,7 +47,7 @@
QT_BEGIN_NAMESPACE
class QDeclarativeNotifierEndpoint;
-class QDeclarativeNotifier
+class Q_DECLARATIVE_EXPORT QDeclarativeNotifier
{
public:
inline QDeclarativeNotifier();
diff --git a/src/declarative/qml/qdeclarativenullablevalue_p_p.h b/src/declarative/qml/qdeclarativenullablevalue_p_p.h
new file mode 100644
index 0000000000..630f39d446
--- /dev/null
+++ b/src/declarative/qml/qdeclarativenullablevalue_p_p.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 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$
+** GNU Lesser General Public License Usage
+** 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.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QDECLARATIVENULLABLEVALUE_P_H
+#define QDECLARATIVENULLABLEVALUE_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+QT_BEGIN_NAMESPACE
+
+template<typename T>
+struct QDeclarativeNullableValue
+{
+ QDeclarativeNullableValue()
+ : isNull(true), value(T()) {}
+ QDeclarativeNullableValue(const QDeclarativeNullableValue<T> &o)
+ : isNull(o.isNull), value(o.value) {}
+ QDeclarativeNullableValue(const T &t)
+ : isNull(false), value(t) {}
+ QDeclarativeNullableValue<T> &operator=(const T &t)
+ { isNull = false; value = t; return *this; }
+ QDeclarativeNullableValue<T> &operator=(const QDeclarativeNullableValue<T> &o)
+ { isNull = o.isNull; value = o.value; return *this; }
+ operator T() const { return value; }
+
+ void invalidate() { isNull = true; }
+ bool isValid() const { return !isNull; }
+ bool isNull;
+ T value;
+};
+
+QT_END_NAMESPACE
+
+#endif // QDECLARATIVENULLABLEVALUE_P_H
diff --git a/src/declarative/qml/qdeclarativepropertycache_p.h b/src/declarative/qml/qdeclarativepropertycache_p.h
index 1787e6ad14..621463dad9 100644
--- a/src/declarative/qml/qdeclarativepropertycache_p.h
+++ b/src/declarative/qml/qdeclarativepropertycache_p.h
@@ -68,7 +68,7 @@ class QMetaProperty;
class QV8Engine;
class QV8QObjectWrapper;
-class Q_AUTOTEST_EXPORT QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarativeCleanup
+class Q_DECLARATIVE_EXPORT QDeclarativePropertyCache : public QDeclarativeRefCount, public QDeclarativeCleanup
{
public:
QDeclarativePropertyCache(QDeclarativeEngine *);
diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp
index 8505caefac..7f77388516 100644
--- a/src/declarative/qml/qdeclarativevaluetype.cpp
+++ b/src/declarative/qml/qdeclarativevaluetype.cpp
@@ -97,14 +97,15 @@ bool QDeclarativeValueTypeFactory::isValueType(int idx)
return false;
}
+void QDeclarativeValueTypeFactory::registerBaseTypes(const char *uri, int versionMajor, int versionMinor)
+{
+ qmlRegisterValueTypeEnums<QDeclarativeEasingValueType>(uri, versionMajor, versionMinor, "Easing");
+ qmlRegisterValueTypeEnums<QDeclarativeFontValueType>(uri, versionMajor, versionMinor, "Font");
+}
+
void QDeclarativeValueTypeFactory::registerValueTypes()
{
- qmlRegisterValueTypeEnums<QDeclarativeEasingValueType>("QtQuick",1,0,"Easing");
- qmlRegisterValueTypeEnums<QDeclarativeFontValueType>("QtQuick",1,0,"Font");
-#ifndef QT_NO_IMPORT_QT47_QML
- qmlRegisterValueTypeEnums<QDeclarativeEasingValueType>("Qt",4,7,"Easing");
- qmlRegisterValueTypeEnums<QDeclarativeFontValueType>("Qt",4,7,"Font");
-#endif
+ registerBaseTypes("QtQuick", 2, 0);
}
QDeclarativeValueType *QDeclarativeValueTypeFactory::valueType(int t)
diff --git a/src/declarative/qml/qdeclarativevaluetype_p.h b/src/declarative/qml/qdeclarativevaluetype_p.h
index 73fa6ca54e..5d103a46de 100644
--- a/src/declarative/qml/qdeclarativevaluetype_p.h
+++ b/src/declarative/qml/qdeclarativevaluetype_p.h
@@ -89,6 +89,7 @@ public:
static bool isValueType(int);
static QDeclarativeValueType *valueType(int);
+ static void registerBaseTypes(const char *uri, int versionMajor, int versionMinor);
static void registerValueTypes();
QDeclarativeValueType *operator[](int idx) const {
diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri
index 7325cd8340..3e63a9c88f 100644
--- a/src/declarative/qml/qml.pri
+++ b/src/declarative/qml/qml.pri
@@ -112,6 +112,8 @@ HEADERS += \
$$PWD/qdeclarativeextensioninterface.h \
$$PWD/qdeclarativeimport_p.h \
$$PWD/qdeclarativeextensionplugin.h \
+ $$PWD/qperformancetimer_p.h \
+ $$PWD/qdeclarativenullablevalue_p_p.h \
$$PWD/qintrusivelist_p.h \
$$PWD/qdeclarativescriptstring_p.h
diff --git a/src/declarative/qml/rewriter/textwriter_p.h b/src/declarative/qml/rewriter/textwriter_p.h
index 719297f701..1f94591c30 100644
--- a/src/declarative/qml/rewriter/textwriter_p.h
+++ b/src/declarative/qml/rewriter/textwriter_p.h
@@ -42,7 +42,7 @@
#ifndef TEXTWRITER_H
#define TEXTWRITER_H
-#include <qdeclarativejsglobal_p.h>
+#include <private/qdeclarativejsglobal_p.h>
#include <QtCore/QString>
#include <QtCore/QList>
diff --git a/src/declarative/qml/v4/qdeclarativev4bindings.cpp b/src/declarative/qml/v4/qdeclarativev4bindings.cpp
index c81f59b0bc..9209e93e4f 100644
--- a/src/declarative/qml/v4/qdeclarativev4bindings.cpp
+++ b/src/declarative/qml/v4/qdeclarativev4bindings.cpp
@@ -44,10 +44,10 @@
#include "private/qdeclarativev4bindings_p.h"
#include "private/qdeclarativev4program_p.h"
#include "private/qdeclarativev4compiler_p.h"
+#include "private/qdeclarativev4compiler_p_p.h"
#include <private/qdeclarativefastproperties_p.h>
#include <private/qdeclarativedebugtrace_p.h>
-#include <private/qdeclarativeanchors_p_p.h> // For AnchorLine
#include <private/qsganchors_p_p.h> // For AnchorLine
#include <QtDeclarative/qdeclarativeinfo.h>
@@ -534,10 +534,10 @@ static bool testCompareVariants(const QVariant &qtscriptRaw, const QVariant &v4)
}
int type = qtscript.userType();
-
- if (type == qMetaTypeId<QDeclarativeAnchorLine>()) {
- QDeclarativeAnchorLine la = qvariant_cast<QDeclarativeAnchorLine>(qtscript);
- QDeclarativeAnchorLine ra = qvariant_cast<QDeclarativeAnchorLine>(v4);
+
+ if (type == qMetaTypeId<QDeclarative1AnchorLine>()) {
+ QDeclarative1AnchorLine la = qvariant_cast<QDeclarative1AnchorLine>(qtscript);
+ QDeclarative1AnchorLine ra = qvariant_cast<QDeclarative1AnchorLine>(v4);
return la == ra;
} else if (type == qMetaTypeId<QSGAnchorLine>()) {
@@ -623,8 +623,8 @@ static void testBindingResult(const QString &binding, int line, int column,
v4value = result.getqreal();
break;
default:
- if (resultType == qMetaTypeId<QDeclarativeAnchorLine>()) {
- v4value = qVariantFromValue<QDeclarativeAnchorLine>(*(QDeclarativeAnchorLine *)result.typeDataPtr());
+ if (resultType == qMetaTypeId<QDeclarative1AnchorLine>()) {
+ v4value = qVariantFromValue<QDeclarative1AnchorLine>(*(QDeclarative1AnchorLine *)result.typeDataPtr());
} else if (resultType == qMetaTypeId<QSGAnchorLine>()) {
v4value = qVariantFromValue<QSGAnchorLine>(*(QSGAnchorLine *)result.typeDataPtr());
} else {
@@ -852,7 +852,7 @@ void QDeclarativeV4BindingsPrivate::run(int instrIndex, quint32 &executedBlocks,
reg.init((Register::Type)instr->fetchAndSubscribe.valueType);
if (instr->fetchAndSubscribe.valueType >= FirstCleanupType)
MARK_REGISTER(instr->fetchAndSubscribe.reg);
- QDeclarativeV4Compiler::fastPropertyAccessor()->accessor(instr->fetchAndSubscribe.function)(object, reg.typeDataPtr(), sub);
+ QDeclarativeFastProperties::instance()->accessor(instr->fetchAndSubscribe.function)(object, reg.typeDataPtr(), sub);
}
}
QML_V4_END_INSTR(FetchAndSubscribe, fetchAndSubscribe)
diff --git a/src/declarative/qml/v4/qdeclarativev4compiler.cpp b/src/declarative/qml/v4/qdeclarativev4compiler.cpp
index 672bf2e57d..371edda6c9 100644
--- a/src/declarative/qml/v4/qdeclarativev4compiler.cpp
+++ b/src/declarative/qml/v4/qdeclarativev4compiler.cpp
@@ -48,7 +48,6 @@
#include <private/qdeclarativejsast_p.h>
#include <private/qdeclarativefastproperties_p.h>
#include <private/qdeclarativejsengine_p.h>
-#include <private/qdeclarativeanchors_p_p.h> // For AnchorLine
#include <private/qsganchors_p_p.h> // For AnchorLine
QT_BEGIN_NAMESPACE
@@ -59,8 +58,6 @@ DEFINE_BOOL_CONFIG_OPTION(qmlExperimental, QML_EXPERIMENTAL)
DEFINE_BOOL_CONFIG_OPTION(qmlVerboseCompiler, QML_VERBOSE_COMPILER)
DEFINE_BOOL_CONFIG_OPTION(qmlBindingsTestEnv, QML_BINDINGS_TEST)
-Q_GLOBAL_STATIC(QDeclarativeFastProperties, fastProperties)
-
static bool qmlBindingsTest = false;
using namespace QDeclarativeJS;
@@ -312,7 +309,7 @@ void QDeclarativeV4CompilerPrivate::visitName(IR::Name *e)
_subscribeName << e->id;
QMetaProperty prop = e->meta->property(e->index);
- int fastFetchIndex = fastProperties()->accessorIndexForProperty(e->meta, e->index);
+ int fastFetchIndex = QDeclarativeFastProperties::instance()->accessorIndexForProperty(e->meta, e->index);
const int propTy = prop.userType();
QDeclarativeRegisterType regType;
@@ -332,7 +329,7 @@ void QDeclarativeV4CompilerPrivate::visitName(IR::Name *e)
break;
default:
- if (propTy == qMetaTypeId<QDeclarativeAnchorLine>()) {
+ if (propTy == qMetaTypeId<QDeclarative1AnchorLine>()) {
regType = PODValueType;
} else if (propTy == qMetaTypeId<QSGAnchorLine>()) {
regType = PODValueType;
@@ -925,7 +922,7 @@ void QDeclarativeV4CompilerPrivate::visitRet(IR::Ret *s)
test.storetest.regType = QMetaType::QUrl;
break;
case IR::AnchorLineType:
- test.storetest.regType = qMetaTypeId<QDeclarativeAnchorLine>();
+ test.storetest.regType = qMetaTypeId<QDeclarative1AnchorLine>();
break;
case IR::SGAnchorLineType:
test.storetest.regType = qMetaTypeId<QSGAnchorLine>();
@@ -978,11 +975,6 @@ void QDeclarativeV4Compiler::dump(const QByteArray &programData)
}
}
-QDeclarativeFastProperties *QDeclarativeV4Compiler::fastPropertyAccessor()
-{
- return fastProperties();
-}
-
/*!
Clear the state associated with attempting to compile a specific binding.
This does not clear the global "committed binding" states.
diff --git a/src/declarative/qml/v4/qdeclarativev4compiler_p.h b/src/declarative/qml/v4/qdeclarativev4compiler_p.h
index 3b89d0d376..cc93f4dbf2 100644
--- a/src/declarative/qml/v4/qdeclarativev4compiler_p.h
+++ b/src/declarative/qml/v4/qdeclarativev4compiler_p.h
@@ -60,7 +60,6 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
-class QDeclarativeFastProperties;
class QDeclarativeTypeNameCache;
class QDeclarativeV4CompilerPrivate;
class Q_AUTOTEST_EXPORT QDeclarativeV4Compiler
@@ -90,7 +89,6 @@ public:
QByteArray program() const;
static void dump(const QByteArray &);
- static QDeclarativeFastProperties *fastPropertyAccessor();
static void enableBindingsTest(bool);
private:
QDeclarativeV4CompilerPrivate *d;
diff --git a/src/declarative/qml/v4/qdeclarativev4compiler_p_p.h b/src/declarative/qml/v4/qdeclarativev4compiler_p_p.h
index 2776630fb8..1d9414dce6 100644
--- a/src/declarative/qml/v4/qdeclarativev4compiler_p_p.h
+++ b/src/declarative/qml/v4/qdeclarativev4compiler_p_p.h
@@ -63,6 +63,36 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
+// NOTE: This is a copy of QDeclarative1AnchorLine: src/qtquick1/graphicsitems/qdeclarativeanchors_p_p.h
+class QGraphicsObject;
+class QDeclarative1AnchorLine
+{
+public:
+ QDeclarative1AnchorLine() : item(0), anchorLine(Invalid) {}
+
+ enum AnchorLine {
+ Invalid = 0x0,
+ Left = 0x01,
+ Right = 0x02,
+ Top = 0x04,
+ Bottom = 0x08,
+ HCenter = 0x10,
+ VCenter = 0x20,
+ Baseline = 0x40,
+ Horizontal_Mask = Left | Right | HCenter,
+ Vertical_Mask = Top | Bottom | VCenter | Baseline
+ };
+
+ QGraphicsObject *item;
+ AnchorLine anchorLine;
+};
+
+inline bool operator==(const QDeclarative1AnchorLine& a, const QDeclarative1AnchorLine& b)
+{
+ return a.item == b.item && a.anchorLine == b.anchorLine;
+}
+
+
class QDeclarativeV4CompilerPrivate: protected QDeclarativeJS::IR::ExprVisitor,
protected QDeclarativeJS::IR::StmtVisitor
{
@@ -178,6 +208,8 @@ private:
QT_END_NAMESPACE
+Q_DECLARE_METATYPE(QDeclarative1AnchorLine)
+
QT_END_HEADER
#endif // QDECLARATIVEV4COMPILER_P_P_H
diff --git a/src/declarative/qml/v4/qdeclarativev4irbuilder.cpp b/src/declarative/qml/v4/qdeclarativev4irbuilder.cpp
index 795406f006..34a59caf1a 100644
--- a/src/declarative/qml/v4/qdeclarativev4irbuilder.cpp
+++ b/src/declarative/qml/v4/qdeclarativev4irbuilder.cpp
@@ -40,8 +40,8 @@
****************************************************************************/
#include "qdeclarativev4irbuilder_p.h"
+#include "qdeclarativev4compiler_p_p.h"
-#include <private/qdeclarativeanchors_p_p.h> // For AnchorLine
#include <private/qsganchors_p_p.h> // For AnchorLine
#include <private/qdeclarativetypenamecache_p.h>
@@ -70,7 +70,7 @@ static IR::Type irTypeFromVariantType(int t, QDeclarativeEnginePrivate *engine,
return IR::UrlType;
default:
- if (t == qMetaTypeId<QDeclarativeAnchorLine>())
+ if (t == qMetaTypeId<QDeclarative1AnchorLine>())
return IR::AnchorLineType;
else if (t == qMetaTypeId<QSGAnchorLine>())
return IR::SGAnchorLineType;
diff --git a/src/declarative/qml/v8/qv8engine_p.h b/src/declarative/qml/v8/qv8engine_p.h
index ef8f16013d..6c05fe4faf 100644
--- a/src/declarative/qml/v8/qv8engine_p.h
+++ b/src/declarative/qml/v8/qv8engine_p.h
@@ -206,7 +206,7 @@ class QDeclarativeEngine;
class QDeclarativeValueType;
class QNetworkAccessManager;
class QDeclarativeContextData;
-class Q_AUTOTEST_EXPORT QV8Engine
+class Q_DECLARATIVE_EXPORT QV8Engine
{
public:
QV8Engine();
diff --git a/src/declarative/qml/v8/qv8qobjectwrapper_p.h b/src/declarative/qml/v8/qv8qobjectwrapper_p.h
index bc4eb443dc..dd787cc476 100644
--- a/src/declarative/qml/v8/qv8qobjectwrapper_p.h
+++ b/src/declarative/qml/v8/qv8qobjectwrapper_p.h
@@ -71,7 +71,7 @@ class QV8ObjectResource;
class QV8QObjectInstance;
class QV8QObjectConnectionList;
class QDeclarativePropertyCache;
-class Q_AUTOTEST_EXPORT QV8QObjectWrapper
+class Q_DECLARATIVE_EXPORT QV8QObjectWrapper
{
public:
QV8QObjectWrapper();
diff --git a/src/declarative/qml/v8/qv8stringwrapper_p.h b/src/declarative/qml/v8/qv8stringwrapper_p.h
index 8dde5c8c44..36c9e24c06 100644
--- a/src/declarative/qml/v8/qv8stringwrapper_p.h
+++ b/src/declarative/qml/v8/qv8stringwrapper_p.h
@@ -58,7 +58,7 @@
QT_BEGIN_NAMESPACE
-class Q_AUTOTEST_EXPORT QV8StringWrapper
+class Q_DECLARATIVE_EXPORT QV8StringWrapper
{
public:
QV8StringWrapper();