Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Thread and Event Handler
Qt 6.11 is out! See what's new in the release blog

Thread and Event Handler

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.1k Views 1 Watching
  • 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.
  • J Offline
    J Offline
    JoelTW
    wrote on last edited by
    #1

    I am building a data collection system where I am using Qt to display data while a thread is collecting the data. The question I have is with the event loop. I need to be able to collect new data from the system and then signal the main app that data has arrived. I am not sure how to structure this with the event handler running. Is it okay to manually call the event handler after I get new data? or is there another method that I should look into?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      Have you already taken a look on "signals and slots":http://doc.qt.digia.com/qt/signalsandslots.html?

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JoelTW
        wrote on last edited by
        #3

        I plan on using signals and slots to pass data/commands between the main GUI and the thread running the data collection. That is the issue I am having. In order to signals I have to use the QT event handler. I need a way for my data collection function to run continously and signal data changes when needed.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          Be aware that you do not need an event loop to emit signals, just to receive.

          And, as always, make sure you've read "Threads, Events and QObjects":http://qt-project.org/wiki/Threads_Events_QObjects.

          1 Reply Last reply
          0
          • V Offline
            V Offline
            vittalonline
            wrote on last edited by
            #5

            Use QDbus inter-process communication (IPC) mechanism

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved