Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt resources doesn't work in windows platform
I met a problem. I compiled Qt 4.8.5 with MinGW 4.8.1. When I used an embeded resources in my project, I found that I can't use code like @ QPixmap pixmap(":/images/abc.jpg")@ to create a Pixmap. I know that pixmap already created but which's width() and height() is 0, and used same code in Linux, I found that it works.
I don't why it doesn't work in windows. And I don't how can I makt it worked.
amonR last edited by
And if you try through a QLabel like this:
QLabel *label = new QLabel(this);
Does it work?
Hi and welcome to devnet,
Since you compiled Qt yourself, are you sure the jpeg plugin was compiled ? (should be but one never knows)
You can get a list of known readable image format using:
@qDebug() << QImageReader::supportedImageFormats();@
thanks for SGaist, I saw it, witch can not support jpeg. I'm compling qt project with -qt-jpeg -qt-tiff -qt-png. Maybe tomorrow I will know the answer.
Thank you, SGaist. you helped me lot. I recompiled the qt project, it's still compiling. But jpeg format worked.
Glad you have it working now
Can you also please update the thread title prepending [solved] so other forum users may know a solution has been found :)