Why i am getting below error when connect catch signal of other class in my desire class?
-
statuscontroller.cpp:15:39: error: call to non-static member function without an object argument
QObject::connect(ptr,&MainWindow::sigPollRequest(),this,&StatusController::slotPollingRequested); -
@Christian-Ehrlicher can you give example how to pass it ?
spot the difference:
&MainWindow::sigPollRequest()
&StatusController::slotPollingRequested
-
statuscontroller.cpp:15:39: error: call to non-static member function without an object argument
QObject::connect(ptr,&MainWindow::sigPollRequest(),this,&StatusController::slotPollingRequested);@Qt-embedded-developer said in Why i am getting below error when connect catch signal of other class in my desire class?:
&MainWindow::sigPollRequest()
Because you call a function here but you have to pass a function pointer.
-
@Qt-embedded-developer said in Why i am getting below error when connect catch signal of other class in my desire class?:
&MainWindow::sigPollRequest()
Because you call a function here but you have to pass a function pointer.
@Christian-Ehrlicher can you give example how to pass it ?
-
@Christian-Ehrlicher can you give example how to pass it ?
@Qt-embedded-developer What example?!
You're already passing a function pointer for the slot, simply do it also for the signal. Just look at your code and think about what is wrong... -
@Christian-Ehrlicher can you give example how to pass it ?
spot the difference:
&MainWindow::sigPollRequest()
&StatusController::slotPollingRequested