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


C++ QVariantHash::find方法代码示例

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


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

示例1: writeMapping

QByteArray FSTReader::writeMapping(const QVariantHash& mapping) {
    static const QStringList PREFERED_ORDER = QStringList() << NAME_FIELD << TYPE_FIELD << SCALE_FIELD << FILENAME_FIELD
    << TEXDIR_FIELD << JOINT_FIELD << FREE_JOINT_FIELD
    << BLENDSHAPE_FIELD << JOINT_INDEX_FIELD;
    QBuffer buffer;
    buffer.open(QIODevice::WriteOnly);
    
    for (auto key : PREFERED_ORDER) {
        auto it = mapping.find(key);
        if (it != mapping.constEnd()) {
            if (key == FREE_JOINT_FIELD) { // writeVariant does not handle strings added using insertMulti.
                for (auto multi : mapping.values(key)) {
                    buffer.write(key.toUtf8());
                    buffer.write(" = ");
                    buffer.write(multi.toByteArray());
                    buffer.write("\n");
                }
            } else {
                writeVariant(buffer, it);
            }
        }
    }
    
    for (auto it = mapping.constBegin(); it != mapping.constEnd(); it++) {
        if (!PREFERED_ORDER.contains(it.key())) {
            writeVariant(buffer, it);
        }
    }
    return buffer.data();
}
开发者ID:cozza13,项目名称:hifi,代码行数:30,代码来源:FSTReader.cpp

示例2: set

void PropertyEditor::set(const QVariantHash &hash)
{
    QVariantHash::const_iterator it = mProperties.constBegin();
    for (;it != mProperties.constEnd(); ++it) {
        QVariantHash::const_iterator ti = hash.find(it.key());
        if (ti == hash.constEnd())
            continue;
        mProperties[it.key()] = ti.value();
    }
}
开发者ID:baoniu,项目名称:QtAV,代码行数:10,代码来源:PropertyEditor.cpp

示例3: writeMapping

QByteArray FSTReader::writeMapping(const QVariantHash& mapping) {
    static const QStringList PREFERED_ORDER = QStringList() << NAME_FIELD << TYPE_FIELD << SCALE_FIELD << FILENAME_FIELD
    << TEXDIR_FIELD << JOINT_FIELD << FREE_JOINT_FIELD
    << BLENDSHAPE_FIELD << JOINT_INDEX_FIELD;
    QBuffer buffer;
    buffer.open(QIODevice::WriteOnly);
    
    for (auto key : PREFERED_ORDER) {
        auto it = mapping.find(key);
        if (it != mapping.constEnd()) {
            writeVariant(buffer, it);
        }
    }
    
    for (auto it = mapping.constBegin(); it != mapping.constEnd(); it++) {
        if (!PREFERED_ORDER.contains(it.key())) {
            writeVariant(buffer, it);
        }
    }
    return buffer.data();
}
开发者ID:DaveDubUK,项目名称:hifi,代码行数:21,代码来源:FSTReader.cpp


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