This question already has an answer here:
- Copy path to QString 1 answer
i got a QString blabla = qtfiledialog::getOpenFileName();
now blabla gives me the full path and the exe like: C:/Program Files/imanoob.exe
but i only want the path like: C:/Program Files/ how to do this?
QString getExistingDirectory
to get a directory path.Or parse the returned string from
getOpenFileName()
by usingQDir
(probablyQDir(blabla).path()
although you need to check the API on the actual method to use).