1

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.

Ben Hoff
  • 1,058
  • 1
  • 11
  • 24
  • It would be easier to help if you post the code which causes you troubles. – scopchanov Aug 14 '18 at 13:41
  • It's going to be a little challenging since it's an entire code base. [Here's the C++](https://github.com/benhoff/qt5-cross-platform-apps/blob/master/core/gameinterface.h) side and [here's the QML side](https://github.com/benhoff/qt5-cross-platform-apps/blob/master/eatem/main.qml). I'm unsure how to break it into a concise question. – Ben Hoff Aug 14 '18 at 19:49
  • Looks like I need to be using [QQmlListProperty](http://doc.qt.io/qt-5/qqmllistproperty.html) instead of QVariantList. [This post](https://stackoverflow.com/questions/26398932/running-into-issues-with-qvariantlists-and-qlists-of-custom-qobjects) helped guide me. – Ben Hoff Aug 15 '18 at 03:07

1 Answers1

0

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

Ben Hoff
  • 1,058
  • 1
  • 11
  • 24