Keep Sharp

Select PyQt4 rectangle by edge/stroke

This tip is about how to make pyqt4 rectangle selectable by its edge (or you call it stroke), by default it's selectable by inner area. To achieve this, basically you need to subclass QGraphicsRectItem and overwrite its shape() function so that its shape is not an area but a ...