Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我有一个类似的方法:
def open(self, opt): if opt == True: ... if opt == False: ...
如何使用QtGui.QAction将参数传递给它,例如:
self.openAct = QtGui.QAction("O&pen", self, shortcut="Ctrl+O", statusTip="Opens a location", triggered=self.open)
我从 functools import partial找到了答案。它在这个线程中。