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. [Solved] QMessageBox stops QSound
Forum Updated to NodeBB v4.3 + New Features

[Solved] QMessageBox stops QSound

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.9k 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.
  • M Offline
    M Offline
    Max13
    wrote on last edited by
    #1

    Hi everybody !

    Qt is new for me and I have to say it...
    It's powerfull! For all my projects, I had to build and learn many libs (ie. pThread for the multi-thread, ncurses for the GUI on terminal [nano like], network...), Qt does it all O_O ...

    This is my first question here, I need help with QSound (on thread).
    The problem is that it works, but when there is a QMessageBox, the sound stops...

    Does anyone have an idea?
    How to put a sound on my app, which doesn't stop on QMessageBox ?

    Thank you all for your help.

    We all have started by asking questions. Then after some time, we can begin answering them.

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

      QSound most likely uses the message loop to send audio samples to a system API for playback. A QMessageBox has it's own message loop that blocks the application loop. Might be the reason for your problem.

      Have you considered using Phonon or QtMultiMedia for audio playback instead of QSound (which is a bit outdated i think)?

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vohi
        wrote on last edited by
        #3

        QMessageBox showing up probably triggers a system sound (through the accessibility integration in QAccessible::updateAccessibility), and that goes through the same channel as the QSound output, and therefore terminates the sound that's playing.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Max13
          wrote on last edited by
          #4

          Finally I used Phonon...
          But it's a little bit more complicated than QSound ^^

          Anyway, thank you for your help :)

          We all have started by asking questions. Then after some time, we can begin answering them.

          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