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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
dridk
Posts: 91
Registered: ‎09-25-2012
My Carrier: free

Re: Will ImageView, ImageTracker support web URLs?

[ Edited ]

It works! But you create a QNetworkDiskCache per Image ! It should be better to create one in the same QNetworkAccessMAnager Instance. 

 

 

a lover of Qt
Please use plain text.
Developer
RileyGB
Posts: 256
Registered: ‎08-06-2010

Re: Will ImageView, ImageTracker support web URLs?

Oops, I had forgot to change that. I've updated the disk cache to be static.



Follow me on twitter @RileyGB - https://twitter.com/RileyGB
View my BB10 OpenSource projects - https://github.com/RileyGB/BlackBerry10-Samples
Please use plain text.
Regular Contributor
Paratheo
Posts: 88
Registered: ‎04-25-2009
My Carrier: AT&T

Re: Will ImageView, ImageTracker support web URLs?

[ Edited ]

How can i use WebImageView when referencing from C++?

 

For instance, I add the component to QML and want to reference and change properties from C++, for instance I want to use the setUrl function. However, I cant get WebImageView to be recognized in C++.

 

I did add this line

 

qmlRegisterType<WebImageView>("org.labsquare", 1, 0, "WebImageView");

 

 

I'm kinda new to Cascades, sorry for noob question.

Please use plain text.
Developer
RileyGB
Posts: 256
Registered: ‎08-06-2010

Re: Will ImageView, ImageTracker support web URLs?

Hi Paratheo, 

 

All you need to do is

 

#include "WebImageView.h"

 

in the c++ class that you want to use it in.

 

In terms of passing a WebImageView object to C++ from QML, please reference my post on how to pass a Button to C++ from QML: http://supportforums.blackberry.com/t5/Cascades-Development/How-Pass-SIGNAL-object-as-parameter-from...



Follow me on twitter @RileyGB - https://twitter.com/RileyGB
View my BB10 OpenSource projects - https://github.com/RileyGB/BlackBerry10-Samples
Please use plain text.
Regular Contributor
Paratheo
Posts: 88
Registered: ‎04-25-2009
My Carrier: AT&T

Re: Will ImageView, ImageTracker support web URLs?

[ Edited ]

I already had the include there, however your method of passing button to C++ worked great, Thanks!

 

One more quick question, how can I listen for WebImageView source changed and react to it all in QML?

Also, is there any way to change scaling, for instance to have it 'fill' rather than 'stretch' or 'fit'

Please use plain text.
Developer
RileyGB
Posts: 256
Registered: ‎08-06-2010

Re: Will ImageView, ImageTracker support web URLs?

[ Edited ]

You could simply monitor the WebImageView.url property through another object. 

 

 

Alternatively, when the url changes, urlChanged is emitted. I think that you could connect to it by using the id of your WebImageView, for example, in the page you could define

 


onCreationCompleted: {
    idOfWebImageView.urlChanged.connect(myfunction);
}
function myfunction() {
//logic here
}

 

In terms of scaling, use the same properties as you would for an ImageView since it is the super class of WebImageView: https://developer.blackberry.com/cascades/reference/bb__cascades__imageview.html#scalingmethod 



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
bbkeeper
Posts: 39
Registered: ‎04-27-2010
My Carrier: VIettel

Re: Will ImageView, ImageTracker support web URLs?

This is more than awesome. Thanks a lot.

---
More applications/games here: http://appworld.blackberry.com/webstore/vendor/14299/
louis.keeper@gmail.com
haitt@viethop.net
http://blackberryvietnam.net
http://viethop.com
Please use plain text.
New Developer
alecaserez
Posts: 8
Registered: ‎08-26-2012
My Carrier: Personal

Re: Will ImageView, ImageTracker support web URLs?

I have an error I do not understand.

"module" org.labsquare "is not installed
     org.labsquare import 1.0 "

I install the module?

Please use plain text.
Contributor
bbkeeper
Posts: 39
Registered: ‎04-27-2010
My Carrier: VIettel

Re: Will ImageView, ImageTracker support web URLs?

Just ignore that annoying issue. Your app will work regardless of that.

---
More applications/games here: http://appworld.blackberry.com/webstore/vendor/14299/
louis.keeper@gmail.com
haitt@viethop.net
http://blackberryvietnam.net
http://viethop.com
Please use plain text.
Contributor
gumpyboy
Posts: 39
Registered: ‎09-25-2010

Re: Will ImageView, ImageTracker support web URLs?

Hi.. i try to use this class, but when i build, it has error :

 

fatal error: QDesktopServices: No such file or directory

 

i've added " QT += network " in the pro file,

 

what am i done wrong?

Please use plain text.