I found the answer it is from functools import partial. It was in This thread.
Passing arguments through QtGui.QAction to the triggered method
Question
Let's say I have a method like:
def open(self, opt):
if opt == True:
...
if opt == False:
...
how do I pass the argument to it with QtGui.QAction like:
self.openAct = QtGui.QAction("O&pen", self, shortcut="Ctrl+O",
statusTip="Opens a location", triggered=self.open)
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow