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>
<!DOCTYPE RCC><RCC version="1.0">
<qresource >
<file>web_logo.jpg</file>
</qresource>
</RCC>
To copy to clipboard, switch view to plain text mode
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
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT += network
# Input
#FORMS += GAB_tool.ui
RESOURCES += gabtool.qrc
SOURCES += main.cpp
HEADERS +=ui_GAB_tool.h
To copy to clipboard, switch view to plain text mode
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->show();
......
.....
MainWindow->setWindowIcon(QIcon(QString::fromUtf8(":/web_logo.jpg")));
....
trayicon = new QSystemTrayIcon(QIcon(QString::fromUtf8(":/web_logo.jpg")));
trayicon->show();
......
To copy to clipboard, switch view to plain text mode
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
Bookmarks