【QT】多个槽函数绑定同一个信号的触发顺序


一、Qt 3.0(包含3.0) - Qt 4.5(包含4.5)版本之前

「多个槽函数绑定同一个信号是无序调用」。

官方文档是这样描述的:

If a signal is connected to several slots, the slots are activated in an arbitrary order when the signal is emitted.
如果信号连接到多个槽函数,则在发出信号时会以任意顺序调用槽函数。

文档出处在:

https://qt.developpez.com/doc/3.0/qobject/#connect
https://qt.developpez.com/doc/4.5/qobject/#connect

二、Qt 4.6(包含4.6)版本之后

「多个槽函数绑定同一个信号是顺序调用」。

官方文档是这样描述的:

If a signal is connected to several slots, the slots are activated in the same order as the order the connection was made, when the signal is emitted.
如果将信号连接到多个槽函数,则在发出信号时将按照与连接顺序相同的顺序调用槽函数。

文档出处在:

https://doc.qt.io/archives/4.6/qobject.html#connect
https://doc.qt.io/qt-5/qobject.html#connect-2


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM