I have a QGraphicsItem implemented to represent points on a grid. My grid can be of variable resolution, and I would like the ability to enforce snap-to behavior on my points when they're drug around the graphics view. From what I can tell, there is no built-in behavior for this and I will have to impelement my own mouseMoveEvent.

My initial thought was to somehow "fudge" the QGraphicsSceneMouseEvent before I sent it up to the QGraphicsItem handler, but it seems that I don't have any access methods to set the internal values.

I checked the mouseMoveEvent code for the QGraphicsItem class, and I really don't want to have to duplicate all of the internal code. Is there any simple solution for offsetting the movements to a grid (i.e. only allow movement in 5 pixel increments etc.), or will I definitely have to re-implement the entirety of the mouseMoveEvent?