I had a requirement where i have to select n number of .bin file for reading purpose.
So I implemented the code like below which is working fine
QDir directory
("Documents");
QString path
= directory.
filePath(" ");
BinFileSize = BinFileNames.size();
QDir directory("Documents");
QString path = directory.filePath(" ");
QStringList BinFileNames = QFileDialog::getOpenFileNames(this,tr("Open File"),path,tr(".bin"));
BinFileSize = BinFileNames.size();
To copy to clipboard, switch view to plain text mode
but now the requirement is like i have to select only the folder which contain all the .bin file.
So i tired to implement like below
QString Directory
= QFileDialog::getExistingDirectory(this, tr
("Choose Or Create Directory"),
"/home",
QString Directory = QFileDialog::getExistingDirectory(this, tr("Choose Or Create Directory"),
"/home",
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
To copy to clipboard, switch view to plain text mode
but not getting how can i save all file path in a QStringList.
So in shot how can I get all the file form the selected folder and open for read purpose
Bookmarks