Results 1 to 4 of 4

Thread: How to use setErrorString() of QNetworkReply?

  1. #1
    Join Date
    Jun 2015
    Posts
    109
    Thanks
    20
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default How to use setErrorString() of QNetworkReply?

    Hi,

    How to access setErrorString() of QNetworkReply Class, as its private member but I want to add my custom message.

    Thanks

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to use setErrorString() of QNetworkReply?

    Quote Originally Posted by npatil15 View Post
    How to access setErrorString() of QNetworkReply Class, as its private member but I want to add my custom message.
    Subclass QNetworkReply and provide a way to get the relevant data to QNetworkReply::setError(). Return an instance of your QNetworkReply subclass from your QNetworkAccessManager::createRequest() override.

  3. #3
    Join Date
    Jun 2015
    Posts
    109
    Thanks
    20
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to use setErrorString() of QNetworkReply?

    Thats the problem here, setError() is private and how I can access it

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to use setErrorString() of QNetworkReply?

    Quote Originally Posted by npatil15 View Post
    Thats the problem here, setError() is private and how I can access it
    No, QNetworkReply::setError() is protected, not private.

    Cheers,
    _

Similar Threads

  1. Getting data from a QNetworkReply
    By ttimt in forum Newbie
    Replies: 8
    Last Post: 3rd March 2014, 15:38
  2. QnetworkReply Problems
    By sai_3289 in forum Qt Programming
    Replies: 6
    Last Post: 25th January 2013, 07:46
  3. QNetworkReply and https
    By Raadush in forum Qt Programming
    Replies: 2
    Last Post: 2nd January 2013, 22:23
  4. QNetworkReply: how to know when data is sent?
    By mentalmushroom in forum Qt Programming
    Replies: 17
    Last Post: 24th June 2011, 09:22
  5. Cannot get QNetworkCookie from QNetworkReply
    By MorrisLiang in forum Newbie
    Replies: 1
    Last Post: 25th May 2010, 17:59

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.