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. QPaintedItem drawing complexity
Qt 6.11 is out! See what's new in the release blog

QPaintedItem drawing complexity

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 568 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.
  • A Offline
    A Offline
    Ajay Krishna
    wrote on last edited by
    #1

    Hi all,
    I am trying to draw using QPaintedItem .
    I can see two options to paint :
    1 . void QQuickPaintedItem::paint(QPainter *painter)

    2 . QSGNode *QQuickPaintedItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *data)

    I'm assuming that both will use the OpenGL for painting.
    I find using QPainter is very easy to draw. However drawing using updatePaintNode(..) is little complex.

    What is the difference between these two ?
    Can somebody help me here .

    raven-worxR 1 Reply Last reply
    0
    • A Ajay Krishna

      Hi all,
      I am trying to draw using QPaintedItem .
      I can see two options to paint :
      1 . void QQuickPaintedItem::paint(QPainter *painter)

      2 . QSGNode *QQuickPaintedItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *data)

      I'm assuming that both will use the OpenGL for painting.
      I find using QPainter is very easy to draw. However drawing using updatePaintNode(..) is little complex.

      What is the difference between these two ?
      Can somebody help me here .

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Ajay-Krishna
      the sole purpose of QQuickPaintedItem is the drawing via QPainter in the QML scene graph. This paints (via CPU) into a texture and then draws the texture via OpenGL.
      So when using this class do not overrride updatePaintNode()

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      A 1 Reply Last reply
      1
      • raven-worxR raven-worx

        @Ajay-Krishna
        the sole purpose of QQuickPaintedItem is the drawing via QPainter in the QML scene graph. This paints (via CPU) into a texture and then draws the texture via OpenGL.
        So when using this class do not overrride updatePaintNode()

        A Offline
        A Offline
        Ajay Krishna
        wrote on last edited by
        #3

        @raven-worx Which one is better to use void QQuickPaintedItem::paint(QPainter *painter) or QSGNode *QQuickPaintedItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *data) ?

        raven-worxR 1 Reply Last reply
        0
        • A Ajay Krishna

          @raven-worx Which one is better to use void QQuickPaintedItem::paint(QPainter *painter) or QSGNode *QQuickPaintedItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *data) ?

          raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          @Ajay-Krishna
          "Better" speaking of performance is updatepaintnode(), if thats too complex for you to use (example), use the QQuickPaintedItem

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          1

          • Login

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