Commit 90925c69 authored by Christian Kamm's avatar Christian Kamm
Browse files

QmlJS: Rename QmlObjectValue -> CppComponentValue.

Reviewed-by: Fawzi Mohamed
Reviewed-by: Thomas Hartmann
Change-Id: Ib89388d5a5678403e4637eec5829f3520637ee27
Reviewed-on: http://codereview.qt-project.org/6310

Reviewed-by: default avatarChristian Kamm <christian.d.kamm@nokia.com>
Sanity-Review: Christian Kamm <christian.d.kamm@nokia.com>
parent 8c94325a
......@@ -138,7 +138,7 @@ QString Context::defaultPropertyName(const ObjectValue *object) const
QString defaultProperty = astObjValue->defaultPropertyName();
if (!defaultProperty.isEmpty())
return defaultProperty;
} else if (const QmlObjectValue *qmlValue = dynamic_cast<const QmlObjectValue *>(o)) {
} else if (const CppComponentValue *qmlValue = dynamic_cast<const CppComponentValue *>(o)) {
return qmlValue->defaultPropertyName();
}
}
......
......@@ -159,7 +159,7 @@ public:
} // end of anonymous namespace
QmlObjectValue::QmlObjectValue(FakeMetaObject::ConstPtr metaObject, const QString &className,
CppComponentValue::CppComponentValue(FakeMetaObject::ConstPtr metaObject, const QString &className,
const QString &packageName, const ComponentVersion &componentVersion,
const ComponentVersion &importVersion, int metaObjectRevision,
ValueOwner *valueOwner)
......@@ -179,7 +179,7 @@ QmlObjectValue::QmlObjectValue(FakeMetaObject::ConstPtr metaObject, const QStrin
}
}
QmlObjectValue::~QmlObjectValue()
CppComponentValue::~CppComponentValue()
{
delete _metaSignatures;
delete _signalScopes;
......@@ -193,7 +193,7 @@ static QString generatedSlotName(const QString &base)
return slotName;
}
void QmlObjectValue::processMembers(MemberProcessor *processor) const
void CppComponentValue::processMembers(MemberProcessor *processor) const
{
// process the meta enums
for (int index = _metaObject->enumeratorOffset(); index < _metaObject->enumeratorCount(); ++index) {
......@@ -269,12 +269,12 @@ void QmlObjectValue::processMembers(MemberProcessor *processor) const
ObjectValue::processMembers(processor);
}
const Value *QmlObjectValue::valueForCppName(const QString &typeName) const
const Value *CppComponentValue::valueForCppName(const QString &typeName) const
{
const CppQmlTypes &cppTypes = valueOwner()->cppQmlTypes();
// check in the same package/version first
const QmlObjectValue *objectValue = cppTypes.objectByQualifiedName(
const CppComponentValue *objectValue = cppTypes.objectByQualifiedName(
_moduleName, typeName, _importVersion);
if (objectValue)
return objectValue;
......@@ -322,7 +322,7 @@ const Value *QmlObjectValue::valueForCppName(const QString &typeName) const
}
// might be an enum
const QmlObjectValue *base = this;
const CppComponentValue *base = this;
const QStringList components = typeName.split(QLatin1String("::"));
if (components.size() == 2) {
base = valueOwner()->cppQmlTypes().objectByCppName(components.first());
......@@ -335,42 +335,42 @@ const Value *QmlObjectValue::valueForCppName(const QString &typeName) const
return valueOwner()->undefinedValue();
}
const QmlObjectValue *QmlObjectValue::prototype() const
const CppComponentValue *CppComponentValue::prototype() const
{
Q_ASSERT(!_prototype || dynamic_cast<const QmlObjectValue *>(_prototype));
return static_cast<const QmlObjectValue *>(_prototype);
Q_ASSERT(!_prototype || dynamic_cast<const CppComponentValue *>(_prototype));
return static_cast<const CppComponentValue *>(_prototype);
}
const QmlObjectValue *QmlObjectValue::attachedType() const
const CppComponentValue *CppComponentValue::attachedType() const
{
return _attachedType;
}
void QmlObjectValue::setAttachedType(QmlObjectValue *value)
void CppComponentValue::setAttachedType(CppComponentValue *value)
{
_attachedType = value;
}
FakeMetaObject::ConstPtr QmlObjectValue::metaObject() const
FakeMetaObject::ConstPtr CppComponentValue::metaObject() const
{
return _metaObject;
}
QString QmlObjectValue::moduleName() const
QString CppComponentValue::moduleName() const
{ return _moduleName; }
ComponentVersion QmlObjectValue::componentVersion() const
ComponentVersion CppComponentValue::componentVersion() const
{ return _componentVersion; }
ComponentVersion QmlObjectValue::importVersion() const
ComponentVersion CppComponentValue::importVersion() const
{ return _importVersion; }
QString QmlObjectValue::defaultPropertyName() const
QString CppComponentValue::defaultPropertyName() const
{ return _metaObject->defaultPropertyName(); }
QString QmlObjectValue::propertyType(const QString &propertyName) const
QString CppComponentValue::propertyType(const QString &propertyName) const
{
for (const QmlObjectValue *it = this; it; it = it->prototype()) {
for (const CppComponentValue *it = this; it; it = it->prototype()) {
FakeMetaObject::ConstPtr iter = it->_metaObject;
int propIdx = iter->propertyIndex(propertyName);
if (propIdx != -1) {
......@@ -380,9 +380,9 @@ QString QmlObjectValue::propertyType(const QString &propertyName) const
return QString();
}
bool QmlObjectValue::isListProperty(const QString &propertyName) const
bool CppComponentValue::isListProperty(const QString &propertyName) const
{
for (const QmlObjectValue *it = this; it; it = it->prototype()) {
for (const CppComponentValue *it = this; it; it = it->prototype()) {
FakeMetaObject::ConstPtr iter = it->_metaObject;
int propIdx = iter->propertyIndex(propertyName);
if (propIdx != -1) {
......@@ -392,9 +392,9 @@ bool QmlObjectValue::isListProperty(const QString &propertyName) const
return false;
}
FakeMetaEnum QmlObjectValue::getEnum(const QString &typeName, const QmlObjectValue **foundInScope) const
FakeMetaEnum CppComponentValue::getEnum(const QString &typeName, const CppComponentValue **foundInScope) const
{
for (const QmlObjectValue *it = this; it; it = it->prototype()) {
for (const CppComponentValue *it = this; it; it = it->prototype()) {
FakeMetaObject::ConstPtr iter = it->_metaObject;
const int index = iter->enumeratorIndex(typeName);
if (index != -1) {
......@@ -408,9 +408,9 @@ FakeMetaEnum QmlObjectValue::getEnum(const QString &typeName, const QmlObjectVal
return FakeMetaEnum();
}
const QmlEnumValue *QmlObjectValue::getEnumValue(const QString &typeName, const QmlObjectValue **foundInScope) const
const QmlEnumValue *CppComponentValue::getEnumValue(const QString &typeName, const CppComponentValue **foundInScope) const
{
for (const QmlObjectValue *it = this; it; it = it->prototype()) {
for (const CppComponentValue *it = this; it; it = it->prototype()) {
if (const QmlEnumValue *e = it->_enums.value(typeName)) {
if (foundInScope)
*foundInScope = it;
......@@ -422,7 +422,7 @@ const QmlEnumValue *QmlObjectValue::getEnumValue(const QString &typeName, const
return 0;
}
const ObjectValue *QmlObjectValue::signalScope(const QString &signalName) const
const ObjectValue *CppComponentValue::signalScope(const QString &signalName) const
{
QHash<QString, const ObjectValue *> *scopes = _signalScopes;
if (!scopes) {
......@@ -457,9 +457,9 @@ const ObjectValue *QmlObjectValue::signalScope(const QString &signalName) const
return scopes->value(signalName);
}
bool QmlObjectValue::isWritable(const QString &propertyName) const
bool CppComponentValue::isWritable(const QString &propertyName) const
{
for (const QmlObjectValue *it = this; it; it = it->prototype()) {
for (const CppComponentValue *it = this; it; it = it->prototype()) {
FakeMetaObject::ConstPtr iter = it->_metaObject;
int propIdx = iter->propertyIndex(propertyName);
if (propIdx != -1) {
......@@ -469,9 +469,9 @@ bool QmlObjectValue::isWritable(const QString &propertyName) const
return false;
}
bool QmlObjectValue::isPointer(const QString &propertyName) const
bool CppComponentValue::isPointer(const QString &propertyName) const
{
for (const QmlObjectValue *it = this; it; it = it->prototype()) {
for (const CppComponentValue *it = this; it; it = it->prototype()) {
FakeMetaObject::ConstPtr iter = it->_metaObject;
int propIdx = iter->propertyIndex(propertyName);
if (propIdx != -1) {
......@@ -481,7 +481,7 @@ bool QmlObjectValue::isPointer(const QString &propertyName) const
return false;
}
bool QmlObjectValue::hasLocalProperty(const QString &typeName) const
bool CppComponentValue::hasLocalProperty(const QString &typeName) const
{
int idx = _metaObject->propertyIndex(typeName);
if (idx == -1)
......@@ -489,9 +489,9 @@ bool QmlObjectValue::hasLocalProperty(const QString &typeName) const
return true;
}
bool QmlObjectValue::hasProperty(const QString &propertyName) const
bool CppComponentValue::hasProperty(const QString &propertyName) const
{
for (const QmlObjectValue *it = this; it; it = it->prototype()) {
for (const CppComponentValue *it = this; it; it = it->prototype()) {
FakeMetaObject::ConstPtr iter = it->_metaObject;
int propIdx = iter->propertyIndex(propertyName);
if (propIdx != -1) {
......@@ -501,9 +501,9 @@ bool QmlObjectValue::hasProperty(const QString &propertyName) const
return false;
}
bool QmlObjectValue::isDerivedFrom(FakeMetaObject::ConstPtr base) const
bool CppComponentValue::isDerivedFrom(FakeMetaObject::ConstPtr base) const
{
for (const QmlObjectValue *it = this; it; it = it->prototype()) {
for (const CppComponentValue *it = this; it; it = it->prototype()) {
FakeMetaObject::ConstPtr iter = it->_metaObject;
if (iter == base)
return true;
......@@ -511,7 +511,7 @@ bool QmlObjectValue::isDerivedFrom(FakeMetaObject::ConstPtr base) const
return false;
}
QmlEnumValue::QmlEnumValue(const QmlObjectValue *owner, int enumIndex)
QmlEnumValue::QmlEnumValue(const CppComponentValue *owner, int enumIndex)
: _owner(owner)
, _enumIndex(enumIndex)
{
......@@ -532,7 +532,7 @@ QStringList QmlEnumValue::keys() const
return _owner->metaObject()->enumerator(_enumIndex).keys();
}
const QmlObjectValue *QmlEnumValue::owner() const
const CppComponentValue *QmlEnumValue::owner() const
{
return _owner;
}
......@@ -1290,7 +1290,7 @@ const QLatin1String CppQmlTypes::cppPackage("<cpp>");
template <typename T>
void CppQmlTypes::load(const T &fakeMetaObjects, const QString &overridePackage)
{
QList<QmlObjectValue *> newCppTypes;
QList<CppComponentValue *> newCppTypes;
foreach (const FakeMetaObject::ConstPtr &fmo, fakeMetaObjects) {
foreach (const FakeMetaObject::Export &exp, fmo->exports()) {
QString package = exp.package;
......@@ -1303,7 +1303,7 @@ void CppQmlTypes::load(const T &fakeMetaObjects, const QString &overridePackage)
if (exp.package == cppPackage) {
QTC_ASSERT(exp.version == ComponentVersion(), continue);
QTC_ASSERT(exp.type == fmo->className(), continue);
QmlObjectValue *cppValue = new QmlObjectValue(
CppComponentValue *cppValue = new CppComponentValue(
fmo, fmo->className(), cppPackage, ComponentVersion(), ComponentVersion(),
ComponentVersion::MaxVersion, _valueOwner);
_objectsByQualifiedName[qualifiedName(cppPackage, fmo->className(), ComponentVersion())] = cppValue;
......@@ -1313,9 +1313,9 @@ void CppQmlTypes::load(const T &fakeMetaObjects, const QString &overridePackage)
}
// set prototypes of cpp types
foreach (QmlObjectValue *object, newCppTypes) {
foreach (CppComponentValue *object, newCppTypes) {
const QString &protoCppName = object->metaObject()->superclassName();
const QmlObjectValue *proto = objectByCppName(protoCppName);
const CppComponentValue *proto = objectByCppName(protoCppName);
if (proto)
object->setPrototype(proto);
}
......@@ -1324,10 +1324,10 @@ void CppQmlTypes::load(const T &fakeMetaObjects, const QString &overridePackage)
template void CppQmlTypes::load< QList<FakeMetaObject::ConstPtr> >(const QList<FakeMetaObject::ConstPtr> &, const QString &);
template void CppQmlTypes::load< QHash<QString, FakeMetaObject::ConstPtr> >(const QHash<QString, FakeMetaObject::ConstPtr> &, const QString &);
QList<const QmlObjectValue *> CppQmlTypes::createObjectsForImport(const QString &package, ComponentVersion version)
QList<const CppComponentValue *> CppQmlTypes::createObjectsForImport(const QString &package, ComponentVersion version)
{
QList<const QmlObjectValue *> exportedObjects;
QList<const QmlObjectValue *> newObjects;
QList<const CppComponentValue *> exportedObjects;
QList<const CppComponentValue *> newObjects;
// make new exported objects
foreach (const FakeMetaObject::ConstPtr &fmo, _fakeMetaObjectsByPackage.value(package)) {
......@@ -1354,7 +1354,7 @@ QList<const QmlObjectValue *> CppQmlTypes::createObjectsForImport(const QString
name = fmo->className();
}
QmlObjectValue *newObject = new QmlObjectValue(
CppComponentValue *newObject = new CppComponentValue(
fmo, name, package, bestExport.version, version,
bestExport.metaObjectRevision, _valueOwner);
......@@ -1366,8 +1366,8 @@ QList<const QmlObjectValue *> CppQmlTypes::createObjectsForImport(const QString
}
// set their prototypes, creating them if necessary
foreach (const QmlObjectValue *cobject, newObjects) {
QmlObjectValue *object = const_cast<QmlObjectValue *>(cobject);
foreach (const CppComponentValue *cobject, newObjects) {
CppComponentValue *object = const_cast<CppComponentValue *>(cobject);
while (!object->prototype()) {
const QString &protoCppName = object->metaObject()->superclassName();
if (protoCppName.isEmpty())
......@@ -1375,19 +1375,19 @@ QList<const QmlObjectValue *> CppQmlTypes::createObjectsForImport(const QString
// if the prototype already exists, done
const QString key = qualifiedName(object->moduleName(), protoCppName, version);
if (const QmlObjectValue *proto = _objectsByQualifiedName.value(key)) {
if (const CppComponentValue *proto = _objectsByQualifiedName.value(key)) {
object->setPrototype(proto);
break;
}
// get the fmo via the cpp name
const QmlObjectValue *cppProto = objectByCppName(protoCppName);
const CppComponentValue *cppProto = objectByCppName(protoCppName);
if (!cppProto)
break;
FakeMetaObject::ConstPtr protoFmo = cppProto->metaObject();
// make a new object
QmlObjectValue *proto = new QmlObjectValue(
CppComponentValue *proto = new CppComponentValue(
protoFmo, protoCppName, object->moduleName(), ComponentVersion(),
object->importVersion(), ComponentVersion::MaxVersion, _valueOwner);
_objectsByQualifiedName.insert(key, proto);
......@@ -1414,18 +1414,18 @@ QString CppQmlTypes::qualifiedName(const QString &module, const QString &type, C
}
const QmlObjectValue *CppQmlTypes::objectByQualifiedName(const QString &name) const
const CppComponentValue *CppQmlTypes::objectByQualifiedName(const QString &name) const
{
return _objectsByQualifiedName.value(name);
}
const QmlObjectValue *CppQmlTypes::objectByQualifiedName(const QString &package, const QString &type,
const CppComponentValue *CppQmlTypes::objectByQualifiedName(const QString &package, const QString &type,
ComponentVersion version) const
{
return objectByQualifiedName(qualifiedName(package, type, version));
}
const QmlObjectValue *CppQmlTypes::objectByCppName(const QString &cppName) const
const CppComponentValue *CppQmlTypes::objectByCppName(const QString &cppName) const
{
return objectByQualifiedName(qualifiedName(cppPackage, cppName, ComponentVersion()));
}
......
......@@ -394,43 +394,43 @@ private:
Error m_error;
};
class QmlObjectValue;
class CppComponentValue;
class QMLJS_EXPORT QmlEnumValue: public NumberValue
{
public:
QmlEnumValue(const QmlObjectValue *owner, int index);
QmlEnumValue(const CppComponentValue *owner, int index);
virtual ~QmlEnumValue();
QString name() const;
QStringList keys() const;
const QmlObjectValue *owner() const;
const CppComponentValue *owner() const;
private:
const QmlObjectValue *_owner;
const CppComponentValue *_owner;
int _enumIndex;
};
// A ObjectValue based on a FakeMetaObject.
// May only have other QmlObjectValues as ancestors.
class QMLJS_EXPORT QmlObjectValue: public ObjectValue
// May only have other CppComponentValue as ancestors.
class QMLJS_EXPORT CppComponentValue: public ObjectValue
{
public:
QmlObjectValue(LanguageUtils::FakeMetaObject::ConstPtr metaObject, const QString &className,
CppComponentValue(LanguageUtils::FakeMetaObject::ConstPtr metaObject, const QString &className,
const QString &moduleName, const LanguageUtils::ComponentVersion &componentVersion,
const LanguageUtils::ComponentVersion &importVersion, int metaObjectRevision,
ValueOwner *valueOwner);
virtual ~QmlObjectValue();
virtual ~CppComponentValue();
virtual void processMembers(MemberProcessor *processor) const;
const Value *valueForCppName(const QString &typeName) const;
using ObjectValue::prototype;
const QmlObjectValue *prototype() const;
const CppComponentValue *prototype() const;
const QmlObjectValue *attachedType() const;
void setAttachedType(QmlObjectValue *value);
const CppComponentValue *attachedType() const;
void setAttachedType(CppComponentValue *value);
LanguageUtils::FakeMetaObject::ConstPtr metaObject() const;
......@@ -446,15 +446,15 @@ public:
bool hasLocalProperty(const QString &typeName) const;
bool hasProperty(const QString &typeName) const;
LanguageUtils::FakeMetaEnum getEnum(const QString &typeName, const QmlObjectValue **foundInScope = 0) const;
const QmlEnumValue *getEnumValue(const QString &typeName, const QmlObjectValue **foundInScope = 0) const;
LanguageUtils::FakeMetaEnum getEnum(const QString &typeName, const CppComponentValue **foundInScope = 0) const;
const QmlEnumValue *getEnumValue(const QString &typeName, const CppComponentValue **foundInScope = 0) const;
const ObjectValue *signalScope(const QString &signalName) const;
protected:
bool isDerivedFrom(LanguageUtils::FakeMetaObject::ConstPtr base) const;
private:
QmlObjectValue *_attachedType;
CppComponentValue *_attachedType;
LanguageUtils::FakeMetaObject::ConstPtr _metaObject;
const QString _moduleName;
// _componentVersion is the version of the export
......@@ -588,20 +588,20 @@ public:
template <typename T>
void load(const T &fakeMetaObjects, const QString &overridePackage = QString());
QList<const QmlObjectValue *> createObjectsForImport(const QString &package, LanguageUtils::ComponentVersion version);
QList<const CppComponentValue *> createObjectsForImport(const QString &package, LanguageUtils::ComponentVersion version);
bool hasModule(const QString &module) const;
static QString qualifiedName(const QString &module, const QString &type,
LanguageUtils::ComponentVersion version);
const QmlObjectValue *objectByQualifiedName(const QString &fullyQualifiedName) const;
const QmlObjectValue *objectByQualifiedName(
const CppComponentValue *objectByQualifiedName(const QString &fullyQualifiedName) const;
const CppComponentValue *objectByQualifiedName(
const QString &package, const QString &type,
LanguageUtils::ComponentVersion version) const;
const QmlObjectValue *objectByCppName(const QString &cppName) const;
const CppComponentValue *objectByCppName(const QString &cppName) const;
private:
// "Package.CppName ImportVersion" -> QmlObjectValue
QHash<QString, const QmlObjectValue *> _objectsByQualifiedName;
// "Package.CppName ImportVersion" -> CppComponentValue
QHash<QString, const CppComponentValue *> _objectsByQualifiedName;
QHash<QString, QSet<LanguageUtils::FakeMetaObject::ConstPtr> > _fakeMetaObjectsByPackage;
ValueOwner *_valueOwner;
};
......
......@@ -366,7 +366,7 @@ Import LinkPrivate::importNonFile(Document::Ptr doc, const ImportInfo &importInf
// if there are cpp-based types for this package, use them too
if (valueOwner->cppQmlTypes().hasModule(packageName)) {
importFound = true;
foreach (const QmlObjectValue *object,
foreach (const CppComponentValue *object,
valueOwner->cppQmlTypes().createObjectsForImport(packageName, version)) {
import.object->setMember(object->className(), object);
}
......@@ -439,7 +439,7 @@ bool LinkPrivate::importLibrary(Document::Ptr doc,
} else {
const QString packageName = importInfo.name();
valueOwner->cppQmlTypes().load(libraryInfo.metaObjects(), packageName);
foreach (const QmlObjectValue *object, valueOwner->cppQmlTypes().createObjectsForImport(packageName, version)) {
foreach (const CppComponentValue *object, valueOwner->cppQmlTypes().createObjectsForImport(packageName, version)) {
import->object->setMember(object->className(), object);
}
}
......@@ -522,7 +522,7 @@ void LinkPrivate::loadImplicitDefaultImports(Imports *imports)
import.valid = true;
import.info = info;
import.object = new ObjectValue(valueOwner);
foreach (const QmlObjectValue *object,
foreach (const CppComponentValue *object,
valueOwner->cppQmlTypes().createObjectsForImport(
defaultPackage, maxVersion)) {
import.object->setMember(object->className(), object);
......
......@@ -185,7 +185,7 @@ void ScopeBuilder::setQmlScopeObject(Node *node)
iter.next();
while (iter.hasNext()) {
const ObjectValue *prototype = iter.next();
if (const QmlObjectValue *qmlMetaObject = dynamic_cast<const QmlObjectValue *>(prototype)) {
if (const CppComponentValue *qmlMetaObject = dynamic_cast<const CppComponentValue *>(prototype)) {
if ((qmlMetaObject->className() == QLatin1String("ListElement")
|| qmlMetaObject->className() == QLatin1String("Connections")
) && (qmlMetaObject->moduleName() == QLatin1String("Qt")
......@@ -259,7 +259,7 @@ const ObjectValue *ScopeBuilder::isPropertyChangesObject(const ContextPtr &conte
PrototypeIterator iter(object, context);
while (iter.hasNext()) {
const ObjectValue *prototype = iter.next();
if (const QmlObjectValue *qmlMetaObject = dynamic_cast<const QmlObjectValue *>(prototype)) {
if (const CppComponentValue *qmlMetaObject = dynamic_cast<const CppComponentValue *>(prototype)) {
if (qmlMetaObject->className() == QLatin1String("PropertyChanges")
&& (qmlMetaObject->moduleName() == QLatin1String("Qt")
|| qmlMetaObject->moduleName() == QLatin1String("QtQuick")))
......
......@@ -103,7 +103,7 @@ public:
type = ref->ast()->memberType.toString();
m_properties.append(qMakePair(name, type));
} else {
if (const QmlObjectValue * ov = dynamic_cast<const QmlObjectValue *>(value)) {
if (const CppComponentValue * ov = dynamic_cast<const CppComponentValue *>(value)) {
QString qualifiedTypeName = ov->moduleName().isEmpty() ? ov->className() : ov->moduleName() + '.' + ov->className();
m_properties.append(qMakePair(name, qualifiedTypeName));
} else {
......@@ -135,12 +135,12 @@ static inline bool isValueType(const QString &type)
return objectValuesList.contains(type);
}
const QmlObjectValue *findQmlPrototype(const ObjectValue *ov, const ContextPtr &context)
const CppComponentValue *findQmlPrototype(const ObjectValue *ov, const ContextPtr &context)
{
if (!ov)
return 0;
const QmlObjectValue * qmlValue = dynamic_cast<const QmlObjectValue *>(ov);
const CppComponentValue * qmlValue = dynamic_cast<const CppComponentValue *>(ov);
if (qmlValue)
return qmlValue;
......@@ -154,7 +154,7 @@ QStringList prototypes(const ObjectValue *ov, const ContextPtr &context, bool ve
return list;
ov = ov->prototype(context);
while (ov) {
const QmlObjectValue * qmlValue = dynamic_cast<const QmlObjectValue *>(ov);
const CppComponentValue * qmlValue = dynamic_cast<const CppComponentValue *>(ov);
if (qmlValue) {
if (versions) {
list << qmlValue->moduleName() + '.' + qmlValue->className() +
......@@ -177,7 +177,7 @@ QStringList prototypes(const ObjectValue *ov, const ContextPtr &context, bool ve
QList<PropertyInfo> getObjectTypes(const ObjectValue *ov, const ContextPtr &context, bool local = false);
QList<PropertyInfo> getQmlTypes(const QmlObjectValue *ov, const ContextPtr &context, bool local = false)
QList<PropertyInfo> getQmlTypes(const CppComponentValue *ov, const ContextPtr &context, bool local = false)
{
QList<PropertyInfo> list;
if (!ov)
......@@ -192,7 +192,7 @@ QList<PropertyInfo> getQmlTypes(const QmlObjectValue *ov, const ContextPtr &cont
QString name = property.first;
if (!ov->isWritable(name) && ov->isPointer(name)) {
//dot property
const QmlObjectValue * qmlValue = dynamic_cast<const QmlObjectValue *>(ov->lookupMember(name, context));
const CppComponentValue * qmlValue = dynamic_cast<const CppComponentValue *>(ov->lookupMember(name, context));
if (qmlValue) {
QList<PropertyInfo> dotProperties = getQmlTypes(qmlValue, context);
foreach (const PropertyInfo &propertyInfo, dotProperties) {
......@@ -224,7 +224,7 @@ QList<PropertyInfo> getQmlTypes(const QmlObjectValue *ov, const ContextPtr &cont
if (!local) {
const ObjectValue* prototype = ov->prototype(context);
const QmlObjectValue * qmlObjectValue = dynamic_cast<const QmlObjectValue *>(prototype);
const CppComponentValue * qmlObjectValue = dynamic_cast<const CppComponentValue *>(prototype);
if (qmlObjectValue) {
list << getQmlTypes(qmlObjectValue, context);
......@@ -240,7 +240,7 @@ QList<PropertyInfo> getTypes(const ObjectValue *ov, const ContextPtr &context, b
{
QList<PropertyInfo> list;
const QmlObjectValue * qmlObjectValue = dynamic_cast<const QmlObjectValue *>(ov);
const CppComponentValue * qmlObjectValue = dynamic_cast<const CppComponentValue *>(ov);
if (qmlObjectValue) {
list << getQmlTypes(qmlObjectValue, context, local);
......@@ -264,7 +264,7 @@ QList<PropertyInfo> getObjectTypes(const ObjectValue *ov, const ContextPtr &cont
if (!local) {
const ObjectValue* prototype = ov->prototype(context);
const QmlObjectValue * qmlObjectValue = dynamic_cast<const QmlObjectValue *>(prototype);
const CppComponentValue * qmlObjectValue = dynamic_cast<const CppComponentValue *>(prototype);
if (qmlObjectValue) {
list << getQmlTypes(qmlObjectValue, context);
......@@ -358,13 +358,13 @@ public:
private:
NodeMetaInfoPrivate(Model *model, QString type, int maj = -1, int min = -1);
const QmlJS::QmlObjectValue *getQmlObjectValue() const;
const QmlJS::CppComponentValue *getCppComponentValue() const;
const QmlJS::ObjectValue *getObjectValue() const;
void setupPropertyInfo(QList<PropertyInfo> propertyInfos);
void setupLocalPropertyInfo(QList<PropertyInfo> propertyInfos);
QString lookupName() const;
QStringList lookupNameComponent() const;
const QmlJS::QmlObjectValue *getNearestQmlObjectValue() const;
const QmlJS::CppComponentValue *getNearestCppComponentValue() const;
QString fullQualifiedImportAliasType() const;
QString m_qualfiedTypeName;
......@@ -424,7 +424,7 @@ NodeMetaInfoPrivate::NodeMetaInfoPrivate(Model *model, QString type, int maj, in
m_model(model)
{
if (context()) {
const QmlObjectValue *objectValue = getQmlObjectValue();
const CppComponentValue *objectValue = getCppComponentValue();
if (objectValue) {
setupPropertyInfo(getTypes(objectValue, context()));
setupLocalPropertyInfo(getTypes(objectValue, context(), true));
......@@ -434,7 +434,7 @@ NodeMetaInfoPrivate::NodeMetaInfoPrivate(Model *model, QString type, int maj, in
} else {
const ObjectValue *objectValue = getObjectValue();
if (objectValue) {
const QmlObjectValue *qmlValue = dynamic_cast<const QmlObjectValue *>(objectValue);
const CppComponentValue *qmlValue = dynamic_cast<const CppComponentValue *>(objectValue);
if (qmlValue) {