Errors usiong QNetworkInterface class in WebAssembly
-
Hello,
I am new to WebAssembly (and Qt in general). I am attempting to create a remote UI for a utility on a Linux computer. A browser was selected as a simple solution for remote UI. Data sharing between the Remote UI program and server uses a UDP socket. The Remote UI program, when compiled by Mingw_64, works as intended. However, as soon as I switch to compile for WebAssembly, I get errors for the QNetworkInterface Class.
error: allocation of incomplete type 'QNetworkInterface'
11 | QNetworkInterface * testAdapter = new QNetworkInterface();
| ^~~~~~~~~~~~~~~~~
C:\Qt\6.8.1\wasm_multithread\include\QtNetwork\qudpsocket.h:17:7: note: forward declaration of 'QNetworkInterface'
17 | class QNetworkInterface;An interesting point is that when compiled under the Mingw_64, the line in question uses qnetworkInterface.h file located in C:\Qt\6.8.1\mingw_64\include\QtNetwork. However, when compiled under WebAssembly, the same line fails with the call to qudpsocket.h file that is located C:\Qt\6.8.1\wasm_multithread\include, even though the qnetworkinterface.h file is located in the same directory.
Any thoughts on why this is happening?
Thank you for any help.
-
Now checking the documentation of QNetworkInterface, It seems to me this class should not be available in WASM. Because of the web sandbox where the program is running the application can not have access to network interfaces.
And as explained here it is not among the supported ones. -
Now checking the documentation of QNetworkInterface, It seems to me this class should not be available in WASM. Because of the web sandbox where the program is running the application can not have access to network interfaces.
And as explained here it is not among the supported ones. -
@Mesrine Thank you again for your quick reply.
I was so focused on the UI portion, that I didn't read the Networking section of the documentation properly. I need to investigate an alternative way to share data between the utility and the Remote UI.
Thanks again for your help.
-