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


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

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


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

示例3: readScore

void TestSpanners::spanners14()
      {
      MasterScore* score = readScore(DIR + "glissando-cloning05.mscx");
      QVERIFY(score);
      score->doLayout();

      // create parts
      // (copied and adapted from void TestParts::createParts() in mtest/libmscore/parts/tst_parts.cpp)
      QList<Part*> parts;
      parts.append(score->parts().at(0));
      Score* nscore = new Score(score);

      Excerpt* ex = new Excerpt(score);
      ex->setPartScore(nscore);
      ex->setTitle(parts.front()->longName());
      ex->setParts(parts);
      Excerpt::createExcerpt(ex);
      QVERIFY(nscore);

//      nscore->setName(parts.front()->partName());

//      QMultiMap<int, int> tracks;
      score->Score::undo(new AddExcerpt(ex));

      QVERIFY(saveCompareScore(score, "glissando-cloning05.mscx", DIR + "glissando-cloning05-ref.mscx"));
      delete score;
      }
开发者ID:,项目名称:,代码行数:27,代码来源:

示例4: ex

void TestSpanners::spanners05()
{
    MasterScore* score = readScore(DIR + "glissando-cloning02.mscx");
    QVERIFY(score);
    score->doLayout();

    // create parts
    // (copied and adapted from void TestParts::createParts() in mtest/libmscore/parts/tst_parts.cpp)
    QList<Part*> parts;
    parts.append(score->parts().at(0));
    Score* nscore = new Score(score);

    Excerpt ex(score);
    ex.setPartScore(nscore);
    ex.setTitle(parts.front()->longName());
    ex.setParts(parts);
    ::createExcerpt(&ex);
    QVERIFY(nscore);

    nscore->setName(parts.front()->partName());
    score->undo(new AddExcerpt(nscore));

    QVERIFY(saveCompareScore(score, "glissando-cloning02.mscx", DIR + "glissando-cloning02-ref.mscx"));
    delete score;
}
开发者ID:sidewayss,项目名称:MuseScore,代码行数:25,代码来源:tst_spanners.cpp

示例5: test_pre

MasterScore* TestChordSymbol::test_pre(const char* p)
      {
      QString p1 = DIR + p + ".mscx";
      MasterScore* score = readScore(p1);
      score->doLayout();
      return score;
      }
开发者ID:Angeldude,项目名称:MuseScore,代码行数:7,代码来源:tst_chordsymbol.cpp

示例6: undoLockLineBreaks

void TestTools::undoLockLineBreaks()
{
    QString readFile(DIR + "undoLockLineBreaks.mscx");
    QString writeFile1("undoLockLineBreaks01-test.mscx");
    QString reference1(DIR  + "undoLockLineBreaks01-ref.mscx");
    QString writeFile2("undoLockLineBreaks02-test.mscx");
    QString reference2(DIR  + "undoLockLineBreaks02-ref.mscx");

    MasterScore* score = readScore(readFile);
    score->doLayout();

    // select all
    score->startCmd();
    score->cmdSelectAll();
    score->endCmd();

    // do
    score->startCmd();
    score->addRemoveBreaks(0, true);
    score->endCmd();
    QVERIFY(saveCompareScore(score, writeFile1, reference1));

    // undo
    score->undoStack()->undo();
    QVERIFY(saveCompareScore(score, writeFile2, reference2));

    delete score;
}
开发者ID:ericfont,项目名称:MuseScore,代码行数:28,代码来源:tst_tools.cpp

示例7: readFile

void TestImplodeExplode::implode1()
      {
      QString readFile(DIR + "implode1.mscx");
      QString writeFile1("implode1-test1.mscx");
      QString writeFile2("implode1-test2.mscx");
      QString reference(DIR + "implode1-ref.mscx");

      MasterScore* score = readScore(readFile);
      score->doLayout();

      // select all
      score->startCmd();
      score->cmdSelectAll();
      score->endCmd();

      // do
      score->startCmd();
      score->cmdImplode();
      score->endCmd();
      QVERIFY(saveCompareScore(score, writeFile1, reference));

      // undo
      score->undoStack()->undo();
      QVERIFY(saveCompareScore(score, writeFile2, readFile));

      delete score;
      }
开发者ID:Fyrult,项目名称:MuseScore,代码行数:27,代码来源:tst_implodeExplode.cpp

示例8: undoSlashRhythm

