QWebEngine register object after initialization

272 Views Asked by At

Currently I'm running a HTML/Javascript page inside a QWebEngieView. After the initialization I want to add further JS code via the QWebChannel. Through this channel javascript code is inserted as well before the application is launched and everything (data is displayed as well as callbacks for events are called) works as expected.

After the application is launched every newly registered object through the QWebChannel causes the following message:

Registered new object after initialization, existing clients won't be notified!

The object is created perfectly, except the event callbacks, but this is probably due to the error message, that existing clients won't be notified.

Reading through documentation of QWebChannel as well as further problems found in repositories (e.g. https://github.com/skylarkdrones/pyqtlet/issues/29#issuecomment-799662856), it seems like that you only can register objects before client initialization.

Are there any options on how to create objects through QWebChannel after client initialization? Is there an option to reload/re-initialize the Client, so it receives updates of newly registered objects?

0

There are 0 best solutions below