1 year ago

#346691

test-img

Syed Iftekharuddin

Using 7za for unzipping with qt and cpp

I am using 7za.exe as subprocess to unzip the files with qt and cpp. I used a checkbox to include the option of recursive unzipping, the recursive option does not seem to work here. Could anyone suggest where I am doing wrong?

void MainWindow::uncompressZipFile()
{
    QStringList queryArguments;
    queryArguments << "e";
    queryArguments << """" + choosenDir  + """"+"/*.zip";

    if(ui->checkBox->isChecked())
        queryArguments << "-ro"+choosenDir+"/example";

    queryArguments << "-o"+choosenDir+"/example";

    QFileInfoList dirs;
    QFileInfoList files;
    for(int i=0; i < dirs.size(); i++)
    {
        qDebug() << "Directories listed here";
        qDebug() << dirs.at(i);
    }

    QDirIterator it(choosenDir, QStringList() << "*.zip", QDir::Files, QDirIterator::Subdirectories);
    while (it.hasNext()){
        qDebug() << it.next();
        ui->resultList->addItem(it.next());
    }
    zipperProcess.setWorkingDirectory(QCoreApplication::applicationDirPath());
    qDebug() << zipperProcess.workingDirectory();
    qDebug()<<queryArguments;
    zipperProcess.start("7za.exe", queryArguments);
}

qt

7zip

0 Answers

Your Answer

Accepted video resources