Wasm not updating without an event (mouse, keyboard)
-
Hi, For the purposes of this question I'm trying to build a simple chat program (there is a little more underneath it but it -shouldn't- be relevant) in Qt, and port it to WASM. I'm using QtWidgets and QtWebSockets. The message gets sent from one instance of the client to a server, who then returns the message to any instances of the client connected to the chat. This works on a networking level; The message gets sent and received by the client, as I can see in the firefox debugger. The problem is that the WASM GUI made of QtWidgets won't update to reflect this until it receives a mouse event, such as movement or clicking, or a keyboard event. I have a QTextEdit chatbox which I append each message to. Messages will not appear in the chatbox until an event one such event is received, such as mousing over the browser. I also tried this with a QLabel, and had the same results of it not updating until moused over. Note that this is specific to WASM, as the clients running just in C++ work fine regardless of mouse events.
What's weird is that it's still receiving messages; the debugger updates that message has been received in the websocket. I'm aware that websockets run on a separate JS level, but not only are the messages receieved, but WASM callback functions bound to when a message is received from the QWebSocket are run. This implies that my issue is just with the rendering to the screen.
Does anyone know anything about this? Is it a known issue with QtWidgets in WASM? Is it a setting of the qt emscripten build? Any ideas would be greatly appreciated, as this doesn't seem like something I can easily debug just with the code. Cheers.
-
@Ollie_A said in Wasm not updating without an event (mouse, keyboard):
I have a QTextEdit chatbox which I append each message to.
I have no idea whether this will help or why you should have to do it, but is it worth calling
QWidget::update()
, or evenQWidget::repaint()
, to see if that reflects immediately?You may get a (better!) answer to this here, or you might have to await the expert @lorn-potter reading your topic....
-
What version of Qt are you using?