MacOS – Open resource from inside the bundle using c++ / qt

applicationsfilesystemmacosresources

I have a Qt app set as a bundle, and it requires a resources database. If I place it inside the bundle, how do I open it ?

The app was created in Windows, and in Windows and Linux, I can use the path for the database:

fopen(path, r);

I can do the same thing in Os X with a path like "/Users/Me/Company/Product/resources.db" or "/Library/Application Support/Compay/Product/resources.db"

1) What path would I use for the resources.db if I want to place the database in Contents/Resources ?

2) Would I be able to do anything to access the location using an Open File Dialog ?

Best Answer

Being that the app structure in OSX is flat it should not matter where you put anything, other than for your own organization purposes.