Qt- “信号-槽”机制之连接类型 部分文档翻译
来源:互联网 发布:主播过度劳累猝死知乎 编辑:程序博客网 时间:2024/05/22 11:37
Qt::ConnectionType
This enum describes the types of connection that can be used between signals and slots. In particular, it determines whether a particular signal is delivered to a slot immediately or queued for delivery at a later time.
Qt::AutoConnection
0
(Default) If the receiver lives in the thread that emits the signal, Qt::DirectConnection is used. Otherwise, Qt::QueuedConnection is used. The connection type is determined when the signal is emitted.Qt::DirectConnection
1
The slot is invoked immediately when the signal is emitted. The slot is executed in the signalling thread.Qt::QueuedConnection
2
The slot is invoked when control returns to the event loop of the receiver's thread. The slot is executed in the receiver's thread.Qt::BlockingQueuedConnection
3
Same as Qt::QueuedConnection, except that the signalling thread blocks until the slot returns. This connection must not be used if the receiver lives in the signalling thread, or else the application will deadlock.Qt::UniqueConnection
0x80
This is a flag that can be combined with any one of the above connection types, using a bitwise OR. When Qt::UniqueConnection is set, QObject::connect() will fail if the connection already exists (i.e. if the same signal is already connected to the same slot for the same pair of objects). This flag was introduced in Qt 4.6.Autoconnection:
枚举值:0
描述:该值为默认连接类型。如果“接收器” 在线程中发射信号,那么使用 "DirectConnection"直连型连接,否则则使用队列型连接“QueuedConnection”,连接类型在信号发送时被确定下来。
DirectConnection:
枚举值:1
描述:当信号发送后,槽函数立即执行,该槽函数执行在发送信号的线程中。
QueuedConnection:
枚举值:2
描述: 当控制返回到“接收者”的事件循环时,槽函数被执行。该槽函数在“接收者”线程中执行。
BlockingQueuedConnection
枚举值:3
描述: 和队列型连接 “QueuedConnection” 一样, 但不同的是,直到槽函数执行结束返回时,信号发送线程都将处于阻塞状态。 当“接收者”在发送信号的线程中时,不要使用
该连接类型,否则程序将会 “死锁” 。
UniqueConnection
枚举值:0x80
描述: 这个标志位可以通过 “按位 ‘或’” 的方式与上述的信号类型进行混合, 当 “Qt::UniqueConnection” 被设置时, 设置相同的connect()对象将会失败(即改connect已经存在时,不能重复设置)。该标志位在 Qt 4.6 时被引入。
- Qt- “信号-槽”机制之连接类型 部分文档翻译
- Qt之信号槽机制
- QT源码之Qt信号槽机制与事件机制
- Qt编程之信号和槽机制
- Qt入门之信号与槽机制
- Qt入门之信号与槽机制
- Qt入门之信号与槽机制
- Qt入门之信号与槽机制
- Qt入门之信号与槽机制
- QT学习之 信号与槽机制
- Qt入门之信号与槽机制
- Qt之信号与槽机制
- Qt入门之信号与槽机制
- Qt入门之信号与槽机制
- Qt入门之信号与槽机制
- Qt入门之信号与槽机制
- Qt入门之信号与槽机制
- Qt入门之信号与槽机制
- 在项目里交叉使用Swift和OC
- 基础算法-冒泡排序
- Linux 网卡配置
- 练习2————1002
- c#中的快捷键
- Qt- “信号-槽”机制之连接类型 部分文档翻译
- 文件上传C:\fakepath\解决方案
- HDU 1796 How many integers can you find
- C++中const 、static、 static const和const static的初始化以及修改问题
- UITabBarController自定义转场动画
- cuda二维数组内存分配和数据拷贝
- Displaying Graphics with OpenGL ES (六)——Responding to Touch Events
- unity 获取当前键盘按键
- Mybatis运用mapper代码实现和Spring的整合(一)