error: no matching member function for call to 'connect'
-
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?
-
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. -
@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()) );
&dialogTestStubObjSolved it
-
@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()) );
&dialogTestStubObjSolved it
@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