Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
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
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.
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:
Rebuilt and all works fine now