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


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

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


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

示例1: readSecrets

void NovellVpnSettingWidget::readSecrets()
{
    QStringMap secrets = d->setting->vpnSecrets();
    kDebug() << "Value of" << NM_NOVELLVPN_KEY_CERT_PWD << secrets.value(QLatin1String(NM_NOVELLVPN_KEY_CERT_PWD));
    d->ui.x509CertPass->setText(secrets.value(QLatin1String(NM_NOVELLVPN_KEY_CERT_PWD)));
    d->ui.leUserPass->setText(secrets.value(QLatin1String(NM_NOVELLVPN_KEY_USER_PWD)));
    d->ui.leGroupPass->setText(secrets.value(QLatin1String(NM_NOVELLVPN_KEY_GRP_PWD)));
}
开发者ID:netrunner-debian-kde-extras,项目名称:networkmanagement,代码行数:8,代码来源:novellvpnwidget.cpp

示例2: SendAction

void MythFEXML::SendAction(HTTPRequest *pRequest)
{
    QStringMap* map = &pRequest->m_mapParams;
    pRequest->m_eResponseType = ResponseTypeHTML;
    QString sText = map->value("action");
    uint pcount   = map->size();

    VERBOSE(VB_UPNP, QString("UPNP Action: %1 (total %2 params)")
        .arg(sText).arg(pcount));

    if (!IsValidAction(sText))
        return;

    if (pcount > 1)
    {
        bool valid = false;
        QStringList args;
        if (ACTION_SCREENSHOT == sText && 3 == pcount)
        {
            args << map->value("width");
            args << map->value("height");
            valid = true;
        }
        else if (ACTION_HANDLEMEDIA == sText && 2 == pcount)
        {
            args << map->value("file");
            valid = true;
        }

        if (valid)
        {
            MythEvent* me = new MythEvent(sText, args);
            qApp->postEvent(GetMythMainWindow(), me);
            return;
        }

        VERBOSE(VB_UPNP, QString("Failed to validate extra paramaters - ignoring"));
    }

    QKeyEvent* ke = new QKeyEvent(QEvent::KeyPress, 0, Qt::NoModifier, sText);
    qApp->postEvent(GetMythMainWindow(), (QEvent*)ke);
}
开发者ID:bwarden,项目名称:mythtv,代码行数:42,代码来源:mythfexml.cpp

示例3: readSecrets

void VpncSettingWidget::readSecrets()
{
    Q_D(VpncSettingWidget);
    QStringMap secrets = d->setting->vpnSecrets();
    Knm::Setting::secretsTypes userType;
    Knm::Setting::secretsTypes groupType;

    userType = (Knm::Setting::secretsTypes)d->setting->data().value(NM_VPNC_KEY_XAUTH_PASSWORD"-flags").toInt();

    if (userType & Knm::Setting::AgentOwned || userType & Knm::Setting::None || !userType) {
        d->ui.leUserPassword->setText(secrets.value(QLatin1String(NM_VPNC_KEY_XAUTH_PASSWORD)));
    }
    fillOnePasswordCombo(d->ui.cboUserPassOptions, userType);

    groupType = (Knm::Setting::secretsTypes)d->setting->data().value(NM_VPNC_KEY_SECRET"-flags").toInt();

    if (groupType & Knm::Setting::AgentOwned || groupType & Knm::Setting::None || !groupType) {
        d->ui.leGroupPassword->setText(secrets.value(QLatin1String(NM_VPNC_KEY_SECRET)));
    }
    fillOnePasswordCombo(d->ui.cboGroupPassOptions, groupType);
}
开发者ID:netrunner-debian-kde-extras,项目名称:networkmanagement,代码行数:21,代码来源:vpncwidget.cpp

示例4: mainScreen


//.........这里部分代码省略.........
            return;
        }

        int groupIdx = query["group"].toInt();

        Document * doc = mw->currentDocument();
        if(!doc)
        {
            generic404(socket,path,query);
            return;
        }

        if(groupIdx < 0 || groupIdx >= doc->numGroups())
        {
            generic404(socket,path,query);
            return;
        }

        DocumentListModel * docModel = mw->documentListModel();
        SlideGroup *group = docModel->groupAt(groupIdx);
        if(!group)
        {
            generic404(socket,path,query);
            return;
        }

        int liveId = AppSettings::taggedOutput("live")->id();
        SlideGroup *liveGroup = mw->outputInst(liveId)->slideGroup();
        Slide * liveSlide = mw->outputInst(liveId)->slide();

        //SlideGroupViewControl *viewControl = mw->viewControl(liveId);
        //Slide * liveSlide = viewControl->selectedSlide();

        int idx = query.value("slide").toInt();
        if(idx < 0 || idx > group->numSlides())
        {
            generic404(socket,path,query);
            return;
        }

        Slide *slide = group->at(idx);


        if(liveGroup != group ||
                liveSlide != slide)
            mw->setLiveGroup(group,
                             ! slide ? liveSlide : slide); // prevent changing slides when loading the group page if group already live on different slide

        if(liveGroup == group &&
                liveSlide != slide/* &&
		   nextPathElement != "icon"*/)
        {
            // this is JUST a change slide request
            mw->setLiveGroup(liveGroup,slide);

            // 204 = HTTP No Content, ("...[the browser] SHOULD NOT change its document view...")
            Http_Send_Response(socket,"HTTP/1.0 204 Changed Slide") << "";

            // BlackBerry Internet Browser doesnt honor HTTP 204, so we have to use javascript to make it not change the current document

            return;
        }
        else
            Http_Send_Response(socket,"HTTP/1.0 204 No Change") << "";
    }
    else if(control == "poll_live_slide")
开发者ID:dtbinh,项目名称:dviz,代码行数:67,代码来源:TabletServer.cpp

示例5: readConfig

