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

Testing and Deployment

Reply
Developer
Posts: 82
Registered: ‎01-11-2013
My Device: DevAlphadevice
My Carrier: rim

how to download image from link in cascades app

Hi

 

I tried below code for downloading image from link but ,am not getting data in QBytearray its null

 

        QNetworkRequest request = QNetworkRequest();
        QUrl url(res);
        request.setUrl(QUrl(res));
        mNetworkAccessManager = new QNetworkAccessManager(this);
       bool result = connect(mNetworkAccessManager, SIGNAL(finished(QNetworkReply*)), this,
                    SLOT(onImageLoaded(QNetworkReply*)));
       QNetworkReply* reply = mNetworkAccessManager->get(request);

        QByteArray dataa=reply.readAll();

its very urgent plz help me

Developer
Posts: 115
Registered: ‎10-22-2012
My Device: Developer
My Carrier: Mobifone

Re: how to download image from link in cascades app

Take a look in this:

https://github.com/blackberry/Cascades-Samples/tree/master/tldr/src

 

Especial in the file

https://github.com/blackberry/Cascades-Samples/blob/master/tldr/src/netimagemanager.cpp

function: constructor and httpFinished



Like my answer if it's helpful. Mark as answer if it help you solve the problem.