anh5kor
28th April 2016, 13:24
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(" ");
QStringList BinFileNames = QFileDialog::getOpenFileNames(this,tr("Open File"),path,tr(".bin"));
BinFileSize = BinFileNames.size();
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",
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
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
So I implemented the code like below which is working fine
QDir directory("Documents");
QString path = directory.filePath(" ");
QStringList BinFileNames = QFileDialog::getOpenFileNames(this,tr("Open File"),path,tr(".bin"));
BinFileSize = BinFileNames.size();
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",
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
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