I want to play a sound within the splash but with the following code I get the splash to show up and then, only when the splash is gone, the sound to play. Can someone help me out? Thank you very much.
QApplication a(argc, argv);
QMediaPlayer * splashSound = new QMediaPlayer;
splashSound->setMedia(QUrl("qrc:/sfx/splash_sound.wav"));
splashSound->play();
QSplashScreen * mainSplash = new QSplashScreen;
mainSplash->setPixmap(QPixmap(":/img/splash.png"));
mainSplash->show();
MainWindow w;
QTimer::singleShot(2500, mainSplash, SLOT(close()));
QThread::msleep(2500);
w.show();
return a.exec();