Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-3836

QThread* argument to QMetaMethod::invoke(); invocation callback

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Invalid
    • Not Evaluated
    • Some future release
    • None
    • Core: Threads
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sorvig Morten Sørvig
            janichol Andy Nichols
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes