I am trying to generate a scripted module with embed html. Then I use webEngineView and set the webEngineView url to my html file. Since I want html js to interact with slicer, I use websockets to allow the two to interact, but whether I use multi-process or Cli Module to run websockets server, I can’t operate view node in Slicer. So, is there any good solution to implement the interaction between the embedded HTML components and the Slicer scene?
Here’s an example of some demo code that mixes a web graph with the segment editor.
If you communicate via the web widget data is passed in ascii, which is usually fast enough but if it’s not you can communicate asynchronously by integrating the sockets with the Qt event loop using tools like the QSocketNotifier, which is used in the SlicerWeb code.