Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Regular Contributor
CrozyBB
Posts: 83
Registered: ‎07-19-2012
My Device: Bold 9790, Dev Alpha A
My Carrier: Koodo

Re: Will ImageView, ImageTracker support web URLs?

Very nice indeed! :smileyhappy: Thanks!

Please use plain text.
Contributor
alejandroh
Posts: 13
Registered: ‎11-30-2012
My Device: Alpha
My Carrier: Pepephone

Re: Will ImageView, ImageTracker support web URLs?

If I try to use this on my project, I get two error:

 

undefined reference to `WebImageView::staticMetaObject'

undefined reference to `vtable for WebImageView'

 

can't find the way to solve them.

Please use plain text.
Contributor
alejandroh
Posts: 13
Registered: ‎11-30-2012
My Device: Alpha
My Carrier: Pepephone

Re: Will ImageView, ImageTracker support web URLs?

Ok, solved by cleaning the proyect!!!
Please use plain text.
Developer
RileyGB
Posts: 282
Registered: ‎08-06-2010
My Device: Z10

Re: Will ImageView, ImageTracker support web URLs?

[ Edited ]

I've expanded on the sample provided by dridk and have implemented caching of images as well. Feel free to check it out at https://github.com/RileyGB/BlackBerry10-Samples/tree/master/WebImageViewSample



Follow me on twitter @RileyGB - https://twitter.com/RileyGB
View my BB10 OpenSource projects - https://github.com/RileyGB/BlackBerry10-Samples
Please use plain text.
Contributor
Scott56
Posts: 22
Registered: ‎01-05-2013
My Device: Dev Alpha
My Carrier: Bell

Re: Will ImageView, ImageTracker support web URLs?

Hey, I tried using your version since I need image caching, but I'm running into an issue.

 

I have a Grid listview of images that can get fairly long. When the list is loading, if the user quickly scrolls through the list before it's loaded the images, it seems that some urls in the cache are associated with the wrong image.

 

When I quickly scroll through the listview without caching, the device will load images, and then reload new images as it redownloads, and tries to catch up with the users quick scrolling. So with caching, it seems to be saving the first loaded image with the url of that list item.

 

Any suggestions?

Please use plain text.
Developer
RileyGB
Posts: 282
Registered: ‎08-06-2010
My Device: Z10

Re: Will ImageView, ImageTracker support web URLs?

[ Edited ]

Hi Scott,

 

Do the URL's change dynamically in your list? I've tried to reproduce this issue myself, but haven't been able to. I would suggest running a debugging session on WebImageView::setUrl and have some sort of comparison function to check for mismatches.

 

 I may try implementing caching in the https://github.com/blackberry/Cascades-Samples/tree/master/imageloader example to see if the results are a little nicer.



Follow me on twitter @RileyGB - https://twitter.com/RileyGB
View my BB10 OpenSource projects - https://github.com/RileyGB/BlackBerry10-Samples
Please use plain text.
Developer
kylefowler
Posts: 526
Registered: ‎05-17-2009
My Device: 9900
My Carrier: ATT

Re: Will ImageView, ImageTracker support web URLs?

Yeah, theres a bug in the webimageview class in the imageLoaded slot. You automatically insert it into the cache based on the current value of the mUrl member variable but at any point the url of that object instance might not match up with the url of that network request. Youd need to check that the urls match before inserting or use the url from the qnetworkreply as the key for inserting into the cache
Like all of my posts
Please use plain text.
Contributor
Scott56
Posts: 22
Registered: ‎01-05-2013
My Device: Dev Alpha
My Carrier: Bell

Re: Will ImageView, ImageTracker support web URLs?

This looks to have fixed the issue. I passed the reply url to SaveImageInCache, and used that as the key.
Please use plain text.
Developer
dridk
Posts: 91
Registered: ‎09-25-2012
My Device: bb10 alpha
My Carrier: free

Re: Will ImageView, ImageTracker support web URLs?

Use QNetworkDiskCache instead.... 

 

and in setUrl(), add  resetImage()

a lover of Qt
Please use plain text.
Developer
RileyGB
Posts: 282
Registered: ‎08-06-2010
My Device: Z10

Re: Will ImageView, ImageTracker support web URLs?

Thanks for the suggestions and input guys, I've updated my sample at https://github.com/RileyGB/BlackBerry10-Samples/tree/master/WebImageViewSample to use QNetworkDiskCache.



Follow me on twitter @RileyGB - https://twitter.com/RileyGB
View my BB10 OpenSource projects - https://github.com/RileyGB/BlackBerry10-Samples
Please use plain text.