Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWebEngine vs QGraphicsScene/QGraphicsSvgItem
Forum Updated to NodeBB v4.3 + New Features

QWebEngine vs QGraphicsScene/QGraphicsSvgItem

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 224 Views 1 Watching
  • 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
    #1

    I'm looking to create a live schematic with data that updates at a 10hz rate, up to 100 sensors changing values along with some animations for pipe flow, valves, etc. It'll be a standalone app developed in PyQt

    I'm a little bit unsure as to which of the above makes the most sense. After some quick playing I seem to have the following thoughts, some of which may be wrong, so please correct.

    QWebEngine seems simple out of the gate. Javascript to manipulate the dom seems pretty straight forward. What I'm a bit unsure of is things such as zoom and panning the image without the scroll bars. I'm not really seeing how a viewport/scene works as it does below in the QGraphicsSvgItem.

    QGraphicsSvgItem seems my preferred. My only big question has to do with manipulating the DOM for updates. The only way I've been able to do it is to keep the DOM local, manipulate it, then do a renderer().load() of the entire svg string each time. This seems extremely resource intensive and worry about performance doing it 10 times a second. Am I over worrying about this and the renderer is expecting and handles this in an optimized way? I also wonder if this is going to mess up when I start adding animations as each time the svg is loaded it'll basically restart?

    Or is there another approach that is better fitting that I'm missing?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Do you already have the animation related stuff ?

      Otherwise a pure QGraphicsView with items could fit the bill or even Qt Quick which is made for animation.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JNoll
        wrote on last edited by
        #3

        For the most part. I take a vizio of the schematic, save it to svg and then do some mark ups in inkscape such as add a text label to for sensor values and animations for pipe flow. Using qwebengine makes it really easy to change data, its just javascript calls to change the DOM, using qgraphicssvgitem and scenes make it easy to zoom, move around, and seems to be a bit more of a custom application solution, but I worry about resetting animations mid update being forced to do an entire load into the renderer.

        I could do it all as standard 2d graphics in a painter, but I'm really interested in playing with an svg based solution if possible.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          From your description, I would say webengine is likely your best bet.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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