How to implement boundingRect and shape methods for a custom QGraphicLineItem item
How to implement boundingRect and shape methods for a custom qgraphicline item, so that the item is easily selected when mouse is clicked on the item end points? Currently the custom line item is not receiving the mouse press events consistently. The mouse press is happening only randomly. I need to click on the line end points inorder to rotate and resize the line item.
Please find my cureent implementation
const int adjustment = 5;
QRectF rect = boundingRect();
path.addRect(rect.adjusted(-adjustment, -adjustment, adjustment, adjustment));