Important: Please read the Qt Code of Conduct -

How to get all boundry items from QgraphicsScene?

  • Hi,

    I have drawn @200 GPS location points on QgraphicsScene/QgraphicsView
    Now i want to draw a boundry line by connecting all points which are at boundry.
    Is there any way of getting all points list which are at boundry from QGraphicsScene so that I can draw the boundry line?
    Thanks in advance.

  • No, because there really is no standard way to define what is the boundary.

    Qt only can give you the bounding rectangle of your points, but I guess that that is not enough for your purpose. You'll have to either find an existing algorithm to do what you want, or device your own. I think it is doable to find a simple polygon to surround all points, but I have never tried.

    Anyway, you should probably look for "convex hull algorithms".

    Here is one "implementation": you might use. It is not the fastest algorithm, but probably fast enough for only 200 points.

Log in to reply