diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2020-04-07 11:50:39 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-04-28 11:46:03 +0200 |
commit | c2de5643cd4f1b8d8b10e2bb62fdf95f12fdd9e3 (patch) | |
tree | 55cfa6610c91315d5ae6cbbf2c961fb2fbfcabd8 /src/qmltyperegistrar/qmltypesclassdescription.cpp | |
parent | 1029b2b9f3d0ff88c0900fbfec2fac873aa6bcd4 (diff) |
Register value types declaratively
For now this has the effect of adding them to the .qmltypes files. In
the future, the registration shall actually add additional value types
you can declare as properties in QML.
Change-Id: Ifee5a8ec054f35cc7bd07eb992a136730be68da7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmltyperegistrar/qmltypesclassdescription.cpp')
-rw-r--r-- | src/qmltyperegistrar/qmltypesclassdescription.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qmltyperegistrar/qmltypesclassdescription.cpp b/src/qmltyperegistrar/qmltypesclassdescription.cpp index 94f06a81ee..2214758f38 100644 --- a/src/qmltyperegistrar/qmltypesclassdescription.cpp +++ b/src/qmltyperegistrar/qmltypesclassdescription.cpp @@ -117,6 +117,9 @@ void QmlTypesClassDescription::collect(const QJsonObject *classDef, else if (foreignName == QLatin1String("QML.Attached")) collectAttached(foreignValue, types, foreign, defaultRevision); } + } else { + // The foreign type does not have a meta object: We only override the name. + className = value; } } else if (name == QLatin1String("QML.Root")) { isRootClass = true; @@ -173,6 +176,8 @@ void QmlTypesClassDescription::collect(const QJsonObject *classDef, revisions.erase(end, revisions.end()); resolvedClass = 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(); |