09-05-2012 05:24 PM
sorry! another newbie question.
Using standard C in my playbook app I can see files in "shared/images" and I can see cover.png is there but if I use that path in Qt, to open the image, I get a fail returned, image not loaded.
What am I doing wrong ![]()
thanks
QImage myImage;
bool val = myImage.load("shared/videos/cover.png");
// bool always false
09-05-2012 11:39 PM - edited 09-05-2012 11:41 PM
your app has access_shared permissions in it's bar-descriptor, right?
have you tried checking what the returned error is?
qDebug() << myImage.error(); qDebug() << myImage.errorString();
Also, have you tried an absolute path, like "file:///accounts/1000/shared/videos/cover.png"? It's possible "file:" is required as part of a Qt pathname URI.
09-06-2012 08:37 AM
09-06-2012 09:40 AM
baby steps...I'm stubbling along, all the problems seem to be in the Qt port for Playbook ![]()
If I try:
QImage myImage;
bool val = myImage.load("shared/videos/cover.png");then that fails always, if I check the error message it varies from unknown error and unsupported format.
But this works fine:
QFile PixmapFile("shared/videos/cover.png");
QByteArray bArray;
QPixmap Pixmap;
bArray = PixmapFile.readAll().toBase64();
Pixmap.loadFromData(bArray.fromBase64(bArray));Looks like some methods work ok, others not.
My next challenge is to try and load jpeg files. If I change the file to a jpg, bArray is filled but loadFromData fails (I can't see a way to get an error message from it, just boolean false).
Qt must support jpegs so it muct be the Qt for Playbook so libraries I downloaded, they must be missing jpeg support I think.
thanks
cel
09-06-2012 05:22 PM
Got it working finally!
I opened bar-descriptor.xml, Assets tab and added (wherever_your_qt_is)/qt4/plugins/imageformats/lib
I then clicked the Source tab and changed:
type="Qnx/Elf">lib/libqjpeg.so</asset>
to
type="Qnx/Elf">lib/imageformats/libqjpeg.so</asset>
Rebuilt and all works fine now