applicationDirPath() returns the path where the executable currently is.
applicationDirPath() returns the path where the executable currently is.
Cheers,
Phillip
--- Please post the solution you got to solve your problem. It may help others.
As I said earlier - you need to start from a well known point. The only path you know exactly is the one from your executable. It doesn't matter what buildsystem you use. The only important thing is where your paths are once the app is installed on the target computer(s).
I would suggest make the path of resources relative to the application path.
and use it in .pro file to include directories.
Or use some file to store the path and read from there.
Both solutions will help u to load resources and easily modify the path even if u install the application on some other computer
Be aware that the path where you build the application is not its final resting place. After building your should install the application to a defined path along all the resources. Especially that installing the application might require super user privileges.
Than you all. I solved it.the code worked for me is
Myfunction(QString qssfilename)
{
QFile file(":/"+qssfilename+".qss");
}
Last edited by phillip_Qt; 28th April 2008 at 11:12. Reason: correct code
Cheers,
Phillip
--- Please post the solution you got to solve your problem. It may help others.
Bookmarks