code: def createOpenAsMenu(self, parent=None):
          
          openAsMenu = QtWidgets.QMenu(parent=parent)
          openAsMenu.setTitle("Open Item As")
  
          registry = globalRtiRegistry()
          for rtiRegItem in registry.items:
              #rtiRegItem.tryImportClass()
              def createTrigger():
                  """Function to create a closure with the regItem"""
                  _rtiRegItem = rtiRegItem # keep reference in closure
                  return lambda: self.reloadFileOfCurrentItem(_rtiRegItem)
  
              action = QtWidgets.QAction("{}".format(rtiRegItem.name), self,
                  enabled=bool(rtiRegItem.successfullyImported is not False),
                  triggered=createTrigger())
              openAsMenu.addAction(action)
  
          return openAsMenu
docs: Creates the submenu for the Open As choice