How do I use QT connect (SIGNAL/SLOT) with QT thread operation?



  • Hi,

    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.

    1. RFID Reader waits for to Mifare RFID card to presented
    2. When Mifare RFID card is present, the reader connects to the card
    3. Read/write/update operation
    4. Disconnect from card
    5. 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?

    Kind Regards,



  • Hey @NTCYP this worked for me :)


  • Moderators

    Use Qt::QueuedConnection as connection type when you call connect(...), then it will work across threads.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.