Important: Please read the Qt Code of Conduct -

Unzip a zip file with C++ Qt

  • Hello,

    I want to unzip a zip file protected by a password that I set.
    I retrieved for example Quazip and I found an example of code:

    QuaZip zip(""); // put real zip file name here;
    QuaZipFile file(&zip);
    for(bool f=zip.goToFirstFile(); f; f=zip.goToNextFile()) {, "password"); // put real password here
        file.readData(data, maxSize);
        // process data from archive

    But this example does not work, I have an error in this line:

    file.readData(data, maxSize);

    readData seems to be a private member.

    Do you have a simple example to unzip a zip file protected by password, please?


  • @tadamo
    I don't have an example, and I don't see what relevance password has, but QuaZipFile derives from QIODevice, so aren't you supposed to use methods from that, like read()?

Log in to reply