<p>According to the documentation the return value from a slot doesn't mean anything.<br>
Yet in the generated moc code I see that if a slot returns a value this value is used for something. Any idea what does it do?</p>

<hr>

<p>Here's an example of what I'm talking about. this is taken from code generated by moc. 'message' is a slot that doesn't return anything and 'selectPart' is declared as returning int.</p>

<pre><code>case 7: message((*reinterpret_cast&lt; const QString(*)&gt;(_a[1])),(*reinterpret_cast&lt; int(*)&gt;(_a[2]))); break;
case 8: { int _r = selectPart((*reinterpret_cast&lt; AppObject*(*)&gt;(_a[1])),(*reinterpret_cast&lt; int(*)&gt;(_a[2])));
    if (_a[0]) *reinterpret_cast&lt; int*&gt;(_a[0]) = _r; }  break;
</code></pre>

Looking through the Qt source it seems that when a slot is called from QMetaObject::invokeMethod the return type can be specified and the return value obtained. (Have a look at invokeMethod in the Qt help)
I could not find many examples of this actually being used in the Qt source. One I found was
```
```
bool QAbstractItemDelegate::helpEvent
```
```
which is a slot with a return type and is called from
```
```
QAbstractItemView::viewportEvent
```
```
using invokeMethod.
I think that the return value for a slot is only available when the function is called directly (when it is a normal C++ function) or when using invokeMethod. I think this is really meant for internal Qt functions rather than for normal use in programs using Qt.
Edit: 
For the sample case:
```
```
case 8: { int _r = selectPart((*reinterpret_cast< AppObject*(*)>(_a[1])), *reinterpret_cast< int(*)>(_a[2])));
if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r; }  break;
```
```
the vector _a is a list of arguments that is passed to qt_metacall. This is passed by QMetaObject::invokeMethod. So the return value in the moc generated code is saved and passed back to the caller. So for normal signal-slot interactions the return value is not used for anything at all. However, the mechanism exists so that return values from slots can be accessed if the slot is called via invokeMethod.