void TestTools::undoSlashRhythm()
      {
      QString readFile(DIR + "undoSlashRhythm.mscx");
      QString writeFile1("undoSlashRhythm01-test.mscx");
      QString reference1(DIR  + "undoSlashRhythm01-ref.mscx");
      QString writeFile2("undoSlashRhythm02-test.mscx");
      QString reference2(DIR  + "undoSlashRhythm02-ref.mscx");

      MasterScore* score = readScore(readFile);
      score->doLayout();

      // select all
      score->startCmd();
      score->cmdSelectAll();
      score->endCmd();

      // do
      score->startCmd();
      score->cmdSlashRhythm();
      score->endCmd();
      QVERIFY(saveCompareScore(score, writeFile1, reference1));

      // undo
      score->undoStack()->undo(&ed);
      QVERIFY(saveCompareScore(score, writeFile2, reference2));

      delete score;
      }
开发者ID:Jojo-Schmitz,项目名称:MuseScore,代码行数:28,代码来源:tst_tools.cpp

示例9: testClear

void TestChordSymbol::testClear()
      {
      MasterScore* score = test_pre("clear");
      Measure* m = score->firstMeasure();
      score->select(m, SelectType::SINGLE, 0);
      score->cmdDeleteSelection();
      score->doLayout();
      test_post(score, "clear");
      }
开发者ID:Angeldude,项目名称:MuseScore,代码行数:9,代码来源:tst_chordsymbol.cpp

示例10: testExtend

void TestChordSymbol::testExtend()
      {
      MasterScore* score = test_pre("extend");
      Measure* m = score->firstMeasure();
      Segment* s = m->first(Segment::Type::ChordRest);
      ChordRest* cr = s->cr(0);
      score->changeCRlen(cr, TDuration::DurationType::V_WHOLE);
      score->doLayout();
      test_post(score, "extend");
      }
开发者ID:Angeldude,项目名称:MuseScore,代码行数:10,代码来源:tst_chordsymbol.cpp

示例11: testDelete

void TestInstrumentChange::testDelete()
      {
      MasterScore* score = test_pre("delete");
      Measure* m = score->firstMeasure()->nextMeasure();
      Segment* s = m->first(Segment::Type::ChordRest);
      InstrumentChange* ic = toInstrumentChange(s->annotations()[0]);
      score->deleteItem(ic);
      score->doLayout();
      test_post(score, "delete");
      }
开发者ID:AntonioBL,项目名称:MuseScore,代码行数:10,代码来源:tst_instrumentchange.cpp

示例12: spanner_A

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

      score->select(score->firstMeasure());
      score->startCmd();
      score->localTimeDelete();
      score->endCmd();
      score->doLayout();
      QVERIFY(saveCompareScore(score, "measure-6.mscx", DIR + "measure-6-ref.mscx"));
      delete score;
      }
开发者ID:trig-ger,项目名称:MuseScore,代码行数:12,代码来源:tst_measure.cpp

示例13: testAdd

void TestInstrumentChange::testAdd()
      {
      MasterScore* score = test_pre("add");
      Measure* m = score->firstMeasure()->nextMeasure();
      Segment* s = m->first(Segment::Type::ChordRest);
      InstrumentChange* ic = new InstrumentChange(score);
      ic->setParent(s);
      ic->setTrack(0);
      ic->setXmlText("Instrument");
      score->undoAddElement(ic);
      score->doLayout();
      test_post(score, "add");
      }
开发者ID:AntonioBL,项目名称:MuseScore,代码行数:13,代码来源:tst_instrumentchange.cpp

示例14: readFile

void TestCompat114::compat()
      {
      QFETCH(QString, file);

      QString readFile(DIR   + file + ".mscx");
      QString writeFile(file + "-test.mscx");
      QString reference(DIR  + file + "-ref.mscx");

      MasterScore* score = readScore(readFile);
      score->doLayout();
      QVERIFY(score);
      QVERIFY(saveCompareScore(score, writeFile, reference));
      }
开发者ID:ajyoon,项目名称:MuseScore,代码行数:13,代码来源:tst_compat114.cpp

示例15: testAddPart

void TestChordSymbol::testAddPart()
      {
      MasterScore* score = test_pre("add-part");
      Segment* seg = score->firstSegment(Segment::Type::ChordRest);
      ChordRest* cr = seg->cr(0);
      Harmony* harmony = new Harmony(score);
      harmony->setHarmony("C7");
      harmony->setTrack(cr->track());
      harmony->setParent(cr->segment());
      score->undoAddElement(harmony);
      score->doLayout();
      test_post(score, "add-part");
      }
开发者ID:Angeldude,项目名称:MuseScore,代码行数:13,代码来源:tst_chordsymbol.cpp


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