moc: Strip parentheses from RESET methods in JSON output

READ, WRITE, NOTIFY etc all come without parentheses. What we actually
want to check in the generator is whether the reset method is empty.

Task-number: QTBUG-104508
Change-Id: If8c70c7491b25e3c4d9a39dc2c0add0212e64dea
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
This commit is contained in:
Ulf Hermann 2022-06-24 15:09:56 +02:00
parent bc8ee34e87
commit 7415e53a8b
2 changed files with 3 additions and 3 deletions

View File

@ -1351,13 +1351,13 @@ void Generator::generateStaticMetacall()
fprintf(out, " switch (_id) {\n");
for (int propindex = 0; propindex < cdef->propertyList.size(); ++propindex) {
const PropertyDef &p = cdef->propertyList.at(propindex);
if (!p.reset.endsWith(')'))
if (p.reset.isEmpty())
continue;
QByteArray prefix = "_t->";
if (p.inPrivateClass.size()) {
prefix += p.inPrivateClass + "->";
}
fprintf(out, " case %d: %s%s; break;\n",
fprintf(out, " case %d: %s%s(); break;\n",
propindex, prefix.constData(), p.reset.constData());
}
fprintf(out, " default: break;\n");

View File

@ -1335,7 +1335,7 @@ void Moc::parsePropertyAttributes(PropertyDef &propDef)
if (l == "READ")
propDef.read = v;
else if (l == "RESET")
propDef.reset = v + v2;
propDef.reset = v;
else if (l == "REVISION") {
bool ok = false;
const int minor = v.toInt(&ok);