code: def _push(self, undoObj: QtmacsUndoCommand):
          
          self._qteStack.append(undoObj)
          if undoObj.nextIsRedo:
              undoObj.commit()
          else:
              undoObj.reverseCommit()
          undoObj.nextIsRedo = not undoObj.nextIsRedo
docs: The actual method that adds the command object onto the stack.
  
          This method also toggles the ``nextIsRedo`` flag in the
          command object and, depending on its value, executes either
          the ``commit`` or ``reverseCommit`` method of the object. This
          distinction is invisible to the user but if the method is
          passed a copy of an older ``undoObj`` already on the stack
          (typically the case when called from ``undo``) then it will
          call the inverse command (ie a ``commit`` when the previous
          call was a ``reverseCommit`` and vice versa). In this manner,
          the undo history will contain just another command object
          which happens to undo a previous one, irrespective of whether
          the previous one was already the undoing of an even earlier
          one.