code: def qteCloseQtmacs(self):
          
          # Announce the shutdown.
          msgObj = QtmacsMessage()
          msgObj.setSignalName('qtesigCloseQtmacs')
          self.qtesigCloseQtmacs.emit(msgObj)
  
          # Kill all applets and update the GUI.
          for appName in self.qteGetAllAppletIDs():
              self.qteKillApplet(appName)
          self._qteFocusManager()
  
          # Kill all windows and update the GUI.
          for window in self._qteWindowList:
              window.close()
          self._qteFocusManager()
  
          # Schedule QtmacsMain for deletion.
          self.deleteLater()
docs: Close Qtmacs.
  
          First kill all applets, then shut down Qtmacs.
  
          |Args|
  
          * **None**
  
          |Returns|
  
          * **None**
  
          |Raises|
  
          * **None**