QNetworkReply is emptied after reading of JDA

I'm currently at qDebug a QNetworkReply but only when there was an error in my json analysis.

qDebug() << reply->readAll();

I couldn't understand why the answer was always returning an empty string. When I showed a friend he said because the answer has already been read "cursor" was at the end of the file, and I needed to bring the cursor to the beggening.

EDIT: now I am implimenting the seek function and it seems executre successfully but answer always returns an empty string. See post #3 for a simplified management versoin.

QNetworkReply is a sequential flow and can't get them.

This function can be rewritten as follows (not tested):

void CascadesRest::requestFinished (QNetworkReply *reply){  if (reply->error() == QNetworkReply::NoError)  {
    QByteArray data = reply->readAll();
    QVariant obj = jda->loadFromBuffer(data);    // Use 'data' for other tasks  }  reply->deleteLater();
}

Also, I suggest to modify the function to verify reply-> error() first and only on the success of the reading / analysis of the data.

There are also constants for most of the HTTP errors. This line:

if (reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toString().indexOf("204")

Can be rewritten in the form:

if (reply->error() == QNetworkReply::AuthenticationRequiredError)

Other codes can be found on this page:

http://Qt-project.org/doc/Qt-4.8/qnetworkreply.html

Tags: BlackBerry Developers

Similar Questions

  • updated my iMAC 7.1 with 4 GB of memory with the intention to go to El Capitan, but after reading how it slows down the speed, I was wondering if going to Yosemite is a better choice.

    Updated my iMAC 7.1 with 4 GB of memory with the intention to go to El Capitan, but after reading the slowness becomes the MAC, it would be best to go with Yosemite?

    If you upgrade the amount of RAM your iMac should be able to handle El Capitan nicely.

  • Satellite A100 battery is empty after 1 hour

    Hello

    I have a problem with my Satellite A100-720:

    When I change to normal energy saver, the battery is empty after almost an hour.
    Even if I change to long mode, the battery is empty after 1.5 hours.

    Anyone has the same problem?
    Is this normal or maybe my battery is damaged.

    Thanks for every answer you need

    (And sorry for my bad English)

    Hello

    No, I don't think that there is something wrong with the battery.
    The fact is that the battery performance is dependent on the use of the laptop and so you can get different results of time.

    You said you use the A100. Well, to my knowledge some A100 series laptops have been delivered with a standard battery of 2000mAh.
    If you want to use the laptop longer with the power of the battery I advise you to buy an extended battery packs.

    On the Toshiba Options & Accessories site you will find various supported batteries.
    Maybe you'll find a Li-ion, 6000mAh battery 9-cell or Li-ion 12 cells, 8600mAh

  • App store is empty after that iOS 9 update on iphone 5 c.  Already tried to set a date.  Any suggestions?

    App store is empty after updating iOS on iphone 5 c 9.0.2.  Already tried the suggestion of setting a date.  Still a Virgin.  Ideas?

    Djrash,

    Why not try a hard reset if you have not already. This, now the "home" button and the power button / stop key at the same time until you see the apple logo. I hope this helps! If no answer.

    Thank you!

  • How can I get Windows Live Hotmail back to my page of the Inbox after reading or deleting a message?

    HOW TO GET HOTMAIL BACK TO THE PAGE OF THE INBOX AFTER READING & DELETING A MESSAGE INSTEAD OF GOING TO THE FOLLOWING E-MAIL ADDRESS, WHICH MAY BE OF THE SPAM OR DANGEROUS TO OPEN IT.  IT DOESN'T SEEM TO BE AN OPTION FOR THIS ON THE HOTMAIL PAGE.  WOULD APPRECIATE ANY HELP.  Thank you

    original title: HOTMAIL INBOX BACK

    Hello

    Answers is a peer group supported and unfortunately has no real influence on Hotmail.

    HotMail has its own Forums, so you can ask your questions there.

    Windows Live Solution Center - HotMail - HotMail Forums Solutions
    http://windowslivehelp.com/

    Hotmail - Forums
    http://windowslivehelp.com/forums.aspx?ProductID=1

    Hotmail - Solutions
    http://windowslivehelp.com/solutions.aspx?ProductID=1

    How to contact Windows Live Hotmail Support
    http://email.about.com/od/hotmailtips/Qt/et_hotmail_supp.htm

    Windows Live Hotmail Top issues and Support information
    http://support.Microsoft.com/kb/316659/en-us

    Compromised account - access unauthorized account - how to recover your account
    http://windowslivehelp.com/solution.aspx?SolutionID=6ea0c7b3-1473-4176-b03f-145b951dcb41

    Hotmail hacked? Take these steps
    http://blogs.msdn.com/b/securitytipstalk/archive/2010/07/07/Hotmail-hacked-take-these-steps.aspx

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • Windows xp sp 1, when I get to the step "I agree" after reading the license, nothing haapens aggremnet?

    Windows xp sp 1, when I get to the step "I agree" after reading the license, nothing haapens aggremnet?

    Personal data backup (which none should be considered 100% reliable at this point) then format the HARD disk and do a clean install of Windows.  Please note that give repair install (upgrade AKA on-site) will NOT fix it!

    HOW to do a clean install of Windows XP: see method 1 and http://michaelstevenstech.com/cleanxpinstall.html#steps in http://support.microsoft.com/kb/978307

    Once installed the clean, you will have the equivalent of a "new computer" in order to take care of everything on the next page before connecting the machine to the internet or one local network (i.e. other computers) otherwise and before using a flash drive or the SD card that is not brand new, or has not been freshly formatted:

    4 steps to help protect your new computer before going online
         http://www.Microsoft.com/security/pypc.aspx

    Other useful references include:

    HOW TO get a computer that is running Windows XP Gold (no Service Pack) fully patched after a clean install
    http://groups.Google.com/group/Microsoft.public.windowsupdate/MSG/3f5afa8ed33e121c

    Tip: After getting the computer fully patched, download/install KB971029 manually: http://support.microsoft.com/kb/971029

    NB: No matter what Norton or McAfee free trial which is preinstalled on the computer when you bought will be reinstalled (but invalid) when Windows is reinstalled. You MUST uninstall the trial for free and download/run the removal tool before installing updates, Windows Service Packs, or updates IE and before installing your new anti-virus application (which will require WinXP SP3 must be installed).

    Norton Removal Tool
         FTP://ftp.Symantec.com/public/english_us_canada/removal_tools/Norton_Removal_Tool.exe

    McAfee Consumer product removal tool
         http://download.McAfee.com/Products/Licensed/cust_support_patches/MCPR.exe

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • E-mail messages disappear after reading

    I wonder why after reading a few emails they just disappear. I don't remove them, they do not in my file deletion, they just disappear. If I reply to the email, it will disappear from my Inbox file but stay in my sent folder. If I send the email to someone else, it doesn't go away in their Inbox. Why this is happening and how to fix it?

    Thank you

    Karol

    While in the Inbox: view | Current view. Make that sure show all Messages is checked and nothing else. Bruce Hagen ~ MS - MVP [Mail]

  • Can I ask what's happened on the Oracle Forms forum, after reading it for 20-odd years it seems to have disappeared?

    Can I ask what's happened on the Oracle Forms forum, after reading it for 20-odd years it seems to have disappeared?

    I just get a message saying that the makers of the element do not exist, it can havbe been deleted when you try to access the page to:

    https://community.Oracle.com/community/Developer/English/development_tools/application_development_in_pl_sql/forms_2

    TIA

    Ady

    Ady,

    Apparently the people who helped create this software was last updated forum decided to restructure the many places as well as simply a change of software...

    ... but could not be bothered to document changes, they went to the URL for the new locations.

    FORMS are always, like REPORTS.

    They were buried at the following locations tree:

    All locations > Database > Oracle + Options database > SQL and PL/SQL > PL/SQL application development

  • Application of VO becomes empty after the backup of the VO

    Hello

    Application of VO becomes empty after the backup of the VO. Can you please let me know why this is happening.

    Thank you
    HC

    Again create a new VO with the same query, save it and open the Jdev and let us know the result.

    Don't forget to win twice three times the time :)

    Thank you
    -Anil

  • Reading messages: when we say page 6 after reading page breaks 1

    Hello!

    A simple question - I think at least: I have not checked the forum for a few weeks, so I read the messages and return to the next page and read. And after reading I always go back to page 1, even if the message I read was on page 6.

    What is the problem with my clicking or Adobe click in this funny way?

    Alexander

    It is an also the forum software Adobe bought last spring.  Workaround: right click on the message you want to read and do open in a new tab.  That will keep your place at the table of contents (and you won't have to wait for the table of contents refresh after you close a message).

  • Sceen empty after activation of the standby mode

    What sleep mode, the monitor was turned off in sleep mode. After reactivation is by moving the mouse or punch a button on the keyboard, the PC wakes up and monitor on, but the empty guard monitor, nothing displayed on the monitor. The PC seemed wakes upward normally, as the indicator of power turned back and the hard drive flashes. I tried pressing all possible keys on the keyboard, no help. Can someone give me an idea?

    Thank you.

    Charles_cwk

    Message edited by Wendy on 11/11/2009 07:40

    Hello Glenn_XYZ, thank you very much for your information, THIS WORKS FOR ME TOO, I have disabled this feature for almost a year, and I works again after I have roll back the display to its older version driver (ver: 7.15.11.7521 to the worm: 7.15.11.65). My OS is Vista 32 bit.

    I underatand there have friends in this forum also have the same problem, try method in the above message.

    I recently faced another problem: IE8 stop working intermittently and had to close, it happened especially often when reading emails. It happened again in a few minutes, even I close all browser windows and re-open again. But especially it closed only my current working window and recovered with my previous windows.

    I have no idea about it and try using FireFox instead of IE8 at the moment. Can anyone help please? Thank you!

    Charles_CWK

  • ICloud empty after the removal of 10 beta 4 to 9.3.4

    5 16GB iPhone

    iOS 9.3.4

    After doing a 9.3.3 OTA update to 9.3.4, I discovered that certain things have been configured accordingly as if a synchronization has occurred with some archived data to icloud for months, I had been using icloud synchronization. But low and behold, when you view the 'Contacts' I learned quickly what had apparently been used in the 9.3.4 install gave when I initially activated iCloud months ago. In other words, a significantly outdated Contact list, a Notes app horribly sad and empty and so on.

    I tried to use my iMac to search around visiting icloud.com/myusername etc., but everything is essentially empty except for the very limited data in the opposite direction on the iPhone 5. The list of contacts is indeed very frustrating, but I've been using Notes in a hyper prolific measure, even including drafts for an upcoming book that I write. These are just a very small example of very critical data that I had taken for a long time. I'm completely panic in this regard and desperately need help to find it.

    A few quirks to consider: I backed up as well during a concert of photos using the mechanism that allows the user to store archived on iCloud photos, leaving versions "optimized" locally, which, when selected RESUMES to their original size and version (uncompressed). 9.3.4 current iOS seems to recognize this archive correctly on iCloud, I tested a handful of images successfully. But didn't want to push my luck. Using my I Mac, however, no sign of the gig of photos, but the available space shows less than half of the total 5 shows available, but no files or data anywhere near the 2 400 MB currently stored in iCloud. ***?

    Is it just me, or is strangely cryptic iCloud and arcane in its usefulness? Also, why there is a mobile version of iPhone support area on Earth is not community are?

    I am really desperate for help here

    You say that your backup data in iCloud are non-existent?

  • Automatically Mark message as read after reading

    Initially by email worked correctly, but somehow I failed and may not know how to reset the e-mail to mark "read" AFTER that I read it.

    Review your settings in OPTIONS - DISPLAY - ADVANCED.

  • Contacts file is empty after the last OS update.  I have a backup, but what is the name of file

    I have a backup, but what is the name of the contacts file so that I can restore the backup?  After that the last operating system updated, the contacts file is empty.

    If you use Time Machine for backup, you can open the app on your Mac and then click the Time Machine icon in the menu bar and then click on "Enter Time Machine".

  • Since Firefox v34, after Zoom text on a Google search page took me, the Google search page is empty after you click 'Back' to it. What is a v34 glitch?

    Since Firefox v34, search results page is empty, 1) by clicking a link in a Google search results page and loading of the linked page, 2) Zoom on the text on the page that Google took me and then without resetting the zoom text, 3) by clicking on the arrow of Firefox 'Back' to return to Google search results. If at that time I reload the page of Google results, or click back one page and will transmit then again, the full search results will be displayed then again.

    This happens on my Windows 7 PC as well as my Vista laptop. Is it a glitch with text zoom and Google in Firefox version 34?

    Sorry, this seems to be a problem with the cache in memory of Firefox: when you use a high Google zoom level the (the default setting) with "instant prediction results" then Firefox pips showing again after going back page (you can see the results for a fraction of a second before they white).

    Assuming you like your zoom level and enjoy using the instant prediction results, then the solution is to disable the part of the Firefox cached in memory by changing a setting under the covers.

    (1) in a new tab, type or paste Subject: config in the address bar and press ENTER. Click on the button promising to be careful.

    (2) in the search above the list box, type or paste sess and make a pause so that the list is filtered

    (3) double-click the preference browser.sessionhistory.max_total_viewers and change the value from-1 to 0 (that's a zero).

    (Please change not all other parameters similar to 0-sounding or you can disable the ability of Firefox to save/restore your tabs and windows open).

    Then reload the page of Google results and the test.

    Fixed? (Or should I say, worked around?)

Maybe you are looking for