hehe,这里楼主 忽略了一个问题:你的程序考虑了多线程吗
1、如果不是多线程,那么这种情况不可能发生,这样的话 两个函数会串行执行
2、如果是多线程,这种情况有可能,也比较复杂,可以查看一下connect函数的相关说明,里面提到了这种情况。下面贴一下相关的部分:
enum 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.
Constant Value Description
Qt::AutoConnection 0 (default) If the signal is emitted from a different thread than the receiving object, the signal is queued, behaving as Qt::QueuedConnection. Otherwise, the slot is invoked directly, behaving as Qt::DirectConnection. The type of connection is determined when the signal is emitted.
Qt::DirectConnection 1 The slot is invoked immediately, when the signal is emitted.
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.
剩下的就不贴了,呵呵