[Interest] Best way to invoke a slot after some time with QObject::sender

Preet prismatic.project at gmail.com
Tue Aug 28 10:08:43 CEST 2012

Hi Bo,

> The first actually uses the second, because those are cross thread
> signal slot connections. But by using the connect, you will
> automatically get the call moved across to the other thread. If you use
> invoke, you don't get this. If it's okay to call across threads, invoke
> is the fastest.

It seems like invokeMethod() uses Qt::AutoConnection by default...
doesn't this mean that I'd be okay (I don't have any return args --
the desired behaviour would be that invokeMethod() post an event in
ObjectA's event loop)?

> You have to figure out how to make sure the ObjectA still exists at the
> point where ObjectB wants to call it. This is the part that really
> worries me with the situation you have described here.

All ObjectAs are 'eternal'. They're actually QtPlugins that are alive
for the life of the application.

More information about the Interest mailing list