[Qt-interest] QMetaObject::invokeMethod()

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Tue Feb 3 11:41:24 CET 2009


Shabd wrote:

> > Why not to just do as follows?
> >
> > yourAction->trigger();
>
> Because it does not return at all. I need to find out when the QAction
> has finished execution of the "trigger" slot.
> 
> Please suggest in case you know of a possible way to do this.
> 
> Regards,

Hi Shabd, 

It is probably easier to work out why the signal doesn't return. 

The signal has no way of knowing whether the connections are direct or via
the event loop. So the code that emits the signal, cannot tell whether the
slots have been executed, or hava simply put events into the queue to be
executed later. 

Can you add a new signal for your slots to report back their completion? 

Also, why does the action need to know the slots execution? If the display
needs updating, then shouldn't the slots be doing that? 

Hope that helps, 

Tony Rietwyk




More information about the Qt-interest-old mailing list