I created a QObject child class, namely A.
Here's a summary:
class A : public QObject
{
Q_OBJECT;
signals:
void bleep(myCustomType&);
}
Instances of A are then registered into a QScriptEngine. myCustomType is a registered MetaType, and conversions functions were made available using qScriptRegisterMetaType().
I expected to be able to use MyCustomType converted to a ScriptValue while connecting a script function to the signal. Oviously things didn't work because the script function parameter was an empty QVariant.
I expected to see an error or a warning at some point, either from the script engine or from the moc, since having a by-reference signal parameter is, as far as I know, an undocumented pitfall.
The fact that the signal argument is passed by reference somehow prevents the conversion functions registered with qScriptRegisterMetaType() to be called. This results in an empty QVariant() resulting of the failed conversion.
Removing the reference signal parameter and using a plain signal parameter, providing copy semantics are available, solves the problem.