Qt Forum

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

    [Solved] QMessageBox stops QSound

    General and Desktop
    3
    4
    2647
    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.
    • M
      Max13 last edited by

      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 Reply Quote 0
      • A
        akonrad last edited by

        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 Reply Quote 0
        • V
          vohi last edited by

          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 Reply Quote 0
          • M
            Max13 last edited by

            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 Reply Quote 0
            • First post
              Last post