本文整理汇总了C++中QNetworkCookieJar::setParent方法的典型用法代码示例。如果您正苦于以下问题:C++ QNetworkCookieJar::setParent方法的具体用法?C++ QNetworkCookieJar::setParent怎么用?C++ QNetworkCookieJar::setParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QNetworkCookieJar
的用法示例。
在下文中一共展示了QNetworkCookieJar::setParent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCredentials
void Account::setCredentials(AbstractCredentials *cred)
{
// set active credential manager
QNetworkCookieJar *jar = 0;
if (_am) {
jar = _am->cookieJar();
jar->setParent(0);
_am->deleteLater();
}
if (_credentials) {
credentials()->deleteLater();
}
// The order for these two is important! Reading the credential's
// settings accesses the account as well as account->_credentials
_credentials = cred;
cred->setAccount(this);
_am = _credentials->getQNAM();
if (jar) {
_am->setCookieJar(jar);
}
connect(_am, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
SLOT(slotHandleErrors(QNetworkReply*,QList<QSslError>)));
connect(_credentials, SIGNAL(fetched()),
SLOT(slotCredentialsFetched()));
}
示例2: QNetworkAccessManager
NetworkAccessManager::NetworkAccessManager(QObject *parent) :
QNetworkAccessManager(parent)
{
QNetworkCookieJar* cookieJar = NetworkCookieJar::GetInstance();
setCookieJar(cookieJar);
cookieJar->setParent(0);
}
示例3: create
QNetworkAccessManager* TBNetworkAccessManagerFactory::create(QObject *parent)
{
QMutexLocker lock(&mutex);
Q_UNUSED(lock);
QNetworkAccessManager* manager = new TBNetworkAccessManager(parent);
#ifdef Q_OS_SYMBIAN
bool useDiskCache = Utility::Instance()->qtVersion() >= 0x040800;
#else
bool useDiskCache = true;
#endif
if (useDiskCache){
QNetworkDiskCache* diskCache = new QNetworkDiskCache(parent);
QString dataPath = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
QDir dir(dataPath);
if (!dir.exists()) dir.mkpath(dir.absolutePath());
diskCache->setCacheDirectory(dataPath);
diskCache->setMaximumCacheSize(3*1024*1024);
manager->setCache(diskCache);
}
QNetworkCookieJar* cookieJar = TBNetworkCookieJar::GetInstance();
manager->setCookieJar(cookieJar);
cookieJar->setParent(0);
return manager;
}
示例4: create
QNetworkAccessManager* ACNetworkAccessManagerFactory::create(QObject *parent)
{
QMutexLocker lock(&mutex);
Q_UNUSED(lock);
QNetworkAccessManager* manager = new ACNetworkAccessManager(parent);
QNetworkCookieJar* cookieJar = ACNetworkCookieJar::GetInstance();
manager->setCookieJar(cookieJar);
cookieJar->setParent(0);
return manager;
}