python - PySide / Qt : Too many arguments to connect a signal to a slot? -
i'm trying connect custom signal (in tcp client class) method updates log data sent server , whatnot.
here's declaration of tcp client class:
class carsocket(qobject): logsignal = signal(str, str) ... def __init__(self, ...): super(carsocket, self).__init__() ... and method i'm trying connect logsignal :
def addtolog(self, text, mode='normal'): if mode == 'raw': toadd = text else: toadd = "<p>{}</p> \n <hr> \n".format(text) self.log.logedit.append(toadd) so, write line when initializing application:
self.carsocket.logsignal.connect(self.addtolog) and weird bug when execute it:
traceback (most recent call last): file "/home/ahmed/workspace/autonomee/main.py", line 286, in <module> window = mainwindow() file "/home/ahmed/workspace/autonomee/main.py", line 115, in __init__ self.carsocket.logsignal.connect(self.addtolog) typeerror: connect() takes 3 arguments (4 given) [finished in 0.5s exit code 1] anyone can ?
it must noted succesfuly connected custom signal on class (with int, connected method of class itself) , have no problems connecting 'default' signals default slots (like self.button.clicked.connect(self.edit.clear) or similar)
just had problem own code, , wanted contribute (think) answer. have function called "connect" in carsocket class. try renaming function , see happens.
in case 1 of classes emitting signal had "connect" function, , renaming fixed problem. shouldn't have caused problem since call connect signal() type itself, there seems problems.
Comments
Post a Comment