c++qtqtwebchannel

QWebChannel new client gets initial state?


For better or worse I was exploring using QWebChannel as a method for creating networked video games. I've run into a problem where as new.clients join, they recieve the game state as it was originally, without any incremented changes that other clients have been making.

Looking at the webchannel chat client example it looks like the client links directly to the changed signals, and then pulls the properties directly using the method/property calls.

Does QWebChannel not incrementally update the state for new clients? Is there a way to work around this?

I currently have a property that is a QVariantList of QObects. Each QObject has an enabled property that gets updated. New clients are getting stale state and it's driving me nuts.


Solution

  • This is a bug in Qt. It's been reported here: https://bugreports.qt.io/browse/QTBUG-70078