Commit 64cddc88 authored by Christian Kamm's avatar Christian Kamm

QmlJS: Fixed attached objects.

Task-number: QTCREATORBUG-6450
Change-Id: Idd8e2ec3550190a137dbf0fe452c8488fb3fe1ad
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@nokia.com>
parent 97319559
...@@ -164,7 +164,6 @@ QmlObjectValue::QmlObjectValue(FakeMetaObject::ConstPtr metaObject, const QStrin ...@@ -164,7 +164,6 @@ QmlObjectValue::QmlObjectValue(FakeMetaObject::ConstPtr metaObject, const QStrin
const ComponentVersion &importVersion, int metaObjectRevision, const ComponentVersion &importVersion, int metaObjectRevision,
ValueOwner *valueOwner) ValueOwner *valueOwner)
: ObjectValue(valueOwner), : ObjectValue(valueOwner),
_attachedType(0),
_metaObject(metaObject), _metaObject(metaObject),
_moduleName(packageName), _moduleName(packageName),
_componentVersion(componentVersion), _componentVersion(componentVersion),
...@@ -258,8 +257,13 @@ void QmlObjectValue::processMembers(MemberProcessor *processor) const ...@@ -258,8 +257,13 @@ void QmlObjectValue::processMembers(MemberProcessor *processor) const
} }
} }
if (_attachedType) // look into attached types
_attachedType->processMembers(processor); const QString &attachedTypeName = _metaObject->attachedTypeName();
if (!attachedTypeName.isEmpty()) {
const QmlObjectValue *attachedType = valueOwner()->cppQmlTypes().objectByCppName(attachedTypeName);
if (attachedType)
attachedType->processMembers(processor);
}
ObjectValue::processMembers(processor); ObjectValue::processMembers(processor);
} }
...@@ -354,16 +358,6 @@ QList<const QmlObjectValue *> QmlObjectValue::prototypes() const ...@@ -354,16 +358,6 @@ QList<const QmlObjectValue *> QmlObjectValue::prototypes() const
return protos; return protos;
} }
const QmlObjectValue *QmlObjectValue::attachedType() const
{
return _attachedType;
}
void QmlObjectValue::setAttachedType(QmlObjectValue *value)
{
_attachedType = value;
}
FakeMetaObject::ConstPtr QmlObjectValue::metaObject() const FakeMetaObject::ConstPtr QmlObjectValue::metaObject() const
{ {
return _metaObject; return _metaObject;
......
...@@ -430,9 +430,6 @@ public: ...@@ -430,9 +430,6 @@ public:
const QmlObjectValue *prototype() const; const QmlObjectValue *prototype() const;
QList<const QmlObjectValue *> prototypes() const; QList<const QmlObjectValue *> prototypes() const;
const QmlObjectValue *attachedType() const;
void setAttachedType(QmlObjectValue *value);
LanguageUtils::FakeMetaObject::ConstPtr metaObject() const; LanguageUtils::FakeMetaObject::ConstPtr metaObject() const;
QString moduleName() const; QString moduleName() const;
...@@ -453,7 +450,6 @@ protected: ...@@ -453,7 +450,6 @@ protected:
bool isDerivedFrom(LanguageUtils::FakeMetaObject::ConstPtr base) const; bool isDerivedFrom(LanguageUtils::FakeMetaObject::ConstPtr base) const;
private: private:
QmlObjectValue *_attachedType;
LanguageUtils::FakeMetaObject::ConstPtr _metaObject; LanguageUtils::FakeMetaObject::ConstPtr _metaObject;
const QString _moduleName; const QString _moduleName;
// _componentVersion is the version of the export // _componentVersion is the version of the export
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment