[Solved] QIcons are not shown in binary, while shown when compiled from source
-
wrote on 9 Feb 2016, 15:05 last edited by viruca 2 Dec 2016, 20:48
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 ?
-
wrote on 10 Feb 2016, 14:17 last edited by
Hi, thank you for suggestion, but yes, I have all the necessary plugins.
-
Hi, to add to @SGaist's thinking (plugin problem) what happens if you try a Windows .bmp file instead of a .svg file?
wrote on 10 Feb 2016, 15:45 last edited by@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! -
wrote on 10 Feb 2016, 16:22 last edited by
Hi, it could be a simple answer: maybe you forgot to copy Qt5Svg.dll to your other machine?
-
Hi, it could be a simple answer: maybe you forgot to copy Qt5Svg.dll to your other machine?
wrote on 10 Feb 2016, 16:45 last edited by@hskoglund You were right! Thank you.
1/7