You can write a program that will uncompress a file embedded into a Qt resource to disk. You don't need to qCompress() the file as resources are already compressed.
#include <QApplication>
#include <QFileDialog>
#include <QFile>
#include <QString>
int main(int main, char **argv) {
if(path.isEmpty()) return 0;
outfile.
open(QFile::WriteOnly);
while(!f.atEnd()) {
outfile.write(data);
}
return 0;
}
#include <QApplication>
#include <QFileDialog>
#include <QFile>
#include <QString>
int main(int main, char **argv) {
QApplication app(argc, argv);
QString path = QFileDialog::getSaveFileName();
if(path.isEmpty()) return 0;
QFile f(":/myfile");
QFile outfile(path);
outfile.open(QFile::WriteOnly);
f.open(QFile::ReadOnly);
while(!f.atEnd()) {
QByteArray data = f.read(4096);
outfile.write(data);
}
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks