QT

커넥션 람다 슬롯 실행 스래드 확인

hellobird 2019. 3. 2. 14:25

connect(sWorker, &SerialWorker::onTextToPreset, [=](){ qDebug() << (QThread::currentThread() == this->thread()) << endl; });



다음과 같이 this를 쓰지 않으면 람다함수의 내용은 Sender의 스래드에서 실행됩니다.


connect(sWorker, &SerialWorker::onTextToPreset, this, [=](){ qDebug() << (QThread::currentThread() == this->thread()) << endl; });



https://www.kdab.com/slot-not-invoked/ 참고