是的,可以直接调用,就像普通函数一样。
区别就是invokeMethod可以指定槽函数的调用时机。[/quote]
这个调用时机该怎么理解?
我猜测m_manager没有调到onEventRequest可能是收到一些因素的影响。
有没有其他的函数设定invokemthod调用slot的条件?[/quote]
The invocation can be either synchronous or asynchronous, depending on type:
If type is Qt::DirectConnection, the member will be invoked immediately.
If type is Qt::QueuedConnection, a QEvent will be sent and the member is invoked as soon as the application enters the main event loop.
If type is Qt::BlockingQueuedConnection, the method will be invoked in the same way as for Qt::QueuedConnection, except that the current thread will block until the event is delivered. Using this connection type to communicate between objects in the same thread will lead to deadlocks.
If type is Qt::AutoConnection, the member is invoked synchronously if obj lives in the same thread as the caller; otherwise it will invoke the member asynchronously.
调试模式一步步跟踪代码,进入Qt的源代码中查找原因。