I am trying to add a function to the PyQt class, but always returns an error to me.
def commander (self, arg): exec arg def aButton (self, layout, **kwargs): name = kwargs.pop("name","Button") command = kwargs.pop("command", "" ) button = QtGui.QPushButton(name) button.clicked.connect(self.commander(command)) layout.addWidget(button) return button
Maybe someone here can help me solve this: ') thanks!
source share