Qt Code:
  1. private:
  2. Phonon::MediaObject *mediaObject;
  3.  
  4. //ADisplay.cpp
  5. void ADisplay::setAlarm(QString alarmSound){
  6. QUrl alarmS = alarmSound;
  7. mediaObject->setCurrentSource(Phonon::MediaSource(alarmS));
  8. }
To copy to clipboard, switch view to plain text mode 

Here whe have the bug:
mediaObject->setCurrentSource(Phonon::MediaSource(alarmS));

But only when it's created the second time:
Qt Code:
  1. display = new ADisplay();
  2. display->setWindowFlags(Qt::WindowStaysOnTopHint);
  3. connect(this,SIGNAL(soundAlarm(Al*)),display,SLOT(showDisplay(Al*)));
  4. connect(display,SIGNAL(quiting(QString)),this,SLOT(quiting(QString)));
  5. emit soundAlarm(a);
To copy to clipboard, switch view to plain text mode 
First time the above works, second time, bug.
Attachment 4598