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?
Forum Updated to NodeBB v4.3 + New Features

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 782 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 last edited by Calvin H-C
    #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.

    Christian EhrlicherC C 2 Replies Last reply
    0
    • C Calvin H-C

      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.

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 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
      2
      • Christian EhrlicherC Christian Ehrlicher

        @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 last edited by Calvin H-C
        #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()?

        jsulmJ 1 Reply Last reply
        0
        • C Calvin H-C

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

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on 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

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

            • Login

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