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


C++ SystemClass::toString方法代码示例

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


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

示例1: read

void ClassesDatas::read(const QJsonObject &json){

    // Clear
    SuperListItem::deleteModel(m_model, false);

    // Read
    QJsonArray jsonList = json["classes"].toArray();
    QStandardItem* item;
    SystemClass* sysClass;
    for (int i = 0; i < jsonList.size(); i++){
        item = new QStandardItem;
        sysClass= new SystemClass;
        sysClass->read(jsonList[i].toObject());
        item->setData(QVariant::fromValue(
                          reinterpret_cast<quintptr>(sysClass)));
        item->setFlags(item->flags() ^ (Qt::ItemIsDropEnabled));
        item->setText(sysClass->toString());
        m_model->appendRow(item);
    }
}
开发者ID:Wano-k,项目名称:RPG-Paper-Maker,代码行数:20,代码来源:classesdatas.cpp

示例2: setDefault


//.........这里部分代码省略.........
        QVector<int>({3, 4, 5, 6, 7, 8, 9, 10, 11, 12}),
        QVector<int>({3, 4, 5, 6, 7, 8, 9, 10, 11, 12}),
        QVector<int>({3, 4, 5, 6, 7, 8, 9, 10, 11, 12})
    };
    QVector<bool> isFix[] = {
        QVector<bool>({true, true, true, false, false, true, true, true, true,
            true}),
        QVector<bool>({true, true, true, false, false, true, true, true, true,
            true}),
        QVector<bool>({true, true, true, false, false, true, true, true, true,
            true}),
        QVector<bool>({true, true, true, false, false, true, true, true, true,
            true}),
        QVector<bool>({true, true, true, false, false, true, true, true, true,
            true})
    };
    QVector<int> initialValue[] = {
        QVector<int>({20, 10, 10, 1, 1, 1, 1, 0, 0, 1}),
        QVector<int>({20, 10, 10, 1, 1, 1, 1, 0, 0, 1}),
        QVector<int>({20, 10, 10, 1, 1, 1, 1, 0, 0, 1}),
        QVector<int>({20, 10, 10, 1, 1, 1, 1, 0, 0, 1}),
        QVector<int>({5, 10, 10, 1, 1, 1, 1, 0, 0, 1})
    };
    QVector<int> finalValue[] = {
        QVector<int>({1000, 500, 100, 999, 999, 200, 200, 50, 50, 200}),
        QVector<int>({1000, 500, 100, 999, 999, 200, 200, 50, 50, 200}),
        QVector<int>({1000, 500, 100, 999, 999, 200, 200, 50, 50, 200}),
        QVector<int>({1000, 500, 100, 999, 999, 200, 200, 50, 50, 200}),
        QVector<int>({1000, 500, 100, 999, 999, 200, 200, 50, 50, 200})
    };
    QVector<QString> formula[] = {
        QVector<QString>({"", "", "", "Math.ceil(u.str * 0.3)",
            "Math.ceil(u.int * 0.3)", "", "", "", "", ""}),
        QVector<QString>({"", "", "", "Math.ceil(u.str * 0.3)",
            "Math.ceil(u.int * 0.3)", "", "", "", "", ""}),
        QVector<QString>({"", "", "", "Math.ceil(u.str * 0.3)",
            "Math.ceil(u.int * 0.3)", "", "", "", "", ""}),
        QVector<QString>({"", "", "", "Math.ceil(u.str * 0.3)",
            "Math.ceil(u.int * 0.3)", "", "", "", "", ""}),
        QVector<QString>({"", "", "", "Math.ceil(u.str * 0.3)",
            "Math.ceil(u.int * 0.3)", "", "", "", "", ""})
    };
    QVector<int> skillIds[] = {
        QVector<int>({6}),
        QVector<int>({7}),
        QVector<int>({8, 9, 10, 11}),
        QVector<int>({12, 13}),
        QVector<int>({})
    };
    QVector<int> skillLevels[] = {
        QVector<int>({1}),
        QVector<int>({1}),
        QVector<int>({1,1,5,10}),
        QVector<int>({1, 5}),
        QVector<int>({})
    };

    int length = (sizeof(names)/sizeof(*names));

    for (int i = 0; i < length; i++){
        // Statistics progression
        statisticsProgression = new QStandardItemModel;
        for (int j = 0; j < idsStatistics[i].size(); j++){
            statistic = SuperListItem::getById(modelStatistics, idsStatistics[i]
                [j]);
            statisticProgression = new SystemStatisticProgression(statistic->id(),
                statistic->name(), new PrimitiveValue(finalValue[i][j]), isFix
                [i][j], new SystemProgressionTable(new PrimitiveValue(
                initialValue[i][j]), new PrimitiveValue(finalValue[i][j]), 0),
                new PrimitiveValue(0), new PrimitiveValue(formula[i][j]));
            row = statisticProgression->getModelRow();
            statisticsProgression->appendRow(row);
        }
        item = new QStandardItem();
        item->setText(SuperListItem::beginningText);
        statisticsProgression->appendRow(item);

        // Skills
        skills = new QStandardItemModel;
        for (int j = 0; j < skillIds[i].size(); j++){
            skill = SuperListItem::getById(modelSkills, skillIds[i][j]);
            classSkill = new SystemClassSkill(skill->id(), skill->name(),
                                              skillLevels[i][j]);
            row = classSkill->getModelRow();
            skills->appendRow(row);
        }
        item = new QStandardItem();
        item->setText(SuperListItem::beginningText);
        skills->appendRow(item);

        sysClass = new SystemClass(i + 1, new LangsTranslation(names[i]),
            initialLevels[i], maxLevels[i], expBases[i], expInflations[i],
            statisticsProgression, skills);
        item = new QStandardItem;
        item->setData(QVariant::fromValue(
                          reinterpret_cast<quintptr>(sysClass)));
        item->setText(sysClass->toString());
        m_model->appendRow(item);
    }
}
开发者ID:Wano-k,项目名称:RPG-Paper-Maker,代码行数:101,代码来源:classesdatas.cpp


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