summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/generator.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-04-01 09:23:53 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2020-06-11 19:39:54 +0200
commit630c7b481184b5e0dd2e87b967fed421d574ee02 (patch)
treea6d95f0a479d47c12d791348331f4ab4a215147e /src/tools/moc/generator.cpp
parent5603be705e9e99b164bb85014c2abd0edf1d13f3 (diff)
Cleanups in QMetaProperty
This changes the layout of the meta object data, so also bump the meta object revision. Original-patch-by: Lars Knoll <lars.knoll@qt.io> Change-Id: I176fb16c207e8ebe59e358e69554be813406232f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/tools/moc/generator.cpp')
-rw-r--r--src/tools/moc/generator.cpp43
1 files changed, 7 insertions, 36 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 2278ba2603..d2fe5fa446 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -363,11 +363,7 @@ void Generator::generateCode()
- cdef->constructorList.count(); // "this" parameters don't have names
fprintf(out, " %4d, %4d, // properties\n", cdef->propertyList.count(), cdef->propertyList.count() ? index : 0);
- index += cdef->propertyList.count() * 3;
- if(cdef->notifyableProperties)
- index += cdef->propertyList.count();
- if (cdef->revisionedProperties)
- index += cdef->propertyList.count();
+ index += cdef->propertyList.count() * QMetaObjectPrivate::IntsPerProperty;
fprintf(out, " %4d, %4d, // enums/sets\n", cdef->enumList.count(), cdef->enumList.count() ? index : 0);
int enumsIndex = index;
@@ -888,12 +884,6 @@ void Generator::generateProperties()
if (p.user != "false")
flags |= User;
- if (p.notifyId != -1)
- flags |= Notify;
-
- if (p.revision > 0)
- flags |= Revisioned;
-
if (p.constant)
flags |= Constant;
if (p.final)
@@ -906,32 +896,13 @@ void Generator::generateProperties()
fprintf(out, " %4d, ", stridx(p.name));
generateTypeInfo(p.type);
- fprintf(out, ", 0x%.8x,\n", flags);
- }
-
- if(cdef->notifyableProperties) {
- fprintf(out, "\n // properties: notify_signal_id\n");
- for (int i = 0; i < cdef->propertyList.count(); ++i) {
- const PropertyDef &p = cdef->propertyList.at(i);
- if (p.notifyId == -1) {
- fprintf(out, " %4d,\n",
- 0);
- } else if (p.notifyId > -1) {
- fprintf(out, " %4d,\n",
- p.notifyId);
- } else {
- const int indexInStrings = strings.indexOf(p.notify);
- fprintf(out, " %4d,\n",
- indexInStrings | IsUnresolvedSignal);
- }
- }
- }
- if (cdef->revisionedProperties) {
- fprintf(out, "\n // properties: revision\n");
- for (int i = 0; i < cdef->propertyList.count(); ++i) {
- const PropertyDef &p = cdef->propertyList.at(i);
- fprintf(out, " %4d,\n", p.revision);
+ int notifyId = p.notifyId;
+ if (p.notifyId < -1) {
+ // signal is in parent class
+ const int indexInStrings = strings.indexOf(p.notify);
+ notifyId = indexInStrings | IsUnresolvedSignal;
}
+ fprintf(out, ", 0x%.8x, uint(%d), %d,\n", flags, notifyId, p.revision);
}
}