qt 6.3 & asyncify
-
Hi!
-
Is It correct to activate asyncify by adding key and value "-device-option QT_EMSCRIPTEN_ASYNCIFY=1" while configuring qt before using cmake?
-
How to check is asyncify enabled?
This code (in case of using QEventLoop) still doesn't work.
bool myclass::func(){ .... QEventLoop el; connect(this, &myclass::mysignal, &el, &QEventLoop::exit)); el.exec(); /// unreachable string } void myclass::recieve_msg(const QByteArray &message){ // QWebSocket callback func ... emit mysignal(0); }
-
-
@lorn-potter Could you please comment my problem?
-
@sitesv I known what you concern, so I think my experience may help you.
When we make network program, the communication protocol sometimes is complicate, we need send request and wait reponse, and depend on the reply and request more different datas, blabla,... and then can process the display. So the qt websocket provide the signal/slot is inadequate. Most of the time, we need wait the network response, and do next step.
My program work fine in windows/linux, but when compile in wasm. I meet the same problem as you.
My code like below:m_websocket.sendTextMessage(request_str); bool timeout=true, dataRet=false; QElapsedTimer netTimer; netTimer.start(); while(netTimer.elapsed() < 3000) //3 seconds timeout { //in websocket receive message slot, process and set dataRet true if (dataRet) { timeout=false; break; } QCoreApplication::processEvents(QEventLoop::AllEvents,100); } qDebug() << "processEvents ok";
The above code doesn't work in qt6.2.4 even if I compile the wasm with asyncify.
The key problem is the processEvents(QEventLoop) doesn't work in wasm. I try other way, include thread... but all don't work.
After I success compile qt6.3.0 with asyncify. I found it works!!!
So I think you can use this way, don't need to solve that QEventLoop problem.
QT wasm is really new, it's a exciting tech. but have many constrain. Now I need process the popup menu problem.... -
@wenqing-zhong Thank you for advice.
BTW, I don't understand for which purpose wasm exists, If we always can start standart app in vnc mode... -
J JonB referenced this topic on