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


C++ BarLine::undoChangeProperty方法代码示例

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


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

示例1: readScore

void TestBarline::barline04()
      {
      Score* score = readScore(DIR + "barline04.mscx");
      QVERIFY(score);
      score->doLayout();

      score->startCmd();
      // 'go' to 5th measure
      Measure* msr = score->firstMeasure();
      for (int i=0; i < 4; i++)
            msr = msr->nextMeasure();
      // check span data of measure-initial start-repeat bar line
      Segment* seg = msr->findSegment(SegmentType::StartRepeatBarLine, msr->tick());
      QVERIFY2(seg != nullptr, "No SegStartRepeatBarLine segment in measure 5.");

      BarLine* bar = static_cast<BarLine*>(seg->element(0));
      QVERIFY2(bar != nullptr, "No start-repeat barline in measure 5.");

      bar->undoChangeProperty(Pid::BARLINE_SPAN, 2);
      bar->undoChangeProperty(Pid::BARLINE_SPAN_FROM, 2);
      bar->undoChangeProperty(Pid::BARLINE_SPAN_TO, 6);
      score->endCmd();

      QVERIFY2(bar->spanStaff() && bar->spanFrom() == 2 && bar->spanTo() == 6,
            "Wrong span data in start-repeat barline of measure 5.");

      // check start-repeat bar ine in second staff is gone
      QVERIFY2(seg->element(1) == nullptr, "Extra start-repeat barline in 2nd staff of measure 5.");

//      QVERIFY(saveCompareScore(score, "barline04.mscx", DIR + "barline04-ref.mscx"));
      delete score;
      }
开发者ID:Jojo-Schmitz,项目名称:MuseScore,代码行数:32,代码来源:tst_barline.cpp

示例2: toBarLine

void InspectorBarLine::presetTick2Clicked()
      {
      BarLine* bl = toBarLine(inspector->element());
      Score* score = bl->score();
      score->startCmd();

      bl->undoChangeProperty(P_ID::BARLINE_SPAN, false);
      bl->undoChangeProperty(P_ID::BARLINE_SPAN_FROM, BARLINE_SPAN_TICK2_FROM);
      bl->undoChangeProperty(P_ID::BARLINE_SPAN_TO,   BARLINE_SPAN_TICK2_TO);

      score->endCmd();
      }
开发者ID:Fyrult,项目名称:MuseScore,代码行数:12,代码来源:inspectorBarline.cpp

示例3: toBarLine

void InspectorBarLine::presetShort2Clicked()
      {
      Score* score = inspector->element()->score();
      score->startCmd();

      BarLine* bl;
      for (Element* e : *inspector->el()) {
            if (e->isBarLine()) {
                  bl = toBarLine(e);
                  bl->undoChangeProperty(Pid::BARLINE_SPAN, false);
                  bl->undoChangeProperty(Pid::BARLINE_SPAN_FROM, BARLINE_SPAN_SHORT2_FROM);
                  int shortDelta = bl->staff() ? (bl->staff()->lines(bl->tick()) - 5) * 2 : 0;
                  bl->undoChangeProperty(Pid::BARLINE_SPAN_TO,   BARLINE_SPAN_SHORT2_TO + shortDelta);
                  }
            }
      score->endCmd();
      }
开发者ID:CammyVee,项目名称:MuseScore,代码行数:17,代码来源:inspectorBarline.cpp


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