QWebEngine javascript causing SVG flicker
-
I have a live schematic, sorry I can't post any images of it, but its done as an svg. It has a dozen or so 'pipes' that when flowing animate using dasharrays and css animation. It also has about 30 sensors and effectors that are modified via the dom on the tspan tag or changing css class/style.
For the most part sensors dont change a ton. Maybe 10 get updated a second normally.
The flickering isn't constant. It comes and goes, can be just fine for a minute or so, then misbehave for a second or a few straight, then behave again.
During page load all of the nodes that get manipulated are found and stored into a javascript dictionary for efficiency so there's really just some simple dom class and style setting being done with no searches.
QWebChannel is used to connect and a series of page().runJavascript() calls such as
page().runJavaScript(updateSensor(node, val)); //Page() side //webengine side updateSensor(node, val) { sensors[node].textContent = val; }
So not a lot of work.
Initially I suspected it might be the dasharray animations in the pipes. But if i turn them all on via css class and dont inject any javascript via the channel there's no flicker and it runs quite well.
Also, I am using PyQt 6.6.1
Any insight appreciated!