Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

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

    Mobile and Embedded
    3
    3
    834
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      NTCYP last edited by

      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,

      1 Reply Last reply Reply Quote 0
      • L
        Lazar Urosevic last edited by

        Hey @NTCYP this worked for me :)

        1 Reply Last reply Reply Quote 0
        • jsulm
          jsulm Lifetime Qt Champion last edited by

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

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply Reply Quote 0
          • First post
            Last post