m_play = new MediaPlay(this); m_play->setMedia("qrc:/music/run.MP3"); //先将run.MP3添加到 QRC 资源中 m_play->play();