当前位置: 首页>>代码示例>>C++>>正文


C++ QNetworkCookieJar::setParent方法代码示例

本文整理汇总了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()));
}
开发者ID:ronynksoft,项目名称:client,代码行数:29,代码来源:account.cpp

示例2: QNetworkAccessManager

NetworkAccessManager::NetworkAccessManager(QObject *parent) :
    QNetworkAccessManager(parent)
{
    QNetworkCookieJar* cookieJar = NetworkCookieJar::GetInstance();
    setCookieJar(cookieJar);
    cookieJar->setParent(0);
}
开发者ID:151706061,项目名称:QQStars,代码行数:7,代码来源:mynetworkaccessmanagerfactory.cpp

示例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;
}
开发者ID:JandunCN,项目名称:tbclient,代码行数:28,代码来源:tbnetworkaccessmanagerfactory.cpp

示例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;
}
开发者ID:QtDevelopGroup,项目名称:acfun,代码行数:12,代码来源:acnetworkaccessmanagerfactory.cpp


注:本文中的QNetworkCookieJar::setParent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。