def createOpenAsMenu(self, parent=None):
        """ Creates the submenu for the Open As choice
        """
        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
def createOpenAsMenu ( self , parent = None ) : openAsMenu = QtWidgets . QMenu ( parent = parent ) openAsMenu . setTitle ( "Open Item As" ) registry = globalRtiRegistry ( ) for rtiRegItem in registry . items : def createTrigger ( ) : _rtiRegItem = rtiRegItem 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
Creates the submenu for the Open As choice