Insert ``mode`` at position ``pos``.

        If ``pos`` is negative then this is equivalent to ``pos=0``. If it
        is larger than the number of modes in the list then it is appended
        as the last element.

        |Args|

        * ``pos`` (**int**): insertion point.
        * ``mode`` (**str**): name of mode.
        * ``value`` (**object**) value associated with ``mode``.

        |Returns|

        * **None**

        |Raises|

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

def qteInsertMode(self, pos: int, mode: str, value):
        """
        Insert ``mode`` at position ``pos``.

        If ``pos`` is negative then this is equivalent to ``pos=0``. If it
        is larger than the number of modes in the list then it is appended
        as the last element.

        |Args|

        * ``pos`` (**int**): insertion point.
        * ``mode`` (**str**): name of mode.
        * ``value`` (**object**) value associated with ``mode``.

        |Returns|

        * **None**

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.
        """
        # Add the label to the list.
        label = self._qteGetLabelInstance()
        label.setText(value)
        self._qteModeList.insert(pos, (mode, value, label))
        self._qteUpdateLabelWidths()