[SOLVED] How to get text of svgz file?
I need to add svgz(zipped svg) content to the QDomDocument.
Usual svg i can open with QFile & QTextStream.
Only way I find, is to extract it with gunzip. But then I must to use additional qprocess.
Is there any other way?
9 replies
It was easier than I thought:
- QStringList args;
- args<<"-c"<<"../vector.svgz";
- proc.start("gunzip",args);
- proc.waitForFinished();
- qDebug()<<proc.readAll();
At the output I get svg text.
Then I replace qDebug with it:
- QDomDocument dom;
- dom.setContent(proc.readAll());
And my problem is solved!
Thanks Volker again.
You’re welcome. You might try
- QDomDocument dom;
- dom.setContent(&proc);
Maybe that saves you from copying around some bytes in the QByteArray.
You must log in to post a reply. Not a member yet? Register here!



