Hi all,

I am using the below code to obtain filenames from the folder. Everything is working fine but I don't want to be taken back to the same folder every time I execute the code. Instead I want the program to remember what folder was last opened by the user and I want the program to offer that folder as the default. In other words, I want the current folder to change as the new folder is opened by the user. I know there is "setCurrent()" that I could perhaps use but I never got it working. Would anyone be able to help me with this code. Thanks a lot!

Qt Code:
  1. QString filenametext = QFileDialog::getOpenFileName(this,
  2. tr("Open file"), QDir::current().dirName(),
  3. tr("Image Files (*.jpg *.jpeg)"));
To copy to clipboard, switch view to plain text mode