I want to override the function addAction() in pyqt to have the possibility to modify my strings and icons (or add a default one if none has been specified) every time an item is added in my QMenu class. Here is the code :
Python code
class Menu(QtWidgets.QMenu):
def __init__(self, parent=None):
super(Menu, self).__init__(parent)
self.addAction("First thing")
self.addAction("Second Thing")
def addAction(self, *__args):
*Modify string and icon
the wanted result would be a menu with these strings (and an icon):
1. First thing
2. Second Thing