answered
2014-08-15 10:48:11 +0200
I got it working. It is nice that Qt has a lot of documentation but the code examples are always so cryptic that it is hard to learn how to use them. After a endless search I accidentally found a solution in a Symbian tutorial. I would suggest that they add a section with things you should know to understand the help for a package as they do with Ubuntu.
So it is not possible to use a relative path in your code. The error message comes because it does not find the file. To make sure your (sound) files are attached to the project create a resource file. Therefore right click on the project name and choose "add" from the menu. In the dialog box select "Qt" and "Resource" and click okay. A new dialog opens asking for a prefix, here use "/".
Now your project tree should have a new folder "Resources". Within that folder is a file called "resources.qrc". Double click it and you will get dialog allowing you to add resources such as images and sounds. Click "add" and then "file" and navigate to your file. Personally I add a resource or sounds folde right in my project folder where I already have stored the files I want to add to the project. Choose these files now to add them. They should appear in the main window now.
To use a resource in your code do a right click on the file you want to use and choose "copy path" from the menu. Within your code you have to use the path like this:
source: "qrc:<paste path>"
This worked nicely for me because the audio files, images etc. get packaged with the project and you do not have to worry about getting your resources to the phone.
@Brundu: I think you got it working because you somehow managed to get the file to your phone.