title: Play notification (frequency x) sound in Qt - easiest way?
body: <p>Qt 5.1 or later:</p>
  
  <p>I need to play a notification sound of frequency x for n milliseconds. It'd also be nice if I could combine tones like this: 1000Hz for 2 secs, then 3000Hz for 1 sec, ..</p>
  
  <p>The easiest way is to use files (WAV, MP3, ..), e.g. as described here: <a href="https://stackoverflow.com/questions/4473608/how-to-play-sound-with-qt">How to play sound with Qt</a> But then I have to generate such files for each of my scenarios.</p>
  
  <p><a href="https://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/multimedia/audiooutput/audiooutput.cpp?h=5.14" rel="nofollow noreferrer">Qt's audio output example</a> generates such tones in memory ( <code>Generator::generateData(const QAudioFormat &amp;format, qint64 durationUs, int sampleRate)</code> ). I could write such a generator for my purpose. But do I have to?</p>
  
  <p>So what is the easiest way to just play frequency x for n milliseconds?</p>