首页 > Qt中信号与槽的疑问

Qt中信号与槽的疑问

在Qt5关于信号与槽的文档:http://qt-project.org/doc/qt-5/signalsandslots.html中,我对下面这句话不太明白

The signals and slots mechanism is type safe: The signature of a signal must match the signature of the receiving slot. (In fact a slot may have a shorter signature than the signal it receives because it can ignore extra arguments.)

疑惑如下:signature 应该翻译成什么?括号中的句子应当怎么理解?
希望大家可以给予帮助,谢谢。


感谢 @Theo 的提醒,看了源地址的后文确实signature是指带参数的东西。特此更正。

signature可以翻译成信号签名,类似于http头一样的东西,包含了信号的一些必要的参数。那句话的意思应该是:

信号和槽机制是安全的:信号发送的信号签名必须和接收槽所绑定的匹配才行。(事实上槽的签名可能会比信号发送的签名更短,因为槽会忽略掉额外的参数。)

【热门文章】
【热门文章】