zoukankan      html  css  js  c++  java
  • 【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
    
  • 相关阅读:
    平衡数问题
    重复值判断练习题
    小范围排序
    堆排序
    基数排序
    计数排序
    希尔排序
    快速排序
    Effective C++笔记:实现
    Effective C++笔记:设计与声明
  • 原文地址:https://www.cnblogs.com/lcgbk/p/14153264.html
Copyright © 2011-2022 走看看