qtqtwebengine

Is there any way to use synchronous function call through Qt WebChannel?


Unlike Qt WebKit Bridge, I couldn't find to use synchronous function call on JS side using Qt WebChannel.

Is there any way to do so?


Solution

  • I think there's no way to do it. It is said in the documentation : QWebChannel

    Note that all communication between the HTML client and the QML/C++ server is asynchronous.

    Moreover, it is precisely said in this blog : Bridge the gap between C++/QML and the web

    But, contrary to the WebKit Bridge, the API provided by the WebChannel is completely asynchronous.

    Hope that helps.