[Solved] SysTray svg icon missing on Windows 7
-
I am writing a small program - the SysTray svg icon is visible on Ubuntu (though in a wrong place), but completely missing - just an empty space - on Windows 7 (though the context menu is available when right-clicking on this empty space).
At runtime there are two error lines in the application console:
Cannot open file ':/dch.svg', because: Unknown error
Cannot open file ':/dch.svg', because: Unknown errorat this string of loading the icon:
QIcon *SysTrayIcon = new QIcon(":/dch.svg");
It is Windows 7 32-bit, Qt 5.2.1, MinGW48-32
All the libraries are written in .pro file and made available in the build folder and sub-folders "platforms" and "plugins". When opening the .qrc file in QtCreator, the icon is perfectly displayed.
Have tried to change the slash to backslash, to put the icon in build folder, not in /res, another folder up, root folder - no way.
-
Hi and welcome to devnet,
IIRC you would need the QtSvg module to load svg files.
On a side note, you shouldn't need to allocate a QIcon on the heap. You are probably creating a memory leak here
-
Out of curiosity, what do you mean by removing the language from the qrc file ?
-
Thanks for the reminder, I've forgot that technique :)