Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED]problem in referring to resource image file
nimingzhe2008 last edited by
I added an image file door_open.png to my .qrc file with prefix im .But when I used the image file in my code @QAction *liulanAct->setIcon(":/im/door_open.png");@
I received an error message Can't transform parameter 1 from const char  to const QIcon &.
Here is the code of .qrc file
My IDE is Qt Creator.
Thank you for your attention.
dbzhang800 last edited by
The Error Message has told you how to do.
You should pass a QIcon instead of a string.