Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Use of signal-slot connect in Windows 10
QtWS25 Last Chance

[Solved] Use of signal-slot connect in Windows 10

Scheduled Pinned Locked Moved General and Desktop
windows 10signal-slotconnectconnect failureqt 5.4.1
24 Posts 4 Posters 11.5k 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.
  • K Offline
    K Offline
    koahnig
    wrote on last edited by koahnig
    #1

    A failing connect for assigning a sigmal to a slot used to deliver an output message. It tells either which signal is not available for the QObject derived class or it tells when the slot rountine is not found.

    For some strange reason the message is no longer displayed. I am checking the return value of a connect by an assert. Therefore, I knew where the problem should be. However, the additional output would have been helpful as well.

    It is always hard to tell when you have seen such messages last time, but I think I have seen it also with version Qt 5.4.1 in the past.
    The only more recent change to my development system is the upgrade from Win 7 to Win 10.

    Does anybody know that the upgrade is the problem?

    BTW, I know that there is a message saying that the version is not tested with Windows 10. ;)

    Vote the answer(s) that helped you to solve your issue(s)

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you show the connection code that is failing ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by koahnig
        #3

        This is the principle code segment:

                Reload = new QTimer;
                bool boo = connect ( Reload, SIGNAL ( timeout() ), this, SLOT ( sltReload() ) );
                assert ( boo );
        

        However, this is irrelevant. The problem in the code is solved. When running the application, the assert was triggered telling me that there was a problem with the connect.

        Before Qt gave an additional output it was telling what the actual cause is, either "signal not found" or "slot not found". (I do not remember the correct text anymore. That was/is quite a nice feature. However, this time I could not find the message anymore.

        The actual cause was that the signal was correct, but the slot routine was wrong. Qt creator's autocomplete suggested different slots and i have chosen by mistake the wrong one which required an argument.

        Therefore, I was wondering why the failure message was not displayed at all.
        It is handy and would have saved some time.

        Is windows 10 the reason?

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi
          do you mean a message like this

          QObject::connect: No such slot RecipeEdit::textChangedExternal(QString) in ../../Dropbox/PlatFormOne/TestBench/mainwindow.cpp:12

          It would normally display on win 7, but after upgrade to win 10, it will not?
          Or I read the question wrong?

          K 1 Reply Last reply
          0
          • mrjjM mrjj

            Hi
            do you mean a message like this

            QObject::connect: No such slot RecipeEdit::textChangedExternal(QString) in ../../Dropbox/PlatFormOne/TestBench/mainwindow.cpp:12

            It would normally display on win 7, but after upgrade to win 10, it will not?
            Or I read the question wrong?

            K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            @mrjj
            Yes, I have seen similar messages in the past.

            Yesterday when the assert was triggered I have checked output, but no message appeared anywhere. Not in the console window and not in the application output window in Qt creator.

            At first I did rebuilt and noticed that I had started in release. But after the same procedure including a rebuilt the same in debug mode.
            The only difference I see is that I have upgraded to Win10 a couple of weeks back. Therefore my suspicion that this might be releated.

            Note, I am using Qt 5.4.1 and receive a message each time starting an application that this Qt version is not tested with windows 10. However, it seem to come only with Qt 5.4.1 and not previous versions such as Qt 5.3.1. Despite the message the applications are running ok. Certainly I could upgrade to Qt 5.5, but my target platforms are currently Windows 2008 server. Therefore, I save the time.

            Vote the answer(s) that helped you to solve your issue(s)

            mrjjM 1 Reply Last reply
            0
            • K koahnig

              @mrjj
              Yes, I have seen similar messages in the past.

              Yesterday when the assert was triggered I have checked output, but no message appeared anywhere. Not in the console window and not in the application output window in Qt creator.

              At first I did rebuilt and noticed that I had started in release. But after the same procedure including a rebuilt the same in debug mode.
              The only difference I see is that I have upgraded to Win10 a couple of weeks back. Therefore my suspicion that this might be releated.

              Note, I am using Qt 5.4.1 and receive a message each time starting an application that this Qt version is not tested with windows 10. However, it seem to come only with Qt 5.4.1 and not previous versions such as Qt 5.3.1. Despite the message the applications are running ok. Certainly I could upgrade to Qt 5.5, but my target platforms are currently Windows 2008 server. Therefore, I save the time.

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @koahnig
              Ok. understand.
              I think I saw such messages on win 10 using Qt 5.5, but Im only 80% sure and I can't check as
              i ran W10 over win W7 again.

              However, its hard to imagine the OS having an effect on internal meta system, but I would never
              say never.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Do you have the same problem if you use the new syntax ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                1
                • JKSHJ Offline
                  JKSHJ Offline
                  JKSH
                  Moderators
                  wrote on last edited by
                  #8

                  Do you get any output when you add qDebug("Hello!") or qWarning("Hello!") to your code? If not, that means your debug output has been disabled (that's why you don't see the message). Make sure your project doesn't define QT_NO_DEBUG_OUTPUT, QT_NO_WARNING_OUTPUT, etc.

                  I'm on Windows 10 Pro (64-bit), using Qt 5.4.2 for MSVC 2013 32-bit. When I try to connect a signal to a non-existent slot, I get this message in my Qt Creator "Application Output" pane:

                  QObject::connect: No such slot MyObject::fakeSlot() in ..\TestProg\main.cpp:32
                  

                  @SGaist said:

                  Do you have the same problem if you use the new syntax ?

                  The problem won't exist with the new syntax, because the compiler will detect the error and stop the build ;)

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @JKSH That's what I wanted @koahnig to check (but I haven't been really clear with my intention)

                    Like you wrote, using the new syntax would avoid the need to check for that warning in the console.

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      koahnig
                      wrote on last edited by
                      #10

                      @SGaist @mrjj @JKSH
                      Sorry guys. I had apparently another notification issue here in the forum. Not sure, if I simply missed the notification.

                      Thanks for pointing towards the new syntax. Have not been aware of this, because I do not read each time I am using Qt constructs in the docs. However, when the syntax causes the compiler to complain, that is really cool and saves the time.

                      Actually I consider it also as strange that the OS shall have such an effect.

                      Vote the answer(s) that helped you to solve your issue(s)

                      1 Reply Last reply
                      0
                      • JKSHJ Offline
                        JKSHJ Offline
                        JKSH
                        Moderators
                        wrote on last edited by
                        #11

                        @koahnig: No problem :)

                        By the way, since you're new to the new syntax, I hope this article will be helpful to you: http://doc.qt.io/qt-5/signalsandslots-syntaxes.html

                        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                        K 1 Reply Last reply
                        0
                        • JKSHJ JKSH

                          @koahnig: No problem :)

                          By the way, since you're new to the new syntax, I hope this article will be helpful to you: http://doc.qt.io/qt-5/signalsandslots-syntaxes.html

                          K Offline
                          K Offline
                          koahnig
                          wrote on last edited by
                          #12

                          @JKSH
                          Yes, I have already seen this yesterday. Thanks for suggesting.

                          Vote the answer(s) that helped you to solve your issue(s)

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            koahnig
                            wrote on last edited by
                            #13

                            @SGaist @JKSH @mrjj

                            Just for closing the issue here. I have the new syntax for connect. I love it, even though it has "drawbacks" of different functionality according the documentation presented by JKSH above. For me it is perfect! Thanks again for pointing towards teh new syntax.

                            Vote the answer(s) that helped you to solve your issue(s)

                            1 Reply Last reply
                            0
                            • mrjjM Offline
                              mrjjM Offline
                              mrjj
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              May I humbly suggest to follow your signature ? ;)

                              K 1 Reply Last reply
                              2
                              • mrjjM mrjj

                                May I humbly suggest to follow your signature ? ;)

                                K Offline
                                K Offline
                                koahnig
                                wrote on last edited by
                                #15

                                @mrjj
                                Actually, my initial problem is not solved. ;)
                                The warning at wrong connects still seems to be gone. Which might be a either a problem with my installation or a bug in Qt.

                                Vote the answer(s) that helped you to solve your issue(s)

                                mrjjM JKSHJ 2 Replies Last reply
                                0
                                • K koahnig

                                  @mrjj
                                  Actually, my initial problem is not solved. ;)
                                  The warning at wrong connects still seems to be gone. Which might be a either a problem with my installation or a bug in Qt.

                                  mrjjM Offline
                                  mrjjM Offline
                                  mrjj
                                  Lifetime Qt Champion
                                  wrote on last edited by mrjj
                                  #16

                                  @koahnig
                                  oh. Well. My bad :)
                                  I tried to install win 10 to but it wont upgrade.
                                  Pretty strange what ever made it stop to display.

                                  1 Reply Last reply
                                  0
                                  • K koahnig

                                    @mrjj
                                    Actually, my initial problem is not solved. ;)
                                    The warning at wrong connects still seems to be gone. Which might be a either a problem with my installation or a bug in Qt.

                                    JKSHJ Offline
                                    JKSHJ Offline
                                    JKSH
                                    Moderators
                                    wrote on last edited by
                                    #17

                                    @koahnig said:

                                    The warning at wrong connects still seems to be gone.

                                    I get the error message for wrong connections, and I'm using Qt 5.5.1 MinGW 4.9.2 32-bit and Qt 5.4.2 MSVC 2013 32-bit on Windows 10 Pro 64-bit.

                                    Does qDebug() and qWarning() work for you?

                                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                    K 1 Reply Last reply
                                    0
                                    • JKSHJ JKSH

                                      @koahnig said:

                                      The warning at wrong connects still seems to be gone.

                                      I get the error message for wrong connections, and I'm using Qt 5.5.1 MinGW 4.9.2 32-bit and Qt 5.4.2 MSVC 2013 32-bit on Windows 10 Pro 64-bit.

                                      Does qDebug() and qWarning() work for you?

                                      K Offline
                                      K Offline
                                      koahnig
                                      wrote on last edited by
                                      #18

                                      @JKSH said:

                                      I get the error message for wrong connections, and I'm using Qt 5.5.1 MinGW 4.9.2 32-bit and Qt 5.4.2 MSVC 2013 32-bit on Windows 10 Pro 64-bit.

                                      Does qDebug() and qWarning() work for you?

                                      I am using qDebug all the time. It does work.

                                      Vote the answer(s) that helped you to solve your issue(s)

                                      JKSHJ 1 Reply Last reply
                                      0
                                      • K koahnig

                                        @JKSH said:

                                        I get the error message for wrong connections, and I'm using Qt 5.5.1 MinGW 4.9.2 32-bit and Qt 5.4.2 MSVC 2013 32-bit on Windows 10 Pro 64-bit.

                                        Does qDebug() and qWarning() work for you?

                                        I am using qDebug all the time. It does work.

                                        JKSHJ Offline
                                        JKSHJ Offline
                                        JKSH
                                        Moderators
                                        wrote on last edited by
                                        #19

                                        @koahnig said:

                                        I am using qDebug all the time. It does work.

                                        How about qWarning()?

                                        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                                        K 1 Reply Last reply
                                        0
                                        • JKSHJ JKSH

                                          @koahnig said:

                                          I am using qDebug all the time. It does work.

                                          How about qWarning()?

                                          K Offline
                                          K Offline
                                          koahnig
                                          wrote on last edited by
                                          #20

                                          @JKSH
                                          qWarning is also working.
                                          However, your last question brought up a clue of what might have been the case.

                                          I am using a message handler for redirecting the output of qDebug. It allows to ignore all output, to store all to a file and/or to the screen.
                                          Since there is a lot of output, the screen output is slowing down dramatically. Therefore, I have redirected the output only to the file. The assert was probably kicking in before the message was written to the file. I have seen this with other output before, but never with the warning for connection failures (Probably I had also screen output then).

                                          Anyway even when the problem was between chair and keyboard, it was good to have the discussion. Otherwise I would not have learnt about the new syntax.

                                          Thanks again.

                                          Vote the answer(s) that helped you to solve your issue(s)

                                          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