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


C++ QNetworkCookie::value方法代码示例

本文整理汇总了C++中QNetworkCookie::value方法的典型用法代码示例。如果您正苦于以下问题:C++ QNetworkCookie::value方法的具体用法?C++ QNetworkCookie::value怎么用?C++ QNetworkCookie::value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QNetworkCookie的用法示例。


在下文中一共展示了QNetworkCookie::value方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: data

QVariant CookieModel::data(const QModelIndex &index, int role) const
{
    if (index.row() < 0 || index.row() >= m_cookies.size())
        return QVariant();

    switch (role) {
    case Qt::DisplayRole:
    case Qt::EditRole: {
        QNetworkCookie cookie = m_cookies.at(index.row());
        switch (index.column()) {
        case 0:
            return cookie.domain();
        case 1:
            return cookie.name();
        case 2:
            return cookie.path();
        case 3:
            return cookie.isSecure() ? tr("true") : tr("false");
        case 4:
            return cookie.isSessionCookie() ? tr("Session cookie") : cookie.expirationDate().toString();
        case 5:
            return cookie.value();
        }
    }
    case Qt::FontRole: {
        QFont font;
        font.setPointSize(10);
        return font;
    }
    }

    return QVariant();
}
开发者ID:enkidu,项目名称:arora,代码行数:33,代码来源:cookiemodel.cpp

示例2: QDialog

CookieDialog::CookieDialog(const QNetworkCookie &cookie, QWidget *parent): QDialog(parent)
{
    setupUi(this);
    m_nameLineEdit->setText(cookie.name());
    m_domainLineEdit->setText(cookie.domain());
    m_valueLineEdit->setText(cookie.value());
    m_pathLineEdit->setText(cookie.path());
    m_dateEdit->setDate(cookie.expirationDate().date());
    m_isSecureComboBox->addItem(cookie.isSecure() ? tr("yes") : tr("no"));
    m_isHttpOnlyComboBox->addItem(cookie.isHttpOnly() ? tr("yes") : tr("no"));
    m_addButton->setVisible(false);
    m_cancelButton->setText(tr("Close"));
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:13,代码来源:mainwindow.cpp

示例3: onNewCookieCreated

void ShibLoginDialog::onNewCookieCreated(const QUrl& url, const QNetworkCookie& cookie)
{
    QString name = cookie.name();
    if (url.host() == url_.host() && name == kSeahubShibCookieName) {
        QString value = cookie.value();

        Account account = parseAccount(value);
        if (seafApplet->accountManager()->saveAccount(account) < 0) {
            seafApplet->warningBox(tr("Failed to save current account"), this);
            reject();
        } else {
            accept();
        }
    }
}
开发者ID:cxz,项目名称:seafile-client,代码行数:15,代码来源:shib-login-dialog.cpp

示例4: onNewCookieCreated

void ShibLoginDialog::onNewCookieCreated(const QUrl& url, const QNetworkCookie& cookie)
{
    if (cookie_seen_) {
        return;
    }
    QString name = cookie.name();
    QString value = cookie.value();
    if (url.host() == url_.host() && name == kSeahubShibCookieName) {
        Account account = parseAccount(value);
        if (!account.isValid()) {
            qWarning("wrong account information from server");
            return;
        }
        cookie_seen_ = true;
        if (seafApplet->accountManager()->saveAccount(account) < 0) {
            seafApplet->warningBox(tr("Failed to save current account"), this);
            reject();
        } else {
            accept();
        }
    }
}
开发者ID:Geosparc,项目名称:seafile-client,代码行数:22,代码来源:shib-login-dialog.cpp

示例5: saveCookies

void CookieJar::saveCookies()
{
    QString fName = m_appPath;
    fName += "cookies";
    QSettings cnFile(fName, QSettings::IniFormat);
    cnFile.clear();

    cnFile.setValue("login", m_sVkLogin);

    QList<QNetworkCookie> cookies = allCookies();
    cnFile.beginWriteArray("cookies");
    for(int i=0; i<cookies.size(); i++) {
        QNetworkCookie cook = cookies.at(i);

        cnFile.setArrayIndex(i);

        cnFile.setValue("name", cook.name());
        cnFile.setValue("value", cook.value());
        cnFile.setValue("domain", cook.domain());
        cnFile.setValue("path", cook.path());
    }
    cnFile.endArray();
}
开发者ID:Nerobrain,项目名称:pulsar,代码行数:23,代码来源:cookiejar.cpp


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