'End the annotation edit.'

def endEdit(self):

    content = self.__textItem.toPlainText()
    self.__textItem.setTextInteractionFlags(self.__defaultInteractionFlags)
    self.__textItem.document().contentsChanged.disconnect(self.textEdited)
    cursor = self.__textItem.textCursor()
    cursor.clearSelection()
    self.__textItem.setTextCursor(cursor)
    self.__content = content
    self.editingFinished.emit()
    QMetaObject.invokeMethod(self, '__updateRenderedContent', Qt.QueuedConnection)
