本文整理汇总了C++中LayoutBreak::setLayoutBreakType方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutBreak::setLayoutBreakType方法的具体用法?C++ LayoutBreak::setLayoutBreakType怎么用?C++ LayoutBreak::setLayoutBreakType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutBreak
的用法示例。
在下文中一共展示了LayoutBreak::setLayoutBreakType方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: newBreaksPalette
Palette* MuseScore::newBreaksPalette()
{
qreal _spatium = gscore->spatium();
Palette* sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Breaks && Spacer"));
sp->setMag(.7);
sp->setGrid(42, 36);
sp->setDrawGrid(true);
LayoutBreak* lb = new LayoutBreak(gscore);
lb->setLayoutBreakType(LAYOUT_BREAK_LINE);
sp->append(lb, tr("Line break"));
lb = new LayoutBreak(gscore);
lb->setLayoutBreakType(LAYOUT_BREAK_PAGE);
sp->append(lb, tr("Page break"));
lb = new LayoutBreak(gscore);
lb->setLayoutBreakType(LAYOUT_BREAK_SECTION);
sp->append(lb, tr("Section break"));
Spacer* spacer = new Spacer(gscore);
spacer->setGap(3 * _spatium);
spacer->setSpacerType(SPACER_DOWN);
sp->append(spacer, tr("Staff spacer down"));
spacer = new Spacer(gscore);
spacer->setGap(3 * _spatium);
spacer->setSpacerType(SPACER_UP);
sp->append(spacer, tr("Staff spacer up"));
return sp;
}
示例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;
}
示例3: newBreaksPalette
Palette* MuseScore::newBreaksPalette()
{
qreal _spatium = gscore->spatium();
Palette* sp = new Palette;
sp->setName(QT_TRANSLATE_NOOP("Palette", "Breaks && Spacers"));
sp->setMag(1.0);
sp->setGrid(42, 36);
sp->setDrawGrid(true);
LayoutBreak* lb = new LayoutBreak(gscore);
lb->setLayoutBreakType(LayoutBreak::Type::LINE);
PaletteCell* cell = sp->append(lb, tr("Line break"));
cell->mag = 1.2;
lb = new LayoutBreak(gscore);
lb->setLayoutBreakType(LayoutBreak::Type::PAGE);
cell = sp->append(lb, tr("Page break"));
cell->mag = 1.2;
lb = new LayoutBreak(gscore);
lb->setLayoutBreakType(LayoutBreak::Type::SECTION);
cell = sp->append(lb, tr("Section break"));
cell->mag = 1.2;
Spacer* spacer = new Spacer(gscore);
spacer->setSpacerType(SpacerType::DOWN);
spacer->setGap(3 * _spatium);
cell = sp->append(spacer, tr("Staff spacer down"));
cell->mag = .7;
spacer = new Spacer(gscore);
spacer->setSpacerType(SpacerType::UP);
spacer->setGap(3 * _spatium);
cell = sp->append(spacer, tr("Staff spacer up"));
cell->mag = .7;
return sp;
}
示例4: undoSetBreak
void MeasureBase::undoSetBreak(bool v, LayoutBreak::Type type)
{
switch (type) {
case LayoutBreak::LINE:
if (lineBreak() == v)
return;
setLineBreak(v);
break;
case LayoutBreak::PAGE:
if (pageBreak() == v)
return;
if (v && lineBreak())
setLineBreak(false);
setPageBreak(v);
break;
case LayoutBreak::SECTION:
if (sectionBreak() == v)
return;
if (v && lineBreak())
setLineBreak(false);
setSectionBreak(v);
break;
case LayoutBreak::NOBREAK:
if (noBreak() == v)
return;
if (v) {
setLineBreak(false);
setPageBreak(false);
setSectionBreak(false);
}
setNoBreak(v);
break;
}
if (v) {
LayoutBreak* lb = new LayoutBreak(score());
lb->setLayoutBreakType(type);
lb->setTrack(-1); // this are system elements
lb->setParent(this);
score()->undoAddElement(lb);
}
cleanupLayoutBreaks(true);
}
示例5: readScore
void TestBarline::barline05()
{
Score* score = readScore(DIR + "barline05.mscx");
QVERIFY(score);
score->doLayout();
// 'go' to 4th measure
Measure* msr = score->firstMeasure();
for (int i=0; i < 3; i++)
msr = msr->nextMeasure();
// create and add a LineBreak element
LayoutBreak* lb = new LayoutBreak(score);
lb->setLayoutBreakType(LayoutBreak::Type::LINE);
lb->setTrack(-1); // system-level element
lb->setParent(msr);
score->undoAddElement(lb);
score->doLayout();
// check an end-repeat bar line has been created at the end of this measure and it is generated
Segment* seg = msr->findSegment(SegmentType::EndBarLine, msr->tick()+msr->ticks());
QVERIFY2(seg != nullptr, "No SegEndBarLine segment in measure 4.");
BarLine* bar = static_cast<BarLine*>(seg->element(0));
QVERIFY2(bar != nullptr, "No end-repeat barline in measure 4.");
QVERIFY2(bar->barLineType() == BarLineType::END_REPEAT, "Barline at measure 4 is not END-REPEAT");
QVERIFY2(bar->generated(), "End-repeat barline in measure 4 is non-generated.");
// // check an end-repeat bar line has been created at the beginning of the next measure and it is not generated
// check an end-repeat bar line has been created at the beginning of the next measure and it is generated
msr = msr->nextMeasure();
seg = msr->findSegment(SegmentType::StartRepeatBarLine, msr->tick());
QVERIFY2(seg != nullptr, "No SegStartRepeatBarLine segment in measure 5.");
bar = static_cast<BarLine*>(seg->element(0));
QVERIFY2(bar != nullptr, "No start-repeat barline in measure 5.");
QVERIFY2(bar->generated(), "Start-reapeat barline in measure 5 is not generated.");
// QVERIFY(saveCompareScore(score, "barline05.mscx", DIR + "barline05-ref.mscx"));
delete score;
}