QtSvgzPlugin is a plugin that adds support for gzip compressed SVG files (a.k.a. .svgz files) to Qt's icon engine.
The library is a regular QIconEngine plugin and is mostly based on the QSvgIconEnginePlugin class found in Qt 4.2 or later. Let's say that 90% of the code is the same as QSvgIconEnginePlugin ;-)
A feature request has been sent to the trolls and they are taking it into account, so it's highly probable that you will see support for svgz files in some next minor version of Qt.
The plugin uses zlib for actual decompression but you don't even need to have the library, as Qt is statically linked to zlib. You will only need two zlib header files to build the plugin!
The package contains a cool example application so you can see how easy it is to use compressed svg icons with this plugin. Everything is transparent, just create a QIcon object as you always do.
Qt's Resource System is also supported so you can embed your icons with no worries.
Using the plugin is quite easy. If you don't want to look at the example application, just remember these few steps:
First off, any comment, suggestion, bug report is welcome. I have written the plugin in about ten minutes so don't expect it to be the state of the art :D
The example application is based on the "icons" example shipped with Qt 4, so thanks again to the trolls. Again, I want to remember that my contribute was quite minimal. I just took a couple of code lines from my unzip classes, changed a couple of things to make everything work with gzip stream and that's all. Most of the work has been done by the trolls and by the zlib developers. Thank you guys :D
Always refer to the example application's main.cpp file or to the class comments in the source files for details and more (and updated) usage examples.
The applications .pro file:
Linking the zlib library is not really required as it is statically linked into the Qt libraries. Qt's QtCore library exports all the zlib functions, so you only need to let your INCLUDEPATH point to the zlib.h and zconf.h header files. Anyway, if you want to use a specific version of the zlib library you will need to link against it as usual.