Loading

【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
posted @ 2020-12-18 09:18  李春港  阅读(1644)  评论(0编辑  收藏  举报