diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-04-28 16:55:22 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-05-18 18:57:56 +0200 |
commit | 79b742fb84abe699ff726eec548793880cfa7527 (patch) | |
tree | 2947c614ac2453e44cbc3a6f45dca438d6486e8b /src/qmltyperegistrar/qmltypesclassdescription.cpp | |
parent | 1e30ec77aaedcc29ba7ac1c3ec3937ee0b8287e9 (diff) |
Preserve access semantics in qmltypes
gadget types are accessed with value semantics, object types are
accessed with reference semantics, and namespaces are not accessed.
Change-Id: I5eb8f132d729416f28bf94e651f877fc4a9a5c77
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmltyperegistrar/qmltypesclassdescription.cpp')
-rw-r--r-- | src/qmltyperegistrar/qmltypesclassdescription.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/qmltyperegistrar/qmltypesclassdescription.cpp b/src/qmltyperegistrar/qmltypesclassdescription.cpp index 2214758f38..2529951d7e 100644 --- a/src/qmltyperegistrar/qmltypesclassdescription.cpp +++ b/src/qmltyperegistrar/qmltypesclassdescription.cpp @@ -179,8 +179,14 @@ void QmlTypesClassDescription::collect(const QJsonObject *classDef, if (className.isEmpty() && mode == TopLevel) className = classDef->value(QLatin1String("qualifiedClassName")).toString(); - // If it's not a QObject, it's not creatable - isCreatable = isCreatable && classDef->value(QLatin1String("object")).toBool(); + if (classDef->value(QLatin1String("object")).toBool()) { + accessSemantics = QLatin1String("reference"); + } else { + isCreatable = false; + accessSemantics = classDef->value(QLatin1String("gadget")).toBool() + ? QLatin1String("value") + : QLatin1String("none"); + } } void QmlTypesClassDescription::collectAttached(const QString &attached, |