10#include <QtCore/qfile.h>
11#include <QtCore/qfileinfo.h>
12#include <QtCore/qdir.h>
13#include <QtCore/qjsondocument.h>
16#include <private/qmetaobject_moc_p.h>
17#include <private/qduplicatetracker_p.h>
31 if (
auto it = knownQObjectClasses.
find(
name);
it != knownQObjectClasses.
end())
55 if (!
test(IDENTIFIER))
63 if (!
test(IDENTIFIER))
66 }
else if (
test(IDENTIFIER)) {
68 if (lex !=
"final" && lex !=
"sealed" && lex !=
"Q_DECL_FINAL")
75 if (
test(IDENTIFIER)) {
82 if (
test(IDENTIFIER)) {
84 if (lex !=
"final" && lex !=
"sealed" && lex !=
"Q_DECL_FINAL")
94 else if (
test(PROTECTED))
106 }
while (
test(COMMA));
118 bool foundRBrace =
until(RBRACE);
127 bool hasSignedOrUnsigned =
false;
135 hasSignedOrUnsigned =
true;
141 if (
lookup(0) == VOLATILE)
142 type.isVolatile =
true;
144 case Q_MOC_COMPAT_TOKEN:
145 case Q_INVOKABLE_TOKEN:
146 case Q_SCRIPTABLE_TOKEN:
147 case Q_SIGNALS_TOKEN:
169 if (hasSignedOrUnsigned) {
192 isVoid |= (
lookup(0) == VOID);
201 if (
type.name.isEmpty()) {
209 type.isScoped =
true;
219 type.referenceType = Type::Reference;
220 else if (
lookup(0) == ANDAND)
221 type.referenceType = Type::RValueReference;
222 else if (
lookup(0) == STAR)
223 type.referenceType = Type::Pointer;
227 if (isVoid &&
type.referenceType == Type::NoReference) {
241 bool isTypdefEnum =
false;
246 if (
test(IDENTIFIER)) {
249 if (
lookup(-1) != TYPEDEF)
260 bool hadIncludeBegin =
false;
261 if (
test(MOC_INCLUDE_BEGIN)) {
264 hadIncludeBegin =
true;
267 next(MOC_INCLUDE_END);
287 if (!
test(IDENTIFIER))
300 if (
arg.type.name ==
"void")
302 if (
test(IDENTIFIER))
304 while (
test(LBRACK)) {
307 if (
test(CONST) ||
test(VOLATILE)) {
308 arg.rightType +=
' ';
312 arg.typeNameForCast =
QByteArray(
"std::add_pointer_t<"+
arg.normalizedType+
">");
314 arg.isDefault =
true;
332 error(
"number of function arguments exceeds std::numeric_limits<int>::max()");
347 case Q_MOC_COMPAT_TOKEN:
350 case Q_INVOKABLE_TOKEN:
359 case Q_SCRIPTABLE_TOKEN:
380 revisionString.remove(0, 1);
381 revisionString.chop(1);
382 const QList<QByteArray> majorMinor = revisionString.split(
',');
383 switch (majorMinor.size()) {
386 const int revision = revisionString.toInt(&
ok);
388 error(
"Invalid revision");
393 const int major = majorMinor[0].toInt(&
ok);
395 error(
"Invalid major version");
396 const int minor = majorMinor[1].toInt(&
ok);
398 error(
"Invalid minor version");
402 error(
"Invalid revision");
410 if (
test(Q_REVISION_TOKEN)) {
426 bool templateFunction = (
lookup() == TEMPLATE);
429 if (templateFunction)
430 error(
"Template function as signal or slot");
434 bool scopedFunctionName =
false;
440 while (!tempType.name.isEmpty() &&
lookup() != LPAREN) {
452 def->
type = tempType;
455 next(LPAREN,
"Not a signal or slot declaration");
456 def->
name = tempType.name;
457 scopedFunctionName = tempType.isScoped;
465 while (
test(IDENTIFIER))
470 while (
test(IDENTIFIER))
496 if (scopedFunctionName) {
498 +
" contains extra qualification. Ignoring as signal or slot.";
504 if (typeNameParts.contains(
"auto")) {
506 error(
"Function declared with auto as return type but missing trailing return type. "
507 "Return type deduction is not supported.");
523 return test(EXPLICIT) ||
test(INLINE) ||
536 bool tilde =
test(TILDE);
540 bool scopedFunctionName =
false;
558 while (!tempType.name.isEmpty() &&
lookup() != LPAREN) {
561 else if (def->
type.
name ==
"Q_SIGNAL")
563 else if (def->
type.
name ==
"Q_SLOT")
570 def->
type = tempType;
575 def->
name = tempType.name;
576 scopedFunctionName = tempType.isScoped;
594 if (scopedFunctionName
596 const QByteArray msg =
"parsemaybe: Function declaration " + def->
name
597 +
" contains extra qualification. Ignoring as signal or slot.";
609 while (function.arguments.size() > 0 && function.arguments.constLast().isDefault) {
610 function.wasCloned =
true;
611 function.arguments.removeLast();
618 auto it = namespaceList.crbegin();
619 const auto rend = namespaceList.crend();
620 for (;
it != rend; ++
it) {
629 error(
"number of signals defined in parent class(es) exceeds "
630 "std::numeric_limits<int>::max().");
633 error(
"number of bindable properties exceeds std::numeric_limits<int>::max().");
636 error(
"number of times Q_CLASSINFO macro is used exceeds "
637 "std::numeric_limits<int>::max().");
640 error(
"number of enumerations exceeds std::numeric_limits<int>::max().");
643 error(
"number of super classes exceeds std::numeric_limits<int>::max().");
646 error(
"number of constructor parameters exceeds std::numeric_limits<int>::max().");
649 error(
"number of signals exceeds std::numeric_limits<int>::max().");
652 error(
"number of declared slots exceeds std::numeric_limits<int>::max().");
655 error(
"number of methods exceeds std::numeric_limits<int>::max().");
658 error(
"number of public functions declared in this class exceeds "
659 "std::numeric_limits<int>::max().");
664 QList<NamespaceDef> namespaceList;
665 bool templateClass =
false;
671 if (
test(IDENTIFIER)) {
682 nested.append(nsName);
688 }
else if (
test(LPAREN)) {
691 }
else if (!
test(SEMIC)) {
709 parentNs.begin = def.
begin;
710 parentNs.end = def.
end;
711 namespaceList += parentNs;
717 if (
test(IDENTIFIER)) {
725 }
else if (!
test(SEMIC)) {
730 case Q_NAMESPACE_TOKEN:
733 case Q_NAMESPACE_EXPORT_TOKEN:
735 while (
test(IDENTIFIER))
741 case Q_ENUM_NS_TOKEN:
745 error(
"Q_ENUM can't be used in a Q_NAMESPACE, use Q_ENUM_NS instead");
748 case Q_FLAG_NS_TOKEN:
752 error(
"Q_FLAG can't be used in a Q_NAMESPACE, use Q_FLAG_NS instead");
754 case Q_DECLARE_FLAGS_TOKEN:
757 case Q_CLASSINFO_TOKEN:
760 case Q_MOC_INCLUDE_TOKEN:
781 namespaceList += def;
784 error(
"Namespace declaration lacks Q_NAMESPACE macro.");
791 templateClass =
false;
794 templateClass =
true;
796 case MOC_INCLUDE_BEGIN:
799 case MOC_INCLUDE_END:
802 case Q_DECLARE_INTERFACE_TOKEN:
805 case Q_DECLARE_METATYPE_TOKEN:
808 case Q_MOC_INCLUDE_TOKEN:
812 if (
test(NAMESPACE)) {
835 case Q_GADGET_EXPORT_TOKEN:
837 while (
test(IDENTIFIER))
868 switch ((
t =
next())) {
871 if (
test(Q_SIGNALS_TOKEN))
872 error(
"Signals cannot have access specifier");
876 if (
test(Q_SIGNALS_TOKEN))
877 error(
"Signals cannot have access specifier");
881 if (
test(Q_SIGNALS_TOKEN))
882 error(
"Signals cannot have access specifier");
890 error(
"Meta object features not supported for nested classes");
894 case Q_SIGNALS_TOKEN:
905 error(
"Missing access specifier for slots");
911 error(
"Template classes not supported by Q_OBJECT");
913 error(
"Class contains Q_OBJECT macro but does not inherit from QObject");
915 case Q_GADGET_EXPORT_TOKEN:
917 while (
test(IDENTIFIER))
924 error(
"Template classes not supported by Q_GADGET");
926 case Q_PROPERTY_TOKEN:
929 case QT_ANONYMOUS_PROPERTY_TOKEN:
932 case Q_PLUGIN_METADATA_TOKEN:
939 case Q_ENUM_NS_TOKEN:
940 error(
"Q_ENUM_NS can't be used in a Q_OBJECT/Q_GADGET, use Q_ENUM instead");
946 case Q_FLAG_NS_TOKEN:
947 error(
"Q_FLAG_NS can't be used in a Q_OBJECT/Q_GADGET, use Q_FLAG instead");
949 case Q_DECLARE_FLAGS_TOKEN:
952 case Q_CLASSINFO_TOKEN:
955 case Q_MOC_INCLUDE_TOKEN:
958 case Q_INTERFACES_TOKEN:
961 case Q_PRIVATE_SLOT_TOKEN:
964 case Q_PRIVATE_PROPERTY_TOKEN:
967 case QT_ANONYMOUS_PRIVATE_PROPERTY_TOKEN:
983 if (funcDef.isConstructor) {
988 }
else if (funcDef.isDestructor) {
993 if (funcDef.isSlot) {
996 if (funcDef.revision > 0)
998 }
else if (funcDef.isSignal) {
1001 if (funcDef.revision > 0)
1003 }
else if (funcDef.isInvokable) {
1006 if (funcDef.revision > 0)
1024 error(
"Class declaration lacks Q_OBJECT macro.");
1043 for (
const auto &
n : std::as_const(namespaceList)) {
1044 if (!
n.hasQNamespace)
1051 return def.classname == val.classname && def.qualified == val.qualified;
1056 Q_ASSERT(
it->classInfoList.
size() <= std::numeric_limits<int>::max());
1059 Q_ASSERT(
it->enumList.
size() <= std::numeric_limits<int>::max());
1081 for (
const auto &
f : functions) {
1082 for (
const auto &
arg :
f.arguments) {
1094#define STREAM_SMART_POINTER(SMART_POINTER) << #SMART_POINTER
1096#undef STREAM_SMART_POINTER
1097#define STREAM_1ARG_TEMPLATE(TEMPLATENAME) << #TEMPLATENAME
1099#undef STREAM_1ARG_TEMPLATE
1109 required.reserve(candidates.size());
1111 bool needsQProperty =
false;
1113 for (
const auto &candidate : candidates) {
1116 for (
const auto &
c : classes) {
1117 for (
const auto &
p :
c.propertyList)
1118 needsQProperty |= !
p.bind.
isEmpty();
1123 required.push_back(candidate);
1130 required.push_back(
"QProperty");
1139 auto isSlash = [](
char ch) {
return ch ==
'/' ||
ch ==
'\\'; };
1140 auto rit = std::find_if(fn.
crbegin(), fn.
crend(), isSlash);
1141 if (rit != fn.
crend())
1144 fprintf(
out,
"/****************************************************************************\n"
1145 "** Meta object code from reading C++ file '%s'\n**\n" , fn.
constData());
1146 fprintf(
out,
"** Created by: The Qt Meta Object Compiler version %d (Qt %s)\n**\n" ,
mocOutputRevision, QT_VERSION_STR);
1147 fprintf(
out,
"** WARNING! All changes made in this file will be lost!\n"
1148 "*****************************************************************************/\n\n");
1157 if (!inc.isEmpty() && inc.at(0) !=
'<' && inc.at(0) !=
'"') {
1160 inc =
'\"' + inc +
'\"';
1162 fprintf(
out,
"#include %s\n", inc.constData());
1166 fprintf(
out,
"#include <QtCore/qobject.h>\n");
1168 fprintf(
out,
"#include <QtCore/qmetatype.h>\n");
1170 fprintf(
out,
"#include <QtCore/qplugin.h>\n");
1173 for (
const QByteArray &qtContainer : qtContainers)
1174 fprintf(
out,
"#include <QtCore/%s>\n", qtContainer.constData());
1176 fprintf(
out,
"\n#include <QtCore/qtmochelpers.h>\n");
1178 fprintf(
out,
"\n#include <memory>\n\n");
1179 fprintf(
out,
"\n#include <QtCore/qxptype_traits.h>\n");
1181 fprintf(
out,
"#if !defined(Q_MOC_OUTPUT_REVISION)\n"
1182 "#error \"The header file '%s' doesn't include <QObject>.\"\n", fn.
constData());
1184 fprintf(
out,
"#error \"This file was generated using the moc from %s."
1185 " It\"\n#error \"cannot be used with the include files from"
1186 " this version of Qt.\"\n#error \"(The moc has changed too"
1187 " much.)\"\n", QT_VERSION_STR);
1188 fprintf(
out,
"#endif\n\n");
1190#if QT_VERSION <= QT_VERSION_CHECK(7, 0, 0)
1191 fprintf(
out,
"#ifndef Q_CONSTINIT\n"
1192 "#define Q_CONSTINIT\n"
1196 fprintf(
out,
"QT_WARNING_PUSH\n");
1197 fprintf(
out,
"QT_WARNING_DISABLE_DEPRECATED\n");
1198 fprintf(
out,
"QT_WARNING_DISABLE_GCC(\"-Wuseless-cast\")\n");
1208 error(
"internal limit exceeded: number of parsed strings is too big.");
1214 fprintf(
out,
"QT_WARNING_POP\n");
1224 classesJsonFormatted.
append(cdef.toJson());
1226 if (!classesJsonFormatted.isEmpty())
1227 mocData[
"classes"_L1] = classesJsonFormatted;
1230 fputs(jsonDoc.toJson().constData(), jsonOutput);
1237 if (
test(Q_REVISION_TOKEN))
1246 case Q_SIGNALS_TOKEN:
1256 error(
"'using' directive not supported in 'slots' section");
1265 if (funcDef.revision > 0) {
1267 }
else if (defaultRevision.isValid()) {
1268 funcDef.revision = defaultRevision.toEncodedVersion<
int>();
1279 if (
test(Q_REVISION_TOKEN))
1288 case Q_SIGNALS_TOKEN:
1298 error(
"'using' directive not supported in 'signals' section");
1305 if (funcDef.isVirtual)
1306 warning(
"Signals cannot be declared virtual");
1307 if (funcDef.inlineCode)
1308 error(
"Not a signal declaration");
1309 if (funcDef.revision > 0) {
1311 }
else if (defaultRevision.isValid()) {
1312 funcDef.revision = defaultRevision.toEncodedVersion<
int>();
1322 propDef.location =
index;
1323 propDef.relativeIndex = propertyIndex;
1328 propDef.designable = propDef.scriptable = propDef.stored =
"true";
1329 propDef.user =
"false";
1340 type =
"QMap<QString,QVariant>";
1341 else if (
type ==
"QValueList")
1342 type =
"QValueList<QVariant>";
1343 else if (
type ==
"LongLong")
1345 else if (
type ==
"ULongLong")
1346 type =
"qulonglong";
1348 propDef.type =
type;
1352 propDef.name =
lexem();
1360 auto checkIsFunction = [&](
const QByteArray &def,
const char *
name) {
1362 QByteArray msg =
"Providing a function for ";
1364 msg +=
" in a property declaration is not be supported in Qt 6.";
1369 while (
test(IDENTIFIER)) {
1372 if (l[0] ==
'C' && l ==
"CONSTANT") {
1373 propDef.constant =
true;
1375 }
else if (l[0] ==
'F' && l ==
"FINAL") {
1376 propDef.final =
true;
1378 }
else if (l[0] ==
'N' && l ==
"NAME") {
1380 propDef.name =
lexem();
1382 }
else if (l[0] ==
'R' && l ==
"REQUIRED") {
1383 propDef.required =
true;
1385 }
else if (l[0] ==
'R' && l ==
"REVISION" &&
test(LPAREN)) {
1394 v =
v.mid(1,
v.size() - 2);
1395 }
else if (
test(INTEGER_LITERAL)) {
1397 if (l !=
"REVISION")
1399 }
else if (
test(DEFAULT)) {
1401 if (l !=
"READ" && l !=
"WRITE")
1408 else if (
v !=
"true" &&
v !=
"false")
1421 else if (l ==
"RESET")
1423 else if (l ==
"REVISION") {
1425 const int minor =
v.toInt(&
ok);
1433 if (l ==
"SCRIPTABLE") {
1434 propDef.scriptable =
v +
v2;
1435 checkIsFunction(propDef.scriptable,
"SCRIPTABLE");
1436 }
else if (l ==
"STORED") {
1437 propDef.stored =
v +
v2;
1438 checkIsFunction(propDef.stored,
"STORED");
1442 case 'W':
if (l !=
"WRITE")
error(lsym);
1445 case 'B':
if (l !=
"BINDABLE")
error(lsym);
1448 case 'D':
if (l !=
"DESIGNABLE")
error(lsym);
1449 propDef.designable =
v +
v2;
1450 checkIsFunction(propDef.designable,
"DESIGNABLE");
1452 case 'N':
if (l !=
"NOTIFY")
error(lsym);
1455 case 'U':
if (l !=
"USER")
error(lsym);
1456 propDef.user =
v +
v2;
1457 checkIsFunction(propDef.user,
"USER");
1463 if (propDef.constant && !propDef.write.isNull()) {
1464 const QByteArray msg =
"Property declaration " + propDef.name
1465 +
" is both WRITEable and CONSTANT. CONSTANT will be ignored.";
1466 propDef.constant =
false;
1469 if (propDef.constant && !propDef.notify.isNull()) {
1470 const QByteArray msg =
"Property declaration " + propDef.name
1471 +
" is both NOTIFYable and CONSTANT. CONSTANT will be ignored.";
1472 propDef.constant =
false;
1475 if (propDef.constant && !propDef.bind.isNull()) {
1476 const QByteArray msg =
"Property declaration " + propDef.name
1477 +
" is both BINDable and CONSTANT. CONSTANT will be ignored.";
1478 propDef.constant =
false;
1481 if (propDef.read ==
"default" && propDef.bind.isNull()) {
1482 const QByteArray msg =
"Property declaration " + propDef.name
1483 +
" is not BINDable but default-READable. READ will be ignored.";
1487 if (propDef.write ==
"default" && propDef.bind.isNull()) {
1488 const QByteArray msg =
"Property declaration " + propDef.name
1489 +
" is not BINDable but default-WRITEable. WRITE will be ignored.";
1509 while (
test(IDENTIFIER)) {
1512 next(STRING_LITERAL);
1514 }
else if (l ==
"URI") {
1515 next(STRING_LITERAL);
1517 }
else if (l ==
"FILE") {
1518 next(STRING_LITERAL);
1525 if (
p.isFrameworkPath)
1537 +
" does not exist. Declaration will be ignored";
1543 QByteArray msg =
"Plugin Metadata file " +
lexem() +
" could not be opened: "
1557 +
" does not contain a valid JSON object. Declaration will be ignored";
1575 if (!nesting && (
t == RPAREN ||
t == COMMA))
1582 accessor +=
lexem();
1604 while (
test(IDENTIFIER)) {
1605 identifier =
lexem();
1608 identifier +=
lexem();
1619 while (
test(IDENTIFIER)) {
1623 flagName +=
lexem();
1627 while (
test(IDENTIFIER)) {
1631 enumName +=
lexem();
1641 bool encounteredQmlMacro =
false;
1644 next(STRING_LITERAL);
1646 if (infoDef.name.startsWith(
"QML."))
1647 encounteredQmlMacro =
true;
1649 if (
test(STRING_LITERAL)) {
1651 }
else if (
test(Q_REVISION_TOKEN)) {
1657 next(STRING_LITERAL);
1675 while (
test(IDENTIFIER)) {
1676 QList<ClassDef::Interface> iface;
1679 iface.last().className +=
lexem();
1681 iface.last().className +=
lexem();
1683 while (
test(COLON)) {
1687 iface.last().className +=
lexem();
1689 iface.last().className +=
lexem();
1696 error(
"Undefined interface");
1698 iface[
i].interfaceId = iid;
1710 interface +=
lexem();
1712 interface +=
lexem();
1714 interface +=
lexem();
1718 if (
test(STRING_LITERAL)) {
1752 funcDef.inPrivateClass =
lexem();
1756 funcDef.inPrivateClass +=
"()";
1763 if (funcDef.revision > 0)
1773 while (from <=
index) {
1775 if (
s.size() &&
n.size()) {
1777 char next =
n.at(0);
1795 case LBRACE: ++braceCount;
break;
1796 case LBRACK: ++brackCount;
break;
1797 case LPAREN: ++parenCount;
break;
1798 case LANGLE: ++angleCount;
break;
1811 case LBRACE: ++braceCount;
break;
1812 case RBRACE: --braceCount;
break;
1813 case LBRACK: ++brackCount;
break;
1814 case RBRACK: --brackCount;
break;
1815 case LPAREN: ++parenCount;
break;
1816 case RPAREN: --parenCount;
break;
1818 if (parenCount == 0 && braceCount == 0)
1822 if (parenCount == 0 && braceCount == 0)
1826 if (parenCount == 0 && braceCount == 0) {
1837 && (
target != RANGLE || angleCount <= 0)) {
1838 if (
target != COMMA || angleCount <= 0)
1843 if (
target == COMMA &&
t == EQ && possible != -1) {
1848 if (braceCount < 0 || brackCount < 0 || parenCount < 0
1849 || (
target == RANGLE && angleCount < 0)) {
1854 if (braceCount <= 0 &&
t == SEMIC) {
1860 if (
target == COMMA && angleCount != 0 && possible != -1) {
1879 +
" contains the Q_OBJECT macro and inherits from "
1881 +
" but that is not a known QObject subclass. You may get compilation errors.";
1888 auto matchesSuperClass = [&super](
const auto &ifaces) {
1889 return !ifaces.isEmpty() && ifaces.first().className == super;
1902 +
" inherits from two QObject subclasses "
1906 +
". This is not supported!";
1911 if (!isRegisteredInterface(superClass)) {
1915 +
" implements the interface "
1917 +
" but does not list it in Q_INTERFACES. qobject_cast to "
1919 +
" will not work!";
1932 QDuplicateTracker<QByteArray> definedProperties(cdef->
propertyList.
size());
1934 if (definedProperties.hasSeen(
p.name)) {
1935 QByteArray msg =
"The property '" +
p.name +
"' is defined multiple times in class " + cdef->
classname +
".";
1939 if (
p.read.isEmpty() &&
p.member.isEmpty() &&
p.bind.isEmpty()) {
1940 QByteArray msg =
"Property declaration " +
p.name +
" has neither an associated QProperty<> member"
1941 ", nor a READ accessor function nor an associated MEMBER variable. The property will be invalid.";
1944 if (
p.write.isEmpty())
1953 if (
f.name !=
p.read)
1957 if (
f.arguments.size())
1961 if (
p.type ==
"QByteArray" && tmp ==
"const char *")
1963 if (tmp.
left(6) ==
"const ")
1965 if (
p.type != tmp && tmp.
endsWith(
'*')) {
1968 }
else if (
f.type.name.endsWith(
'&')) {
1976 if (!
p.notify.isEmpty()) {
1980 if (
f.name !=
p.notify) {
1987 p.notifyId = notifyId;
1988 if (notifyId == -1) {
1994 p.notifyId = int(-2 -
index);
2012 classInfos.
append(infoJson);
2015 if (classInfos.
size())
2016 cls[
"classInfos"_L1] = classInfos;
2018 const auto appendFunctions = [&cls](
const QString &
type,
const QList<FunctionDef> &
funcs) {
2022 jsonFuncs.
append(fdef.toJson());
2024 if (!jsonFuncs.isEmpty())
2025 cls[
type] = jsonFuncs;
2029 appendFunctions(
"slots"_L1,
slotList);
2038 if (!
props.isEmpty())
2039 cls[
"properties"_L1] =
props;
2042 cls[
"object"_L1] =
true;
2044 cls[
"gadget"_L1] =
true;
2046 cls[
"namespace"_L1] =
true;
2053 if (super.classname != super.qualified)
2056 superClasses.
append(superCls);
2060 cls[
"superClasses"_L1] = superClasses;
2064 enums.
append(enumDef.toJson(*
this));
2066 cls[
"enums"_L1] = enums;
2071 for (
const Interface &iface: ifaceList) {
2075 jsonList.append(ifaceJson);
2080 cls[
"interfaces"_L1] = ifaces;
2098 fdef[
"arguments"_L1] =
args;
2106 fdef[
"isCloned"_L1] =
true;
2114 case Private: (*obj)[
"access"_L1] =
"private"_L1;
break;
2115 case Public: (*obj)[
"access"_L1] =
"public"_L1;
break;
2116 case Protected: (*obj)[
"access"_L1] =
"protected"_L1;
break;
2124 if (!
name.isEmpty())
2140 jsonify(
"member",
member);
2141 jsonify(
"read",
read);
2142 jsonify(
"write",
write);
2143 jsonify(
"bindable",
bind);
2144 jsonify(
"reset",
reset);
2145 jsonify(
"notify",
notify);
2148 const auto jsonifyBoolOrString = [&prop](
const char *
str,
const QByteArray &boolOrString) {
2150 if (boolOrString ==
"true")
2152 else if (boolOrString ==
"false")
2159 jsonifyBoolOrString(
"designable",
designable);
2160 jsonifyBoolOrString(
"scriptable",
scriptable);
2161 jsonifyBoolOrString(
"stored",
stored);
2162 jsonifyBoolOrString(
"user",
user);
2165 prop[
"final"_L1] =
final;
2180 if (!
type.isEmpty())
2188 if (!valueArr.isEmpty())
2189 def[
"values"_L1] = valueArr;
void checkSuperClasses(ClassDef *def)
bool parseEnum(EnumDef *def)
void parseProperty(ClassDef *def, PropertyMode mode)
QByteArray lexemUntil(Token)
EncounteredQmlMacro parseClassInfo(BaseDef *def)
QList< QByteArray > includeFiles
bool requireCompleteTypes
QHash< QByteArray, QByteArray > knownQObjectClasses
void createPropertyDef(PropertyDef &def, int propertyIndex, PropertyMode mode)
bool parseClassHead(ClassDef *def)
void parsePrivateProperty(ClassDef *def, PropertyMode mode)
void parseFlag(BaseDef *def)
void parseSignals(ClassDef *def)
void parseDeclareMetatype()
void parsePropertyAttributes(PropertyDef &propDef)
void parseInterfaces(ClassDef *def)
bool testFunctionRevision(FunctionDef *def)
bool testFunctionAttribute(FunctionDef *def)
void prependNamespaces(BaseDef &def, const QList< NamespaceDef > &namespaceList) const
QHash< QByteArray, QByteArray > knownGadgets
QList< QByteArray > metaTypes
bool parseFunction(FunctionDef *def, bool inMacro=false)
QByteArray parsePropertyAccessor()
QMap< QString, QJsonArray > metaArgs
bool testForFunctionModifiers(FunctionDef *def)
const QByteArray & toFullyQualified(const QByteArray &name) const noexcept
void parseSlots(ClassDef *def, FunctionDef::Access access)
void parseDeclareInterface()
void checkListSizes(const ClassDef &def)
QTypeRevision parseRevision()
QList< QString > parsedPluginMetadataFiles
bool parseMaybeFunction(const ClassDef *cdef, FunctionDef *def)
void checkProperties(ClassDef *cdef)
void parseFunctionArguments(FunctionDef *def)
void parseSlotInPrivate(ClassDef *def, FunctionDef::Access access)
bool inClass(const ClassDef *def) const
void parsePluginData(ClassDef *def)
void generate(FILE *out, FILE *jsonOutput)
QMap< QByteArray, QByteArray > interface2IdMap
bool inNamespace(const NamespaceDef *def) const
QList< ClassDef > classList
void parseEnumOrFlag(BaseDef *def, bool isFlag)
QList< IncludePath > includes
const Symbol & symbolAt(qsizetype idx)
void warning(const char *=nullptr)
std::stack< QByteArray, QByteArrayList > currentFilenames
QByteArray unquotedLexem()
constexpr QByteArrayView last(qsizetype n) const
constexpr const_reverse_iterator crbegin() const noexcept
constexpr const_reverse_iterator crend() const noexcept
constexpr const_pointer constData() const noexcept
bool endsWith(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing just after the last byte in the ...
const_iterator constBegin() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first byte in the byte-ar...
QByteArray & prepend(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
QByteArray left(qsizetype n) const &
void chop(qsizetype n)
Removes n bytes from the end of the byte array.
char at(qsizetype i) const
Returns the byte at index position i in the byte array.
bool contains(char c) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
QByteArray & remove(qsizetype index, qsizetype len)
Removes len bytes from the array, starting at index position pos, and returns a reference to the arra...
QByteArray mid(qsizetype index, qsizetype len=-1) const &
QDir dir() const
Returns a QDir object representing the path of the parent directory of the file system entry that thi...
QFILE_MAYBE_NODISCARD bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QByteArray readAll()
Reads all remaining data from the device, and returns it as a byte array.
QString errorString() const
Returns a human-readable description of the last device error that occurred.
\inmodule QtCore\reentrant
bool isEmpty() const
Returns true if the object is empty.
qsizetype size() const
Returns the number of values stored in the array.
void append(const QJsonValue &value)
Inserts value at the end of the array.
\inmodule QtCore\reentrant
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error=nullptr)
Parses json as a UTF-8 encoded JSON document, and creates a QJsonDocument from it.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
qsizetype size() const noexcept
bool isEmpty() const noexcept
const T & constLast() const noexcept
void push_back(parameter_type t)
const_reference at(qsizetype i) const noexcept
T value(qsizetype i) const
qsizetype removeIf(Predicate pred)
const T & constFirst() const noexcept
void removeLast() noexcept
const_iterator cend() const noexcept
void append(parameter_type t)
const_iterator cbegin() const noexcept
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue=T()) const
bool contains(const Key &key) const
iterator find(const T &value)
iterator insert(const T &value)
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QByteArray toUtf8() const &
static constexpr QTypeRevision fromVersion(Major majorVersion, Minor minorVersion)
Produces a QTypeRevision from the given majorVersion and minorVersion, both of which need to be a val...
static constexpr bool isValidSegment(Integer segment)
Returns true if the given number can be used as either major or minor version in a QTypeRevision.
static constexpr QTypeRevision fromMinorVersion(Minor minorVersion)
Produces a QTypeRevision from the given minorVersion with an invalid major version.
constexpr Integer toEncodedVersion() const
Transforms the revision into an integer value, encoding the minor version into the least significant ...
static VulkanServerBufferGlFunctions * funcs
QSet< QString >::iterator it
static bool any_arg_contains(const QList< FunctionDef > &functions, const QByteArray &pattern)
#define STREAM_1ARG_TEMPLATE(TEMPLATENAME)
static QByteArrayList requiredQtContainers(const QList< ClassDef > &classes)
static QByteArray normalizeType(const QByteArray &ba)
static QByteArrayList make_candidates()
#define STREAM_SMART_POINTER(SMART_POINTER)
static bool any_type_contains(const QList< PropertyDef > &properties, const QByteArray &pattern)
void handleDefaultArguments(QList< FunctionDef > *functionList, FunctionDef &function)
Combined button and popup list for selecting options.
static const QCssKnownValue properties[NumProperties - 1]
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char * interface
DBusConnection const char DBusError * error
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint GLfloat GLfloat GLfloat v2
GLsizei const GLfloat * v
[13]
GLenum GLuint GLsizei const GLenum * props
QRandomGenerator generator(sseq)
QTextStream out(stdout)
[7]
QByteArray normalizedType
QJsonObject toJson() const
QMap< QByteArray, QByteArray > flagAliases
QMap< QByteArray, bool > enumDeclarations
QList< ClassInfoDef > classInfoList
QList< EnumDef > enumList
QList< QList< Interface > > interfaceList
QList< FunctionDef > publicList
QList< FunctionDef > methodList
QList< PropertyDef > propertyList
QList< FunctionDef > constructorList
QList< SuperClass > superclassList
bool requireCompleteMethodTypes
QList< FunctionDef > slotList
QList< FunctionDef > signalList
struct ClassDef::PluginData pluginData
QJsonObject toJson() const
QList< QByteArray > nonClassSignalList
QByteArray qualifiedType(const ClassDef *cdef) const
QJsonObject toJson(const ClassDef &cdef) const
QList< QByteArray > values
QByteArray normalizedType
QJsonObject toJson() const
static void accessToJson(QJsonObject *obj, Access acs)
QList< ArgumentDef > arguments
QByteArray inPrivateClass
QJsonObject toJson() const
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
QByteArray unquotedLexem() const
ReferenceType referenceType