docs: def qteRegisterApplet(self, cls, replaceApplet: bool=False):
          """
          Register ``cls`` as an applet.
  
          The name of the applet is the class name of ``cls``
          itself. For instance, if the applet was defined and registered
          as
  
              class NewApplet17(QtmacsApplet):
                  ...
  
              app_name = qteRegisterApplet(NewApplet17)
  
          then the applet will be known as *NewApplet17*, which is also
          returned in ``app_name``.
  
          If an applet with this name already exists then
          ``replaceApplet`` decides whether the registration will
          overwrite the existing definition or ignore the registration
          request altogether. In the first case, none of the already
          instantiated applets will be affected, only newly created ones
          will use the new definition.
  
          .. note:: this method expects a *class*, not an instance.
  
          |Args|
  
          * ``cls`` (**class QtmacsApplet**): this must really be a class,
            not an instance.
          * ``replaceApplet`` (**bool**): if applet with same name exists,
            then replace it.
  
          |Returns|
  
          * **str**: name under which the applet was registered with Qtmacs.
  
          |Raises|
  
          * **QtmacsArgumentError** if at least one argument has an invalid type.
          """
          # Check type of input arguments.
          if not issubclass(cls, QtmacsApplet):
              args = ('cls', 'class QtmacsApplet', inspect.stack()[0][3])
              raise QtmacsArgumentError(*args)
  
          # Extract the class name as string, because this is the name
          # under which the applet will be known.
          class_name = cls.__name__
  
          # Issue a warning if an applet with this name already exists.
          if class_name in self._qteRegistryApplets:
              msg = 'The original applet <b>{}</b>'.format(class_name)
              if replaceApplet:
                  msg += ' was redefined.'
                  self.qteLogger.warning(msg)
              else:
                  msg += ' was not redefined.'
                  self.qteLogger.warning(msg)
                  return class_name
  
          # Execute the classmethod __qteRegisterAppletInit__ to
          # allow the applet to make global initialisations that do
          # not depend on a particular instance, eg. the supported
          # file types.
          cls.__qteRegisterAppletInit__()
  
          # Add the class (not instance!) to the applet registry.
          self._qteRegistryApplets[class_name] = cls
          self.qteLogger.info('Applet <b>{}</b> now registered.'
                              .format(class_name))
          return class_name