13#include <QtCore/qcborarray.h>
14#include <QtCore/qcbormap.h>
15#include <QtCore/qdir.h>
16#include <QtCore/qfile.h>
17#include <QtCore/qjsondocument.h>
18#include <QtCore/qqueue.h>
22using namespace Qt::StringLiterals;
31std::vector<std::unique_ptr<MetaTypePrivate>> s_pool;
35 const QJsonDocument jsonValue = QJsonDocument::fromJson(json, error);
36 if (jsonValue.isArray())
37 return QCborValue::fromJsonValue(jsonValue.array());
38 if (jsonValue.isObject())
39 return QCborValue::fromJsonValue(jsonValue.object());
45 const QAnyStringView unqualified = classDef.className();
46 const QAnyStringView qualified = classDef.qualifiedClassName();
48 QList<QAnyStringView> namespaces;
49 if (qualified != unqualified) {
50 namespaces = split(qualified,
"::"_L1);
51 Q_ASSERT(namespaces.last() == unqualified);
52 namespaces.pop_back();
60 for (
const QString &source: files) {
61 if (m_seenMetaTypesFiles.hasSeen(QDir::cleanPath(source)))
64 QCborValue metaObjects;
67 if (!f.open(QIODevice::ReadOnly)) {
68 error(source) <<
"Cannot open file for reading";
71 QJsonParseError parseError = {0, QJsonParseError::NoError};
72 metaObjects = fromJson(f.readAll(), &parseError);
73 if (parseError.error != QJsonParseError::NoError) {
75 <<
"Failed to parse JSON:" << parseError.error
76 << parseError.errorString();
81 if (metaObjects.isArray()) {
82 const QCborArray metaObjectsArray = metaObjects.toArray();
83 for (
const QCborValue &metaObject : metaObjectsArray) {
84 if (!metaObject.isMap()) {
85 error(source) <<
"JSON is not an object";
89 processTypes(metaObject.toMap());
91 }
else if (metaObjects.isMap()) {
92 processTypes(metaObjects.toMap());
94 error(source) <<
"JSON is not an object or an array";
104 QFile typesFile(types);
105 if (!typesFile.open(QIODevice::ReadOnly)) {
106 error(types) <<
"Cannot open foreign types file";
110 QJsonParseError parseError = {0, QJsonParseError::NoError};
111 QCborValue foreignMetaObjects = fromJson(typesFile.readAll(), &parseError);
112 if (parseError.error != QJsonParseError::NoError) {
114 <<
"Failed to parse JSON:" << parseError.error
115 << parseError.errorString();
119 const QCborArray foreignObjectsArray = foreignMetaObjects.toArray();
120 for (
const QCborValue &metaObject : foreignObjectsArray) {
121 if (!metaObject.isMap()) {
122 error(types) <<
"JSON is not an object";
126 processForeignTypes(metaObject.toMap());
136 for (
const QString &types : foreignTypesFiles) {
137 if (m_seenMetaTypesFiles.hasSeen(QDir::cleanPath(types)))
140 if (!processForeignTypes(types))
146template<
typename String>
149 std::sort(list->begin(), list->end());
150 const auto newEnd = std::unique(list->begin(), list->end());
151 list->erase(
typename QList<String>::const_iterator(newEnd), list->constEnd());
161 sortTypes(m_foreignTypes);
162 sortStringList(&m_primitiveTypes);
163 sortStringList(&m_usingDeclarations);
165 sortStringList(&m_referencedTypes);
166 sortStringList(&m_includes);
171 QString registrationHelper;
172 for (
const auto &obj: m_types) {
173 const QString className = obj.className().toString();
174 const QString qualifiedClassName = obj.qualifiedClassName().toString();
175 const QString foreignClassName = className + u"Foreign";
176 QStringList qmlElements;
177 QString qmlUncreatable;
179 bool isSingleton =
false;
180 bool isExplicitlyUncreatable =
false;
181 bool isNamespace = obj.kind() == MetaType::Kind::Namespace;
182 for (
const ClassInfo &entry: obj.classInfos()) {
183 const auto name = entry.name;
184 const auto value = entry.value;
185 if (name == S_ELEMENT) {
186 if (value == S_AUTO) {
187 qmlElements.append(u"QML_NAMED_ELEMENT("_s + className + u")"_s);
188 }
else if (value == S_ANONYMOUS) {
189 qmlElements.append(u"QML_ANONYMOUS"_s);
191 qmlElements.append(u"QML_NAMED_ELEMENT("_s + value.toString() + u")");
193 }
else if (name == S_CREATABLE && value == S_FALSE) {
194 isExplicitlyUncreatable =
true;
195 }
else if (name == S_UNCREATABLE_REASON) {
196 qmlUncreatable = u"QML_UNCREATABLE(\""_s + value.toString() + u"\")";
197 }
else if (name == S_ATTACHED) {
198 qmlAttached = u"QML_ATTACHED("_s + value.toString() + u")";
199 }
else if (name == S_SINGLETON) {
203 if (qmlElements.isEmpty())
205 const QString spaces = u" "_s;
207 registrationHelper += u"\nnamespace "_s + foreignClassName + u"{\n Q_NAMESPACE\n"_s;
208 registrationHelper += spaces + u"QML_FOREIGN_NAMESPACE(" + qualifiedClassName + u")\n"_s;
210 registrationHelper += u"\nstruct "_s + foreignClassName + u"{\n Q_GADGET\n"_s;
211 registrationHelper += spaces + u"QML_FOREIGN(" + qualifiedClassName + u")\n"_s;
213 registrationHelper += spaces + qmlElements.join(u"\n"_s) + u"\n"_s;
215 registrationHelper += spaces + u"QML_SINGLETON\n"_s;
216 if (isExplicitlyUncreatable) {
217 if (qmlUncreatable.isEmpty())
218 registrationHelper += spaces + uR"(QML_UNCREATABLE(""))" + u"n";
220 registrationHelper += spaces + qmlUncreatable + u"\n";
222 if (!qmlAttached.isEmpty())
223 registrationHelper += spaces + qmlAttached + u"\n";
224 registrationHelper += u"}";
226 registrationHelper += u";";
227 registrationHelper += u"\n";
229 return registrationHelper;
233 const MetaType &classDef, PopulateMode populateMode)
239 QList<QAnyStringView> primitiveAliases;
242 RegistrationMode mode = NoRegistration;
243 bool isSelfExtendingValueType =
false;
244 bool hasJavaScriptExtension =
false;
245 bool isRootObject =
false;
246 bool isSequence =
false;
248 for (
const ClassInfo &classInfo : classDef.classInfos()) {
249 if (classInfo.name == S_FOREIGN)
250 usingDeclaration.alias = classInfo.value;
251 else if (classInfo.name == S_PRIMITIVE_ALIAS)
252 primitiveAliases.append(classInfo.value);
253 else if (classInfo.name == S_EXTENSION_IS_JAVA_SCRIPT)
254 hasJavaScriptExtension = (classInfo.value == S_TRUE);
255 else if (classInfo.name == S_EXTENDED && classDef.kind() == MetaType::Kind::Gadget)
256 isSelfExtendingValueType = classInfo.value == classDef.className();
257 else if (classInfo.name == S_ROOT)
258 isRootObject = (classInfo.value == S_TRUE);
259 else if (classInfo.name == S_SEQUENCE)
261 else if (classInfo.name == S_USING)
262 usingDeclaration.original = classInfo.value;
263 else if (populateMode == PopulateMode::Yes && classInfo.name == S_ELEMENT) {
264 switch (classDef.kind()) {
265 case MetaType::Kind::Object:
266 mode = ObjectRegistration;
268 case MetaType::Kind::Gadget:
269 mode = GadgetRegistration;
271 case MetaType::Kind::Namespace:
272 mode = NamespaceRegistration;
276 <<
"Not registering a classInfo which is neither an object,"
277 <<
"nor a gadget, nor a namespace:"
278 << classInfo.name.toString();
284 return PreProcessResult {
285 std::move(primitiveAliases),
287 (!isRootObject && (isSequence || isSelfExtendingValueType || hasJavaScriptExtension))
288 ? usingDeclaration.alias
298 return string.visit([seed](
auto view) {
299 if constexpr (std::is_same_v<
decltype(view), QStringView>)
300 return qHash(view, seed);
301 if constexpr (std::is_same_v<
decltype(view), QLatin1StringView>)
302 return qHash(view, seed);
303 if constexpr (std::is_same_v<
decltype(view), QUtf8StringView>)
304 return qHash(QByteArrayView(view.data(), view.length()), seed);
310 return a.qualifiedClassName() < b.qualifiedClassName();
316 const auto remove = std::equal_range(
317 typeList.constBegin(), typeList.constEnd(), toBeRemoved,
318 qualifiedClassNameLessThan);
319 if (remove.first == remove.second)
321 for (
auto it = remove.first; it != remove.second; ++it) {
322 if (*it == toBeRemoved) {
333 const auto [lower, upper] = std::equal_range(
334 typeList.constBegin(), typeList.constEnd(), toBeAdded,
335 qualifiedClassNameLessThan);
337 typeList.insert(lower, toBeAdded);
348 case TypeRelation::Property:
return "property"_L1;
349 case TypeRelation::Argument:
return "argument"_L1;
350 case TypeRelation::Return:
return "return"_L1;
351 case TypeRelation::Enum:
return "enum"_L1;
352 case TypeRelation::Attached:
return "attached"_L1;
353 case TypeRelation::SequenceValue:
return "sequence value"_L1;
354 case TypeRelation::Extension:
return "extension"_L1;
359 Q_UNREACHABLE_RETURN(QLatin1StringView());
364 QSet<QAnyStringView> processedRelatedNativeNames;
365 QSet<QAnyStringView> processedRelatedJavaScriptNames;
366 QSet<QAnyStringView> unresolvedForeignNames;
367 QQueue<MetaType> typeQueue;
368 typeQueue.append(m_types);
370 const auto addRelatedName
371 = [&](QAnyStringView relatedName,
const QList<QAnyStringView> &namespaces) {
372 if (
const FoundType related = QmlTypesClassDescription::findType(
373 m_types, m_foreignTypes, relatedName, namespaces)) {
376 processedRelatedJavaScriptNames.insert(related
.javaScript.qualifiedClassName());
379 processedRelatedNativeNames.insert(related
.native.qualifiedClassName());
387 const auto addRelatedType = [&](
const MetaType &type) {
388 const QAnyStringView qualifiedName = type.qualifiedClassName();
389 if (type.inputFile().isEmpty())
390 processedRelatedJavaScriptNames.insert(qualifiedName);
392 processedRelatedNativeNames.insert(qualifiedName);
396 for (
const MetaType &type : std::as_const(m_types)) {
397 addRelatedType(type);
398 for (
const ClassInfo &obj : type.classInfos()) {
399 if (obj.name == S_FOREIGN) {
400 const QAnyStringView foreign = obj.value;
401 if (!addRelatedName(foreign, namespaces(type)))
402 unresolvedForeignNames.insert(foreign);
410 for (
const MetaType &foreignType : std::as_const(m_foreignTypes)) {
411 bool seenQmlPrefix =
false;
412 for (
const ClassInfo &obj : foreignType.classInfos()) {
413 const QAnyStringView name = obj.name;
414 if (!seenQmlPrefix && startsWith(name,
"QML."_L1)) {
415 addRelatedType(foreignType);
416 seenQmlPrefix =
true;
418 if (name == S_FOREIGN
419 || name == S_EXTENDED
420 || name == S_ATTACHED
421 || name == S_SEQUENCE) {
422 ResolvedTypeAlias foreign(obj.value, m_usingDeclarations);
423 if (!addRelatedName(foreign.type, namespaces(foreignType)))
424 unresolvedForeignNames.insert(foreign.type);
429 const auto addReference
430 = [&](
const MetaType &type, QSet<QAnyStringView> *processedRelatedNames,
434 QAnyStringView qualifiedName = type.qualifiedClassName();
435 m_referencedTypes.append(qualifiedName);
436 const qsizetype size = processedRelatedNames->size();
437 processedRelatedNames->insert(qualifiedName);
439 if (processedRelatedNames->size() == size) {
454 if (removeFromSortedMetaTypeList(m_opaqueTypes, type) ==
NotFound)
457 typeQueue.enqueue(type);
467 insertIntoSortedMetaTypeList(m_opaqueTypes, type);
475 insertIntoSortedMetaTypeList(m_types, type);
482 removeFromSortedMetaTypeList(m_foreignTypes, type);
485 const auto addInterface
486 = [&](QAnyStringView typeName,
const QList<QAnyStringView> &namespaces,
488 if (
const FoundType other = QmlTypesClassDescription::findType(
489 m_types, m_foreignTypes, typeName, namespaces)) {
498 unresolvedForeignNames.insert(typeName);
501 processedRelatedNativeNames.insert(typeName);
505 const auto doAddReferences = [&](QAnyStringView typeName,
506 const QList<QAnyStringView> &namespaces,
508 if (
const FoundType other = QmlTypesClassDescription::findType(
509 m_types, m_foreignTypes, typeName, namespaces)) {
521 const auto addType = [&](
const MetaType &context, QAnyStringView typeName,
522 const QList<QAnyStringView> &namespaces,
TypeRelation relation) {
523 if (doAddReferences(typeName, namespaces, relation))
527 const QLatin1StringView separator(
"::");
528 if (
const qsizetype index = lastIndexOf(typeName, separator); index > 0) {
529 if (
const FoundType other = QmlTypesClassDescription::findType(
530 m_types, m_foreignTypes, typeName.left(index), namespaces)) {
532 const QAnyStringView enumName = typeName.mid(index + separator.length());
534 for (
const Enum &enumerator : other.native.enums()) {
535 if (enumerator.name != enumName && enumerator.alias != enumName)
539 other.native, &processedRelatedNativeNames, other.nativeOrigin,
542 other.javaScript, &processedRelatedJavaScriptNames,
543 other.javaScriptOrigin, relation);
550 for (
const Enum &enumerator : context.enums()) {
551 if (enumerator.name == typeName || enumerator.alias == typeName)
558 if (!unresolvedForeignNames.contains(typeName) && !isPrimitive(typeName)) {
565 MetaType type = MetaType::createOpaqueType(typeName);
566 insertIntoSortedMetaTypeList(m_opaqueTypes, type);
570 warning(context) << typeName <<
"is used as" << typeRelationString(relation)
571 <<
"type but cannot be found.";
575 processedRelatedNativeNames.insert(typeName);
576 processedRelatedJavaScriptNames.insert(typeName);
582 const auto addSupers = [&](
const MetaType &context,
const QList<QAnyStringView> &namespaces) {
583 for (
const Interface &iface : context.ifaces())
584 addInterface(interfaceName(iface), namespaces, TypeRelation::Base);
587 bool warnAboutSupers = context.kind() != MetaType::Kind::Gadget;
589 QList<QAnyStringView> missingSupers;
591 for (
const BaseType &superObject : context.superClasses()) {
592 if (superObject.access != Access::Public)
595 QAnyStringView typeName = superObject.name;
596 if (doAddReferences(typeName, namespaces, TypeRelation::Base))
597 warnAboutSupers =
false;
599 missingSupers.append(typeName);
602 for (QAnyStringView typeName : std::as_const(missingSupers)) {
605 && !unresolvedForeignNames.contains(typeName)
606 && !isPrimitive(typeName)) {
607 warning(context) << typeName <<
"is used as base type but cannot be found.";
610 processedRelatedNativeNames.insert(typeName);
611 processedRelatedJavaScriptNames.insert(typeName);
615 const auto addProperties = [&](
const MetaType &context,
616 const QList<QAnyStringView> &namespaces) {
617 for (
const Property &property : context.properties()) {
618 ResolvedTypeAlias resolved(property.type, m_usingDeclarations);
619 if (!resolved.type.isEmpty())
620 addType(context, resolved.type, namespaces, TypeRelation::Property);
624 const auto addMethods = [&](
const MetaType &context,
625 const QList<QAnyStringView> &namespaces) {
626 for (
const Method::Container &methods
627 : {context.methods(), context.constructors(), context.sigs() }) {
628 for (
const Method &methodObject : methods) {
629 if (methodObject.access != Access::Public)
631 for (
const Argument &argument : std::as_const(methodObject.arguments)) {
632 ResolvedTypeAlias resolved(argument.type, m_usingDeclarations);
633 if (!resolved.type.isEmpty())
634 addType(context, resolved.type, namespaces, TypeRelation::Argument);
637 ResolvedTypeAlias resolved(methodObject.returnType, m_usingDeclarations);
638 if (!resolved.type.isEmpty())
639 addType(context, resolved.type, namespaces, TypeRelation::Return);
644 const auto addEnums = [&](
const MetaType &context,
645 const QList<QAnyStringView> &namespaces) {
646 for (
const Enum &enumerator : context.enums()) {
647 ResolvedTypeAlias resolved(enumerator.type, m_usingDeclarations);
648 if (!resolved.type.isEmpty())
649 addType(context, resolved.type, namespaces, TypeRelation::Enum);
654 const QList<QAnyStringView> &namespaces) {
655 const QAnyStringView objNameValue = obj.name;
656 if (objNameValue == S_ATTACHED) {
659 }
else if (objNameValue == S_SEQUENCE) {
663 }
else if (objNameValue == S_EXTENDED) {
664 const QAnyStringView value = obj.value;
673 while (!typeQueue.isEmpty()) {
674 QAnyStringView unresolvedForeign;
676 const MetaType classDef = typeQueue.dequeue();
677 const QList<QAnyStringView> namespaces = MetaTypesJsonProcessor::namespaces(classDef);
679 for (
const ClassInfo &obj : classDef.classInfos()) {
680 if (addRelation(classDef, obj, namespaces))
682 if (obj.name != S_FOREIGN)
685 const QAnyStringView foreignClassName = obj.value;
689 if (
const FoundType found = QmlTypesClassDescription::findType(
690 m_foreignTypes, {}, foreignClassName, namespaces)) {
691 const MetaType other = found.select(classDef,
"Foreign");
692 const QList<QAnyStringView> otherNamespaces
693 = MetaTypesJsonProcessor::namespaces(other);
694 addSupers(other, otherNamespaces);
695 addProperties(other, otherNamespaces);
696 addMethods(other, otherNamespaces);
697 addEnums(other, otherNamespaces);
699 for (
const ClassInfo &obj : other.classInfos()) {
700 if (addRelation(classDef, obj, otherNamespaces))
704 }
else if (!QmlTypesClassDescription::findType(
705 m_types, {}, foreignClassName, namespaces)) {
706 unresolvedForeign = foreignClassName;
710 if (!unresolvedForeign.isEmpty() && !isPrimitive(unresolvedForeign)) {
713 <<
"is declared as foreign type, but cannot be found.";
716 addSupers(classDef, namespaces);
717 addProperties(classDef, namespaces);
718 addMethods(classDef, namespaces);
719 addEnums(classDef, namespaces);
725 std::sort(types.begin(), types.end(), qualifiedClassNameLessThan);
730 if (!m_privateIncludes)
731 return include.toString();
733 if (endsWith(include,
"_p.h"_L1))
734 return QLatin1String(
"private/") + include.toString();
736 if (startsWith(include,
"qplatform"_L1) || startsWith(include,
"qwindowsystem"_L1))
737 return QLatin1String(
"qpa/") + include.toString();
739 return include.toString();
744 const QString include = resolvedInclude(types[S_INPUT_FILE].toStringView());
745 const QCborArray classes = types[S_CLASSES].toArray();
746 for (
const QCborValue &cls : classes) {
747 const MetaType classDef(cls.toMap(), include);
749 const PreProcessResult preprocessed = preProcess(classDef, PopulateMode::Yes);
750 switch (preprocessed.mode) {
751 case NamespaceRegistration:
752 case GadgetRegistration:
753 case ObjectRegistration: {
754 if (!endsWith(include, QLatin1String(
".h"))
755 && !endsWith(include, QLatin1String(
".hpp"))
756 && !endsWith(include, QLatin1String(
".hxx"))
757 && !endsWith(include, QLatin1String(
".hh"))
758 && !endsWith(include, QLatin1String(
".py"))
759 && contains(include, QLatin1Char(
'.'))) {
761 <<
"Class" << classDef.qualifiedClassName()
762 <<
"is declared in" << include <<
"which appears not to be a header."
763 <<
"The compilation of its registration to QML may fail.";
765 m_includes.append(include);
766 m_types.emplaceBack(classDef);
770 m_foreignTypes.emplaceBack(classDef);
774 if (!preprocessed.foreignPrimitive.isEmpty()) {
775 m_primitiveTypes.emplaceBack(preprocessed.foreignPrimitive);
776 m_primitiveTypes.append(preprocessed.primitiveAliases);
779 if (preprocessed.usingDeclaration.isValid())
780 m_usingDeclarations.append(preprocessed.usingDeclaration);
786 const QString include = resolvedInclude(types[S_INPUT_FILE].toStringView());
787 const QCborArray classes = types[S_CLASSES].toArray();
788 for (
const QCborValue &cls : classes) {
789 const MetaType classDef(cls.toMap(), include);
790 PreProcessResult preprocessed = preProcess(classDef, PopulateMode::No);
792 m_foreignTypes.emplaceBack(classDef);
793 if (!preprocessed.foreignPrimitive.isEmpty()) {
794 m_primitiveTypes.emplaceBack(preprocessed.foreignPrimitive);
795 m_primitiveTypes.append(preprocessed.primitiveAliases);
798 if (preprocessed.usingDeclaration.isValid())
799 m_usingDeclarations.append(preprocessed.usingDeclaration);
805 const auto it = cbor.find(S_REVISION);
806 return it == cbor.end()
808 : QTypeRevision::fromEncodedVersion(it->toInteger());
813 const QAnyStringView access = cbor[S_ACCESS].toStringView();
814 if (access == S_PUBLIC)
815 return Access::Public;
816 if (access == S_PROTECTED)
817 return Access::Protected;
818 return Access::Private;
835 if (cbor.isArray()) {
836 QCborArray needlessWrapping = cbor.toArray();
837 className = needlessWrapping.size() > 0
838 ? needlessWrapping[0].toMap()[S_CLASS_NAME].toStringView()
841 className = cbor.toMap()[S_CLASS_NAME].toStringView();
855 ,
index(cbor[S_INDEX].toInteger(-1))
858 ,
isFinal(cbor[S_FINAL].toBool())
879 ,
isCloned(cbor[S_IS_CLONED].toBool())
881 ,
isConstructor(isConstructor || cbor[S_IS_CONSTRUCTOR].toBool())
882 ,
isConst(cbor[S_IS_CONST].toBool())
884 const QCborArray args = cbor[S_ARGUMENTS].toArray();
885 for (
const QCborValue &argument : args)
886 arguments.emplace_back(argument.toMap());
888 if (arguments.size() == 1) {
889 const QAnyStringView type = arguments[0].type;
890 if (type ==
"QQmlV4FunctionPtr"_L1 || type ==
"QQmlV4Function*"_L1) {
902 ,
isFlag(cbor[S_IS_FLAG].toBool())
903 ,
isClass(cbor[S_IS_CLASS].toBool())
905 const QCborArray vals = cbor[S_VALUES].toArray();
906 for (
const QCborValue &value : vals)
907 values.emplace_back(value.toStringView());
914 className = cbor[S_CLASS_NAME].toStringView();
916 qualifiedClassName = cbor[S_QUALIFIED_CLASS_NAME].toStringView();
918 const QCborArray cborSuperClasses = cbor[S_SUPER_CLASSES].toArray();
919 for (
const QCborValue &superClass : cborSuperClasses)
920 superClasses.emplace_back(superClass.toMap());
922 const QCborArray cborClassInfos = cbor[S_CLASS_INFOS].toArray();
923 for (
const QCborValue &classInfo : cborClassInfos)
924 classInfos.emplace_back(classInfo.toMap());
926 const QCborArray cborIfaces = cbor[S_INTERFACES].toArray();
927 for (
const QCborValue &iface : cborIfaces)
928 ifaces.emplace_back(iface);
930 const QCborArray cborProperties = cbor[S_PROPERTIES].toArray();
931 for (
const QCborValue &property : cborProperties)
932 properties.emplace_back(property.toMap());
934 for (
const QCborArray &cborMethods : { cbor[S_SLOTS].toArray(), cbor[S_METHODS].toArray() }) {
935 for (
const QCborValue &method : cborMethods)
936 methods.emplace_back(method.toMap(),
false);
939 const QCborArray cborSigs = cbor[S_SIGNALS].toArray();
940 for (
const QCborValue &sig : cborSigs)
941 sigs.emplace_back(sig.toMap(),
false);
943 const QCborArray cborConstructors = cbor[S_CONSTRUCTORS].toArray();
944 for (
const QCborValue &constructor : cborConstructors)
945 constructors.emplace_back(constructor.toMap(),
true);
947 const QCborArray cborEnums = cbor[S_ENUMS].toArray();
948 for (
const QCborValue &enumerator : cborEnums)
949 enums.emplace_back(enumerator.toMap());
951 if (cbor[S_GADGET].toBool())
953 else if (cbor[S_OBJECT].toBool())
955 else if (cbor[S_NAMESPACE].toBool())
956 kind = Kind::Namespace;
964
965
966
969 auto priv = s_pool.emplace_back(std::make_unique<MetaTypePrivate>()).get();
970 priv->className = typeName;
971 priv->qualifiedClassName = typeName;
972 priv->kind = MetaType::Kind::Gadget;
Combined button and popup list for selecting options.
QDebug warning(const MetaType &classDef)
Argument(const QCborMap &cbor)
BaseType(const QCborMap &cbor)
ClassInfo(const QCborMap &cbor)
Enum(const QCborMap &cbor)
Interface(const QCborValue &cbor)
bool isJavaScriptFunction
Method(const QCborMap &cbor, bool isConstructor)
static constexpr int InvalidIndex
Property(const QCborMap &cbor)