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)
Was it helpful?

Solution

I found the answer it is from functools import partial. It was in This thread.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top