Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QWebEngine javascript causing SVG flicker
Forum Updated to NodeBB v4.3 + New Features

QWebEngine javascript causing SVG flicker

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 290 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JNoll
    wrote on last edited by JNoll
    #1

    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!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved