
I just need to be able to have a folder within the project where I can store images and get the absolute path of each file. Shortcuts on Mac are best assistants such as Command-R, Ctrl Alt Delete, etc. Type the name of the file in the search bar and find the file you want from the list. What can be the solution to this problem? Not necessarily that it would be a completely different one, it's ok. Click the file, then press and hold the Command key, you will see the file path appear on the bottom until you release the key. Copy by command+c the Pathname from the Context Menu to find the path of the file mac terminal. This will ensure that you will get a file path on Mac. Replicate the copy as an option titled Pathname.

#GET FILE PATH MAC HOW TO#
pro file, but I didn't figure out how to use qmake variable. By right-clicking on the necessary folder and selecting Copy option as a pathname, and then you can command+c the Pathname itself. I know there's a qmake variable called $$_PRO_FILE_PWD_ which returns the folder with. I tried to use getenv() as well as qgetenv - got nothing. Maybe it's possible to create folder within the project and use something like: QString imagePath = "$PROJECT_DIR" + "/images/bubble.png"īut I couldn't find the appropriate variable.

QString imagePath = image.absoluteFilePath() īut it returns the resource file path - :/images/blah-blah. I tried to use the next variant: QFileInfo image(":/images/bubble.jpg") I need to give it to the constructor, but I don't know how can I extract the path from resource file, not the :/images/bubble.jpg, but /home/john/Pictures/bubble.jpg.

I'm using an external library which asks for path to the file in its constructor. I have a resource file which contains a few images.
