Put the document into the new state.

def commit(self):
        """
        Put the document into the new state.
        """
        if self.after is None:
            # If this is the first 'commit' call then do not make
            # any changes but store the current document state.
            self.after = self.qteWidget.toHtml()
        else:
            # Put the document into the edited state.
            pos = self.qteWidget.textCursor().position()
            self.qteWidget.setHtml(self.after)
            self.placeCursor(pos)