Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. error: no matching member function for call to 'connect'
Qt 6.12 LTS is out! See what's new in the release blog

error: no matching member function for call to 'connect'

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 3.0k Views 1 Watching
  • 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.
  • G Offline
    G Offline
    gully
    wrote on last edited by
    #1
    connect( dialogTestStubObj, SIGNAL(executeButtonIsClicked()), this, SLOT(onExecuteButtonIsClicked()) );
    
    In the 'this' class have declared slot
    public slots:
        void onExecuteButtonIsClicked();
    
    In the 
    class dialog_testing_stub:public QObject
    {
        Q_OBJECT
    public:
        dialog_testing_stub();
    Q_SIGNALS:
        void executeButtonIsClicked();
    
    

    Where am I going wrong?

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

      Hi
      You also have Q_OBJECT in the "this" class?
      Anyway, it can be slow sometimes to detect changes. ( like adding Q_OBJECT )

      Please try to delete the build folder
      and then rebuild all.

      The code seems fine.
      I assume the dialog_testing_stub lives in a .h file.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        gully
        wrote on last edited by
        #3

        @gully said in error: no matching member function for call to 'connect':

        connect( dialogTestStubObj, SIGNAL(executeButtonIsClicked()), this, SLOT(onExecuteButtonIsClicked()) );

        connect( &dialogTestStubObj, SIGNAL(executeButtonIsClicked()), this, SLOT(onExecuteButtonIsClicked()) );

        &dialogTestStubObj
        

        Solved it

        mrjjM 1 Reply Last reply
        0
        • G gully

          @gully said in error: no matching member function for call to 'connect':

          connect( dialogTestStubObj, SIGNAL(executeButtonIsClicked()), this, SLOT(onExecuteButtonIsClicked()) );

          connect( &dialogTestStubObj, SIGNAL(executeButtonIsClicked()), this, SLOT(onExecuteButtonIsClicked()) );

          &dialogTestStubObj
          

          Solved it

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

          @gully
          Ah it was not a pointer.
          I assume you use exec() in same place as else
          dialogTestStubObj might run out of scope.

          Also as note.
          the new connect syntax is better as it can give error at compile time if something is wrong.
          https://wiki.qt.io/New_Signal_Slot_Syntax

          1 Reply Last reply
          5

          • Login

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