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. [SOLVED]how to update the polygon point of a custom QGraphicsPolygonItem?
Forum Update on Monday, May 27th 2025

[SOLVED]how to update the polygon point of a custom QGraphicsPolygonItem?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.5k 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.
  • O Offline
    O Offline
    opengpu
    wrote on last edited by
    #1

    i want to update the polygon point of a custom QGraphicsPolygonItem, i got the point from the m_Polygon, and change its value, then i use the API setPolygon() again...
    my it's the same m_Polygon, and i just changed some point value in it, and is there any update() kinda API to do this?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      You changed a copy of the polygon. You need to set the polygon for the update to happen. If you need anything else, you will have to write a custom GraphicsItem.

      1 Reply Last reply
      0
      • O Offline
        O Offline
        opengpu
        wrote on last edited by
        #3

        so there is no way except call setPolygon() again?
        i just want to know if it is the most effcient way.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Asperamanca
          wrote on last edited by
          #4

          There is no other way I know of. If you want more efficiency, you would probably have to write your own specialized item.

          1 Reply Last reply
          0
          • O Offline
            O Offline
            opengpu
            wrote on last edited by
            #5

            ok thanks very much

            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