Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. [Moved] Invalid Signal signature: errorSignal(long)
QtWS25 Last Chance

[Moved] Invalid Signal signature: errorSignal(long)

Scheduled Pinned Locked Moved Language Bindings
15 Posts 2 Posters 6.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    ThomasDalla
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      PyQt or PySide?

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • T Offline
        T Offline
        ThomasDalla
        wrote on last edited by
        #3

        PySide.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Franzk
          wrote on last edited by
          #4

          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)@

          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • F Offline
            F Offline
            Franzk
            wrote on last edited by
            #5

            Oh, the empty one also failed.

            "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • T Offline
              T Offline
              ThomasDalla
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • T Offline
                T Offline
                ThomasDalla
                wrote on last edited by
                #7

                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)).

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  Franzk
                  wrote on last edited by
                  #8

                  Good to see you found it.

                  "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

                  http://www.catb.org/~esr/faqs/smart-questions.html

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    ThomasDalla
                    wrote on last edited by
                    #9

                    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) @

                    1 Reply Last reply
                    0
                    • F Offline
                      F Offline
                      Franzk
                      wrote on last edited by
                      #10

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

                      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        ThomasDalla
                        wrote on last edited by
                        #11

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

                        1 Reply Last reply
                        0
                        • F Offline
                          F Offline
                          Franzk
                          wrote on last edited by
                          #12

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

                          "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

                          http://www.catb.org/~esr/faqs/smart-questions.html

                          1 Reply Last reply
                          0
                          • T Offline
                            T Offline
                            ThomasDalla
                            wrote on last edited by
                            #13

                            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.

                            1 Reply Last reply
                            0
                            • F Offline
                              F Offline
                              Franzk
                              wrote on last edited by
                              #14

                              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 :)

                              "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

                              http://www.catb.org/~esr/faqs/smart-questions.html

                              1 Reply Last reply
                              0
                              • T Offline
                                T Offline
                                ThomasDalla
                                wrote on last edited by
                                #15

                                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...

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved