'Some parameters of the optic have changed.'

def paramStateChanged(self):

    self.gitem.setPos(Point(self['pos']))
    self.gitem.resetTransform()
    self.gitem.rotate(self['angle'])
    try:
        self.roi.sigRegionChanged.disconnect(self.roiChanged)
        br = self.gitem.boundingRect()
        o = self.gitem.mapToParent(br.topLeft())
        self.roi.setAngle(self['angle'])
        self.roi.setPos(o)
        self.roi.setSize([br.width(), br.height()])
    finally:
        self.roi.sigRegionChanged.connect(self.roiChanged)
    self.sigStateChanged.emit()
