PDA

View Full Version : [Solved] QuaZIP and getting a file out of an archiv



Lykurg
6th March 2008, 08:44
Edit: The failure was in the QByteArray handling.

QTextStream stream(&file);
QString str = stream.readAll();

-----------

Hi,

I want get the content.xml out of an *.odt file, so I use QuaZip:

QuaZip zip("test.odt");
zip.open(QuaZip::mdUnzip);
zip.setCurrentFile("content.xml");
QuaZipFile file(&zip);
int method;
file.open(QIODevice::ReadOnly, &method, NULL, true);
QByteArray array=file.readAll();
file.close();
zip.close();
QString str(array);

Fine, but str is raw and not uncompressed. So how to uncompress?


Thanks in advance

Lykurg