Qt Connect signals with different arguments

僤鯓⒐⒋嵵緔 提交于 2019-12-24 03:03:27

问题


I have a simple question guys, reading the thread about connecting signals with slots with fewer arguments, and of course, the Qt documentation.

However, I do not need to connect signals with slots. I actually want to connect signals with signals with fewer arguments.

The documentation is very clear about slots, but what about signals?

Is that considered safe?

Thanks & Cheers!


回答1:


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()


来源:https://stackoverflow.com/questions/22499965/qt-connect-signals-with-different-arguments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!