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

QJSValue that represents a Javascript Promise

    XMLWordPrintable

Details

    Description

      The subclass or QJSValue itself could have signals or any other API you deem suitable to handle promise resolution and rejection.

      The use case is calling Javascript functions that return promises from C++.

      This is what usage could look like:

       

      QJSValue promise = myJsFunction.call(myArgs);
      connect(&promise, QJSValue::then, this, [](QJSValue data) { // do something });
      connect(&promise, QJSValue::catch, this, [](QJSValue error) { // do something });
       
       
      

       

       

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            flaviotordini Flavio Tordini
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes