QList<QNetworkCookie> cookies = cookie->allCookies(); into Variable
Hello. Im trying to write all cookies to the variable and getting an error.
My code
Code:
QList<QNetworkCookie> cookies = cookie->allCookies();
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...
Re: QList<QNetworkCookie> cookies = cookie->allCookies(); into Variable
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:
Code:
class MyCookieJar : public QNetworkCookieJar
{
public:
getAllCookies() { return allCookies(); }
};