Lua programs can emit signals using the function call syntax. Consider for example the following c++ class:
class MyQObject : public QObject { Q_OBJECT ... signals: void mysignal(QByteArray msg, int x=0); ...Given an instance
myqobject
of this class,
a Lua program can emit signal mysignal
as follows
myqobject:mysignal("mymessage") -- or myqobject:mysignal("mymessage", 4)Overloaded signals are resolved like method invokation. In particular, arguments with default values are handled by considering implicit overloaded functions. As for functions, it is always possible to work around these rules by selecting a particular signal using its signature.
myqobject['mysignal(QByteArray,int)'](self,"message",3)