def setVisible(self, flag): QGraphicsItem.setVisible(self, flag) for connection in self._connections: connection.updateVisibility()