summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-06-24 15:09:56 +0200
committerUlf Hermann <ulf.hermann@qt.io>2022-06-27 13:05:23 +0200
commit7415e53a8bd509781e2bc589887d46b11610048f (patch)
tree1e522a24ca588ebf587597f86c4b358fd591c802 /src/tools/moc
parentbc8ee34e87c159bdc56b56ac5974f75dc0056ab3 (diff)
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>
Diffstat (limited to 'src/tools/moc')
-rw-r--r--src/tools/moc/generator.cpp4
-rw-r--r--src/tools/moc/moc.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 8219571162..c6384bf340 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -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");
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index e931e32f4e..c6e8f0bda8 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -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);