def _updateClipPath(self, path, operation):
        """Update clipping path."""
        # print "clip"
        if operation != qt.Qt.NoClip:
            self._createPath(path)
            clipmode = {
                 qt.Qt.ReplaceClip: pyemf.RGN_COPY,
                 qt.Qt.IntersectClip: pyemf.RGN_AND,
            }[operation]
        else:
            # is this the only wave to get rid of clipping?
            self.emf.BeginPath()
            self.emf.MoveTo(0,0)
            w = int(self.width*self.dpi*scale)
            h = int(self.height*self.dpi*scale)
            self.emf.LineTo(w, 0)
            self.emf.LineTo(w, h)
            self.emf.LineTo(0, h)
            self.emf.CloseFigure()
            self.emf.EndPath()
            clipmode = pyemf.RGN_COPY

        self.emf.SelectClipPath(mode=clipmode)