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. Receiving signals into a QThread without calling exec()
Forum Updated to NodeBB v4.3 + New Features

Receiving signals into a QThread without calling exec()

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 654 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.
  • S Offline
    S Offline
    sharevari
    wrote on last edited by
    #1

    Is it possible to have a QThread without a Qt event loop and somehow manually poke the Qt event delivery mechanism to deliver any events sent to the thread?

    E.g. a run method that looks something like this:

    @while (true)
    {
    processEventQueueForThisThread();
    doChunkOfWork();
    }@

    I'm wondering whether it's possible to have a worker thread which can listen for signals but without handing over control to exec().

    (For some background, this is in the context of an audio callback thread where I don't have control over when I get called.)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      I guess you could try that. You could try what happens if you run processEvents() regulary in your thread. That is, in its basics, what an eventloop does too. I have not tried this myself, and I would not recommend it in general.

      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