Commit 9b96c60d authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Adapt to Qt6Multimedia changes

parent c3607867
......@@ -50,9 +50,17 @@ void SoundFactory::playSound(const QString &soundRef) const
if (soundFile.isEmpty()) return;
if (soundFile.startsWith(':')) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
player->setSource(QUrl("qrc" + soundFile));
#else
player->setMedia(QUrl("qrc" + soundFile));
#endif
} else {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
player->setSource(QUrl::fromLocalFile(soundFile));
#else
player->setMedia(QUrl::fromLocalFile(soundFile));
#endif
}
player->play();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment