connect signal with slot in slot function
Solved
General and Desktop
-
Hi,
I create a concurrent job and connect futuer's finished to onFinished slot.
like this
QFutureWatcher<QJsonObject>* future_watcherr = new QFutureWatcher<QJsonObject>(); QObject::connect(future_watcherr , SIGNAL(finished()), this, SLOT(onFinished())); this->_watcherList.push_back(future_watcher);
after that, in onFinsihed function I connect another class signal to lamdat function.
void MyClass::onFinished() { for (int i = _watcherList.size() - 1; i >= 0; i--) { if (_watcherList[i]->isFinished() == true) { QMetaObject::Connection* connection = new QMetaObject::Connection; connection = QObject::connect(&Woker::getInstance(), &Woker::anotherJobFinished, [this, job_id, pid, scan_id](unsigned long long id, bool result, QString doc_str) { if (result == true) { _renderer->SaveSceneEvent(); } emit endSaveRAYFaceModelsJob(result); Worker::getInstance().DisconnectConnection(job_id); } ); Woker::getInstance().anotherJob(job_id) } } }
It said to me AreArgumentCompatible error,
Is it impossible syntax?
-
@MintogoDeveloper said in connect signal with slot in slot function:
It said to me AreArgumentCompatible error
Please post the whole error!
"Woker::getInstance()" - what is Woker and what are anotherJobFinished parameters? -
@jsulm Sorry, it's my fault.
I write wrong parameters at lamda function :(;;;