同一信号的两个不同插槽
当 m_serverClientControl 在其线程上发出 finishRunning() 时,我如何知道主线程中第一个/最后一个执行哪个插槽?在这种情况下,插槽如何排队?我对 Qt 如何将插槽事件放在线程事件队列上感到困惑。我已经阅读了该文档,但我仍然有点困惑。
connect( m_serverClientControl, SIGNAL( finishedRunning() ), m_serverClientControl, SLOT( deleteLater() ) );
connect( m_serverClientControl, SIGNAL( finishedRunning() ), this, SLOT( finishedRunningEmited() ) )
When m_serverClientControl emits finishedRunning() on its thread, How can I tell what slot gets executed first/last in the main thread? How do the slots get queued in a situation like this? I'm confused as how Qt places slot events on the thread event queue. I have read the document ion but I'm still a tad bit confused.
connect( m_serverClientControl, SIGNAL( finishedRunning() ), m_serverClientControl, SLOT( deleteLater() ) );
connect( m_serverClientControl, SIGNAL( finishedRunning() ), this, SLOT( finishedRunningEmited() ) )
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 Qt 4.7 文档:
http://doc.qt.io/archives/qt-4.7/signalsandslots .html#signals
因此,在您的情况下,应在
deleteLater()
之后调用finishedRunningEmited()
。From the Qt 4.7 docs:
http://doc.qt.io/archives/qt-4.7/signalsandslots.html#signals
So in your case
finishedRunningEmited()
should be called afterdeleteLater()
.