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


C++ QMap::remove方法代码示例

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


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

示例1: detailDefinitions

/*!
 * Modifies the detail definitions. The default detail definitions are
 * queried from QContactManagerEngine::schemaDefinitions and then modified
 * with this function in the transform leaf classes.
 *
 * \a definitions The detail definitions to modify.
 * \a contactType The contact type the definitions apply for.
 */
void CntTransformOnlineAccount::detailDefinitions(QMap<QString, QContactDetailDefinition> &definitions, const QString& contactType) const
{
    Q_UNUSED(contactType);

    if(definitions.contains(QContactOnlineAccount::DefinitionName)) {
        QContactDetailDefinition d = definitions.value(QContactOnlineAccount::DefinitionName);
        QMap<QString, QContactDetailFieldDefinition> fields = d.fields();
        QContactDetailFieldDefinition f;

        // Not all fields are supported
        fields.remove(QContactOnlineAccount::FieldCapabilities);
        fields.remove(QContactOnlineAccount::FieldDetailUri);
        fields.remove(QContactOnlineAccount::FieldLinkedDetailUris);
        fields.remove(QContactOnlineAccount::FieldServiceProvider);
        fields.remove(QContactOnlineAccount::FieldContext);

        // Support only certain subtypes 
        f.setDataType(QVariant::StringList);
        QVariantList subTypes;
        subTypes << QString(QLatin1String(QContactOnlineAccount::SubTypeSip));
        subTypes << QString(QLatin1String(QContactOnlineAccount::SubTypeSipVoip));
        subTypes << QString(QLatin1String(QContactOnlineAccount::SubTypeVideoShare));
        f.setAllowableValues(subTypes);
        fields[QContactOnlineAccount::FieldSubTypes] = f;

        d.setFields(fields);

        // Replace original definitions
        definitions.insert(d.name(), d);
    }
}
开发者ID:taladar,项目名称:qtmobility,代码行数:39,代码来源:cnttransformonlineaccountsimple.cpp

示例2: detailDefinitions

/*!
 * Modifies the detail definitions. The default detail definitions are
 * queried from QContactManagerEngine::schemaDefinitions and then modified
 * with this function in the transform leaf classes.
 *
 * \a definitions The detail definitions to modify.
 * \a contactType The contact type the definitions apply for.
 */
void CntTransformAnniversarySimple::detailDefinitions(QMap<QString, QContactDetailDefinition> &definitions, const QString& contactType) const
{
    Q_UNUSED(contactType);

    if(definitions.contains(QContactAnniversary::DefinitionName)) {
        QContactDetailDefinition d = definitions.value(QContactAnniversary::DefinitionName);
        QMap<QString, QContactDetailFieldDefinition> fields = d.fields();

        // Following fields not supported in symbian (pre-10.1) back-end, remove
        fields.remove(QContactAnniversary::FieldCalendarId);
        fields.remove(QContactAnniversary::FieldEvent);

        // Sub-types not supported in symbian back-end, remove
        fields.remove(QContactAnniversary::FieldSubType);

        // Context not supported in symbian back-end, remove
        fields.remove(QContactAnniversary::FieldContext);

        d.setFields(fields);
        d.setUnique(true);

        // Replace original definitions
        definitions.insert(d.name(), d);
    }
}
开发者ID:robclark,项目名称:qtmobility-1.1.0,代码行数:33,代码来源:cnttransformanniversarysimple.cpp

示例3:

/*! Return the parameters relevant to the creation of this QOrganizerManager
  \since 1.1
*/
QMap<QString, QString> QOrganizerManager::managerParameters() const
{
    QMap<QString, QString> params = d->m_engine->managerParameters();

    params.remove(QString::fromAscii(QTORGANIZER_VERSION_NAME));
    params.remove(QString::fromAscii(QTORGANIZER_IMPLEMENTATION_VERSION_NAME));
    return params;
}
开发者ID:RobinD42,项目名称:qt-mobility,代码行数:11,代码来源:qorganizermanager.cpp

示例4: GetRandomEffect

