Create a way to inform moc about private signals.
authorStephen Kelly <stephen.kelly@kdab.com>
Mon, 9 Jul 2012 07:56:51 +0000 (09:56 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 12 Jul 2012 23:51:42 +0000 (01:51 +0200)
commit0efa445141ce3d7243f28e7b6da730d8dec17e23
treedea4b906324ec959ca73071726390a084f871bfb
parenta2b0ab4f579151bd2a6145dd18ce684fadedfe23
Create a way to inform moc about private signals.

Moc checks for the use of the QPrivateSignal struct, which is part of
the Q_OBJECT macro and is private to each class that uses it. Moc then
generates a name of the signal which does not include the private
struct, and generates code to invoke such signals with an instance of
the private struct.

This way we can mark private signals as such and prevent them from
being emitted from subclasses or from outside of the class entirely.

The drawback to this is that it only works if the private
signal has no default arguments. However, at least in Qt, there are
no such signals.

Change-Id: Id16eadaa8d3c36a2c3b265077877f3e1d8304c84
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
src/corelib/kernel/qobjectdefs.h
src/tools/moc/generator.cpp
src/tools/moc/moc.cpp
src/tools/moc/moc.h
tests/auto/tools/moc/tst_moc.cpp