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. Polygon creation like gimp free select

Polygon creation like gimp free select

Scheduled Pinned Locked Moved General and Desktop
qgraphicssceneqgraphicsviewgraphicsitem
2 Posts 2 Posters 956 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
    jakir
    wrote on 18 Sept 2015, 13:08 last edited by
    #1

    I am working on a desktop application using subclassed QGraphicsView/Scene and -Items for showing an image and various overlay graphics.

    In the application, the user needs to be able to draw a closed polygon, as it is e.g. done in Gimp select lasso tool and other drawing applications. Basically the user initially clicks in the scene marking the first vertex. Following this a line is drawn between the first vertex and the mouse cursor points. New clicks adds new vertices. While still in drawing mode the user can select previously added vertices and move them around (not translating the entire polygon) and finally close the polygon by adding a connection to initial vertex.

    What would be the QT-way of implementing this? If have looked at the elasticnodes example in the qt examples, and it could be a way forward, i.e. creating a custom QGraphicsItem for the vertices and another custom QGraphicsItem for the edges. Is this the way to go or is there a better/simpler approach?

    Any input much appreciated!

    1 Reply Last reply
    0
    • G Offline
      G Offline
      guanyu
      Banned
      wrote on 10 Sept 2019, 08:09 last edited by
      #2
      This post is deleted!
      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