本文整理汇总了C++中QMultiHash::insertMulti方法的典型用法代码示例。如果您正苦于以下问题:C++ QMultiHash::insertMulti方法的具体用法?C++ QMultiHash::insertMulti怎么用?C++ QMultiHash::insertMulti使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMultiHash
的用法示例。
在下文中一共展示了QMultiHash::insertMulti方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xapianDocToComponent
Component xapianDocToComponent(Xapian::Document document) {
Component component;
// kind
QString kindString = value (document, XapianValues::TYPE);
component.setKind(Component::stringToKind(kindString));
// Identifier
QString id = value(document, XapianValues::IDENTIFIER);
component.setId(id);
// Component name
QString name = value(document,XapianValues::CPTNAME);
component.setName(name);
// Package name
QStringList packageNames = value(document,XapianValues::PKGNAME).split("\n",QString::SkipEmptyParts);
component.setPackageNames(packageNames);
// URLs
QString concatUrlStrings = value(document, XapianValues::URLS);
QStringList urlStrings = concatUrlStrings.split('\n',QString::SkipEmptyParts);
if(urlStrings.size() %2 == 0) {
QMultiHash<Component::UrlKind, QUrl> urls;
for(int i = 0; i < urlStrings.size(); i=i+2) {
Component::UrlKind ukind = Component::stringToUrlKind(urlStrings.at(i));
QUrl url = QUrl::fromUserInput(urlStrings.at(i+1));
urls.insertMulti(ukind, url);
}
component.setUrls(urls);
} else {
qWarning("Bad url strings for component: '%s' (%s)", qPrintable(id), qPrintable(concatUrlStrings));
}
// Provided items
QString concatProvides = value(document, XapianValues::PROVIDED_ITEMS);
QStringList providesList = concatProvides.split('\n',QString::SkipEmptyParts);
QList<Provides> provideslist;
Q_FOREACH(const QString& string, providesList) {
QStringList providesParts = string.split(';',QString::SkipEmptyParts);
if(providesParts.size() < 2) {
qWarning("Bad component parts for component: '%s' (%s)", qPrintable(id), qPrintable(string));
continue;
}
QString kindString = providesParts.takeFirst();
Provides::Kind kind = Provides::stringToKind(kindString);
Provides provides;
provides.setKind(kind);
QString value = providesParts.takeFirst();
provides.setValue(value);
QString extraData = providesParts.join(";");
provides.setExtraData(extraData);
provideslist << provides;
}
示例2: collectFuzzyDepend
QString CodeAtlas::FuzzyDependBuilder::collectFuzzyDepend( SymbolNode::Ptr& node )
{
// ignore dependency under a function
SymbolInfo nodeInfo = node->getSymInfo();
if (nodeInfo.elementType() & SymbolInfo::Variable)
return nodeInfo.type() + " " + nodeInfo.name();
QString nodeCode;
CodeAttr::Ptr pCode = node->getAttr<CodeAttr>();
if (pCode)
nodeCode = pCode->getCode();
if (nodeInfo.elementType() & SymbolInfo::Function)
return nodeCode;
QMultiHash<QString, ChildPack> childList;
int ithChild = 0;
bool* isNonVar = new bool[node->childCount()];
for (SymbolNode::ChildIterator pChild = node->childBegin();
pChild != node->childEnd(); ++pChild, ++ithChild)
{
ChildPack p;
p.m_info = pChild.key();
p.m_code = collectFuzzyDepend(pChild.value());
p.m_pNode = pChild.value();
p.m_index = ithChild;
childList.insertMulti(p.m_info.name(), p);
isNonVar[ithChild] = (p.m_info.elementType() & SymbolInfo::Variable) == 0;
nodeCode += "\n" + p.m_code;
}
FuzzyDependAttr::Ptr pAttr = node->getOrAddAttr<FuzzyDependAttr>();
buildChildDepend(childList, pAttr->vtxEdgeMatrix(), pAttr->edgeWeightVector(), pAttr->dependPairList());
buildSubGraphLevel(pAttr->vtxEdgeMatrix(), isNonVar, ithChild, pAttr->levelVector());
delete[] isNonVar;
return nodeCode;
}
示例3: setConnectionName
DrugBaseEssentials::DrugBaseEssentials():
Utils::Database(),
m_dbcore_initialized(false),
m_isDefaultDb(false)
{
setConnectionName(Constants::DB_DRUGS_NAME);
using namespace Constants;
QMultiHash<int, ftype> types;
int i = Table_MASTER;
types.insertMulti(i, ftype(MASTER_DID, FieldIsUniquePrimaryKey));
types.insertMulti(i, ftype(MASTER_UID1, FieldIsUUID));
types.insertMulti(i, ftype(MASTER_UID2, FieldIsUUID));
types.insertMulti(i, ftype(MASTER_UID3, FieldIsUUID));
types.insertMulti(i, ftype(MASTER_OLDUID,FieldIsUUID));
types.insertMulti(i, ftype(MASTER_SID, FieldIsInteger));
i = Table_SOURCES;
types.insertMulti(i, ftype(SOURCES_SID, FieldIsUniquePrimaryKey));
types.insertMulti(i, ftype(SOURCES_DBUID, FieldIsUUID));
types.insertMulti(i, ftype(SOURCES_MASTERLID, FieldIsInteger));
types.insertMulti(i, ftype(SOURCES_LANG, FieldIsLanguageText));
types.insertMulti(i, ftype(SOURCES_WEB, FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_COPYRIGHT, FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_LICENSE, FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_DATE, FieldIsDateTime));
types.insertMulti(i, ftype(SOURCES_DRUGS_VERSION,FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_AUTHORS, FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_VERSION, FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_PROVIDER, FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_WEBLINK, FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_DRUGUID_NAME, FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_ATC, FieldIsBoolean));
types.insertMulti(i, ftype(SOURCES_INTERACTIONS, FieldIsBoolean));
types.insertMulti(i, ftype(SOURCES_COMPL_WEBSITE,FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_PACKUID_NAME,FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_COMPLETION, FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_AUTHOR_COMMENTS, FieldIsLongText));
types.insertMulti(i, ftype(SOURCES_DRUGNAMECONSTRUCTOR, FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_FMFCOMPAT, FieldIsShortText));
types.insertMulti(i, ftype(SOURCES_OPENREACT_COMPAT, FieldIsShortText));
i = Table_LABELS;
types.insertMulti(i, ftype(LABELS_LID, FieldIsUniquePrimaryKey));
types.insertMulti(i, ftype(LABELS_LANG, FieldIsLanguageText));
types.insertMulti(i, ftype(LABELS_LABEL, FieldIsShortText));
i = Table_LABELSLINK;
types.insertMulti(i, ftype(LABELSLINK_MASTERLID, FieldIsInteger));
types.insertMulti(i, ftype(LABELSLINK_LID, FieldIsInteger));
i= Table_BIB;
types.insertMulti(i, ftype(BIB_BIBID, FieldIsUniquePrimaryKey));
types.insertMulti(i, ftype(BIB_TYPE, FieldIsShortText));
types.insertMulti(i, ftype(BIB_LINK, FieldIsShortText));
types.insertMulti(i, ftype(BIB_TEXTREF, FieldIsShortText));
types.insertMulti(i, ftype(BIB_ABSTRACT, FieldIsLongText));
types.insertMulti(i, ftype(BIB_EXPLAIN, FieldIsLongText));
types.insertMulti(i, ftype(BIB_XML, FieldIsBlob));
i = Table_BIB_LINK;
types.insertMulti(i, ftype(BIB_LINK_MASTERID, FieldIsInteger));
types.insertMulti(i, ftype(BIB_LINK_BIBID, FieldIsInteger));
i = Table_DRUGS;
types.insertMulti(i, ftype(DRUGS_ID , FieldIsUniquePrimaryKey));
types.insertMulti(i, ftype(DRUGS_DID ,FieldIsInteger));
types.insertMulti(i, ftype(DRUGS_SID, FieldIsInteger));
types.insertMulti(i, ftype(DRUGS_NAME, FieldIsShortText));
types.insertMulti(i, ftype(DRUGS_ATC_ID, FieldIsInteger));
types.insertMulti(i, ftype(DRUGS_STRENGTH,FieldIsShortText));
types.insertMulti(i, ftype(DRUGS_VALID, FieldIsBoolean));
types.insertMulti(i, ftype(DRUGS_MARKET, FieldIsBoolean));
types.insertMulti(i, ftype(DRUGS_AID_MASTER_LID, FieldIsInteger));
types.insertMulti(i, ftype(DRUGS_LINK_SPC, FieldIsShortText));
types.insertMulti(i, ftype(DRUGS_EXTRA_XML,FieldIsLongText));
i = Table_MOLS;
types.insertMulti(i, ftype(MOLS_MID,FieldIsUniquePrimaryKey));
types.insertMulti(i, ftype(MOLS_SID, FieldIsInteger));
types.insertMulti(i, ftype(MOLS_NAME,FieldIsShortText));
types.insertMulti(i, ftype(MOLS_WWW, FieldIsShortText));
i = Table_COMPO;
types.insertMulti(i, ftype(COMPO_ID,FieldIsUniquePrimaryKey));
types.insertMulti(i, ftype(COMPO_DID,FieldIsInteger));
types.insertMulti(i, ftype(COMPO_MID,FieldIsInteger));
types.insertMulti(i, ftype(COMPO_STRENGTH, FieldIsShortText));
types.insertMulti(i, ftype(COMPO_STRENGTH_NID, FieldIsInteger));
types.insertMulti(i, ftype(COMPO_DOSE_REF, FieldIsShortText));
types.insertMulti(i, ftype(COMPO_REF_NID, FieldIsInteger));
types.insertMulti(i, ftype(COMPO_NATURE, FieldIsInteger));
types.insertMulti(i, ftype(COMPO_LK_NATURE, FieldIsInteger));
i = Table_UNITS;
types.insertMulti(i, ftype(UNITS_NID, FieldIsUniquePrimaryKey));
types.insertMulti(i, ftype(UNITS_VALUE, FieldIsShortText));
i = Table_LK_MOL_ATC;
types.insertMulti(i, ftype(LK_MID,FieldIsInteger));
types.insertMulti(i, ftype(LK_ATC_ID, FieldIsInteger));
types.insertMulti(i, ftype(LK_ATC_SID,FieldIsInteger));
i = Table_PACKAGING;
types.insertMulti(i, ftype(PACK_DID, FieldIsUniquePrimaryKey));
types.insertMulti(i, ftype(PACK_SID, FieldIsInteger));
types.insertMulti(i, ftype(PACK_PACK_UID,FieldIsUUID));
types.insertMulti(i, ftype(PACK_LABEL, FieldIsShortText));
types.insertMulti(i, ftype(PACK_STATUS, FieldIsOneChar));
types.insertMulti(i, ftype(PACK_MARKET, FieldIsInteger));
types.insertMulti(i, ftype(PACK_DATE, FieldIsDateTime));
types.insertMulti(i, ftype(PACK_OPTION_CODE, FieldIsShortText));
//.........这里部分代码省略.........