Bind ``macroName`` to ``widgetObj`` and associate it with
        ``keysequence``.

        This method does not affect the key bindings of other applets
        and/or widgets and can be used to individualise the key
        bindings inside every applet instance and every widget inside
        that instance. Even multiple instances of the same applet type
        (eg. multiple text buffers) can all have individual key
        bindings.

        The ``keysequence`` can be specified either as a string (eg
        '<ctrl>+x <ctrl>+f'), or a list of tuples containing the
        constants from the ``QtCore.Qt`` name space
        (eg. [(ControlModifier, Key_X), (ControlModifier, Key_F)]), or
        as a ``QtmacsKeysequence`` object.

        |Args|

        * ``keysequence`` (**str**, **list** of **tuples**,
          **QtmacsKeysequence**):
          key sequence to activate ``macroName`` for specified
          ``widgetSignature``.
        * ``macroName`` (**str**): the macro to associated with
          ``keysequence``.
        * ``widgetObj`` (**QWidget**): determines which widgets
          signature to use.

        |Returns|

        * **bool**: whether or not at least one widget was
            successfully bound.

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.
        * **QtmacsKeysequenceError** if the provided ``keysequence``
          could not be parsed.
        * **QtmacsOtherError** if ``widgetObj`` was not added with
          ``qteAddWidget``.

def qteBindKeyWidget(self, keysequence, macroName: str,
                         widgetObj: QtGui.QWidget):
        """
        Bind ``macroName`` to ``widgetObj`` and associate it with
        ``keysequence``.

        This method does not affect the key bindings of other applets
        and/or widgets and can be used to individualise the key
        bindings inside every applet instance and every widget inside
        that instance. Even multiple instances of the same applet type
        (eg. multiple text buffers) can all have individual key
        bindings.

        The ``keysequence`` can be specified either as a string (eg
        '<ctrl>+x <ctrl>+f'), or a list of tuples containing the
        constants from the ``QtCore.Qt`` name space
        (eg. [(ControlModifier, Key_X), (ControlModifier, Key_F)]), or
        as a ``QtmacsKeysequence`` object.

        |Args|

        * ``keysequence`` (**str**, **list** of **tuples**,
          **QtmacsKeysequence**):
          key sequence to activate ``macroName`` for specified
          ``widgetSignature``.
        * ``macroName`` (**str**): the macro to associated with
          ``keysequence``.
        * ``widgetObj`` (**QWidget**): determines which widgets
          signature to use.

        |Returns|

        * **bool**: whether or not at least one widget was
            successfully bound.

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.
        * **QtmacsKeysequenceError** if the provided ``keysequence``
          could not be parsed.
        * **QtmacsOtherError** if ``widgetObj`` was not added with
          ``qteAddWidget``.
        """
        # Convert the key sequence into a QtmacsKeysequence object, or
        # raise an QtmacsKeysequenceError if the conversion is
        # impossible.
        keysequence = QtmacsKeysequence(keysequence)

        # Check type of input arguments.
        if not hasattr(widgetObj, '_qteAdmin'):
            msg = '<widgetObj> was probably not added with <qteAddWidget>'
            msg += ' method because it lacks the <_qteAdmin> attribute.'
            raise QtmacsOtherError(msg)

        # Verify that Qtmacs knows a macro named 'macroName'.
        if not self.qteIsMacroRegistered(macroName):
            msg = ('Cannot bind key to unknown macro <b>{}</b>.'
                   .format(macroName))
            self.qteLogger.error(msg, stack_info=True)
            return False

        # Associate 'keysequence' with 'macroName' for 'widgetObj'.
        try:
            widgetObj._qteAdmin.keyMap.qteInsertKey(keysequence, macroName)
        except AttributeError:
            msg = 'Received an invalid macro object.'
            self.qteLogger.error(msg, stack_info=True)
            return False
        return True