def push(self, undoObj):
        """
        Add ``undoObj`` command to stack and run its ``commit`` method.

        |Args|

        * ``undoObj`` (**QtmacsUndoCommand**): the new command object.

        |Returns|

        * **None**

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.
        """
        # Check type of input arguments.
        if not isinstance(undoObj, QtmacsUndoCommand):
            raise QtmacsArgumentError('undoObj', 'QtmacsUndoCommand',
                                      inspect.stack()[0][3])

        # Flag that the last action was not an undo action and push
        # the command to the stack.
        self._wasUndo = False
        self._push(undoObj)
Add ``undoObj`` command to stack and run its ``commit`` method.

        |Args|

        * ``undoObj`` (**QtmacsUndoCommand**): the new command object.

        |Returns|

        * **None**

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.