def updateState(self, state):
        """Examine what has changed in state and call apropriate function."""
        ss = state.state()
        if ss & qt.QPaintEngine.DirtyPen:
            self._updatePen(state.pen())
        if ss & qt.QPaintEngine.DirtyBrush:
            self._updateBrush(state.brush())
        if ss & qt.QPaintEngine.DirtyTransform:
            self._updateTransform(state.transform())
        if ss & qt.QPaintEngine.DirtyClipPath:
            self._updateClipPath(state.clipPath(), state.clipOperation())
        if ss & qt.QPaintEngine.DirtyClipRegion:
            path = qt.QPainterPath()
            path.addRegion(state.clipRegion())
            self._updateClipPath(path, state.clipOperation())