QMetaObject::invokeMethod

Lubomir I. Ivanov neolit123 at gmail.com
Sat Jul 7 12:45:47 PDT 2018


On 7 July 2018 at 22:36, Robert Helling <helling at atdotde.de> wrote:
> Thiago,
>
> On 7. Jul 2018, at 18:54, Thiago Macieira <thiago at macieira.org> wrote:
>
> Usually, that function is used with Qt::QueuedConnection, which instead of
> calling the method indicated right now, it posts an event to the event queue
> with the arguments you supply. When the event loop gets to that event, the
> method you listed gets finally called.
>
> Another way of doing the same is by using QTimer::singleShot() with a lambda
> that carries your parameters. But this wasn't available before Qt 5.4, so
> there's a lot of code (and muscle memory) using invokeMethod().
>
>
> but this doesn’t seem the application in the subsurface code. If you do
>
> git grep invokeMethod
>
> you will find the instances.
>

the image related calls that don't have a connection type and are
technically using Qt::AutoConnection, which detects separate threads.
invokeMethod() can be also used to call functions in QML objects.

lubomir
--


More information about the subsurface mailing list