[PyQt] selecting and moving - snapping to grid

Christopher M. Nahler christopher.nahler at papermodels.at
Tue May 4 07:27:11 BST 2010


I would like to have the rubberband selection and the moving of objects 
snap to a grid.

 From what I have researched the itemChange method seems to be the way 
to go. I have started with replicating the default behaviour as 
explained in the docu.

def itemChange(self, change, value)
    print change, value
    return value

With the debug info I now see that when I create a new  scene item (in 
my case a rectangle) that this function is visited when I create but not 
when I move the item.

Can anybody help me with info or links with info about how to deal with 
this method?

thanks in advance
Chris


More information about the PyQt mailing list