fix sound slider on qt6 (#4642)
This commit is contained in:
parent
40c88fe385
commit
235adbbdf1
1 changed files with 3 additions and 2 deletions
|
@ -59,11 +59,12 @@ void SoundEngine::playSound(QString fileName)
|
|||
}
|
||||
|
||||
player->stop();
|
||||
int volumeSliderValue = SettingsCache::instance().getMasterVolume();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
player->audioOutput()->setVolume(SettingsCache::instance().getMasterVolume());
|
||||
player->audioOutput()->setVolume(qreal(volumeSliderValue) / 100);
|
||||
player->setSource(QUrl::fromLocalFile(audioData[fileName]));
|
||||
#else
|
||||
player->setVolume(SettingsCache::instance().getMasterVolume());
|
||||
player->setVolume(volumeSliderValue);
|
||||
player->setMedia(QUrl::fromLocalFile(audioData[fileName]));
|
||||
#endif
|
||||
player->play();
|
||||
|
|
Loading…
Reference in a new issue