[Moved] Invalid Signal signature: errorSignal(long)



  • Dear community,

    Sometimes (not even always), my program raises the following errors:
    @Invalid Signal signature: errorSignal(long)
    Invalid Signal signature: infoSignal(long)
    Invalid Signal signature: doneSignal(long,QString)
    Invalid Signal signature: aSlot()@

    There are two things:

    1. The last one, aSlot() is not a Signal but a Slot, defined as follows:

    @@Slot()
    def aSlot(self):
    ... code ...@

    and called by linking a signal to it:
    @myObject.mySignal.connect(self.aSlot)@

    2. For the three first real signals, what is wrong with their signature?
    I defined my Signals as follows:
    @class myClass(QObject):
    errorSignal = Signal(long)
    doneSignal = Signal(long,str)
    infoSignal = Signal(long)
    def init(self):
    ...code...@

    The problem is only raised "sometimes".
    And I cannot figure out when does it occur, as it does not stop the program and does not break on that error in debug mode...
    However, something is not working correctly as my program keeps waiting when this error occurs.

    Any help?



  • PyQt or PySide?



  • PySide.



  • It appears from the pyside source code that there is no C++ wrapper available for this signal. I'm not exactly sure what that means. Did you try using a different signature? Things I would try include
    @Signal()
    Signal(int)
    Signal(QString)@



  • Oh, the empty one also failed.



  • Yeah I think it's not a signature problem as the program is actually working 99% of the time.
    Just that 1% that I cannot figure out why... with the same program, same execution parameters...

    Anyway, it's occurring less and less, and I just need to retry if it occurs but I was just wondering if there is a way to fix it.



  • I think I found the problem.
    I'm not sure but it seems that it happens when an object is deleted too early.

    The problem happens with a QNetworkReply and raises weird errors such as "QNetworkReply doesn't have a createRequest() method".
    I don't know if this error is linked to the previous one but that's a new error that occurs right after the previous ones already introduced previously.
    And I think this error is raised because the object QNetworkReply was deleted too early (by a manual Object.deleteLater(reply)).



  • Good to see you found it.



  • Well I'm not sure that was the problem...
    It was finally raised even if I don't manually "QOBject.deleteLater()"...

    I got more information from the debugger this time:

    @Error in sys.excepthook:
    Traceback (most recent call last):
    File "C:\Program Files (x86)\Programming\PyCharm 1.2.1\helpers\pydev\pydevd_breakpoints.py", line 58, in excepthook
    frame = frames[-1]
    IndexError: list index out of range

    Original exception was:
    TypeError: errorOccured() takes exactly 2 arguments (1 given)
    Invalid Signal signature: errorSignal(long,QString)
    Invalid Signal signature: partPercent(long,long,long)
    Invalid Signal signature: doneSignal(long,QString)
    Invalid Signal signature: aSlot()
    Invalid Signal signature: anotherSlot(QNetworkReply::NetworkError) @



  • Any chance you could share the code or mock up an example that shows the same behavior?



  • I sent you an email with the code, thanks for your help!



  • It's probably useful if other people can have a look at the code as well.



  • Well actually this is only one part of a non really open-source project.
    I was allowed to send one class only (the one raising the error) to you but not to 'everyone'.

    I'll ask permission for that and might edit this post!
    If I can't use it directly, I'll try to rewrite a similar class but it will need more time.



  • I'd go the extra mile to try and produce the error in a separate mock up then. I could not find anything odd or wrong reviewing your code, but I'm not proficient enough using PySide to notice more subtle errors.

    It'll be a learning experience for either of us then :)



  • Well the main code of the mock up example is there:
    http://pastebin.com/a2Z2tx02

    The main class it is using is there:
    http://pastebin.com/u46TXF0z

    However, the error is raised almost never...
    I even could not get the error after trying the mock up example more than 50 times.
    Maybe I already fixed the error.
    It used to appear sometimes only.

    I'm not sure this mock-up is very meaningful, but maybe some people might find some huge mistakes in the main class.
    This is very crappy coding by the way, this is my first PySide program and it was rapidly coded...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.