I was trying to load a wavefile for QSound from a qrc but of no luck. I tried loading the file from my drive then QSound made its sound. I am suspecting my QSound did not find the file in qrc. Is there any trick? I did all these in the snippet below
int main (int argc,char *argv[])
{
QPixmap pixmap
(":/Menu/tool.gif");
//QPixmap foound this file in my qrc splash.show();
app.processEvents();
QSound::play(":/Sounds/voices/welcome.wav");
//I did not hear any on this one
MyWindow*mainWin = new MyWindow;
mainWin->setMinimumSize(1024,740);
mainWin->show();
splash.finish(mainWin);
return app.exec();
}
int main (int argc,char *argv[])
{
QApplication app(argc,argv);
QPixmap pixmap(":/Menu/tool.gif"); //QPixmap foound this file in my qrc
QSplashScreen splash(pixmap);
splash.show();
app.processEvents();
QSound::play(":/Sounds/voices/welcome.wav"); //I did not hear any on this one
MyWindow*mainWin = new MyWindow;
mainWin->setMinimumSize(1024,740);
mainWin->show();
splash.finish(mainWin);
return app.exec();
}
To copy to clipboard, switch view to plain text mode
my qrc look like this
<qresource prefix="/Menu" >
<file>tool.gif</file>
</qresource>
<qresource prefix="/Sounds">
<file>voices/welcome.wav</file>
</qresource>
<qresource prefix="/Menu" >
<file>tool.gif</file>
</qresource>
<qresource prefix="/Sounds">
<file>voices/welcome.wav</file>
</qresource>
To copy to clipboard, switch view to plain text mode
anything i missed?
baray98
Bookmarks