I'd like to implement the snap to grid behaviour.

I draw the grid inside my drawbackground() function.....How can my custom QGraphicsItems have this behaviour????