Results 1 to 3 of 3

Thread: QList<QNetworkCookie> cookies = cookie->allCookies(); into Variable

  1. #1
    Join Date
    Mar 2010
    Posts
    38
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default QList<QNetworkCookie> cookies = cookie->allCookies(); into Variable

    Hello. Im trying to write all cookies to the variable and getting an error.
    My code
    Qt Code:
    1. QList<QNetworkCookie> cookies = cookie->allCookies();
    To copy to clipboard, switch view to plain text mode 

    error code
    D:/my14/../Qt/2010.01-win/qt/include/QtNetwork/../../src/network/access/qnetworkcookiejar.h:69: error: 'QList<QNetworkCookie> QNetworkCookieJar::allCookies() const' is protected
    What does it mean "protected"???Seems i cant write in variable...
    Documentation says that this function is used for writing cookies in file......
    Help please...

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QList<QNetworkCookie> cookies = cookie->allCookies(); into Variable

    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QList<QNetworkCookie> cookies = cookie->allCookies(); into Variable

    ... or without reading manuals (but you really should read it): you can use protected methods ONLY INSIDE the class (or inherited classes). That means, that if you want to use it outside, you have to overload it or write another public method to access it. Like this:
    Qt Code:
    1. class MyCookieJar : public QNetworkCookieJar
    2. {
    3. public:
    4. getAllCookies() { return allCookies(); }
    5. };
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. How to enable cookie in QWebView
    By KoalaSydney in forum Newbie
    Replies: 5
    Last Post: 21st July 2014, 04:56
  2. Replies: 11
    Last Post: 12th July 2009, 16:01
  3. QNetworkAccessManager can't handle multiple cookies?
    By krippy2k in forum Qt Programming
    Replies: 5
    Last Post: 7th June 2009, 23:12
  4. I get only 1 of 4 cookies...
    By cherva in forum Qt Programming
    Replies: 33
    Last Post: 5th June 2009, 15:42
  5. Replies: 1
    Last Post: 17th February 2009, 16:55

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.