docs: def qteRunHook(self, hookName: str, msgObj: QtmacsMessage=None):
          """
          Trigger the hook named ``hookName`` and pass on ``msgObj``.
  
          This will call all slots associated with ``hookName`` but
          without calling the event loop in between. Therefore, if
          one slots changes the state of the GUI, every subsequent slot
          may have difficulties determining the actual state of the GUI
          using Qt accessor functions. It is thus usually a good idea
          to either avoid manipulating the GUI directly, or call macros
          because Qtmacs will always run the event loop in between any
          two macros.
  
          .. note: the slots are executed in the order in which they
            were registered via ``qteConnectHook``, but there is no
            guarantee that this is really so. However, it is guaranteed
            that all slots will be triggered, even if some raise an error
            during the execution.
  
          |Args|
  
          * ``hookName`` (**str**): the name of the hook to trigger.
          * ``msgObj`` (**QtmacsMessage**): data passed to the function.
  
          |Returns|
  
          * **None**
  
          |Raises|
  
          * **QtmacsArgumentError** if at least one argument has an invalid type.
          """
          # Shorthand.
          reg = self._qteRegistryHooks
  
          # Do nothing if there are not recipients for the hook.
          if hookName not in reg:
              return
  
          # Create an empty ``QtmacsMessage`` object if none was provided.
          if msgObj is None:
              msgObj = QtmacsMessage()
  
          # Add information about the hook that will deliver ``msgObj``.
          msgObj.setHookName(hookName)
  
          # Try to call each slot. Intercept any errors but ensure that
          # really all slots are called, irrespective of how many of them
          # raise an error during execution.
          for fun in reg[hookName]:
              try:
                  fun(msgObj)
              except Exception as err:
                  # Format the error message.
                  msg = '<b>{}</b>-hook function <b>{}</b>'.format(
                      hookName, str(fun)[1:-1])
                  msg += " did not execute properly."
                  if isinstance(err, QtmacsArgumentError):
                      msg += '<br/>' + str(err)
  
                  # Log the error.
                  self.qteLogger.exception(msg, exc_info=True, stack_info=True)