Results 1 to 4 of 4

Thread: How to use setErrorString() of QNetworkReply?

  1. #1
    Join Date
    Jun 2015
    Posts
    86
    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,543
    Thanks
    13
    Thanked 1,577 Times in 1,506 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
    86
    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,396
    Thanks
    37
    Thanked 1,542 Times in 1,493 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, 14:38
  2. QnetworkReply Problems
    By sai_3289 in forum Qt Programming
    Replies: 6
    Last Post: 25th January 2013, 06:46
  3. QNetworkReply and https
    By Raadush in forum Qt Programming
    Replies: 2
    Last Post: 2nd January 2013, 21:23
  4. QNetworkReply: how to know when data is sent?
    By mentalmushroom in forum Qt Programming
    Replies: 17
    Last Post: 24th June 2011, 08:22
  5. Cannot get QNetworkCookie from QNetworkReply
    By MorrisLiang in forum Newbie
    Replies: 1
    Last Post: 25th May 2010, 16: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.