Drawing polygon ROI using mouse with re-sizable handles for vertices
-
I have a project where i need to extract ROI based on polygons. I tried
QGraphicsPathItemalong withQPainterPathbut couldn't achieve the one like shown below in the picture.
Background:
I already have subclassed
QGraphicsItemwhich i use to paint my bounding boxes and ellipses based on LMB+Drag and they work fine. I already have my custom re-sizable handles also implemented for myQGraphicsItemI want to create this polygon ROI exactly as:
Action1: Clicking first time creates a starting point
Action2: Selecting another point shows line from the starting point and creates a re-sizable handle at the point
.
.
ActionN: Clicking on starting point again should close the subpath.I am not sure how to get this working on my scene. Any ideas or pointers to demo code?
-
Hi,
Maybe QGraphicsPathItem can be a starting point.