Can not load image on mobiledevice
-
I have a "resources.qrc" file with these content:
<RCC> <qresource prefix="/images"> <file alias="fact.logo.png">Resources/Images/fact.logo.png</file> </qresource> </RCC>
In my contructor I have implemented:
Q_INIT_RESOURCE(resources);
In a function I have these code:
QImage image(":/images/fact.logo.png"); if (image.isNull()) { return; }
When I run it as a desktop app, everything is ok. But when it runs on my mobiledevice iphone6s the image can not be loaded.
What can I do, to repair this?
-
I think you should rather include the resource in your .pro file.
When you run Q_INIT_RESOURCE it means you are loading external resources - maybe Qt does not have access to them at the point where you are making the call?
-
I think you should rather include the resource in your .pro file.
When you run Q_INIT_RESOURCE it means you are loading external resources - maybe Qt does not have access to them at the point where you are making the call?
-
Then you don't need to run
Q_INIT_RESOURCE(resources);
, qmake already handles that for you.But it should work... hm. The only idea that comes to my mind now is that you can try changing the resource url from
":/images/fact.logo.png"
to"qrc://images/fact.logo.png"
.