title: How to mute all sounds (alarm bells) from a QWidget?
body: <p><strong>I'm wondering how to mute all sounds from the <code>QDialog</code>.</strong> I have this basic popup-window class based on <code>QDialog</code>,</p>
  
  <pre><code>class PopUp : QDialog
  {
      // member vars and funcs
  };
  </code></pre>
  
  <p>which I display like</p>
  
  <pre><code>PopUp *popup_msg = new PopUp(this, /* ... */);
  popup_msg-&gt;exec();
  </code></pre>
  
  <p>This PopUp-class doesn't really do anything except displaying some text, but I need it to be modal, hence I call <code>setModal(true)</code> in the constructor. The problem is that, when a <code>QDialog</code> is modal, it plays an error bell/beep/sound when the user tries to interact with other widgets (e.g. the MainWindow). I want to disable this sound!</p>
  
  <p>This question: <a href="https://stackoverflow.com/questions/16070012">How can i disable sounds played by Qt QMessageBox?</a>, addresses the problem but doesn't completely solve it in my case. Its solution only mutes the sound upon <code>show()</code>-ing the <code>QMessageBox</code> (or <code>QDialog</code> in my case), but the sound still plays when the user tries to click on other widgets. I want it muted completely, and one would think this was a trivial problem with a really simple solution. Maybe something like <code>QWidget::setAttribute(Qt::WA_MuteAllSounds, true)</code> could have existed, but apperently not(?). </p>
  
  <p>All help, tips and tricks are most appriciated!!</p>