baray98
10th February 2009, 05:21
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[])
{
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();
}
my qrc look like this
<qresource prefix="/Menu" >
<file>tool.gif</file>
</qresource>
<qresource prefix="/Sounds">
<file>voices/welcome.wav</file>
</qresource>
anything i missed?
baray98
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();
}
my qrc look like this
<qresource prefix="/Menu" >
<file>tool.gif</file>
</qresource>
<qresource prefix="/Sounds">
<file>voices/welcome.wav</file>
</qresource>
anything i missed?
baray98