Hello!

Suppose a class (derived from QObject) with methods such as
Qt Code:
  1. int receiveValue()
To copy to clipboard, switch view to plain text mode 

The class' events are processed in QThread. There are methods without returning value which may be called asynchronous. The values are needed to be given in similar way as using explicit method invocation but must not be running in caller thread.

It is unable to QMetaObject::invokeMethod with return values in queued connections. The only solution I found is declare methods like
Qt Code:
  1. void receiveValue(int *ret)
To copy to clipboard, switch view to plain text mode 
and invoke methods in Qt::BlockingQueuedConnection. But it is not so beautiful.

Is there another solution alike QMetaObject::invokeMethod(), but with return values and queued connections?

In addition to aesthetic, I have an academic interest in this problem.