开发者

Using Qt Resource for icons in a dll

开发者 https://www.devze.com 2023-03-20 04:28 出处:网络
I need to build a c++ dll with only one QT dialog which will have some icons. I added these icons in the Qt Creator/Qt Designer开发者_JAVA技巧. I created a resource file and added these images to it.

I need to build a c++ dll with only one QT dialog which will have some icons. I added these icons in the Qt Creator/Qt Designer开发者_JAVA技巧. I created a resource file and added these images to it. These icons appear in the Qt Designer, but at run time they do not show up.

There is no .pro file. So I can not add RESOURCES += myRes.qrc as suggested on some similar topics. Also Q_INIT_RESOURCE(myRes); can not be invoked.

Any ideas what to do here?


Solved..

I was using Visual Studio 2010 to code the dll and dialog was created in the QT Creator. Resource file was created using QT Creator as well.

Solution was to add qrc file (generated using QT Creator) to the dll project in the Visual Studio. No other modifications needed to be done.

No .pro file and no Q_INIT_RESOURCE(myRes) needed to be created/invoked.

Thanks for help :)

0

精彩评论

暂无评论...
验证码 换一张
取 消