Results 1 to 5 of 5

Thread: QMessageBox sound

  1. #1
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Question QMessageBox sound

    I tried make a messagebox like this

    Qt Code:
    1. QMessageBox msg(this);
    2. msg.setIcon(QMessageBox::Critical);
    3. msg.setWindowTitle("Error");
    4. msg.setText("Message");
    5. msg.setDetailedText("Detail");
    6. msg.addButton("OK", QMessageBox::RejectRole);
    7. msg.exec();
    To copy to clipboard, switch view to plain text mode 

    But, why I lost critical message sound ??

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QMessageBox sound

    Because you are using the Qt message box that doesn't make sounds instead of the native message box that is used when you use static methods of QMessageBox.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2009
    Location
    Gorontalo
    Posts
    200
    Thanks
    20
    Thanked 5 Times in 5 Posts
    Qt products
    Platforms
    Unix/X11 Windows

    Question Re: QMessageBox sound

    I need make with dinamic way, not static. How to set the sound ? I look in the Qt doc, there is nothing to set a sound on QMessageBox..

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QMessageBox sound

    Widgets don't make sounds.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QMessageBox sound

    Not automatically, anyway. If you want to have a sound accompany the appearance of your widget, you'll have to arrange for that yourself. And if you want the sound to be one of the system sounds, you'll have to figure out how they're organized and stored, and how to access them reliably; they're managed by whatever desktop system you're using.

    Or, you can simply settle for the static calls, which already make use of a native widget.

Similar Threads

  1. Sound Volume
    By anafor2004 in forum Qt for Embedded and Mobile
    Replies: 7
    Last Post: 2nd February 2011, 06:03
  2. Phonon no sound
    By msaiia in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 30th November 2010, 06:18
  3. Play .amr sound
    By ahmdsd_ostora in forum Qt Programming
    Replies: 3
    Last Post: 17th July 2010, 15:34
  4. MP3 Sound / OGG Sound Play on GUI
    By patrik08 in forum Newbie
    Replies: 3
    Last Post: 1st September 2006, 19:01
  5. Sound on KDE 3.5
    By jaynewpeng in forum KDE Forum
    Replies: 6
    Last Post: 2nd February 2006, 13:06

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.