[Solved] QIcons are not shown in binary, while shown when compiled from source
-
I have a big Qt program which is compiled using CMake. I add the resource files by
qt5_add_resources(IMG_RSC_ADDED Data/Actions.qrc )
add_executable(${PROJECT_NAME} ${Application_SRCS} ${IMG_RSC_ADDED} )
In my program, I load these icons to actions, for example:
m_action = new QAction(":/icon.svg", tr("&Bar"), this);
And everything works when I compile from source - the icons are where they are supposed to be.
I created a binary of my program so that to test it on another machine. I put all the necessary
dll
s to the folder where myexe
file is. However, the icons are not displayed in that binary. While I thought that the commandqt5_add_resources
makes the icons a part of the binary, it does not seem to be the case. Where my problem could be? How to make the icons to be displayed in the binary? -
Hi,
Maybe a silly question but do you have the SVG plugin deployed ?
-
@hskoglund , thank you for suggestion.
I tried few things, and I also tried other file formats like
png
. It started to work after I addedQ_INIT_RESOURCE
macro, but only forpng
format. Does it mean I am missing some plugins to add support forsvg
?Inside my binary folder, I already have
imageformats
andiconengines
. I can see that both containdll
s related tosvg
format:imageformats
hasqsvg.dll
andiconengines
hasqsvgicon.dll
. Any ideas whysvg
cannot be displayed in binary? Thanks!