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. Qt5 Mac QAudioInput Hates Multi-threading
Qt 6.11 is out! See what's new in the release blog

Qt5 Mac QAudioInput Hates Multi-threading

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.2k 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.
  • G Offline
    G Offline
    Gilgrum
    wrote on last edited by
    #1

    I have a QAudioInput that is a grandchild of an object I am pushing into another thread. On Windows this works out fine: When Grandpa gets pushed onto the new thread, Grandpa's kids and grand kids come along with him. However this is not the case for Mac. When I try to call QAudioInput's start() (no params version), I get these errors and the program stops working:

    QObject: Cannot create children for a parent that is in a different thread.
    (Parent is QAudioInputPrivate(0x10410e420), parent's thread is QThread(0x101c09550), current thread is QThread(0x101970950)
    QObject: Cannot create children for a parent that is in a different thread.
    (Parent is QAudioInputPrivate(0x10410e420), parent's thread is QThread(0x101c09550), current thread is QThread(0x101970950)

    I tried digging around in the source a bit to see if this is a bug in QAudioInputPrivate. It appears that QAudioInputPrivate creates a QIODevice when QAudioInput's param-less start is called and that this QIODevice is properly set as the QAudioInput's child, but I could be mistaken. Eitherway, I'm not sure why I'm getting these error messages.

    Anyone with more knowledge on this topic know a fix?

    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