Quote Originally Posted by prashant View Post
How do you restrict a QGraphicsItem to move horizontally or vertically?
For example, If an item is at (0,0), how do I restrict the movement between (0,0)-(150,0)?
For this you need to subclass QGraphicsScene and re-implement mouseMoveEvent. In mouseMoveEvent, you need to identify that particular item and manually restrict the movable area of that item. Here the point is, the item cannot cannot control this behaviour but its parent can.