void VpncSettingWidget::readConfig()
{
    Q_D(VpncSettingWidget);
    // General settings
    QStringMap dataMap = d->setting->data();
    //   gateway
    QString gateway = dataMap[NM_VPNC_KEY_GATEWAY];
    if (!gateway.isEmpty()) {
        d->ui.leGateway->setText(gateway);
    }
    //   username
    QString user = dataMap[NM_VPNC_KEY_XAUTH_USER];
    if (!user.isEmpty()) {
        d->ui.leUserName->setText(user);
    }
    //   group name
    QString group = dataMap[NM_VPNC_KEY_ID];
    if (!group.isEmpty()) {
        d->ui.leGroupName->setText(group);
    }
    // hybrid auth
    if (dataMap[NM_VPNC_KEY_AUTHMODE] == QLatin1String("hybrid")) {
        d->ui.cbUseHybridAuth->setChecked(true);
        d->ui.leCaCertPath->setUrl(KUrl(dataMap[NM_VPNC_KEY_CA_FILE]));
    }
    // password storage type is set in readSecrets

    // Optional settings
    //   domain
    QString domain = dataMap[NM_VPNC_KEY_DOMAIN];
    if (!domain.isEmpty()) {
        d->ui.leDomain->setText(domain);
    }

    //   encryption
    if (dataMap[NM_VPNC_KEY_SINGLE_DES] == QLatin1String("yes")) {
        d->ui.cboEncryptionMethod->setCurrentIndex(VpncSettingWidgetPrivate::EnumEncryptionMethod::Weak);
    } else if (dataMap[NM_VPNC_KEY_NO_ENCRYPTION] == QLatin1String("yes")) {
        d->ui.cboEncryptionMethod->setCurrentIndex(VpncSettingWidgetPrivate::EnumEncryptionMethod::None);
    }

    //   nat traversal
    if (dataMap[NM_VPNC_KEY_NAT_TRAVERSAL_MODE] == NM_VPNC_NATT_MODE_NATT)
        d->ui.cboNatTraversal->setCurrentIndex(VpncSettingWidgetPrivate::EnumNatt::NattIfAvail);
    else if (dataMap[NM_VPNC_KEY_NAT_TRAVERSAL_MODE] == NM_VPNC_NATT_MODE_NATT_ALWAYS)
        d->ui.cboNatTraversal->setCurrentIndex(VpncSettingWidgetPrivate::EnumNatt::Force);
    else if (dataMap[NM_VPNC_KEY_NAT_TRAVERSAL_MODE] == NM_VPNC_NATT_MODE_CISCO)
        d->ui.cboNatTraversal->setCurrentIndex(VpncSettingWidgetPrivate::EnumNatt::CiscoUdp);
    else if (dataMap[NM_VPNC_KEY_NAT_TRAVERSAL_MODE] == NM_VPNC_NATT_MODE_NONE)
        d->ui.cboNatTraversal->setCurrentIndex(VpncSettingWidgetPrivate::EnumNatt::Disabled);

    //   dead peer detection
    if (dataMap.contains(NM_VPNC_KEY_DPD_IDLE_TIMEOUT)) {
        uint dpdTimeout = dataMap.value(NM_VPNC_KEY_DPD_IDLE_TIMEOUT).toUInt();
        if (dpdTimeout == 0) {
            d->ui.chkDeadPeerDetection->setChecked(false);
            d->dpdTimeout = dpdTimeout;
        }
    }
    //   dh group
    if (dataMap.contains(NM_VPNC_KEY_DHGROUP)) {
        QString dhGroup = dataMap.value(NM_VPNC_KEY_DHGROUP);
        if (dhGroup == NM_VPNC_DHGROUP_DH1) {
            // DH Group 1
            d->ui.cboDHGroup->setCurrentIndex(VpncSettingWidgetPrivate::EnumDh::Dh1);
        } else if (dhGroup == NM_VPNC_DHGROUP_DH2) {
            // DH Group 2
            d->ui.cboDHGroup->setCurrentIndex(VpncSettingWidgetPrivate::EnumDh::Dh2);
        } else if (dhGroup == NM_VPNC_DHGROUP_DH5) {
            // DH Group 5
            d->ui.cboDHGroup->setCurrentIndex(VpncSettingWidgetPrivate::EnumDh::Dh5);
        }
    }

    // Perfect Forward Secrecy
    if (dataMap.contains(NM_VPNC_KEY_PERFECT_FORWARD)) {
        QString forwardSecrecy = dataMap.value(NM_VPNC_KEY_PERFECT_FORWARD);
        if (forwardSecrecy == QLatin1String("nopfs")) {
            d->ui.cboPerfectForwardSecrecy->setCurrentIndex(VpncSettingWidgetPrivate::EnumPerfectForwardSecrecy::NoPfs);
        } else if (forwardSecrecy == QLatin1String("server")) {
            d->ui.cboPerfectForwardSecrecy->setCurrentIndex(VpncSettingWidgetPrivate::EnumPerfectForwardSecrecy::Server);
        } else if (forwardSecrecy == QLatin1String("dh1")) {
            d->ui.cboPerfectForwardSecrecy->setCurrentIndex(VpncSettingWidgetPrivate::EnumPerfectForwardSecrecy::Dh1);
        } else if (forwardSecrecy == QLatin1String("dh2")) {
            d->ui.cboPerfectForwardSecrecy->setCurrentIndex(VpncSettingWidgetPrivate::EnumPerfectForwardSecrecy::Dh2);
        } else if (forwardSecrecy == QLatin1String("dh5")) {
            d->ui.cboPerfectForwardSecrecy->setCurrentIndex(VpncSettingWidgetPrivate::EnumPerfectForwardSecrecy::Dh5);
        }
    }

    // Vendor
    if (dataMap.contains(NM_VPNC_KEY_VENDOR)) {
        QString vendor = dataMap.value(NM_VPNC_KEY_VENDOR);
        if (vendor == QLatin1String("cisco")) {
            d->ui.cboVendor->setCurrentIndex(VpncSettingWidgetPrivate::EnumVendor::Cisco);
        } else if (vendor == QLatin1String("netscreen")) {
            d->ui.cboVendor->setCurrentIndex(VpncSettingWidgetPrivate::EnumVendor::Netscreen);
        }
    }

//.........这里部分代码省略.........
开发者ID:netrunner-debian-kde-extras,项目名称:networkmanagement,代码行数:101,代码来源:vpncwidget.cpp


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