QApplication::processEvents() doesn't works
-
@sitesv said in QApplication::processEvents() doesn't works:
What should I do to fix this behaviour?
Get rid of the loop
-
@KroMignon
There is a problem with QEventLoop exec()
I can't exit by emitting signal. And browser console says: "Uncaught Please compile your program with async support in order to use asynchronous operations like emscripten_sleep"Made something like this:
bool myclass::func(){ .... QEventLoop el; connect(this, &myclass::mysignal, &el, &QEventLoop::exit)); el.exec(); /// unreachable string } void myclass::recieve_msg(const QByteArray &message){ ... emit mysignal(0); }
msvc compiled app works fine.
Glad to see any advice.
-
secondary event loops are not really supported in emscripten. In Qt, you can run them, but they never return, or they won't return to the place you expect, as we needed to raise a javascript exception to pop out of it and return to the main loop.
You might try Qt 6.3 and reconfiguring with asyncify ( -device-option QT_EMSCRIPTEN_ASYNCIFY=1 ), which has workarounds for Emscripten event loop.
-
@lorn-potter Thank you for an advice!
Could you please help me about reconfiguring?Did you mean a rebuilding qt from sources with this key?
-
Trying to do next:
C:\Qt\6.3.0>\Src\configure.bat -qt-host-path C:\Qt\6.3.0\wasm_32 -no-warnings-are-errors -platform wasm-emscripten -device-option QT_EMSCRIPTEN_ASYNCIFY=1 -prefix C:\Qt\6.3.0\wasm_32_asyncifyBut there is an error message:
CMake Error at qtbase/cmake/QtToolHelpers,cmake:156 (message): The tool "Qt6::moc" was not found in the Qt6CoreTools package.
... -
@sitesv said in QApplication::processEvents() doesn't works:
Trying to do next:
C:\Qt\6.3.0>\Src\configure.bat -qt-host-path C:\Qt\6.3.0\wasm_32 -no-warnings-are-errors -platform wasm-emscripten -device-option QT_EMSCRIPTEN_ASYNCIFY=1 -prefix C:\Qt\6.3.0\wasm_32_asyncify
But there is an error message:
CMake Error at qtbase/cmake/QtToolHelpers,cmake:156 (message): The tool "Qt6::moc" was not found in the Qt6CoreTools package.This Q was solved. There is an error in qt host parameter...
But problem with QEventLoop still exist...