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.
02-16-2013 10:54 PM
I need some help understanding how NetImageTracker is working. What I'm trying to achieve is to download images to insert in listview but i'm trying to use it directly from C++. What I have right now is declaring a new Net ImageTracker and then I use the function imageSource but for some reason I can't pass my url in there.
So I have
NetImageTracker* nit = new NetImageTracker(); nit->setImageSource(QUrl(feed.value("url")));
but I don't think that how it's suppose to work. the feed.value("url") is a json file I download from the web
Thank you for the help
Solved! Go to Solution.
02-17-2013 02:23 PM
02-17-2013 03:11 PM - edited 02-17-2013 03:13 PM
You'll need to create a NetImageManager instance which all NetImageTrackers will use:
manager_ = new NetImageManager(this);
When creating ImageTrackers also set their parent so they will be automatically destroyed together with parent:
NetImageTracker* nit = new NetImageTracker(this);
NetImageTracker* nit = new NetImageTracker(manager_); // if you want to set manager_ as it's parent
Configure ImageTrackers with NetImageManager instance:
Set image URL to load: (use setSource, not setImageSource as it holds the result)
Connect to imageSourceChanged signal and when it fires get the URL of downloaded image.
In the signal handler:
NetImageTracker *tracker = (NetImageTracker *)sender();
QString urlStr = tracker->getImageSource();
QUrl url = QUrl(urlStr);
// this url can be used in ImageView
tracker->deleteLater(); // optionally destroy NewImageTracker as it's no longer needed