'Replace one handle in the ROI for another. This is useful when
connecting multiple ROIs together.
*oldHandle* may be a Handle instance or the index of a handle to be
replaced.'

def replaceHandle(self, oldHandle, newHandle):

    index = self.indexOfHandle(oldHandle)
    info = self.handles[index]
    self.removeHandle(index)
    info['item'] = newHandle
    info['pos'] = newHandle.pos()
    self.addHandle(info, index=index)
