PDA

View Full Version : problem with resources



SuperSonik
15th February 2007, 10:58
Hi,
I have a problem with resources. I want to use a image as icon as WindowIcon
and SystemTrayIcon.
For this I created a .qrc fle:



<!DOCTYPE RCC><RCC version="1.0">
<qresource >
<file>web_logo.jpg</file>
</qresource>
</RCC>


and I make the statment in my .pro file:



TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT += network
# Input
#FORMS += GAB_tool.ui
RESOURCES += gabtool.qrc
SOURCES += main.cpp
HEADERS +=ui_GAB_tool.h


I use the Q_INIT_RESOURCE function for the .qrc file in my main function.

Then I use the source in this way:



.....
MainWindow->setWindowIcon(QIcon(QString::fromUtf8(":/web_logo.jpg")));
....
trayicon = new QSystemTrayIcon(QIcon(QString::fromUtf8(":/web_logo.jpg")));
trayicon->show();
......

The problem is, only on my system the icons are showed. On other systems the icons
are not showed. The other systems are Windows 2000 and XP. In case of the SystemTrayIcon the space for the icon is created and the actions also work. (right click menue and so on) Only the icon itself is not.
On systems where the complete Qt instalation for development is installed it works !
Has someone an idea what's wrong.
Greetings,
SuperSonik

aamer4yu
15th February 2007, 11:42
I think the problem is with loading jpeg images.
Qt doesnt have direct support for them,,, while deploying you have to ship the plugins too.

For this copy the \Qt\4.2.0\plugins\imageformats folder along with ur application. Say u installed ur exe on C:\test , copy imageformats folder also to C:\test
See more for deploying Qt Applications

Hope this works..

SuperSonik
15th February 2007, 11:58
I think the problem is with loading jpeg images.
Qt doesnt have direct support for them,,, while deploying you have to ship the plugins too.

For this copy the \Qt\4.2.0\plugins\imageformats folder along with ur application. Say u installed ur exe on C:\test , copy imageformats folder also to C:\test
See more for deploying Qt Applications

Hope this works..

Thanks,
that was the hint I need! :D
Greetings,
SuperSonik