Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Canvas - alternative ?

Canvas - alternative ?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 460 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.
  • M Offline
    M Offline
    Melle_87
    wrote on 23 Mar 2022, 09:56 last edited by
    #1

    Hi,
    at the moment I am using Canvas an moveTo() / lineTo() to draw a kind of line diagram with incoming values.
    Unfortunately the repaint interval of Canvas seems to be too slow.
    In the code repaint() is called, when necessary. But it takes some time (> 300ms) until the repaint is really done.
    Because of that I am searching for an alternative to Canvas to draw the lines.
    What would you recommend?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Markkyboy
      wrote on 23 Mar 2022, 15:14 last edited by Markkyboy
      #2

      NOT a recommendation, but a suggestion; Path ( see glossary on page; i.e PathLine ) or perhaps Shape QML;

      Path ~ https://doc.qt.io/qt-5/qml-qtquick-path.html

      LineShape ~ https://doc.qt.io/qt-5/qml-qtquick-particles-lineshape.html

      Shape ~ https://doc.qt.io/qt-5/qml-qtquick-shapes-shape.html

      Don't just sit there standing around, pick up a shovel and sweep up!

      I live by the sea, not in it.

      1 Reply Last reply
      1
      • F Offline
        F Offline
        fcarney
        wrote on 23 Mar 2022, 15:42 last edited by fcarney
        #3

        I used some shape stuff to replace my canvas code. I used Instantiators for some ShapePaths inside of Shape. I also used Repeaters for some Shapes and PolyMultiLine for some more complex paths inside those. I was doing mostly line drawing. Just be aware some of these objects are Item based and some are QObject based. I have no idea how fast it was compared to my original Canvas code. But it ended up being less complex and I made it all data driven via ListModel and js arrays.

        How many lines are we talking?

        C++ is a perfectly valid school of magic.

        1 Reply Last reply
        0

        3/3

        23 Mar 2022, 15:42

        • Login

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