Results 1 to 1 of 1

Thread: [Solved] QuaZIP and getting a file out of an archiv

  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default [Solved] QuaZIP and getting a file out of an archiv

    Edit: The failure was in the QByteArray handling.
    Qt Code:
    1. QTextStream stream(&file);
    2. QString str = stream.readAll();
    To copy to clipboard, switch view to plain text mode 

    -----------

    Hi,

    I want get the content.xml out of an *.odt file, so I use QuaZip:
    Qt Code:
    1. QuaZip zip("test.odt");
    2. zip.open(QuaZip::mdUnzip);
    3. zip.setCurrentFile("content.xml");
    4. QuaZipFile file(&zip);
    5. int method;
    6. file.open(QIODevice::ReadOnly, &method, NULL, true);
    7. QByteArray array=file.readAll();
    8. file.close();
    9. zip.close();
    10. QString str(array);
    To copy to clipboard, switch view to plain text mode 

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


    Thanks in advance

    Lykurg
    Last edited by Lykurg; 6th March 2008 at 11:12. Reason: solved

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.