QFileDialog:Recursive selecting files for unzip
Unsolved
General and Desktop
-
I want to use 7za.exe as a subprocess in qt application, select a root directory using the browse button, look for all .zip and .7z files and extract their content.
Now with the code I came up- I am unable to recursively select any .zip or .7z in the root folder and extract them.
- How can I get the files name of the files that has been extracted from the root folder?
void MainWindow::uncompressZipFile() { QStringList queryArguments; queryArguments << "e"; queryArguments << """" + choosenDir + """"+"/*.zip"; queryArguments << "-ro"+choosenDir+"/example"; zipperProcess.setWorkingDirectory(QCoreApplication::applicationDirPath()); qDebug() << zipperProcess.workingDirectory(); qDebug()<<queryArguments; zipperProcess.start("7za.exe", queryArguments); }
void MainWindow::on_browseFileButton_clicked() { qDebug()<<"browse button clicked"; choosenDir = QFileDialog::getExistingDirectory(this, tr("Choose catalog"), ".", QFileDialog::ReadOnly); }
-
@Iftekhar You can iterate reqursevely using https://doc.qt.io/qt-5/qdir.html#entryList