title: How to compress a few files to zip in Qt?
body: <p>I need to zip a few files in Qt. I am trying Quazip. But the zip file contains files with 0kb size. Something goes wrong. Can somebody help me out here!
  The code for zipping is given here:</p>
  
  <pre><code>QString testZip = location + "/tempTheme/test.zip";
              QuaZip zip(testZip);
              zip.setFileNameCodec("IBM866");            
              if(!zip.open(QuaZip::mdCreate)) {
                qWarning("testCreate(): zip.open(): %d", zip.getZipError());
              }
              zip.setComment("Test comment");
              QFileInfoList files=QDir(location + "/tempTheme/").entryInfoList();
              QFile inFile;
              QuaZipFile outFile(&amp;zip);
              char c;
              foreach(QFileInfo file, files) {
                if(!file.isFile()||file.fileName()=="test.zip") continue;
                inFile.setFileName(file.fileName());
                if(!inFile.open(QIODevice::ReadOnly)) {
                  qWarning("testCreate(): inFile.open(): %s", inFile.errorString().toLocal8Bit().constData());
                }
                if(!outFile.open(QIODevice::WriteOnly, QuaZipNewInfo(inFile.fileName(), inFile.fileName()))) {
                  qWarning("testCreate(): outFile.open(): %d", outFile.getZipError());
                }
                while(inFile.getChar(&amp;c)&amp;&amp;outFile.putChar(c));
                if(outFile.getZipError()!=UNZ_OK) {
                  qWarning("testCreate(): outFile.putChar(): %d", outFile.getZipError());
                }
                outFile.close();
                if(outFile.getZipError()!=UNZ_OK) {
                  qWarning("testCreate(): outFile.close(): %d", outFile.getZipError());
                }
                inFile.close();
              }
              zip.close();
              if(zip.getZipError()!=0) {
                qWarning("testCreate(): zip.close(): %d", zip.getZipError());
               QMessageBox msgInfo;
               msgInfo.information(this, "blah", "done");
              }
  </code></pre>