[Qt-interest] QMetaObject::invokeMethod()

Shabd Swarup V shabd at cadence.com
Tue Feb 3 09:20:01 CET 2009


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,
Shabd

-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Anthony
Serdyukov
Sent: Tuesday, February 03, 2009 1:21 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] QMetaObject::invokeMethod()

Why not to just do as follows?

yourAction->trigger();



2009/2/3 Shabd Swarup V <shabd at cadence.com>:
> Hi,
>
> I am trying to invoke the "triggered" signal of a QAction using the
> QMetaObject::invokeMethod() call. The code snippet is given below:
>
> QMetaObject::invokeMethod(targetObject, "triggered", 
> Qt::QueuedConnection);
>
> In case of a QueuedConnection, ideally, the signal should be queued 
> until the event loop is able to deliver it to the slot but I get the 
> return even before the action has executed.
>
> For example, there is a QAction "Open" under a MenuBar. When it is 
> clicked through the QMetaObject, I get a response immediately and then

> the QFileDialog opens.
> In case of all other widgets, this method seems to behave well.
>
> I hope the problem is clear. Any ideas on how I can achieve what I am 
> trying. I basically need to find out when the action is finished
executing.
>
> Thanks in advance.
>
> Regards,
> Shabd
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>



--
Regards,
Anthony
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list