Connect the method or function ``slot`` to ``hookName``.

        |Args|

        * ``hookName`` (**str**): name of the hook.
        * ``slot`` (**function**, **method**): the routine to execute
          when the hook triggers.

        |Returns|

        * **None**

        |Raises|

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

def qteConnectHook(self, hookName: str,
                       slot: (types.FunctionType, types.MethodType)):
        """
        Connect the method or function ``slot`` to ``hookName``.

        |Args|

        * ``hookName`` (**str**): name of the hook.
        * ``slot`` (**function**, **method**): the routine to execute
          when the hook triggers.

        |Returns|

        * **None**

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.
        """
        # Shorthand.
        reg = self._qteRegistryHooks
        if hookName in reg:
            reg[hookName].append(slot)
        else:
            reg[hookName] = [slot]