Change the custom graphics item so that the boundingRect() method returns the rect + border instead of just the rect of the item.
Or center the custom item as a child inside a QGraphicsRectItem whose size is adjusted to include the border. This might be more flexible, because then you can change the rect item's size and the position of the custom item inside it without affecting the custom item itself.
Bookmarks