summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/moc.cpp
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals@canonical.com>2017-03-10 13:14:19 +0100
committerOlivier Goffart (Woboq GmbH) <ogoffart@woboq.com>2017-05-23 11:11:52 +0000
commit2ca187caa383ddc0cdebeb1dbc312405c8c871ad (patch)
tree70de643261bb96fd2350b9129d281a780bdbe6b6 /src/tools/moc/moc.cpp
parentf437fb2934e56c293039dc3b00410c53596f9c3e (diff)
moc: Allow NOTIFY signals defined in parent classes
Limitation is that the signal needs to be parameter-less [ChangeLog][moc] moc now supports NOTIFY signals of parent classes in Q_PROPERTY Change-Id: Iad64c96c3ec65d4be8ad9ff1a9f889938ab9bf45 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'src/tools/moc/moc.cpp')
-rw-r--r--src/tools/moc/moc.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 36d84a61d8..f7de57fae3 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -1727,9 +1727,13 @@ void Moc::checkProperties(ClassDef *cdef)
}
p.notifyId = notifyId;
if (notifyId == -1) {
- QByteArray msg = "NOTIFY signal '" + p.notify + "' of property '" + p.name
- + "' does not exist in class " + cdef->classname + ".";
- error(msg.constData());
+ int index = cdef->nonClassSignalList.indexOf(p.notify);
+ if (index == -1) {
+ cdef->nonClassSignalList << p.notify;
+ p.notifyId = -1 - cdef->nonClassSignalList.count();
+ } else {
+ p.notifyId = -2 - index;
+ }
}
}
}