且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

具有不同参数的 Qt Connect 信号

更新时间:2023-02-11 11:05:43

没有区别.接收信号可以具有比发射信号更短的签名.因为它可以忽略额外的参数.您可以连接如下信号:

There is no difference. The receiving signal may have a shorter signature than the emitting signal. because it can ignore extra arguments. You can connect a signal like:

signal(int, int, int)

使用以下签名发出信号:

TO SIGNAL with the following signatures:

signal1(int, int, int)
signal2(int, int)
signal3(int)
signal4()