Commit f2ae69b1 authored by Fawzi Mohamed's avatar Fawzi Mohamed

qmljs: qmltypes, added isCreatable, isSingleton, isComposite

Change-Id: I62cd3736de46b25107e5ea5f6d8e8dcafaa5e11a
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarFawzi Mohamed <fawzi.mohamed@digia.com>
parent 1ff5faac
......@@ -200,7 +200,7 @@ void FakeMetaProperty::addToHash(QCryptographicHash &hash) const
}
FakeMetaObject::FakeMetaObject()
FakeMetaObject::FakeMetaObject() : m_isSingleton(false), m_isCreatable(true), m_isComposite(false)
{
}
......@@ -352,6 +352,36 @@ QByteArray FakeMetaObject::fingerprint() const
return m_fingerprint;
}
bool FakeMetaObject::isSingleton() const
{
return m_isSingleton;
}
bool FakeMetaObject::isCreatable() const
{
return m_isCreatable;
}
bool FakeMetaObject::isComposite() const
{
return m_isComposite;
}
void FakeMetaObject::setIsSingleton(bool value)
{
m_isSingleton = value;
}
void FakeMetaObject::setIsCreatable(bool value)
{
m_isCreatable = value;
}
void FakeMetaObject::setIsComposite(bool value)
{
m_isSingleton = value;
}
FakeMetaObject::Export::Export()
: metaObjectRevision(0)
{}
......
......@@ -166,6 +166,9 @@ private:
QString m_defaultPropertyName;
QString m_attachedTypeName;
QByteArray m_fingerprint;
bool m_isSingleton;
bool m_isCreatable;
bool m_isComposite;
public:
FakeMetaObject();
......@@ -207,6 +210,13 @@ public:
QByteArray calculateFingerprint() const;
void updateFingerprint();
QByteArray fingerprint() const;
bool isSingleton() const;
bool isCreatable() const;
bool isComposite() const;
void setIsSingleton(bool value);
void setIsCreatable(bool value);
void setIsComposite(bool value);
};
} // namespace LanguageUtils
......
......@@ -213,10 +213,17 @@ void TypeDescriptionReader::readComponent(UiObjectDefinition *ast)
readMetaObjectRevisions(script, fmo);
} else if (name == QLatin1String("attachedType")) {
fmo->setAttachedTypeName(readStringBinding(script));
} else if (name == QLatin1String("isSingleton")) {
fmo->setIsSingleton(readBoolBinding(script));
} else if (name == QLatin1String("isCreatable")) {
fmo->setIsCreatable(readBoolBinding(script));
} else if (name == QLatin1String("isComposite")) {
fmo->setIsComposite(readBoolBinding(script));
} else {
addWarning(script->firstSourceLocation(),
tr("Expected only name, prototype, defaultProperty, attachedType, exports "
"and exportMetaObjectRevisions script bindings, not '%1'.").arg(name));
"isSingleton, isCreatable, isComposite and exportMetaObjectRevisions "
"script bindings, not '%1'.").arg(name));
}
} else {
addWarning(member->firstSourceLocation(), tr("Expected only script bindings and object definitions."));
......
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