Destroy the applet with ID ``appletID``.

        This method removes ``appletID`` from Qtmacs permanently - no
        questions asked. It is the responsibility of the (macro)
        programmer to use it responsibly.

        If the applet was visible then the method also takes care of
        replacing with the next invisible applet, if one is available.

        If ``appletID`` does not refer to a valid applet then nothing
        happens.

        |Args|

        * ``appletID`` (**str**): name of applet to be destroyed.

        |Returns|

        * **None**

        |Raises|

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

def qteKillApplet(self, appletID: str):
        """
        Destroy the applet with ID ``appletID``.

        This method removes ``appletID`` from Qtmacs permanently - no
        questions asked. It is the responsibility of the (macro)
        programmer to use it responsibly.

        If the applet was visible then the method also takes care of
        replacing with the next invisible applet, if one is available.

        If ``appletID`` does not refer to a valid applet then nothing
        happens.

        |Args|

        * ``appletID`` (**str**): name of applet to be destroyed.

        |Returns|

        * **None**

        |Raises|

        * **QtmacsArgumentError** if at least one argument has an invalid type.
        """
        # Compile list of all applet IDs.
        ID_list = [_.qteAppletID() for _ in self._qteAppletList]

        if appletID not in ID_list:
            # Do nothing if the applet does not exist.
            return
        else:
            # Get a reference to the actual applet object based on the
            # name.
            idx = ID_list.index(appletID)
            appObj = self._qteAppletList[idx]

        # Mini applets are killed with a special method.
        if self.qteIsMiniApplet(appObj):
            self.qteKillMiniApplet()
            return

        # Inform the applet that it is about to be killed.
        appObj.qteToBeKilled()

        # Determine the window of the applet.
        window = appObj.qteParentWindow()

        # Get the previous invisible applet (*may* come in handy a few
        # lines below).
        newApplet = self.qteNextApplet(numSkip=-1, skipInvisible=False,
                                       skipVisible=True)

        # If there is no invisible applet available, or the only available
        # applet is the one to be killed, then set newApplet to None.
        if (newApplet is None) or (newApplet is appObj):
            newApplet = None
        else:
            self.qteReplaceAppletInLayout(newApplet, appObj, window)

        # Ensure that _qteActiveApplet does not point to the applet
        # to be killed as it will otherwise result in a dangling
        # pointer.
        if self._qteActiveApplet is appObj:
            self._qteActiveApplet = newApplet

        # Remove the applet object from the applet list.
        self.qteLogger.debug('Kill applet: <b>{}</b>'.format(appletID))
        self._qteAppletList.remove(appObj)

        # Close the applet and schedule it for destruction. Explicitly
        # call the sip.delete() method to ensure that all signals are
        # *immediately* disconnected, as otherwise there is a good
        # chance that Qtmacs segfaults if Python/Qt thinks the slots
        # are still connected when really the object does not exist
        # anymore.
        appObj.close()
        sip.delete(appObj)