I have my own object implementing a QGraphicsItem
- it is essentially just a square with a border. I am attempting to draw shapes within that item, using it as the parent. The issue is that the coordinates I am using for the shapes within the parent are not relative to the parent's coordinates, but rather the scene.
Example: I want to draw a QGraphicsLineItem
within my QGraphicsItem
(the parent). The parent is at 50,50, with dimensions 20x20. If I draw a line with the parent specified, using coordinates 0,0,20,20, it draws at 0,0,20,20 relative to the scene, not the parent.
Is there a way to make the line (or any other shape) use positions relative the parent, not the scene? Or would I need to manually determine the coordinates by checking the parent's X and Y?