I have a QGraphicsView that is showing some data. The user wants to be able to lay down some "markers" on this view that stretch the full length of the viewport, either full width or full height. The user also wants to be able to move these markers.

I thought of starting with the QGraphicsLineItem, but I am not sure how to set the width or height based on the viewport since the line item is held in scene coordinates. I need this to work on any scaling of the scene. Also, I believe I will need a small buffer around the line to make it easier to grab, but again this is in scene coordinates . . . would just like to add a couple of pixels on either side of line.

So, is QGraphicsLineItem the way to go or do I implement something within the view itself to control the markers and their drawing?