Iterate recursiv through QMenu

JakobDev jakobdev at gmx.de
Wed Mar 17 14:09:38 GMT 2021


I have this function in one of my programs:

     def getMenuActions(self, menu):
         for action in menu.actions():
             if action.menu():
                 self.getMenuActions(action.menu())
             else:
                 #Do something with Action

This function iterate recursiv through QMenu. But in PyQt6 
QAction.menu() does not exists anymore and I haven't found a replacement 
yet. Any ideas?



More information about the PyQt mailing list