10#include <QtCore/qmetatype.h>
11#include <QtCore/qjsondocument.h>
12#include <QtCore/qjsonobject.h>
13#include <QtCore/qjsonvalue.h>
14#include <QtCore/qjsonarray.h>
15#include <QtCore/qplugin.h>
16#include <QtCore/qstringview.h>
17#include <QtCore/qtmocconstants.h>
22#include <private/qmetaobject_p.h>
23#include <private/qplugin_p.h>
27using namespace QtMiscUtils;
34 uint tp = qMetaTypeTypeInternal(name.constData());
35 return tp < uint(QMetaType::User) ? tp : uint(QMetaType::UnknownType);
39
40
43 int id = qMetaTypeTypeInternal(type.constData());
44 if (id == QMetaType::UnknownType)
46 return (id < QMetaType::User);
51#define RETURN_METATYPENAME_STRING(MetaTypeName, MetaTypeId, RealType)
52 case QMetaType::MetaTypeName: return #MetaTypeName;
55QT_FOR_EACH_STATIC_TYPE(RETURN_METATYPENAME_STRING)
57#undef RETURN_METATYPENAME_STRING
62 const QHash<QByteArray, QByteArray> &knownQObjectClasses,
63 const QHash<QByteArray, QByteArray> &knownGadgets, FILE *outfile,
64 bool requireCompleteTypes)
71 requireCompleteTypes(requireCompleteTypes)
73 if (cdef->superclassList.size())
74 purestSuperClass = cdef->superclassList.constFirst().classname;
79 if (s.at(i) !=
'\\' || i >= s.size() - 1)
81 const qsizetype startPos = i;
86 while (i < s.size() && isHexDigit(s.at(i)))
88 }
else if (isOctalDigit(ch)) {
89 while (i < startPos + 4
91 && isOctalDigit(s.at(i))) {
95 i = qMin(i + 1, s.size());
104 static constexpr int ColumnWidth = 72;
105 const qsizetype len = s.size();
109 qsizetype spanLen = qMin(ColumnWidth - 2, len - idx);
111 const qsizetype backSlashPos = s.lastIndexOf(
'\\', idx + spanLen - 1);
112 if (backSlashPos >= idx) {
113 const qsizetype escapeLen = lengthOfEscapeSequence(s, backSlashPos);
114 spanLen = qBound(spanLen, backSlashPos + escapeLen - idx, len - idx);
116 fprintf(out,
"\n \"%.*s\"",
int(spanLen), s.constData() + idx);
121void Generator::strreg(
const QByteArray &s)
123 if (!strings.contains(s))
127int Generator::stridx(
const QByteArray &s)
129 int i =
int(strings.indexOf(s));
130 Q_ASSERT_X(i != -1, Q_FUNC_INFO,
"We forgot to register some strings");
134bool Generator::registerableMetaType(
const QByteArray &propertyType)
136 if (metaTypes.contains(propertyType))
139 if (propertyType.endsWith(
'*')) {
140 QByteArray objectPointerType = propertyType;
144 objectPointerType.chop(1);
145 if (knownQObjectClasses.contains(objectPointerType))
149 static const QList<QByteArray> smartPointers = QList<QByteArray>()
150#define STREAM_SMART_POINTER(SMART_POINTER) << #SMART_POINTER
151 QT_FOR_EACH_AUTOMATIC_TEMPLATE_SMART_POINTER(STREAM_SMART_POINTER)
152#undef STREAM_SMART_POINTER
155 for (
const QByteArray &smartPointer : smartPointers) {
156 QByteArray ba = smartPointer +
"<";
157 if (propertyType.startsWith(ba) && !propertyType.endsWith(
"&"))
158 return knownQObjectClasses.contains(propertyType.mid(smartPointer.size() + 1, propertyType.size() - smartPointer.size() - 1 - 1));
161 static const QList<QByteArray> oneArgTemplates = QList<QByteArray>()
162#define STREAM_1ARG_TEMPLATE(TEMPLATENAME) << #TEMPLATENAME
163 QT_FOR_EACH_AUTOMATIC_TEMPLATE_1ARG(STREAM_1ARG_TEMPLATE)
164#undef STREAM_1ARG_TEMPLATE
166 for (
const QByteArray &oneArgTemplateType : oneArgTemplates) {
167 const QByteArray ba = oneArgTemplateType +
"<";
168 if (propertyType.startsWith(ba) && propertyType.endsWith(
">")) {
169 const qsizetype argumentSize = propertyType.size() - ba.size()
173 - (propertyType.at(propertyType.size() - 2) ==
' ' ? 1 : 0 );
174 const QByteArray templateArg = propertyType.sliced(ba.size(), argumentSize);
175 return isBuiltinType(templateArg) || registerableMetaType(templateArg);
182
185 if (qualifiedName == name)
187 const qsizetype index = qualifiedName.indexOf(
"::");
190 return qualifiedNameEquals(qualifiedName.mid(index+2), name);
196 QByteArray qualifiedClassNameIdentifier =
"ZN";
197 for (
const auto scope : qTokenize(QLatin1StringView(identifier), QLatin1Char(
':'),
198 Qt::SkipEmptyParts)) {
199 qualifiedClassNameIdentifier += QByteArray::number(scope.size());
200 qualifiedClassNameIdentifier += scope;
202 qualifiedClassNameIdentifier +=
'E';
203 return qualifiedClassNameIdentifier;
208 bool isQObject = (cdef->classname ==
"QObject");
209 bool isConstructible = !cdef->constructorList.isEmpty();
214 for (EnumDef def : std::as_const(cdef->enumList)) {
215 if (cdef->enumDeclarations.contains(def.name)) {
218 def.enumName = def.name;
219 QByteArray alias = cdef->flagAliases.value(def.name);
220 if (cdef->enumDeclarations.contains(alias)) {
225 cdef->enumList = enumList;
231 strreg(cdef->qualified);
232 registerClassInfoStrings();
233 registerFunctionStrings(cdef->signalList);
234 registerFunctionStrings(cdef->slotList);
235 registerFunctionStrings(cdef->methodList);
236 registerFunctionStrings(cdef->constructorList);
237 registerByteArrayVector(cdef->nonClassSignalList);
238 registerPropertyStrings();
239 registerEnumStrings();
242 bool hasStaticMetaCall =
244 || !cdef->propertyList.isEmpty() || !cdef->constructorList.isEmpty());
245 if (parser->activeQtMode)
246 hasStaticMetaCall =
false;
248 const QByteArray qualifiedClassNameIdentifier = generateQualifiedClassNameIdentifier(cdef->qualified);
251 const char *ownType = !cdef
->hasQNamespace ? cdef->classname.data() :
"void";
254 fprintf(out,
"namespace {\n"
255 "struct qt_meta_tag_%s_t {};\n"
256 "} // unnamed namespace\n\n",
257 qualifiedClassNameIdentifier.constData());
263 fprintf(out,
"static constexpr auto qt_meta_stringdata_%s = QtMocHelpers::stringData(",
264 qualifiedClassNameIdentifier.constData());
267 for (
const QByteArray &str : strings) {
270 printStringWithIndentation(out, str);
274 fprintf(out,
"\n);\n\n");
284 fprintf(out,
"template <> constexpr inline auto %s::qt_create_metaobjectdata<qt_meta_tag_%s_t>()\n"
286 " namespace QMC = QtMocConstants;\n"
287 " QtMocHelpers::UintData qt_methods {\n",
288 cdef->qualified.constData(), qualifiedClassNameIdentifier.constData());
291 addFunctions(cdef->signalList,
"Signal");
292 addFunctions(cdef->slotList,
"Slot");
293 addFunctions(cdef->methodList,
"Method");
295 " QtMocHelpers::UintData qt_properties {\n");
298 " QtMocHelpers::UintData qt_enums {\n");
300 fprintf(out,
" };\n");
302 const char *uintDataParams =
"";
303 if (isConstructible || !cdef->classInfoList.isEmpty()) {
304 if (isConstructible) {
305 fprintf(out,
" using Constructor = QtMocHelpers::NoType;\n"
306 " QtMocHelpers::UintData qt_constructors {\n");
307 addFunctions(cdef->constructorList,
"Constructor");
308 fprintf(out,
" };\n");
310 fputs(
" QtMocHelpers::UintData qt_constructors {};\n", out);
313 uintDataParams =
", qt_constructors";
314 if (!cdef->classInfoList.isEmpty()) {
315 fprintf(out,
" QtMocHelpers::ClassInfos qt_classinfo({\n");
317 fprintf(out,
" });\n");
318 uintDataParams =
", qt_constructors, qt_classinfo";
322 const char *metaObjectFlags =
"QMC::MetaObjectFlag{}";
327 metaObjectFlags =
"QMC::PropertyAccessInStaticMetaCall";
330 QByteArray tagType =
"qt_meta_tag_" + qualifiedClassNameIdentifier +
"_t";
331 if (requireCompleteness)
332 tagType =
"QtMocHelpers::ForceCompleteMetaTypes<" + tagType +
'>';
333 fprintf(out,
" return QtMocHelpers::metaObjectData<%s, %s>(%s,\n"
334 " qt_methods, qt_properties, qt_enums%s);\n"
336 ownType, tagType.constData(), metaObjectFlags, uintDataParams);
339 QByteArray metaVarNameSuffix;
343 metaVarNameSuffix =
'_' + qualifiedClassNameIdentifier;
344 const char *n = metaVarNameSuffix.constData();
346static constexpr auto qt_staticMetaObjectContent%s =
347 %s::qt_create_metaobjectdata<qt_meta_tag%s_t>();
348static constexpr auto qt_staticMetaObjectStaticContent%s =
349 qt_staticMetaObjectContent%s.data;
350static constexpr auto qt_staticMetaObjectRelocatingContent%s =
351 qt_staticMetaObjectContent%s.metaTypes;
352
353)",
354 n, cdef->qualified.constData(), n,
359 metaVarNameSuffix =
"<qt_meta_tag_" + qualifiedClassNameIdentifier +
"_t>";
365 QList<QByteArray> extraList;
366 QMultiHash<QByteArray, QByteArray> knownExtraMetaObject(knownGadgets);
367 knownExtraMetaObject.unite(knownQObjectClasses);
369 for (
const PropertyDef &p : std::as_const(cdef->propertyList)) {
370 if (isBuiltinType(p.type))
373 if (p.type.contains(
'*') || p.type.contains(
'<') || p.type.contains(
'>'))
376 const qsizetype s = p.type.lastIndexOf(
"::");
380 QByteArray unqualifiedScope = p.type.left(s);
383 QMultiHash<QByteArray, QByteArray>::ConstIterator scopeIt;
385 QByteArray thisScope = cdef->qualified;
387 const qsizetype s = thisScope.lastIndexOf(
"::");
388 thisScope = thisScope.left(s);
389 QByteArray currentScope = thisScope.isEmpty() ? unqualifiedScope : thisScope +
"::" + unqualifiedScope;
390 scopeIt = knownExtraMetaObject.constFind(currentScope);
391 }
while (!thisScope.isEmpty() && scopeIt == knownExtraMetaObject.constEnd());
393 if (scopeIt == knownExtraMetaObject.constEnd())
396 const QByteArray &scope = *scopeIt;
400 if (qualifiedNameEquals(cdef->qualified, scope))
403 if (!extraList.contains(scope))
410 for (
auto it = cdef->enumDeclarations.keyBegin(),
411 end = cdef->enumDeclarations.keyEnd(); it != end; ++it) {
412 const QByteArray &enumKey = *it;
413 const qsizetype s = enumKey.lastIndexOf(
"::");
415 QByteArray scope = enumKey.left(s);
416 if (scope !=
"Qt" && !qualifiedNameEquals(cdef->qualified, scope) && !extraList.contains(scope))
425 if (!extraList.isEmpty()) {
426 fprintf(out,
"Q_CONSTINIT static const QMetaObject::SuperData qt_meta_extradata_%s[] = {\n",
427 qualifiedClassNameIdentifier.constData());
428 for (
const QByteArray &ba : std::as_const(extraList))
429 fprintf(out,
" QMetaObject::SuperData::link<%s::staticMetaObject>(),\n", ba.constData());
431 fprintf(out,
" nullptr\n};\n\n");
437 fprintf(out,
"Q_CONSTINIT const QMetaObject %s::staticMetaObject = { {\n",
438 cdef->qualified.constData());
441 fprintf(out,
" nullptr,\n");
443 fprintf(out,
" QMetaObject::SuperData::link<%s::staticMetaObject>(),\n", purestSuperClass.constData());
444 else if (cdef->superclassList.size())
445 fprintf(out,
" QtPrivate::MetaObjectForType<%s>::value,\n", purestSuperClass.constData());
447 fprintf(out,
" nullptr,\n");
448 fprintf(out,
" qt_meta_stringdata_%s.offsetsAndSizes,\n"
449 " qt_staticMetaObjectStaticContent%s.data(),\n",
450 qualifiedClassNameIdentifier.constData(),
451 metaVarNameSuffix.constData());
452 if (hasStaticMetaCall)
453 fprintf(out,
" qt_static_metacall,\n");
455 fprintf(out,
" nullptr,\n");
457 if (extraList.isEmpty())
458 fprintf(out,
" nullptr,\n");
460 fprintf(out,
" qt_meta_extradata_%s,\n", qualifiedClassNameIdentifier.constData());
462 fprintf(out,
" qt_staticMetaObjectRelocatingContent%s.data(),\n",
463 metaVarNameSuffix.constData());
465 fprintf(out,
" nullptr\n} };\n\n");
470 if (hasStaticMetaCall)
471 generateStaticMetacall();
476 fprintf(out,
"\nconst QMetaObject *%s::metaObject() const\n{\n"
477 " return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;\n"
479 cdef->qualified.constData());
484 fprintf(out,
"\nvoid *%s::qt_metacast(const char *_clname)\n{\n", cdef->qualified.constData());
485 fprintf(out,
" if (!_clname) return nullptr;\n");
486 fprintf(out,
" if (!strcmp(_clname, qt_meta_stringdata_%s.stringdata0))\n"
487 " return static_cast<void*>(this);\n",
488 qualifiedClassNameIdentifier.constData());
491 if (cdef->superclassList.size() > 1) {
492 auto it = cdef->superclassList.cbegin() + 1;
493 const auto end = cdef->superclassList.cend();
494 for (; it != end; ++it) {
497 const char *cname = it->classname.constData();
498 fprintf(out,
" if (!strcmp(_clname, \"%s\"))\n return static_cast< %s*>(this);\n",
503 for (
const QList<ClassDef::Interface> &iface : std::as_const(cdef->interfaceList)) {
504 for (qsizetype j = 0; j < iface.size(); ++j) {
505 fprintf(out,
" if (!strcmp(_clname, %s))\n return ", iface.at(j).interfaceId.constData());
506 for (qsizetype k = j; k >= 0; --k)
507 fprintf(out,
"static_cast< %s*>(", iface.at(k).className.constData());
508 fprintf(out,
"this%s;\n", QByteArray(j + 1,
')').constData());
511 if (!purestSuperClass.isEmpty() && !isQObject) {
512 QByteArray superClass = purestSuperClass;
513 fprintf(out,
" return %s::qt_metacast(_clname);\n", superClass.constData());
515 fprintf(out,
" return nullptr;\n");
519 if (parser->activeQtMode)
530 for (
int signalindex = 0; signalindex <
int(cdef->signalList.size()); ++signalindex)
531 generateSignal(&cdef->signalList.at(signalindex), signalindex);
536 generatePluginMetaData();
541 if (!cdef->nonClassSignalList.isEmpty()) {
542 fprintf(out,
"namespace CheckNotifySignalValidity_%s {\n", qualifiedClassNameIdentifier.constData());
543 for (
const QByteArray &nonClassSignal : std::as_const(cdef->nonClassSignalList)) {
544 const auto propertyIt = std::find_if(cdef->propertyList.constBegin(),
545 cdef->propertyList.constEnd(),
546 [&nonClassSignal](
const PropertyDef &p) {
547 return nonClassSignal == p.notify;
550 Q_ASSERT(propertyIt != cdef->propertyList.constEnd());
551 fprintf(out,
"template<typename T> using has_nullary_%s = decltype(std::declval<T>().%s());\n",
552 nonClassSignal.constData(),
553 nonClassSignal.constData());
554 const auto &propertyType = propertyIt->type;
555 fprintf(out,
"template<typename T> using has_unary_%s = decltype(std::declval<T>().%s(std::declval<%s>()));\n",
556 nonClassSignal.constData(),
557 nonClassSignal.constData(),
558 propertyType.constData());
559 fprintf(out,
"static_assert(qxp::is_detected_v<has_nullary_%s, %s> || qxp::is_detected_v<has_unary_%s, %s>,\n"
560 " \"NOTIFY signal %s does not exist in class (or is private in its parent)\");\n",
561 nonClassSignal.constData(), cdef->qualified.constData(),
562 nonClassSignal.constData(), cdef->qualified.constData(),
563 nonClassSignal.constData());
570void Generator::registerClassInfoStrings()
572 for (
const ClassInfoDef &c : std::as_const(cdef->classInfoList)) {
580 for (
const ClassInfoDef &c : std::as_const(cdef->classInfoList))
581 fprintf(out,
" { %4d, %4d },\n", stridx(c.name), stridx(c.value));
586 for (
const FunctionDef &f : list) {
588 if (!isBuiltinType(f.normalizedType))
589 strreg(f.normalizedType);
592 for (
const ArgumentDef &a : f.arguments) {
593 if (!isBuiltinType(a.normalizedType))
594 strreg(a.normalizedType);
600void Generator::registerByteArrayVector(
const QList<QByteArray> &list)
602 for (
const QByteArray &ba : list)
608 for (
const FunctionDef &f : list) {
609 if (!f.isConstructor)
610 fprintf(out,
" // %s '%s'\n", functype, f.name.constData());
611 fprintf(out,
" QtMocHelpers::%s%sData<",
612 f.revision > 0 ?
"Revisioned" :
"", functype);
615 fprintf(out,
"Constructor(");
617 fprintf(out,
"%s(", f.type.name.constData());
619 const char *comma =
"";
620 for (
const auto &argument : f.arguments) {
621 fprintf(out,
"%s%s", comma, argument.type.name.constData());
626 fprintf(out,
")>(%d, ", stridx(f.tag));
628 fprintf(out,
")%s>(%d, %d, ", f.isConst ?
" const" :
"", stridx(f.name), stridx(f.tag));
632 if (f.access == FunctionDef::Private)
633 fprintf(out,
"QMC::AccessPrivate");
634 else if (f.access == FunctionDef::Public)
635 fprintf(out,
"QMC::AccessPublic");
636 else if (f.access == FunctionDef::Protected)
637 fprintf(out,
"QMC::AccessProtected");
639 fprintf(out,
" | QMC::MethodCompatibility");
641 fprintf(out,
" | QMC::MethodCloned");
643 fprintf(out,
" | QMC::MethodScriptable");
647 fprintf(out,
", %#x", f.revision);
650 if (!f.isConstructor) {
652 generateTypeInfo(f.normalizedType);
655 if (f.arguments.isEmpty()) {
656 fprintf(out,
"),\n");
659 fprintf(out,
", {{");
660 for (qsizetype i = 0; i < f.arguments.size(); ++i) {
663 const ArgumentDef &arg = f.arguments.at(i);
665 generateTypeInfo(arg.normalizedType);
666 fprintf(out,
", %d },", stridx(arg.name));
669 fprintf(out,
"\n }}),\n");
675void Generator::generateTypeInfo(
const QByteArray &typeName,
bool allowEmptyName)
677 Q_UNUSED(allowEmptyName);
678 if (isBuiltinType(typeName)) {
680 const char *valueString;
681 if (typeName ==
"qreal") {
682 type = QMetaType::UnknownType;
683 valueString =
"QReal";
685 type = nameToBuiltinType(typeName);
689 fprintf(out,
"QMetaType::%s", valueString);
691 Q_ASSERT(type != QMetaType::UnknownType);
692 fprintf(out,
"%4d", type);
695 Q_ASSERT(!typeName.isEmpty() || allowEmptyName);
696 fprintf(out,
"0x%.8x | %d", IsUnresolvedType, stridx(typeName));
702 for (
const PropertyDef &p : std::as_const(cdef->propertyList)) {
704 if (!isBuiltinType(p.type))
711 for (
const PropertyDef &p : std::as_const(cdef->propertyList)) {
712 fprintf(out,
" // property '%s'\n"
713 " QtMocHelpers::PropertyData<%s>(%d, ",
714 p.name.constData(), p.type.constData(), stridx(p.name));
715 generateTypeInfo(p.type);
718 const char *separator =
"";
719 auto addFlag = [
this, &separator](
const char *text) {
720 fprintf(out,
"%s QMC::%s", separator, text);
723 bool readable = !p.read.isEmpty() || !p.member.isEmpty();
724 bool designable = p.designable !=
"false";
725 bool scriptable = p.scriptable !=
"false";
726 bool stored = p.stored !=
"false";
727 if (readable && designable && scriptable && stored) {
728 addFlag(
"DefaultPropertyFlags");
729 if ((!p.member.isEmpty() && !p.constant) || !p.write.isEmpty())
734 if ((!p.member.isEmpty() && !p.constant) || !p.write.isEmpty())
737 addFlag(
"Designable");
739 addFlag(
"Scriptable");
743 if (!p.reset.isEmpty())
744 addFlag(
"Resettable");
745 if (!isBuiltinType(p.type))
746 addFlag(
"EnumOrFlag");
748 addFlag(
"StdCppSet");
753 if (p.user !=
"false")
757 if (!p.bind.isEmpty())
760 if (*separator ==
'\0')
763 int notifyId = p.notifyId;
764 if (notifyId != -1 || p.revision > 0) {
766 if (p.notifyId < -1) {
768 const int indexInStrings =
int(strings.indexOf(p.notify));
769 notifyId = indexInStrings;
770 fprintf(out,
"%#x | ", IsUnresolvedSignal);
772 fprintf(out,
"%d", notifyId);
774 fprintf(out,
", %#x", p.revision);
777 fprintf(out,
"),\n");
783 for (
const EnumDef &e : std::as_const(cdef->enumList)) {
785 if (!e.enumName.isNull())
787 for (
const QByteArray &val : e.values)
794 for (
const EnumDef &e : std::as_const(cdef->enumList)) {
795 const QByteArray &typeName = e.enumName.isNull() ? e.name : e.enumName;
796 fprintf(out,
" // %s '%s'\n"
797 " QtMocHelpers::EnumData<%s>(%d, %d,",
798 e.flags & EnumIsFlag ?
"flag" :
"enum", e.name.constData(),
799 e.name.constData(), stridx(e.name), stridx(typeName));
802 const char *separator =
"";
803 auto addFlag = [
this, &separator](
const char *text) {
804 fprintf(out,
"%s QMC::%s", separator, text);
807 if (e.flags & EnumIsFlag)
808 addFlag(
"EnumIsFlag");
809 if (e.flags & EnumIsScoped)
810 addFlag(
"EnumIsScoped");
812 fprintf(out,
" QMC::EnumFlags{}");
815 if (e.values.isEmpty()) {
816 fprintf(out,
"),\n");
821 fprintf(out,
").add({\n");
822 QByteArray prefix = (e.enumName.isNull() ? e.name : e.enumName);
823 for (
const QByteArray &val : e.values) {
824 fprintf(out,
" { %4d, %s::%s },\n", stridx(val),
825 prefix.constData(), val.constData());
828 fprintf(out,
" }),\n");
834 bool isQObject = (cdef->classname ==
"QObject");
836 fprintf(out,
"\nint %s::qt_metacall(QMetaObject::Call _c, int _id, void **_a)\n{\n",
837 cdef->qualified.constData());
839 if (!purestSuperClass.isEmpty() && !isQObject) {
840 QByteArray superClass = purestSuperClass;
841 fprintf(out,
" _id = %s::qt_metacall(_c, _id, _a);\n", superClass.constData());
846 methodList += cdef->signalList;
847 methodList += cdef->slotList;
848 methodList += cdef->methodList;
853 if (methodList.size() || cdef->propertyList.size()) {
854 fprintf(out,
" if (_id < 0)\n return _id;\n");
857 if (methodList.size()) {
858 fprintf(out,
" if (_c == QMetaObject::InvokeMetaMethod) {\n");
859 fprintf(out,
" if (_id < %d)\n",
int(methodList.size()));
860 fprintf(out,
" qt_static_metacall(this, _c, _id, _a);\n");
861 fprintf(out,
" _id -= %d;\n }\n",
int(methodList.size()));
863 fprintf(out,
" if (_c == QMetaObject::RegisterMethodArgumentMetaType) {\n");
864 fprintf(out,
" if (_id < %d)\n",
int(methodList.size()));
866 if (methodsWithAutomaticTypesHelper(methodList).isEmpty())
867 fprintf(out,
" *reinterpret_cast<QMetaType *>(_a[0]) = QMetaType();\n");
869 fprintf(out,
" qt_static_metacall(this, _c, _id, _a);\n");
870 fprintf(out,
" _id -= %d;\n }\n",
int(methodList.size()));
874 if (cdef->propertyList.size()) {
876 " if (_c == QMetaObject::ReadProperty || _c == QMetaObject::WriteProperty\n"
877 " || _c == QMetaObject::ResetProperty || _c == QMetaObject::BindableProperty\n"
878 " || _c == QMetaObject::RegisterPropertyMetaType) {\n"
879 " qt_static_metacall(this, _c, _id, _a);\n"
880 " _id -= %d;\n }\n",
int(cdef->propertyList.size()));
882 fprintf(out,
" return _id;\n}\n");
887QMultiMap<QByteArray,
int>
Generator::automaticPropertyMetaTypesHelper()
889 QMultiMap<QByteArray,
int> automaticPropertyMetaTypes;
890 for (
int i = 0; i <
int(cdef->propertyList.size()); ++i) {
891 const QByteArray propertyType = cdef->propertyList.at(i).type;
892 if (registerableMetaType(propertyType) && !isBuiltinType(propertyType))
893 automaticPropertyMetaTypes.insert(propertyType, i);
895 return automaticPropertyMetaTypes;
898QMap<
int, QMultiMap<QByteArray,
int>>
901 QMap<
int, QMultiMap<QByteArray,
int> > methodsWithAutomaticTypes;
902 for (
int i = 0; i < methodList.size(); ++i) {
904 for (
int j = 0; j < f.arguments.size(); ++j) {
905 const QByteArray argType = f.arguments.at(j).normalizedType;
906 if (registerableMetaType(argType) && !isBuiltinType(argType))
907 methodsWithAutomaticTypes[i].insert(argType, j);
910 return methodsWithAutomaticTypes;
915 fprintf(out,
"void %s::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)\n{\n",
916 cdef->qualified.constData());
928 fprintf(out,
" Q_ASSERT(_o == nullptr || staticMetaObject.cast(_o));\n");
930 fprintf(out,
" auto *_t = static_cast<%s *>(_o);\n", cdef->classname.constData());
932 fprintf(out,
" auto *_t = reinterpret_cast<%s *>(_o);\n", cdef->classname.constData());
935 const auto generateCtorArguments = [&](
int ctorindex) {
936 const FunctionDef &f = cdef->constructorList.at(ctorindex);
940 const auto begin = f.arguments.cbegin();
941 const auto end = f.arguments.cend();
942 for (
auto it = begin; it != end; ++it) {
946 fprintf(out,
"(*reinterpret_cast<%s>(_a[%d]))",
947 a.typeNameForCast.constData(), offset++);
951 if (!cdef->constructorList.isEmpty()) {
952 fprintf(out,
" if (_c == QMetaObject::CreateInstance) {\n");
953 fprintf(out,
" switch (_id) {\n");
954 const int ctorend =
int(cdef->constructorList.size());
955 for (
int ctorindex = 0; ctorindex < ctorend; ++ctorindex) {
956 fprintf(out,
" case %d: { %s *_r = new %s(", ctorindex,
957 cdef->classname.constData(), cdef->classname.constData());
958 generateCtorArguments(ctorindex);
959 fprintf(out,
");\n");
960 fprintf(out,
" if (_a[0]) *reinterpret_cast<%s**>(_a[0]) = _r; } break;\n",
963 fprintf(out,
" default: break;\n");
964 fprintf(out,
" }\n");
965 fprintf(out,
" }\n");
966 fprintf(out,
" if (_c == QMetaObject::ConstructInPlace) {\n");
967 fprintf(out,
" switch (_id) {\n");
968 for (
int ctorindex = 0; ctorindex < ctorend; ++ctorindex) {
969 fprintf(out,
" case %d: { new (_a[0]) %s(",
970 ctorindex, cdef->classname.constData());
971 generateCtorArguments(ctorindex);
972 fprintf(out,
"); } break;\n");
974 fprintf(out,
" default: break;\n");
975 fprintf(out,
" }\n");
976 fprintf(out,
" }\n");
977 usedArgs |= UsedC | UsedId | UsedA;
981 methodList += cdef->signalList;
982 methodList += cdef->slotList;
983 methodList += cdef->methodList;
985 if (!methodList.isEmpty()) {
986 usedArgs |= UsedT | UsedC | UsedId;
987 fprintf(out,
" if (_c == QMetaObject::InvokeMetaMethod) {\n");
988 fprintf(out,
" switch (_id) {\n");
989 for (
int methodindex = 0; methodindex < methodList.size(); ++methodindex) {
991 Q_ASSERT(!f.normalizedType.isEmpty());
992 fprintf(out,
" case %d: ", methodindex);
993 if (f.normalizedType !=
"void")
994 fprintf(out,
"{ %s _r = ", noRef(f.normalizedType).constData());
995 fprintf(out,
"_t->");
996 if (f.inPrivateClass.size())
997 fprintf(out,
"%s->", f.inPrivateClass.constData());
998 fprintf(out,
"%s(", f.name.constData());
1002 fprintf(out,
"QMethodRawArguments{ _a }");
1005 const auto begin = f.arguments.cbegin();
1006 const auto end = f.arguments.cend();
1007 for (
auto it = begin; it != end; ++it) {
1011 fprintf(out,
"(*reinterpret_cast< %s>(_a[%d]))",a.typeNameForCast.constData(), offset++);
1015 if (!f.arguments.isEmpty())
1017 fprintf(out,
"%s",
"QPrivateSignal()");
1021 if (f.normalizedType !=
"void") {
1022 fprintf(out,
"\n if (_a[0]) *reinterpret_cast< %s*>(_a[0]) = std::move(_r); } ",
1023 noRef(f.normalizedType).constData());
1026 fprintf(out,
" break;\n");
1028 fprintf(out,
" default: ;\n");
1029 fprintf(out,
" }\n");
1030 fprintf(out,
" }\n");
1032 QMap<
int, QMultiMap<QByteArray,
int> > methodsWithAutomaticTypes = methodsWithAutomaticTypesHelper(methodList);
1034 if (!methodsWithAutomaticTypes.isEmpty()) {
1035 fprintf(out,
" if (_c == QMetaObject::RegisterMethodArgumentMetaType) {\n");
1036 fprintf(out,
" switch (_id) {\n");
1037 fprintf(out,
" default: *reinterpret_cast<QMetaType *>(_a[0]) = QMetaType(); break;\n");
1038 QMap<
int, QMultiMap<QByteArray,
int> >::const_iterator it = methodsWithAutomaticTypes.constBegin();
1039 const QMap<
int, QMultiMap<QByteArray,
int> >::const_iterator end = methodsWithAutomaticTypes.constEnd();
1040 for ( ; it != end; ++it) {
1041 fprintf(out,
" case %d:\n", it.key());
1042 fprintf(out,
" switch (*reinterpret_cast<int*>(_a[1])) {\n");
1043 fprintf(out,
" default: *reinterpret_cast<QMetaType *>(_a[0]) = QMetaType(); break;\n");
1044 auto jt = it->begin();
1045 const auto jend = it->end();
1046 while (jt != jend) {
1047 fprintf(out,
" case %d:\n", jt.value());
1048 const QByteArray &lastKey = jt.key();
1050 if (jt == jend || jt.key() != lastKey)
1051 fprintf(out,
" *reinterpret_cast<QMetaType *>(_a[0]) = QMetaType::fromType< %s >(); break;\n", lastKey.constData());
1053 fprintf(out,
" }\n");
1054 fprintf(out,
" break;\n");
1056 fprintf(out,
" }\n");
1057 fprintf(out,
" }\n");
1058 usedArgs |= UsedC | UsedId | UsedA;
1062 if (!cdef->signalList.isEmpty()) {
1063 usedArgs |= UsedC | UsedA;
1064 fprintf(out,
" if (_c == QMetaObject::IndexOfMethod) {\n");
1065 for (
int methodindex = 0; methodindex <
int(cdef->signalList.size()); ++methodindex) {
1066 const FunctionDef &f = cdef->signalList.at(methodindex);
1069 fprintf(out,
" if (QtMocHelpers::indexOfMethod<%s (%s::*)(",
1070 f.type.rawName.constData() , cdef->classname.constData());
1072 const auto begin = f.arguments.cbegin();
1073 const auto end = f.arguments.cend();
1074 for (
auto it = begin; it != end; ++it) {
1078 fprintf(out,
"%s", QByteArray(a.type.name +
' ' + a.rightType).constData());
1081 if (!f.arguments.isEmpty())
1083 fprintf(out,
"%s",
"QPrivateSignal");
1085 fprintf(out,
")%s>(_a, &%s::%s, %d))\n",
1087 cdef->classname.constData(), f.name.constData(), methodindex);
1088 fprintf(out,
" return;\n");
1090 fprintf(out,
" }\n");
1093 const QMultiMap<QByteArray,
int> automaticPropertyMetaTypes = automaticPropertyMetaTypesHelper();
1095 if (!automaticPropertyMetaTypes.isEmpty()) {
1096 fprintf(out,
" if (_c == QMetaObject::RegisterPropertyMetaType) {\n");
1097 fprintf(out,
" switch (_id) {\n");
1098 fprintf(out,
" default: *reinterpret_cast<int*>(_a[0]) = -1; break;\n");
1099 auto it = automaticPropertyMetaTypes.begin();
1100 const auto end = automaticPropertyMetaTypes.end();
1102 fprintf(out,
" case %d:\n", it.value());
1103 const QByteArray &lastKey = it.key();
1105 if (it == end || it.key() != lastKey)
1106 fprintf(out,
" *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< %s >(); break;\n", lastKey.constData());
1108 fprintf(out,
" }\n");
1109 fprintf(out,
" }\n");
1110 usedArgs |= UsedC | UsedId | UsedA;
1113 if (!cdef->propertyList.empty()) {
1114 bool needGet =
false;
1115 bool needTempVarForGet =
false;
1116 bool needSet =
false;
1117 bool needReset =
false;
1118 bool hasBindableProperties =
false;
1119 for (
const PropertyDef &p : std::as_const(cdef->propertyList)) {
1120 needGet |= !p.read.isEmpty() || !p.member.isEmpty();
1121 if (!p.read.isEmpty() || !p.member.isEmpty())
1122 needTempVarForGet |= (p.gspec != PropertyDef::PointerSpec
1123 && p.gspec != PropertyDef::ReferenceSpec);
1125 needSet |= !p.write.isEmpty() || (!p.member.isEmpty() && !p.constant);
1126 needReset |= !p.reset.isEmpty();
1127 hasBindableProperties |= !p.bind.isEmpty();
1129 if (needGet || needSet || hasBindableProperties || needReset)
1130 usedArgs |= UsedT | UsedC | UsedId;
1131 if (needGet || needSet || hasBindableProperties)
1135 fprintf(out,
" if (_c == QMetaObject::ReadProperty) {\n");
1136 if (needTempVarForGet)
1137 fprintf(out,
" void *_v = _a[0];\n");
1138 fprintf(out,
" switch (_id) {\n");
1139 for (
int propindex = 0; propindex <
int(cdef->propertyList.size()); ++propindex) {
1140 const PropertyDef &p = cdef->propertyList.at(propindex);
1141 if (p.read.isEmpty() && p.member.isEmpty())
1143 QByteArray prefix =
"_t->";
1144 if (p.inPrivateClass.size()) {
1145 prefix += p.inPrivateClass +
"->";
1149 fprintf(out,
" case %d: _a[0] = const_cast<void*>(reinterpret_cast<const void*>(%s%s())); break;\n",
1150 propindex, prefix.constData(), p.read.constData());
1152 fprintf(out,
" case %d: _a[0] = const_cast<void*>(reinterpret_cast<const void*>(&%s%s())); break;\n",
1153 propindex, prefix.constData(), p.read.constData());
1154#if QT_VERSION <= QT_VERSION_CHECK(7
, 0
, 0
)
1155 else if (
auto eflags = cdef->enumDeclarations.value(p.type); eflags & EnumIsFlag)
1156 fprintf(out,
" case %d: QtMocHelpers::assignFlags<%s>(_v, %s%s()); break;\n",
1157 propindex, p.type.constData(), prefix.constData(), p.read.constData());
1159 else if (p.read ==
"default")
1160 fprintf(out,
" case %d: *reinterpret_cast< %s*>(_v) = %s%s().value(); break;\n",
1161 propindex, p.type.constData(), prefix.constData(), p.bind.constData());
1162 else if (!p.read.isEmpty())
1163 fprintf(out,
" case %d: *reinterpret_cast< %s*>(_v) = %s%s(); break;\n",
1164 propindex, p.type.constData(), prefix.constData(), p.read.constData());
1166 fprintf(out,
" case %d: *reinterpret_cast< %s*>(_v) = %s%s; break;\n",
1167 propindex, p.type.constData(), prefix.constData(), p.member.constData());
1169 fprintf(out,
" default: break;\n");
1170 fprintf(out,
" }\n");
1171 fprintf(out,
" }\n");
1175 fprintf(out,
" if (_c == QMetaObject::WriteProperty) {\n");
1176 fprintf(out,
" void *_v = _a[0];\n");
1177 fprintf(out,
" switch (_id) {\n");
1178 for (
int propindex = 0; propindex <
int(cdef->propertyList.size()); ++propindex) {
1179 const PropertyDef &p = cdef->propertyList.at(propindex);
1182 if (p.write.isEmpty() && p.member.isEmpty())
1184 QByteArray prefix =
"_t->";
1185 if (p.inPrivateClass.size()) {
1186 prefix += p.inPrivateClass +
"->";
1188 if (p.write ==
"default") {
1189 fprintf(out,
" case %d: {\n", propindex);
1190 fprintf(out,
" %s%s().setValue(*reinterpret_cast< %s*>(_v));\n",
1191 prefix.constData(), p.bind.constData(), p.type.constData());
1192 fprintf(out,
" break;\n");
1193 fprintf(out,
" }\n");
1194 }
else if (!p.write.isEmpty()) {
1195 fprintf(out,
" case %d: %s%s(*reinterpret_cast< %s*>(_v)); break;\n",
1196 propindex, prefix.constData(), p.write.constData(), p.type.constData());
1198 fprintf(out,
" case %d:\n", propindex);
1199 fprintf(out,
" if (%s%s != *reinterpret_cast< %s*>(_v)) {\n",
1200 prefix.constData(), p.member.constData(), p.type.constData());
1201 fprintf(out,
" %s%s = *reinterpret_cast< %s*>(_v);\n",
1202 prefix.constData(), p.member.constData(), p.type.constData());
1203 if (!p.notify.isEmpty() && p
.notifyId > -1) {
1205 if (f.arguments.size() == 0)
1206 fprintf(out,
" Q_EMIT _t->%s();\n", p.notify.constData());
1207 else if (f.arguments.size() == 1 && f.arguments.at(0).normalizedType == p.type)
1208 fprintf(out,
" Q_EMIT _t->%s(%s%s);\n",
1209 p.notify.constData(), prefix.constData(), p.member.constData());
1210 }
else if (!p.notify.isEmpty() && p
.notifyId < -1) {
1211 fprintf(out,
" Q_EMIT _t->%s();\n", p.notify.constData());
1213 fprintf(out,
" }\n");
1214 fprintf(out,
" break;\n");
1217 fprintf(out,
" default: break;\n");
1218 fprintf(out,
" }\n");
1219 fprintf(out,
" }\n");
1223 fprintf(out,
"if (_c == QMetaObject::ResetProperty) {\n");
1224 fprintf(out,
" switch (_id) {\n");
1225 for (
int propindex = 0; propindex <
int(cdef->propertyList.size()); ++propindex) {
1226 const PropertyDef &p = cdef->propertyList.at(propindex);
1227 if (p.reset.isEmpty())
1229 QByteArray prefix =
"_t->";
1230 if (p.inPrivateClass.size()) {
1231 prefix += p.inPrivateClass +
"->";
1233 fprintf(out,
" case %d: %s%s(); break;\n",
1234 propindex, prefix.constData(), p.reset.constData());
1236 fprintf(out,
" default: break;\n");
1237 fprintf(out,
" }\n");
1238 fprintf(out,
" }\n");
1241 if (hasBindableProperties) {
1242 fprintf(out,
" if (_c == QMetaObject::BindableProperty) {\n");
1243 fprintf(out,
" switch (_id) {\n");
1244 for (
int propindex = 0; propindex <
int(cdef->propertyList.size()); ++propindex) {
1245 const PropertyDef &p = cdef->propertyList.at(propindex);
1246 if (p.bind.isEmpty())
1248 QByteArray prefix =
"_t->";
1249 if (p.inPrivateClass.size()) {
1250 prefix += p.inPrivateClass +
"->";
1253 " case %d: *static_cast<QUntypedBindable *>(_a[0]) = %s%s(); "
1255 propindex, prefix.constData(), p.bind.constData());
1257 fprintf(out,
" default: break;\n");
1258 fprintf(out,
" }\n");
1259 fprintf(out,
" }\n");
1263 auto printUnused = [&](UsedArgs entry,
const char *name) {
1264 if ((usedArgs & entry) == 0)
1265 fprintf(out,
" (void)%s;\n", name);
1267 printUnused(UsedT,
"_t");
1268 printUnused(UsedC,
"_c");
1269 printUnused(UsedId,
"_id");
1270 printUnused(UsedA,
"_a");
1272 fprintf(out,
"}\n");
1279 fprintf(out,
"\n// SIGNAL %d\n%s %s::%s(",
1280 index, def->type.name.constData(), cdef->qualified.constData(), def->name.constData());
1282 QByteArray thisPtr =
"this";
1283 const char *constQualifier =
"";
1286 thisPtr =
"const_cast< " + cdef->qualified +
" *>(this)";
1287 constQualifier =
"const";
1290 Q_ASSERT(!def->normalizedType.isEmpty());
1291 if (def->arguments.isEmpty() && def->normalizedType ==
"void" && !def
->isPrivateSignal) {
1292 fprintf(out,
")%s\n{\n"
1293 " QMetaObject::activate(%s, &staticMetaObject, %d, nullptr);\n"
1294 "}\n", constQualifier, thisPtr.constData(), index);
1299 const auto begin = def->arguments.cbegin();
1300 const auto end = def->arguments.cend();
1301 for (
auto it = begin; it != end; ++it) {
1305 if (a.type.name.size())
1306 fputs(a.type.name.constData(), out);
1307 fprintf(out,
" _t%d", offset++);
1308 if (a.rightType.size())
1309 fputs(a.rightType.constData(), out);
1312 if (!def->arguments.isEmpty())
1314 fprintf(out,
"QPrivateSignal _t%d", offset++);
1317 fprintf(out,
")%s\n{\n", constQualifier);
1318 if (def->type.name.size() && def->normalizedType !=
"void") {
1319 QByteArray returnType = noRef(def->normalizedType);
1320 fprintf(out,
" %s _t0{};\n", returnType.constData());
1323 fprintf(out,
" QMetaObject::activate<%s>(%s, &staticMetaObject, %d, ",
1324 def->normalizedType.constData(), thisPtr.constData(), index);
1325 if (def->normalizedType ==
"void") {
1326 fprintf(out,
"nullptr");
1328 fprintf(out,
"std::addressof(_t0)");
1331 for (i = 1; i < offset; ++i)
1332 fprintf(out,
", _t%d", i);
1333 fprintf(out,
");\n");
1335 if (def->normalizedType !=
"void")
1336 fprintf(out,
" return _t0;\n");
1337 fprintf(out,
"}\n");
1343 auto it = o.constBegin();
1344 auto end = o.constEnd();
1346 cbor_encoder_create_map(parent, &map, o.size());
1348 for ( ; it != end; ++it) {
1349 QByteArray key = it.key().toUtf8();
1350 cbor_encode_text_string(&map, key.constData(), key.size());
1351 jsonValueToCbor(&map, it.value());
1353 return cbor_encoder_close_container(parent, &map);
1359 cbor_encoder_create_array(parent, &array, a.size());
1360 for (
const QJsonValue v : a)
1361 jsonValueToCbor(&array, v);
1362 return cbor_encoder_close_container(parent, &array);
1368 case QJsonValue::Null:
1369 case QJsonValue::Undefined:
1370 return cbor_encode_null(parent);
1371 case QJsonValue::Bool:
1372 return cbor_encode_boolean(parent, v.toBool());
1373 case QJsonValue::Array:
1374 return jsonArrayToCbor(parent, v.toArray());
1375 case QJsonValue::Object:
1376 return jsonObjectToCbor(parent, v.toObject());
1377 case QJsonValue::String: {
1378 QByteArray s = v.toString().toUtf8();
1379 return cbor_encode_text_string(parent, s.constData(), s.size());
1381 case QJsonValue::Double: {
1382 double d = v.toDouble();
1383 if (d == floor(d) && fabs(d) <= (Q_INT64_C(1) <<
std::numeric_limits<
double>::digits))
1384 return cbor_encode_int(parent, qint64(d));
1385 return cbor_encode_double(parent, d);
1388 Q_UNREACHABLE_RETURN(CborUnknownError);
1393 if (cdef->pluginData.iid.isEmpty())
1396 auto outputCborData = [
this]() {
1399 cbor_encoder_init_writer(&enc, CborDevice::callback, &dev);
1402 cbor_encoder_create_map(&enc, &map, CborIndefiniteLength);
1405 cbor_encode_int(&map,
int(QtPluginMetaDataKeys::IID));
1406 cbor_encode_text_string(&map, cdef->pluginData.iid.constData(), cdef->pluginData.iid.size());
1409 cbor_encode_int(&map,
int(QtPluginMetaDataKeys::ClassName));
1410 cbor_encode_text_string(&map, cdef->classname.constData(), cdef->classname.size());
1412 QJsonObject o = cdef->pluginData.metaData.object();
1415 cbor_encode_int(&map,
int(QtPluginMetaDataKeys::MetaData));
1416 jsonObjectToCbor(&map, o);
1419 if (!cdef->pluginData.uri.isEmpty()) {
1421 cbor_encode_int(&map,
int(QtPluginMetaDataKeys::URI));
1422 cbor_encode_text_string(&map, cdef->pluginData.uri.constData(), cdef->pluginData.uri.size());
1426 for (
auto it = cdef->pluginData.metaArgs.cbegin(), end = cdef->pluginData.metaArgs.cend(); it != end; ++it) {
1427 const QJsonArray &a = it.value();
1428 QByteArray key = it.key().toUtf8();
1429 dev
.nextItem(QByteArray(
"command-line \"" + key +
"\"").constData()
);
1430 cbor_encode_text_string(&map, key.constData(), key.size());
1431 jsonArrayToCbor(&map, a);
1436 cbor_encoder_close_container(&enc, &map);
1440 qsizetype pos = cdef->qualified.indexOf(
"::");
1441 for ( ; pos != -1 ; pos = cdef->qualified.indexOf(
"::", pos + 2) )
1442 fprintf(out,
"using namespace %s;\n", cdef->qualified.left(pos).constData());
1444 fputs(
"\n#ifdef QT_MOC_EXPORT_PLUGIN_V2", out);
1447 fprintf(out,
"\nstatic constexpr unsigned char qt_pluginMetaDataV2_%s[] = {",
1448 cdef->classname.constData());
1450 fprintf(out,
"\n};\nQT_MOC_EXPORT_PLUGIN_V2(%s, %s, qt_pluginMetaDataV2_%s)\n",
1451 cdef->qualified.constData(), cdef->classname.constData(), cdef->classname.constData());
1454 fprintf(out,
"#else\nQT_PLUGIN_METADATA_SECTION\n"
1455 "Q_CONSTINIT static constexpr unsigned char qt_pluginMetaData_%s[] = {\n"
1456 " 'Q', 'T', 'M', 'E', 'T', 'A', 'D', 'A', 'T', 'A', ' ', '!',\n"
1457 " // metadata version, Qt version, architectural requirements\n"
1458 " 0, QT_VERSION_MAJOR, QT_VERSION_MINOR, qPluginArchRequirements(),",
1459 cdef->classname.constData());
1461 fprintf(out,
"\n};\nQT_MOC_EXPORT_PLUGIN(%s, %s)\n"
1462 "#endif // QT_MOC_EXPORT_PLUGIN_V2\n",
1463 cdef->qualified.constData(), cdef->classname.constData());
1468QT_WARNING_DISABLE_GCC(
"-Wunused-function")
1469QT_WARNING_DISABLE_CLANG(
"-Wunused-function")
1470QT_WARNING_DISABLE_CLANG(
"-Wundefined-internal")
1471QT_WARNING_DISABLE_MSVC(4334)
1473#define CBOR_ENCODER_WRITER_CONTROL 1
1474#define CBOR_ENCODER_WRITE_FUNCTION CborDevice::callback
1478#include "cborencoder.c"
void nextItem(const char *comment=nullptr)
Generator(Moc *moc, ClassDef *classDef, const QList< QByteArray > &metaTypes, const QHash< QByteArray, QByteArray > &knownQObjectClasses, const QHash< QByteArray, QByteArray > &knownGadgets, FILE *outfile=nullptr, bool requireCompleteTypes=false)
\inmodule QtCore\reentrant
bool requireCompleteMethodTypes