QString ImageView::GetRandomEffect(void) const
{
    QMap<QString,QString> tmpMap = m_effect_map;
    tmpMap.remove("none");
    tmpMap.remove("Ken Burns (gl)");
    QStringList t = tmpMap.keys();
    int i = (int) ( (float)(t.count()) * random() / (RAND_MAX + 1.0f) );
    return tmpMap[t[i]];
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:9,代码来源:imageview.cpp

示例5: k

QList<QVariantMap > HsMenuClientPrivate::getList(const QVariantMap &queryPreference)
{
    QList<QVariantMap> list;
    QMap<QString, QVariant> map = queryPreference;
    
    map.remove(hsItemName);
    map.remove(hsItemDescription);
    
    CaQuery query;
    // define query
    query.setFlagsOn(VisibleEntryFlag);
    query.setEntryRoles(ItemEntryRole);
    query.setEntryTypeNames(QStringList(Hs::templatedApplicationTypeName));
    
    
    // add atributes to caquery
    QMapIterator<QString, QVariant> k(map);
    while (k.hasNext()) {
        k.next();
        query.setAttribute(k.key(),k.value().toString());
    }  
    QList< QSharedPointer<CaEntry> > entries = CaService::instance()->getEntries(query);
    map.clear();
    if (entries.count()) {
        QMap<QString, QString> attrMap;
        QMapIterator<QString, QString> k(attrMap);
        //walk trought entrys and extract keys into map
        for (int i = 0; i < entries.count(); ++i) {
            map[hsItemId] = entries.at(i)->id();
            map[hsItemName] = entries.at(i)->text();
            map[hsItemDescription] = entries.at(i)->description();
            CaIconDescription iconDesc = entries.at(i)->iconDescription();
            map[hsIconFileName] = iconDesc.filename();
            map[hsIconName] = iconDesc.skinId();
            map[hsIconApplicationId] = iconDesc.applicationId();
            
            // extract entry atributes
            attrMap = entries.at(i)->attributes();
            QMapIterator<QString, QString> k(attrMap);
            // insert entrys attr into map
            while (k.hasNext()) {
                k.next();
                map.insert(k.key(),k.value());
            }
            list.append(map); //append entry map to list
            // clean used maps
            map.clear();
            attrMap.clear();
        }
    }
    return list;
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:52,代码来源:hsmenuclient.cpp

示例6: while

QList<TLType> GeneratorNG::solveTypes(QMap<QString, TLType> types)
{
    QList<TLType> solvedTypes;
    QStringList solvedTypesNames = nativeTypes;
    solvedTypesNames.append(tlValueName);

    int previousSolvedTypesCount = -1;

    // In order to successful compilation, type must rely only on defined types.
    while (solvedTypes.count() != previousSolvedTypesCount) { // Check for infinity loop
        previousSolvedTypesCount = solvedTypes.count();
        foreach(const QString &typeName, types.keys()) {
            const TLType &type = types.value(typeName);

            bool solved = true;

            if (nativeTypes.contains(type.name)) {
                types.remove(typeName);
                continue;
            }

            foreach (const TLSubType &subType, type.subTypes) {
                foreach (const TLParam &member, subType.members) {
                    QString memberType = getTypeOrVectorType(member.type);

                    if (!solvedTypesNames.contains(memberType)) {
                        solved = false;
                        break;
                    }
                }

                if (!solved) {
                    break;
                }
            }

            if (solved) {
                solvedTypes.append(type);
                types.remove(typeName);
                solvedTypesNames.append(typeName);

                qDebug() << "Solved:" << typeName;
            }
        }
    }

    qDebug() << "Unresolved:" << types.count();

    return solvedTypes;
}
开发者ID:jsfdez,项目名称:telegram-qt,代码行数:50,代码来源:GeneratorNG.cpp

示例7: SetLoginSavingEnabled

NS_IMETHODIMP KDEWallet::SetLoginSavingEnabled(const nsAString & aHost,
        bool isEnabled) {
    PR_LOG( gKDEWalletLog, PR_LOG_DEBUG, ( "KDEWallet::SetLoginSavingEnabled() Called") );

    nsresult res = checkWallet();
    NS_ENSURE_SUCCESS(res, res);

    QMap< QString, QString > saveDisabledHostMap;

    wallet->readMap( kSaveDisabledHostsMapName, saveDisabledHostMap );
    if( isEnabled ) { //Remove form disabled list, if it is there
        if( saveDisabledHostMap.contains( NSString2QtString(aHost) ) )
            if( saveDisabledHostMap.remove( NSString2QtString(aHost) ) != 1 ) {
                NS_ERROR("Can not remove save map information");
                return NS_ERROR_FAILURE;
            }
    }
    else 	// Add to disabled list
        saveDisabledHostMap[ NSString2QtString(aHost) ] = "TRUE";
    if( wallet->writeMap( kSaveDisabledHostsMapName, saveDisabledHostMap ) ) {
        NS_ERROR("Can not save map information");
        return NS_ERROR_FAILURE;
    }
    return NS_OK;
}
开发者ID:maciex,项目名称:mozilla-kwallet,代码行数:25,代码来源:KDEWallet.cpp

示例8: removeRequest

QContactAbstractRequest* QContactJsonDbRequestManager::removeRequest(QJsonDbRequest *jsonDbRequest, RequestType &requestType, int &contactIndex, QString *partitionName)
{
    QMutexLocker locker(m_operationMutex);
    if (m_jsonDbRequestTypeMap.contains(jsonDbRequest)) {
        requestType = m_jsonDbRequestTypeMap.value(jsonDbRequest);
        m_jsonDbRequestTypeMap.remove(jsonDbRequest);
        if (requestType == OrphanRequest || requestType == InvalidRequest)
            return 0;
    } else {
        qWarning() << Q_FUNC_INFO << "Could not find jsondbRequest:" << jsonDbRequest;
        requestType = InvalidRequest;
        return 0;
    }
    QList<QContactAbstractRequest*> reqList = m_activeRequests.keys();
    for (int i = 0; i < reqList.size(); i++) {
        QContactAbstractRequest* req = reqList.at(i);
        QMap<QJsonDbRequest*, int>* requestMap = &(m_activeRequests.value(req)->m_jsonDbRequestMap);
        if (requestMap->contains(jsonDbRequest)) {
            *partitionName = jsonDbRequest->partition();
            contactIndex = requestMap->value(jsonDbRequest);
            requestMap->remove(jsonDbRequest);
            return reqList.at(i);
        }
    }
    // request already deleted so mark this as orphan.
    requestType = OrphanRequest;
    return 0;
}
开发者ID:chriadam,项目名称:qtpim,代码行数:28,代码来源:qcontactjsondbrequestmanager.cpp

示例9: onCollectionsLoaded

void CollectionMapBridge::onCollectionsLoaded(std::vector<Collection> collections, bool /*ok*/)
{
  qDebug() << "Loaded" << collections.size() << "collections";

  // clear deleted collections on map
  if (delegatedMap == nullptr) {
    displayedCollection.clear();
  }else{
    QMap<qint64, DisplayedCollection> collectionToHide = displayedCollection;

    for (const auto &c: collections){
      if (c.visible){
        collectionToHide.remove(c.id);
        collectionDetailRequest(c);
      }
    }

    for (const auto &colId: collectionToHide.keys()) {
      DisplayedCollection col=displayedCollection.take(colId);
      for (const auto &wpt: col.waypoints) {
        delegatedMap->removeOverlayObject(wpt.id);
      }
      for (const auto &trk:col.tracks){
        for (const auto &id:trk.ids){
          delegatedMap->removeOverlayObject(id);
        }
      }
    }
  }
}
开发者ID:Karry,项目名称:osmscout-sailfish,代码行数:30,代码来源:CollectionMapBridge.cpp

示例10: qDeleteAll

Downloader::Downloader(QStringList tags, QStringList postfiltering, QStringList sources, int page, int max, int perpage, QString location, QString filename, QString user, QString password, bool blacklist, QStringList blacklistedtags, bool noduplicates, int tagsmin, QString tagsformat)
	: m_tags(tags), m_postfiltering(postfiltering), m_sources(sources), m_page(page), m_max(max), m_perpage(perpage), m_location(location), m_filename(filename), m_user(user), m_password(password), m_blacklist(blacklist), m_noduplicates(noduplicates), m_tagsmin(tagsmin), m_tagsformat(tagsformat), m_blacklistedTags(blacklistedtags)
{
	m_quit = false;
	QMap<QString, Site*> *sites = Site::getAllSites();

	m_sites = new QList<Site*>();
	for (QString source : sources)
	{
		if (!sites->contains(source))
			std::cerr << "Source '"+source.toStdString()+"' not found" << std::endl;
		else
        {
			m_sites->append(sites->value(source));
            sites->remove(source);
        }
	}
    qDeleteAll(*sites);
    delete sites;

	m_pages = new QList<Page*>();
    m_pagesC = new QList<Page*>();
	m_pagesT = new QList<Page*>();
	m_pagesP = new QList<QPair<Site*, int> >();
	m_opages = new QList<Page*>();
	m_opagesC = new QList<Page*>();
	m_opagesT = new QList<Page*>();
	m_opagesP = new QList<QPair<Site*, int> >();
	m_waiting = 0;
	m_ignored = 0;
	m_duplicates = 0;
	m_results = new QList<Tag>();
	m_images = new QList<Image*>();
}
开发者ID:ExKia,项目名称:imgbrd-grabber,代码行数:34,代码来源:downloader.cpp

示例11: changeModes

void IrcChannelPrivate::changeModes(const QString& value, const QStringList& arguments)
{
    Q_Q(IrcChannel);
    const IrcNetwork* network = q->network();

    QMap<QString, QString> ms = modes;
    QStringList args = arguments;

    bool add = true;
    for (int i = 0; i < value.size(); ++i) {
        const QString m = value.at(i);
        if (m == QLatin1String("+")) {
            add = true;
        } else if (m == QLatin1String("-")) {
            add = false;
        } else {
            if (add) {
                QString a;
                if (!args.isEmpty() && network && network->channelModes(IrcNetwork::TypeB | IrcNetwork::TypeC).contains(m))
                    a = args.takeFirst();
                ms.insert(m, a);
            } else {
                ms.remove(m);
            }
        }
    }

    if (modes != ms) {
        setKey(ms.value(QLatin1String("k")));
        modes = ms;
        emit q->modeChanged(q->mode());
    }
}
开发者ID:Mudlet,项目名称:Mudlet,代码行数:33,代码来源:ircchannel.cpp

示例12: setSetColor

void tGraph::setSetColor(int set, const QColor * color) {
    if(color) {
        _setColors[set] = *color;
    } else {
        _setColors.remove(set);
    }
}
开发者ID:Wushaowei001,项目名称:xtuple,代码行数:7,代码来源:graph.cpp

示例13: QDialog

LyricsProvidersDialog::LyricsProvidersDialog(QString state, QWidget *parent) :
    QDialog(parent),
    ui(new Ui::LyricsProvidersDialog)
{
    ui->setupUi(this);

    ui->upButton->setIcon(QIcon::fromTheme("keyboard_move_up"));
    ui->checkButton->setIcon(QIcon::fromTheme("widgets_tickmark_grid"));
    ui->downButton->setIcon(QIcon::fromTheme("keyboard_move_down"));
    ui->providersList->setItemDelegate(new ProviderListItemDelegate(ui->providersList));

    QMap<QString,QString> availableProviders = LyricsManager::listProviders();
    QStringList configList = state.split(',', QString::SkipEmptyParts);

    foreach(QString config, configList) {
        bool active;

        if (active = config.startsWith('+'))
            config = config.mid(1);

        if (availableProviders.contains(config))
            addProvider(config, availableProviders.value(config), active);

        availableProviders.remove(config);
    }
开发者ID:gidzzz,项目名称:openmediaplayer,代码行数:25,代码来源:lyricsprovidersdialog.cpp

示例14: lock

UrlParseLock::~UrlParseLock() {
  QMutexLocker lock(&urlParseMutex);
  Q_ASSERT(parsingUrls.contains(m_url));
  Q_ASSERT(parsingUrls[m_url].first == QThread::currentThread());
  --parsingUrls[m_url].second;
  if(parsingUrls[m_url].second == 0)
    parsingUrls.remove(m_url);
}
开发者ID:caidongyun,项目名称:kdevplatform,代码行数:8,代码来源:urlparselock.cpp

示例15: captureListSet

void SubsystemContainer::captureListSet(QHash<QString,QVariant>* subsystemElement, QString key){
    for(QVariant el : subsystemElement->value(key).toList()){
        QMap<QString,QVariant> set = el.toMap();
        QString setKey = set.value("id").toString();
        set.remove("id");
        m_sets.insert(setKey,set);
    }
}
开发者ID:hbirchtree,项目名称:jason,代码行数:8,代码来源:subsystemcontainer.cpp


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