moc: fix Q_INVOKABLE returning references
authorOlivier Goffart <ogoffart@woboq.com>
Tue, 15 Nov 2011 09:14:23 +0000 (10:14 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 15 Nov 2011 10:53:44 +0000 (11:53 +0100)
commit9924a637ccf63a6a002080497a25890edafe492e
tree55d7e431d345b21230d9042e2bafdd8df0397944
parenta254611ba152cefb425ca205fde796a7a7810d4f
moc: fix Q_INVOKABLE returning references

The moc generated code would not compile otherwise

Keep Moc::parseFunction and Moc::parseMaybeFunction in sync
(the first is used for signals and slots, and the second for normal
 functions such as Q_INVOKABLE)
Last patch that introduced function pointer updated parseFunction
but not parseMaybeFunction

When a slot return a reference, moc generate code that make the
MetaObject system think it is a void, so qt_metacall and invokeMethod
do not mess with the return value.
But when we want to take the function signature, in the IndexOfMethod
call, we need to have the exact return type.

Change-Id: I4661218d7ce367ad3934e73929e7d04f0a6dbc09
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
src/tools/moc/moc.cpp
tests/auto/tools/moc/tst_moc.cpp