[Development] invokeMethod() with function pointers
Thiago Macieira
thiago.macieira at intel.com
Tue Jan 17 18:11:32 CET 2017
Em terça-feira, 17 de janeiro de 2017, às 11:21:56 PST, Grégoire Barbier
escreveu:
> And maybe lambdas too, if there was a way to choose the thread/eventloop
> in which we want the lambda to be executed (but christmas was a few
> weeks ago, I should not dream ;-)).
If we do this, it should be possible to write:
QMetaObject::invokeMethod(object, [=]() {
doSomething(); return something; },
Qt::BlockingQueuedConnection,
Q_RETURN_ARG(foo));
Since we have lambdas and std::bind, I don't see the point of supporting
passing arguments. The return value is interesting still.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Development
mailing list