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. QMetaObject::connectSlotsByName: No matching signal for - Intentional, so how do I suppress the message?

QMetaObject::connectSlotsByName: No matching signal for - Intentional, so how do I suppress the message?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qdialogqpushbuttonsignal & slot
5 Posts 4 Posters 741 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.
  • C Offline
    C Offline
    Calvin H-C
    wrote on 8 Jan 2024, 05:38 last edited by Calvin H-C 1 Aug 2024, 05:40
    #1

    An application that I am converting from MFC to QT has a password feature where one class is used for two different dialogs. One is for password entry and verification, and the other is for changing your password.

    The password entry dialog just has the text input field with two pushbuttons: OK and Cancel. The password change dialog has three text input fields (enter current, enter new, re-enter new) but has three pushbuttons: OK, Cancel, and Help. Dialog selection is made by what constructor is used for the class (PW change has additional parameters).

    This all works exactly as it should, but when the password entry dialog opens up, this debug message is sent:

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

    Of course it does! Since there is no Help button in this dialog, there is no signal.

    My question: Is there a way in code that can suppress this message?

    I'm figuring the easiest way would be to add a Help button in the dialog and make it not visible, but I'm wondering if there is a simple way in code to do this.

    C C 2 Replies Last reply 8 Jan 2024, 05:48
    0
    • C Calvin H-C
      8 Jan 2024, 05:38

      An application that I am converting from MFC to QT has a password feature where one class is used for two different dialogs. One is for password entry and verification, and the other is for changing your password.

      The password entry dialog just has the text input field with two pushbuttons: OK and Cancel. The password change dialog has three text input fields (enter current, enter new, re-enter new) but has three pushbuttons: OK, Cancel, and Help. Dialog selection is made by what constructor is used for the class (PW change has additional parameters).

      This all works exactly as it should, but when the password entry dialog opens up, this debug message is sent:

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

      Of course it does! Since there is no Help button in this dialog, there is no signal.

      My question: Is there a way in code that can suppress this message?

      I'm figuring the easiest way would be to add a Help button in the dialog and make it not visible, but I'm wondering if there is a simple way in code to do this.

      C Online
      C Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 8 Jan 2024, 05:48 last edited by
      #2

      @Calvin-H-C said in QMetaObject::connectSlotsByName: No matching signal for - Intentional, so how do I suppress the message?:

      s there a way in code that can suppress this message?

      Rename your slot and/or disable this feature.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      C 1 Reply Last reply 8 Jan 2024, 05:49
      2
      • C Christian Ehrlicher
        8 Jan 2024, 05:48

        @Calvin-H-C said in QMetaObject::connectSlotsByName: No matching signal for - Intentional, so how do I suppress the message?:

        s there a way in code that can suppress this message?

        Rename your slot and/or disable this feature.

        C Offline
        C Offline
        Calvin H-C
        wrote on 8 Jan 2024, 05:49 last edited by Calvin H-C 1 Aug 2024, 06:00
        #3

        @Christian-Ehrlicher The Password Change dialog uses this slot, so I cannot rename it, it must stay there.

        If I change its name, would I have to manually connect it for the Password Change dialog? If so, what parameters are used for the signal side of connect()?

        J 1 Reply Last reply 8 Jan 2024, 06:33
        0
        • C Calvin H-C
          8 Jan 2024, 05:49

          @Christian-Ehrlicher The Password Change dialog uses this slot, so I cannot rename it, it must stay there.

          If I change its name, would I have to manually connect it for the Password Change dialog? If so, what parameters are used for the signal side of connect()?

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 8 Jan 2024, 06:33 last edited by
          #4

          @Calvin-H-C said in QMetaObject::connectSlotsByName: No matching signal for - Intentional, so how do I suppress the message?:

          what parameters are used for the signal side of connect()?

          You should really read https://doc.qt.io/qt-6/signalsandslots.html
          It is anyway better to do the connections manually, because the autoconnect feature is unreliable.

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

          1 Reply Last reply
          4
          • C Calvin H-C
            8 Jan 2024, 05:38

            An application that I am converting from MFC to QT has a password feature where one class is used for two different dialogs. One is for password entry and verification, and the other is for changing your password.

            The password entry dialog just has the text input field with two pushbuttons: OK and Cancel. The password change dialog has three text input fields (enter current, enter new, re-enter new) but has three pushbuttons: OK, Cancel, and Help. Dialog selection is made by what constructor is used for the class (PW change has additional parameters).

            This all works exactly as it should, but when the password entry dialog opens up, this debug message is sent:

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

            Of course it does! Since there is no Help button in this dialog, there is no signal.

            My question: Is there a way in code that can suppress this message?

            I'm figuring the easiest way would be to add a Help button in the dialog and make it not visible, but I'm wondering if there is a simple way in code to do this.

            C Offline
            C Offline
            ChrisW67
            wrote on 8 Jan 2024, 07:57 last edited by
            #5

            @Calvin-H-C I assume you are using Designer to generate the UI code. The default uic generated code behaviour is to auto-connect by name. This can be suppressed by passing the -a or --no-autoconnection option to uic. In a qmake project file this could be achieved using the QMAKE_UIC_FLAGS. Your code must then connect everything manually.

            1 Reply Last reply
            2

            3/5

            8 Jan 2024, 05:49

            • Login

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