【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