aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/qmlcompiler')
-rw-r--r--src/qmlcompiler/qqmljsscope.cpp1
-rw-r--r--src/qmlcompiler/qqmljsscope_p.h10
-rw-r--r--src/qmlcompiler/qqmljstypedescriptionreader.cpp6
3 files changed, 15 insertions, 2 deletions
diff --git a/src/qmlcompiler/qqmljsscope.cpp b/src/qmlcompiler/qqmljsscope.cpp
index 0787e1062e..ed029208dc 100644
--- a/src/qmlcompiler/qqmljsscope.cpp
+++ b/src/qmlcompiler/qqmljsscope.cpp
@@ -152,6 +152,7 @@ void QQmlJSScope::resolveTypes(const QHash<QString, QQmlJSScope::ConstPtr> &cont
m_baseType = findType(m_baseTypeName);
m_attachedType = findType(m_attachedTypeName);
+ m_valueType = findType(m_valueTypeName);
for (auto it = m_properties.begin(), end = m_properties.end(); it != end; ++it)
it->setType(findType(it->typeName()));
diff --git a/src/qmlcompiler/qqmljsscope_p.h b/src/qmlcompiler/qqmljsscope_p.h
index 99645a8071..24e401fa0a 100644
--- a/src/qmlcompiler/qqmljsscope_p.h
+++ b/src/qmlcompiler/qqmljsscope_p.h
@@ -101,7 +101,8 @@ public:
enum class AccessSemantics {
Reference,
Value,
- None
+ None,
+ Sequence
};
enum Flag {
@@ -200,6 +201,10 @@ public:
void setAttachedTypeName(const QString &name) { m_attachedTypeName = name; }
QQmlJSScope::ConstPtr attachedType() const { return m_attachedType; }
+ QString valueTypeName() const { return m_valueTypeName; }
+ void setValueTypeName(const QString &name) { m_valueTypeName = name; }
+ QQmlJSScope::ConstPtr valueType() const { return m_valueType; }
+
bool isSingleton() const { return m_flags & Singleton; }
bool isCreatable() const { return m_flags & Creatable; }
bool isComposite() const { return m_flags & Composite; }
@@ -258,6 +263,9 @@ private:
QString m_attachedTypeName;
QQmlJSScope::WeakConstPtr m_attachedType;
+ QString m_valueTypeName;
+ QQmlJSScope::WeakConstPtr m_valueType;
+
Flags m_flags;
AccessSemantics m_semantics = AccessSemantics::Reference;
diff --git a/src/qmlcompiler/qqmljstypedescriptionreader.cpp b/src/qmlcompiler/qqmljstypedescriptionreader.cpp
index 215a82b4bc..fd875dd715 100644
--- a/src/qmlcompiler/qqmljstypedescriptionreader.cpp
+++ b/src/qmlcompiler/qqmljstypedescriptionreader.cpp
@@ -224,6 +224,8 @@ void QQmlJSTypeDescriptionReader::readComponent(UiObjectDefinition *ast)
readMetaObjectRevisions(script, scope);
} else if (name == QLatin1String("attachedType")) {
scope->setAttachedTypeName(readStringBinding(script));
+ } else if (name == QLatin1String("valueType")) {
+ scope->setValueTypeName(readStringBinding(script));
} else if (name == QLatin1String("isSingleton")) {
scope->setIsSingleton(readBoolBinding(script));
} else if (name == QLatin1String("isCreatable")) {
@@ -238,6 +240,8 @@ void QQmlJSTypeDescriptionReader::readComponent(UiObjectDefinition *ast)
scope->setAccessSemantics(QQmlJSScope::AccessSemantics::Value);
} else if (semantics == QLatin1String("none")) {
scope->setAccessSemantics(QQmlJSScope::AccessSemantics::None);
+ } else if (semantics == QLatin1String("sequence")) {
+ scope->setAccessSemantics(QQmlJSScope::AccessSemantics::Sequence);
} else {
addWarning(script->firstSourceLocation(),
tr("Unknown access semantics \"%1\".").arg(semantics));
@@ -245,7 +249,7 @@ void QQmlJSTypeDescriptionReader::readComponent(UiObjectDefinition *ast)
} else {
addWarning(script->firstSourceLocation(),
tr("Expected only name, prototype, defaultProperty, attachedType, "
- "exports, isSingleton, isCreatable, isComposite and "
+ "valueType, exports, isSingleton, isCreatable, isComposite and "
"exportMetaObjectRevisions script bindings, not \"%1\".").arg(name));
}
} else {