System Tray Icon in Application linked to a static Qt
-
I have compiled Qt 4.7.2 statically by following this link: http://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/
Now, using the System Tray example from C:\Qt\4.7.2\examples\desktop\systray , I succeed to compile and run it, however the icons from the system tray were not loaded. Looks like I got some problem with the embedded resources, which are supposed to be statically added in the executable file. The example source code contains:
@Q_INIT_RESOURCE(systray);@
and
@iconComboBox->addItem(QIcon(":/images/bad.svg"), tr("Bad"));
iconComboBox->addItem(QIcon(":/images/heart.svg"), tr("Heart"));
iconComboBox->addItem(QIcon(":/images/trash.svg"), tr("Trash"));@I can run the same example without any problem with the icons if I link the application with a shared compilation of Qt.
-
"Almost". QtSvg is the SVG module for Qt; if you want to read an image with QImageReader (or anything that uses it) an image plugin is required (qsvg in this case).
http://doc.qt.nokia.com/4.7/plugins-howto.html#static-plugins