剛開始用QT對于信號和槽功能不是很熟悉。
自己連接信號和槽時出現error: no matching member function for call to 'connect'的問題。

槽dealphotos是建立在mainwindow下public slots里的,

信號Sendphoto是建立在一個嵌套于MainWindow類下的內部類里的,

但是connect的時候卻報錯沒有匹配的成員函式來呼叫,
test_mainwindow.cpp:46:5: error: no matching member function for call to 'connect'
qobject.h:242:43: note: candidate function [with Func1 = void (Test_MainWindow::CSampleCaptureEventHandler::*)(), Func2 = void (Test_MainWindow::*)()] not viable: no known conversion from 'Test_MainWindow *' to 'const typename QtPrivate::FunctionPointer<void (CSampleCaptureEventHandler::*)()>::Object *' (aka 'const Test_MainWindow::CSampleCaptureEventHandler *') for 1st argument
qobject.h:222:36: note: candidate function not viable: no known conversion from 'void (Test_MainWindow::CSampleCaptureEventHandler::*)()' to 'const char *' for 2nd argument
qobject.h:225:36: note: candidate function not viable: no known conversion from 'void (Test_MainWindow::CSampleCaptureEventHandler::*)()' to 'const QMetaMethod' for 2nd argument
qobject.h:481:41: note: candidate function not viable: no known conversion from 'void (Test_MainWindow::CSampleCaptureEventHandler::*)()' to 'const char *' for 2nd argument
qobject.h:283:13: note: candidate template ignored: requirement '!QtPrivate::FunctionPointer<void (Test_MainWindow::*)()>::IsPointerToMemberFunction' was not satisfied [with Func1 = void (Test_MainWindow::CSampleCaptureEventHandler::*)(), Func2 = void (Test_MainWindow::*)()]
qobject.h:322:13: note: candidate template ignored: requirement 'QtPrivate::FunctionPointer<void (Test_MainWindow::*)()>::ArgumentCount == -1' was not satisfied [with Func1 = void (Test_MainWindow::CSampleCaptureEventHandler::*)(), Func2 = void (Test_MainWindow::*)()]
qobject.h:274:13: note: candidate function template not viable: requires 3 arguments, but 4 were provided
qobject.h:314:13: note: candidate function template not viable: requires 3 arguments, but 4 were provided
不知道什么情況,求教各位DL!!!
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/249626.html
標籤:Qt
