有没有办法通过 Qt WebChannel 使用同步函数调用?
Is there any way to use synchronous function call through Qt WebChannel?
与 Qt WebKit Bridge
不同,我找不到使用 Qt WebChannel
在 JS side
上使用同步函数调用。
有什么办法吗?
我觉得没办法。文档中说:QWebChannel
Note that all communication between the HTML client and the QML/C++
server is asynchronous.
此外,这篇博客中正是这样说的:Bridge the gap between C++/QML and the web
But, contrary to the WebKit Bridge, the API provided by the WebChannel
is completely asynchronous.
希望对您有所帮助。
与 Qt WebKit Bridge
不同,我找不到使用 Qt WebChannel
在 JS side
上使用同步函数调用。
有什么办法吗?
我觉得没办法。文档中说:QWebChannel
Note that all communication between the HTML client and the QML/C++ server is asynchronous.
此外,这篇博客中正是这样说的:Bridge the gap between C++/QML and the web
But, contrary to the WebKit Bridge, the API provided by the WebChannel is completely asynchronous.
希望对您有所帮助。