1 year ago

#344275

test-img

Syed Iftekharuddin

QFileDialog:Recursive selecting files for unzip

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

  1. I am unable to recursively select any .zip or .7z in the root folder and extract them. There is some better way of using the commands (arguments ) in uncompressZipFile().
  2. How can I get the files name, name of the files that has been extracted from the root folder?

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);
    qDebug()<<choosenDir;
    ui->path->setText(choosenDir);}

qt

7zip

qdir

0 Answers

Your Answer

Accepted video resources