I am using QFileDialog::getOpenFileNames to open one or several files in my application and that works fine.

However, I would like to remember the last used directory from one call to another. Now, yes, I am aware that this has already been discussed before (e.g. here and here), but that's what I already have in my application and isn't quite what I am after.

Indeed, the above works fine, but only if the user selects at least one file. What I would like is to be able to handle the case where the user ends in a directory (which is different from the starting one) and closes the dialog box without having selected any file. Now, even though no file has been selected, it would still be nice to keep track of that directory. However, it seems to me like it might not be possible or is it?