code: def qteGetAllMacroNames(self, widgetObj: QtGui.QWidget=None):
          
          # The keys of qteRegistryMacros are (macroObj, app_sig,
          # wid_sig) tuples. Get them, extract the macro names, and
          # remove all duplicates.
          macro_list = tuple(self._qteRegistryMacros.keys())
          macro_list = [_[0] for _ in macro_list]
          macro_list = tuple(set(macro_list))
  
          # If no widget object was supplied then omit the signature
          # check and return the macro list verbatim.
          if widgetObj is None:
              return macro_list
          else:
              # Use qteGetMacroObject to compile a list of macros that
              # are compatible with widgetObj. This list contains
              # (macroObj, macroName, app_sig, wid_sig) tuples.
              macro_list = [self.qteGetMacroObject(macroName, widgetObj)
                            for macroName in macro_list]
  
              # Remove all elements where macroObj=None. This is the
              # case if no compatible macro with the specified name
              # could be found for widgetObj.
              macro_list = [_.qteMacroName() for _ in macro_list
                            if _ is not None]
              return macro_list
docs: Return all macro names known to Qtmacs as a list.
  
          If ``widgetObj`` is **None** then the names of all registered
          macros are returned as a tuple. Otherwise, only those macro
          compatible with ``widgetObj`` are returned. See
          ``qteGetMacroObject`` for the definition of a compatible
          macro.
  
          |Args|
  
          * ``widgetObj`` (**QWidget**): widget with which the macros
            must be compatible.
  
          |Returns|
  
          * **tuple**: tuple of macro names.
  
          |Raises|
  
          * **QtmacsArgumentError** if at least one argument has an invalid type.