def setText(self, text: str):
        """
        Undo safe wrapper for the native ``setText`` method.

        |Args|

        * ``text`` (**str**): text to insert at the specified position.

        |Returns|

        **None**

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.
        """
        undoObj = UndoSetText(self, text)
        self.qteUndoStack.push(undoObj)
Undo safe wrapper for the native ``setText`` method.

        |Args|

        * ``text`` (**str**): text to insert at the specified position.

        |Returns|

        **None**

        |Raises|

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