diff options
| author | 2023-10-04 22:50:00 +0200 | |
|---|---|---|
| committer | 2023-10-18 10:26:35 +0200 | |
| commit | b62b83e7772e9fba12fd6eadb6c1e70924ccf173 (patch) | |
| tree | 768534de16817dadabf5f9a9f8005558f9201a9d /src/modules/snd | |
| parent | Make shortcuts compatible with qt6; remove unused KviShortcut constructor sin... (diff) | |
| download | KVIrc-b62b83e7772e9fba12fd6eadb6c1e70924ccf173.tar.gz KVIrc-b62b83e7772e9fba12fd6eadb6c1e70924ccf173.tar.bz2 KVIrc-b62b83e7772e9fba12fd6eadb6c1e70924ccf173.zip | |
Misc Qt6 port for slightly changed class names and method signatures
Diffstat (limited to 'src/modules/snd')
| -rw-r--r-- | src/modules/snd/libkvisnd.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp index 4c56ab380..3ad4d5bd9 100644 --- a/src/modules/snd/libkvisnd.cpp +++ b/src/modules/snd/libkvisnd.cpp @@ -34,7 +34,11 @@ #include "KviLocale.h" #include "KviQString.h" +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include <QSound> +#else +#include <QSoundEffect> +#endif #ifdef COMPILE_PHONON_SUPPORT #include <phonon/mediaobject.h> @@ -347,7 +351,13 @@ bool KviSoundPlayer::playQt(const QString & szFileName) { if(isMuted()) return true; +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QSound::play(szFileName); +#else + QSoundEffect effect; + effect.setSource(QUrl::fromLocalFile(szFileName)); + effect.play(); +#endif return true; } |
