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. Safe to ignore "No matching signal for ..."?
Forum Update on Monday, May 27th 2025

Safe to ignore "No matching signal for ..."?

Scheduled Pinned Locked Moved Solved General and Desktop
19 Posts 5 Posters 2.3k 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.
  • L Offline
    L Offline
    legitnameyo
    wrote on last edited by legitnameyo
    #1

    I have a function that gives me this error

    QMetaObject::connectSlotsByName: No matching signal for create_new_button()
    

    given from

    connect(btn, SIGNAL(clicked()), this, SLOT(create_new_button());
    

    and it works without a single problem.I don't really want to rename and follow the schematics of QT since it doesn't look the way I want it. I know QT follows "on_<object name>_<signal>" type of function style, but again I don't like how it looks.

    Is it safe to ignore?

    aha_1980A 1 Reply Last reply
    0
    • L legitnameyo

      I have a function that gives me this error

      QMetaObject::connectSlotsByName: No matching signal for create_new_button()
      

      given from

      connect(btn, SIGNAL(clicked()), this, SLOT(create_new_button());
      

      and it works without a single problem.I don't really want to rename and follow the schematics of QT since it doesn't look the way I want it. I know QT follows "on_<object name>_<signal>" type of function style, but again I don't like how it looks.

      Is it safe to ignore?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by aha_1980
      #2

      @legitnameyo please try to comment your connect statement - I'm sure the error persists.

      "Connectslots by name" is exactly the auto-connect you mentioned, without a connect from your side.

      PS: you should use the Qt5 functor style connect, which gives compile errors on signal-slot mismatch.

      Regards

      Qt has to stay free or it will die.

      L 1 Reply Last reply
      4
      • aha_1980A aha_1980

        @legitnameyo please try to comment your connect statement - I'm sure the error persists.

        "Connectslots by name" is exactly the auto-connect you mentioned, without a connect from your side.

        PS: you should use the Qt5 functor style connect, which gives compile errors on signal-slot mismatch.

        Regards

        L Offline
        L Offline
        legitnameyo
        wrote on last edited by
        #3

        @aha_1980 said in Safe to ignore "No matching signal for ..."?:

        @legitnameyo please try to comment your connect statement - I'm sure the error persists.

        What do you mean by "I'm sure the error persists"? I am also sure the error persists if I comment the connect, since comments does not affect the actual code after being compiled.

        "Connectslots by name" is exactly the auto-connect you mentioned, without a connect from your side.

        From my side? What is the other side? and I know there is an auto-connect thingy or whatever within QT but what I am asking is: is it safe to ignore? Not if it gives me compiler error, I know it does. Not if I should follow Qt5 function style connect or Qt 4 or whatever, only: is it safe to ignore?

        JonBJ aha_1980A jsulmJ 3 Replies Last reply
        0
        • L legitnameyo

          @aha_1980 said in Safe to ignore "No matching signal for ..."?:

          @legitnameyo please try to comment your connect statement - I'm sure the error persists.

          What do you mean by "I'm sure the error persists"? I am also sure the error persists if I comment the connect, since comments does not affect the actual code after being compiled.

          "Connectslots by name" is exactly the auto-connect you mentioned, without a connect from your side.

          From my side? What is the other side? and I know there is an auto-connect thingy or whatever within QT but what I am asking is: is it safe to ignore? Not if it gives me compiler error, I know it does. Not if I should follow Qt5 function style connect or Qt 4 or whatever, only: is it safe to ignore?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @legitnameyo

          What do you mean by "I'm sure the error persists"?

          He means: comment out your own connect() statement and verify that you still get that connectSlotsByName() error message, i.e. it's nothing to do with your connect().

          1 Reply Last reply
          3
          • L legitnameyo

            @aha_1980 said in Safe to ignore "No matching signal for ..."?:

            @legitnameyo please try to comment your connect statement - I'm sure the error persists.

            What do you mean by "I'm sure the error persists"? I am also sure the error persists if I comment the connect, since comments does not affect the actual code after being compiled.

            "Connectslots by name" is exactly the auto-connect you mentioned, without a connect from your side.

            From my side? What is the other side? and I know there is an auto-connect thingy or whatever within QT but what I am asking is: is it safe to ignore? Not if it gives me compiler error, I know it does. Not if I should follow Qt5 function style connect or Qt 4 or whatever, only: is it safe to ignore?

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @legitnameyo said in Safe to ignore "No matching signal for ..."?:

            only: is it safe to ignore?

            It is never safe to ignore warnings.

            What do you mean by "I'm sure the error persists"? I am also sure the error persists if I comment the connect, since comments does not affect the actual code after being compiled.

            Please remove your connect statement by either deleting it or commenting it out.

            For 99% the warning is not from this connect, but from somewhere else.

            Qt has to stay free or it will die.

            1 Reply Last reply
            0
            • L legitnameyo

              @aha_1980 said in Safe to ignore "No matching signal for ..."?:

              @legitnameyo please try to comment your connect statement - I'm sure the error persists.

              What do you mean by "I'm sure the error persists"? I am also sure the error persists if I comment the connect, since comments does not affect the actual code after being compiled.

              "Connectslots by name" is exactly the auto-connect you mentioned, without a connect from your side.

              From my side? What is the other side? and I know there is an auto-connect thingy or whatever within QT but what I am asking is: is it safe to ignore? Not if it gives me compiler error, I know it does. Not if I should follow Qt5 function style connect or Qt 4 or whatever, only: is it safe to ignore?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @legitnameyo said in Safe to ignore "No matching signal for ..."?:

              since comments does not affect the actual code after being compiled

              They do if you comment out a line of code, since this line will not be compiled.

              "is it safe to ignore?" - safe in the way that your app will not crash. But it is always better to resolve all warnings. Try to rename the slot to see whether the auto-connect feature is not triggered then.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • L Offline
                L Offline
                legitnameyo
                wrote on last edited by
                #7

                The error is still there after commenting out the connect();

                jsulmJ 1 Reply Last reply
                0
                • L legitnameyo

                  The error is still there after commenting out the connect();

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @legitnameyo Then try to rename your slot and check again.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    legitnameyo
                    wrote on last edited by
                    #9

                    The error disappears when I comment out connect() and move the definition of the function that I got in my SLOT, inside connect, to the top in my .h file. When I re-add the connect() inside my .cpp the error is still there HOWEVER the program, just as before, runs smoothly. So again: is it safe to ignore? Is the error just a guideline or is it possible that it will break on another OS? On another OS version? Is it SAFE to ignore? Does anybody know what the error implies?

                    jsulmJ J.HilkJ 2 Replies Last reply
                    0
                    • L legitnameyo

                      The error disappears when I comment out connect() and move the definition of the function that I got in my SLOT, inside connect, to the top in my .h file. When I re-add the connect() inside my .cpp the error is still there HOWEVER the program, just as before, runs smoothly. So again: is it safe to ignore? Is the error just a guideline or is it possible that it will break on another OS? On another OS version? Is it SAFE to ignore? Does anybody know what the error implies?

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @legitnameyo Did you try to rename the slot?
                      Because QMetaObject::connectSlotsByName tells that auto-connect is trying to connect the slot...

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by
                        #11

                        @others
                        The point is that OP knows he is not following the slot naming convention, he does not wish to, and is asking whether he "can get away with" ignoring the warning.

                        @legitnameyo
                        Chances are it is just a warning that it cannot find the slot name it expects but you are choosing not to supply, and will work OK, it's your decision. However, I too would not wish to leave a warning in for this. So if I were you I'd have Googled for connectslotsbyname no matching signal and read through the hits to see if there is a way to suppress this if you don't want to follow the naming the convention (most seem to just say "rename your slot", I don't know if any offer how to suppress it).

                        1 Reply Last reply
                        1
                        • L legitnameyo

                          The error disappears when I comment out connect() and move the definition of the function that I got in my SLOT, inside connect, to the top in my .h file. When I re-add the connect() inside my .cpp the error is still there HOWEVER the program, just as before, runs smoothly. So again: is it safe to ignore? Is the error just a guideline or is it possible that it will break on another OS? On another OS version? Is it SAFE to ignore? Does anybody know what the error implies?

                          J.HilkJ Offline
                          J.HilkJ Offline
                          J.Hilk
                          Moderators
                          wrote on last edited by
                          #12

                          @legitnameyo

                          you create_new_button is suspiciously close to what the connectSlotsByName is looking for void on_<object name>_<signal name>(<signal parameters>); it shouldn't trigger as the first part is wrong. But maybe ?

                          What version of Qt are you using?

                          also try a complete rebuild. If you added slot from the designer and manually removed the generated code. the moc file will be wrong and will cause all kinds of warning/issues


                          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                          Q: What's that?
                          A: It's blue light.
                          Q: What does it do?
                          A: It turns blue.

                          1 Reply Last reply
                          1
                          • L Offline
                            L Offline
                            legitnameyo
                            wrote on last edited by
                            #13

                            Qt Creator 4.8.1
                            Based on Qt 5.12.0 (Clang 10.0 (Apple), 64 bit)
                            on a MacBook Air (13-inch, Early 2014) running macOS Mojave 10.14.

                            I've added everything in the code, nothing in the actual UI designer of Qt Creator.

                            @JonB gets the point! From what I've googled it seems as if there should be no performance issues from not following the conventional signal slot style. Some people say it COULD break and/or give performance issues but nobody seems to have actually tried it out or experienced any issues that are noticeable. I'll set the thread as solved since nobody experiences issues and I'll just make the assumption that it's up to me to follow conventional styling or not. Thanks!

                            J.HilkJ 1 Reply Last reply
                            1
                            • L legitnameyo

                              Qt Creator 4.8.1
                              Based on Qt 5.12.0 (Clang 10.0 (Apple), 64 bit)
                              on a MacBook Air (13-inch, Early 2014) running macOS Mojave 10.14.

                              I've added everything in the code, nothing in the actual UI designer of Qt Creator.

                              @JonB gets the point! From what I've googled it seems as if there should be no performance issues from not following the conventional signal slot style. Some people say it COULD break and/or give performance issues but nobody seems to have actually tried it out or experienced any issues that are noticeable. I'll set the thread as solved since nobody experiences issues and I'll just make the assumption that it's up to me to follow conventional styling or not. Thanks!

                              J.HilkJ Offline
                              J.HilkJ Offline
                              J.Hilk
                              Moderators
                              wrote on last edited by
                              #14

                              @legitnameyo said in Safe to ignore "No matching signal for ..."?:

                              Qt Creator 4.8.1
                              Based on Qt 5.12.0 (Clang 10.0 (Apple), 64 bit)

                              A common enough mistake, that is the version of QtCreator not necessarily the same as the one you're using for your project


                              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                              Q: What's that?
                              A: It's blue light.
                              Q: What does it do?
                              A: It turns blue.

                              1 Reply Last reply
                              0
                              • L Offline
                                L Offline
                                legitnameyo
                                wrote on last edited by
                                #15

                                True. I gleaned in the build settings and it looks as if I'm using

                                Desktop Qt 5.12.1 clang 64bit
                                
                                J.HilkJ 1 Reply Last reply
                                0
                                • L legitnameyo

                                  True. I gleaned in the build settings and it looks as if I'm using

                                  Desktop Qt 5.12.1 clang 64bit
                                  
                                  J.HilkJ Offline
                                  J.HilkJ Offline
                                  J.Hilk
                                  Moderators
                                  wrote on last edited by J.Hilk
                                  #16

                                  @legitnameyo alright, wouldn't surprise me if there's a bug in 5.12.0 or 5.12.1 .
                                  The 5.12 release was way too bumpy in my opinion.

                                  Maybe worth a try to update to 5.12.3, if you want to invest the time downloading the precompiled libs.


                                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                  Q: What's that?
                                  A: It's blue light.
                                  Q: What does it do?
                                  A: It turns blue.

                                  1 Reply Last reply
                                  0
                                  • L Offline
                                    L Offline
                                    legitnameyo
                                    wrote on last edited by
                                    #17

                                    In my experience, on macOS Mojave 10.14, there are some clashes and bugs between newer versions of Qt and the OS so I won't try to update. I don't want to run the risk of spending a few hours upgrading and then possibly downgrading as well as reinstalling stuff.

                                    I don't experience and I don't see other people experiencing performance issues with this error, so I won't try anything unless somebody comes out and explicitly says there are performance issues or possible breaks on other OS's.

                                    J.HilkJ 1 Reply Last reply
                                    0
                                    • L legitnameyo

                                      In my experience, on macOS Mojave 10.14, there are some clashes and bugs between newer versions of Qt and the OS so I won't try to update. I don't want to run the risk of spending a few hours upgrading and then possibly downgrading as well as reinstalling stuff.

                                      I don't experience and I don't see other people experiencing performance issues with this error, so I won't try anything unless somebody comes out and explicitly says there are performance issues or possible breaks on other OS's.

                                      J.HilkJ Offline
                                      J.HilkJ Offline
                                      J.Hilk
                                      Moderators
                                      wrote on last edited by
                                      #18

                                      @legitnameyo you can have multiple versions of Qt on your system in parallel and you can easily switch between them via the "kit selection" inside QtCreator


                                      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                      Q: What's that?
                                      A: It's blue light.
                                      Q: What does it do?
                                      A: It turns blue.

                                      1 Reply Last reply
                                      0
                                      • L Offline
                                        L Offline
                                        legitnameyo
                                        wrote on last edited by
                                        #19

                                        That's a really neat feature! I'll try it out some time in the future but for now I think the thread is done. The explicit and concrete answer to my question won't come from a new version but rather from an analysis of the source code of Qt (or possibly tests on different computers and OS's). Thanks anyways!

                                        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