How do I use QT connect (SIGNAL/SLOT) with QT thread operation?
I have a RFID Reader and Mifare RFID card. I need some kind automation for the card reader and each card presented to reader it must be run in separate thread. So I thought below design is the basic solution for my project.
- RFID Reader waits for to Mifare RFID card to presented
- When Mifare RFID card is present, the reader connects to the card
- Read/write/update operation
- Disconnect from card
- RFID reader waits another card to presented
I need my reader to always in waiting mode kind of always to be listen if any card presented. Then if card is presented I need to connect the card. Do some CRUD operation. And disconnect from the card. I am thinking to use SIGNAL/SLOT connect and disconnect with some threading operation. But I don’t know how to use QT connect/disconnect (SIGNAL/SLOT) with QT Threading. How do I use QT connect (SIGNAL/SLOT) with QT thread operation?
Use Qt::QueuedConnection as connection type when you call connect(...), then it will work across threads.