Details
-
Suggestion
-
Resolution: Invalid
-
Not Evaluated
-
None
-
None
Description
Suggestion 1: Overload QMetaMethod::invoke() to take a QThread* argument that specifies in which thread's event loop to post the QMetaCallEvent, ignoring the thread affinity of the target object. Obviously, using this feature implies a queued connection.
Suggestion 2: Overload QMetaMethod::invoke() to take three extra arguments (QObject* obj, QMetaMethod cb, QVariant var) specifying a function to call when the invocation completes. var defaults to the invalid QVariant. If the QMetaMethod returns a value, cb must be a QMetaMethod in obj whose first argument type matches the return type and whose second argument type is QVariant. If the QMetaMethod does not return a value, cb takes only a QVariant argument. As usual, it's not an error for cb to take fewer arguments than are passed to it, but it cannot take more arguments or arguments of the wrong types. This feature implies a queued connection.
The combination of these two features is a lighter weight alternative to QtConcurrent::run(), QFuture, and QFutureWatcher. Unlike QtConcurrent::run(), it supports up to ten arguments (instead of only five), and it allows (actually requires) the function to be a class member function.