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


C++ MasterScore::systems方法代码示例

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


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

示例1: minWidth

void TestMeasure::minWidth()
      {
      MasterScore* score = readScore(DIR + "measure-2.mscx");

      int n = score->systems().size();
      int measuresSystem[n];
      for (int i = 0; i < n; ++i)
            measuresSystem[i] = score->systems().at(i)->measures().size();

      score->doLayout();

      Measure* m1 = score->systems().at(1)->lastMeasure();
      Measure* m2 = score->systems().at(2)->firstMeasure();
      qreal mw1   = m1->minWidth1();
      qreal mw2   = m2->minWidth1();

      score->doLayout();

      QCOMPARE(mw1, m1->minWidth1());
      QCOMPARE(mw2, m2->minWidth1());

      // after second layout nothing should be changed:
      for (int i = 0; i < n; ++i) {
            QCOMPARE(measuresSystem[i], int(score->systems().at(i)->measures().size()));
            }
      }
开发者ID:trig-ger,项目名称:MuseScore,代码行数:26,代码来源:tst_measure.cpp

示例2: readScore

void TestSpanners::spanners13()
{
    DropData          dropData;
    LayoutBreak*      brk;

    MasterScore* score = readScore(DIR + "lyricsline06.mscx");
    QVERIFY(score);
    score->doLayout();

    // DROP A BREAK AT FIRST MEASURE AND VERIFY
    Measure*    msr   = score->firstMeasure();
    QVERIFY(msr);
    brk               = new LayoutBreak(score);
    brk->setLayoutBreakType(LayoutBreak::Type::LINE);
    dropData.pos      = msr->pagePos();
    dropData.element  = brk;
    score->startCmd();
    msr->drop(dropData);
    score->endCmd();
    // VERIFY SEGMENTS IN SYSTEMS AND THEN SCORE
    for (System* sys : score->systems())
        QVERIFY(sys->spannerSegments().size() == 1);
    QVERIFY(saveCompareScore(score, "lyricsline06.mscx", DIR + "lyricsline06-ref.mscx"));

    // UNDO AND VERIFY
    score->undoStack()->undo();
    score->doLayout();      // systems need to be re-computed
    QVERIFY(saveCompareScore(score, "lyricsline06.mscx", DIR + "lyricsline06.mscx"));
    delete score;
}
开发者ID:sidewayss,项目名称:MuseScore,代码行数:30,代码来源:tst_spanners.cpp


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