driscan
driscan

Reputation: 23

PNG images not displayed with Qt and Visual Studio

My application is developped using Visual Studio 2010 and the Qt5 framework.

I've created a qrc resources file using the Qt VS-addin, with some PNG images inside. The QRC file is included in the Resources section of my VS project.

But my images are still not displayed on Windows on runtime, neither in debug or release build. The Linux port of my application displays these images.

Any idea?

Thanks.

Edit: I'm using Qt Designer to load images, using QLabel. That said, manually specifying the PNG image using setPixmap() doesn't work neither.

Edit 2: Apparently, the problem seems to be caused by the qrc file which has an underscore in its name. Renaming the qrc in a more conventional way fixed the issue. I guess that using special characters in such files require escaping or sort of.

Upvotes: 0

Views: 2281

Answers (2)

driscan
driscan

Reputation: 23

Problem solved, here is copy of my comment above.

Apparently, the problem seems to be caused by the qrc file which has an underscore in its name. Renaming the qrc in a more conventional way fixed the issue. I guess that using special characters in such files require escaping or sort of.

Upvotes: 0

Reza Ebrahimi
Reza Ebrahimi

Reputation: 3689

In your Qt directory there is a folder named plugins, inside plugins folder, a folder with the name imageformats exists, copy imageformats folder to your compilation output directory.

Upvotes: 1

Related Questions