aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertycache.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-11-20 09:07:52 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-29 14:39:22 +0100
commitefc3cc717ac1a62965465e909cc99acef627cdb1 (patch)
tree9d181ca8e9e299fa99b9b7598bfb83bc53056dde /src/qml/qml/qqmlpropertycache.cpp
parent65953304a2775e69c7edd46b780aa39f769d32ac (diff)
Make QQmlPropertyCache available in QJSEngine
The QQmlEngine has two containers for property caches, one for QML types and one for all-purpose meta-objects. The latter is rather useful and now being moved to QJSEngine to be available there. Change-Id: Ieab65c400b8a2e410e5f9eee6d603162dbb864d9 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlpropertycache.cpp')
-rw-r--r--src/qml/qml/qqmlpropertycache.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/qml/qml/qqmlpropertycache.cpp b/src/qml/qml/qqmlpropertycache.cpp
index 363fce4375..b5bc29aaa6 100644
--- a/src/qml/qml/qqmlpropertycache.cpp
+++ b/src/qml/qml/qqmlpropertycache.cpp
@@ -231,7 +231,7 @@ void QQmlPropertyData::lazyLoad(const QMetaMethod &m)
/*!
Creates a new empty QQmlPropertyCache.
*/
-QQmlPropertyCache::QQmlPropertyCache(QQmlEngine *e)
+QQmlPropertyCache::QQmlPropertyCache(QJSEngine *e)
: engine(e), _parent(0), propertyIndexCacheStart(0), methodIndexCacheStart(0),
signalHandlerIndexCacheStart(0), _hasPropertyOverrides(false), _ownMetaObject(false),
_metaObject(0), argumentsCache(0)
@@ -242,7 +242,7 @@ QQmlPropertyCache::QQmlPropertyCache(QQmlEngine *e)
/*!
Creates a new QQmlPropertyCache of \a metaObject.
*/
-QQmlPropertyCache::QQmlPropertyCache(QQmlEngine *e, const QMetaObject *metaObject)
+QQmlPropertyCache::QQmlPropertyCache(QJSEngine *e, const QMetaObject *metaObject)
: engine(e), _parent(0), propertyIndexCacheStart(0), methodIndexCacheStart(0),
signalHandlerIndexCacheStart(0), _hasPropertyOverrides(false), _ownMetaObject(false),
_metaObject(0), argumentsCache(0)
@@ -818,7 +818,7 @@ void QQmlPropertyCache::resolve(QQmlPropertyData *data) const
data->propType = registerResult == -1 ? QMetaType::UnknownType : registerResult;
}
}
- data->flags |= flagsForPropertyType(data->propType, engine);
+ data->flags |= flagsForPropertyType(data->propType, qobject_cast<QQmlEngine*>(engine));
}
data->flags &= ~QQmlPropertyData::NotFullyResolved;
@@ -1135,7 +1135,7 @@ QString QQmlPropertyCache::signalParameterStringForJS(int index, QString *errorS
}
QString error;
- QString parameters = signalParameterStringForJS(engine, parameterNameList, &error);
+ QString parameters = signalParameterStringForJS(QV8Engine::getV4(engine), parameterNameList, &error);
A *arguments = static_cast<A *>(signalData->arguments);
arguments->signalParameterStringForJS = new QString(!error.isEmpty() ? error : parameters);
@@ -1148,11 +1148,10 @@ QString QQmlPropertyCache::signalParameterStringForJS(int index, QString *errorS
return *arguments->signalParameterStringForJS;
}
-QString QQmlPropertyCache::signalParameterStringForJS(QQmlEngine *engine, const QList<QByteArray> &parameterNameList, QString *errorString)
+QString QQmlPropertyCache::signalParameterStringForJS(QV4::ExecutionEngine *engine, const QList<QByteArray> &parameterNameList, QString *errorString)
{
- QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine);
bool unnamedParameter = false;
- const QSet<QString> &illegalNames = ep->v8engine()->illegalNames();
+ const QSet<QString> &illegalNames = engine->v8Engine->illegalNames();
QString error;
QString parameters;