[Qt-interest] QtConcurrent::run inside classes
Andreas Pakulat
apaku at gmx.de
Mon May 4 14:59:52 CEST 2009
On 04.05.09 14:36:11, Stefan Bisplinghoff wrote:
> > On compile time, I get a lot of C2780 errors (X args expected, 2 args
> > supported, X in [1,3..7]) for the run function.
> >
>
> Well, I covered one solution now by getting the hello function static.
> Is there a reason, why this is necessary?
Because a non-static method needs to have "this" passed as parameter when
its called. QtConcurrent::run() cannot pass on the "this" pointer from the
place where its called to the method it runs in a separate thread, so you
have to specify a global or class-static method.
Andreas
--
You will be awarded a medal for disregarding safety in saving someone.
More information about the Qt-interest-old
mailing list