在QT 工程文件中加入
QT += multimedia
QSound *sound = new QSound("E:/QT/untitled1/untitled1/alert.wav");//暂时把声音文件放在绝对路径中
// sound->setLoops(QSound::Infinite);
sound->play();
在QT 工程文件中加入
QT += multimedia
QSound *sound = new QSound("E:/QT/untitled1/untitled1/alert.wav");//暂时把声音文件放在绝对路径中
// sound->setLoops(QSound::Infinite);
sound->play();