本文整理汇总了C++中MasterScore::setLayoutAll方法的典型用法代码示例。如果您正苦于以下问题:C++ MasterScore::setLayoutAll方法的具体用法?C++ MasterScore::setLayoutAll怎么用?C++ MasterScore::setLayoutAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MasterScore
的用法示例。
在下文中一共展示了MasterScore::setLayoutAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addClicked
void AlbumManager::addClicked()
{
QStringList files = mscore->getOpenScoreNames(
tr("MuseScore Files") + " (*.mscz *.mscx);;", tr("Load Score")
);
QList<MasterScore*> scores;
for (const QString& fn : files) {
MasterScore* score = mscore->readScore(fn);
Movements* m = score->movements();
for (MasterScore* ms : *m) {
scores.push_back(ms);
ms->setMovements(0);
}
delete m;
}
if (scores.empty())
return;
MasterScore* topScore = album->front();
scoreList->blockSignals(true);
for (MasterScore* score : scores) {
topScore->addMovement(score);
QString name = getScoreTitle(score);
QListWidgetItem* li = new QListWidgetItem(name, scoreList);
li->setFlags(Qt::ItemFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled));
}
scoreList->blockSignals(false);
topScore->setLayoutAll();
topScore->update();
}
示例2: addNewClicked
void AlbumManager::addNewClicked()
{
MasterScore* score = mscore->getNewFile();
if (!score)
return;
delete score->movements();
MasterScore* topScore = album->front();
scoreList->blockSignals(true);
topScore->addMovement(score);
QString name = getScoreTitle(score);
QListWidgetItem* li = new QListWidgetItem(name, scoreList);
li->setFlags(Qt::ItemFlags(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled));
scoreList->blockSignals(false);
topScore->setLayoutAll();
topScore->update();
}
示例3: editInstrList
//.........这里部分代码省略.........
int n = s->nstaves();
int curSpan = 0;
for (int j = 0; j < n; ++j) {
Staff* staff = s->staff(j);
int span = staff->barLineSpan();
int setSpan = -1;
// determine if we need to update barline span
if (curSpan == 0) {
// no current span; this staff must start a new one
if (span == 0) {
// no span; this staff must have been within a span
// update it to a span of 1
setSpan = j;
}
else if (span > (n - j)) {
// span too big; staves must have been removed
// reduce span to last staff
setSpan = n - j;
}
else if (span > 1 && staff->barLineTo() > 0) {
// TODO: check if span is still valid
// (true if the last staff is the same as it was before this edit)
// the code here fixes https://musescore.org/en/node/41786
// but by forcing an update,
// we lose custom modifications to staff barLineTo
// at least this happens only for span > 1, and not for Mensurstrich (barLineTo<=0)
setSpan = span; // force update to pick up new barLineTo value
}
else {
// this staff starts a span
curSpan = span;
}
}
else if (span && staff->barLineTo() > 0) {
// within a current span; staff must have span of 0
// except for Mensurstrich (barLineTo<=0)
// for consistency with Barline::endEdit,
// don't special case 1-line staves
//TODO s->undoChangeBarLineSpan(staff, 0, 0, (staff->lines() - 1) * 2);
}
// update barline span if necessary
if (setSpan > 0) {
// this staff starts a span
curSpan = setSpan;
// calculate spanFrom and spanTo values
// int spanFrom = staff->lines() == 1 ? BARLINE_SPAN_1LINESTAFF_FROM : 0;
// int linesTo = masterScore->staff(i + setSpan - 1)->lines();
// int spanTo = linesTo == 1 ? BARLINE_SPAN_1LINESTAFF_TO : (linesTo - 1) * 2;
//TODO s->undoChangeBarLineSpan(staff, setSpan, spanFrom, spanTo);
}
// count off one from barline span
--curSpan;
// update brackets
for (BracketItem* bi : staff->brackets()) {
if ((bi->bracketSpan() > (n - j)))
bi->undoChangeProperty(Pid::BRACKET_SPAN, n - j);
}
}
}
//
// there should be at least one measure
//
if (masterScore->measures()->size() == 0)
masterScore->insertMeasure(ElementType::MEASURE, 0, false);
const QList<Excerpt*> excerpts(masterScore->excerpts()); // excerpts list may change in the loop below
for (Excerpt* excerpt : excerpts) {
QList<Staff*> sl = excerpt->partScore()->staves();
QMultiMap<int, int> tr = excerpt->tracks();
if (sl.size() == 0)
masterScore->undo(new RemoveExcerpt(excerpt));
else {
for (Staff* s : sl) {
const LinkedElements* sll = s->links();
for (auto le : *sll) {
Staff* ss = toStaff(le);
if (ss->primaryStaff()) {
for (int j = s->idx() * VOICES; j < (s->idx() + 1) * VOICES; j++) {
int strack = tr.key(j, -1);
if (strack != -1 && ((strack & ~3) == ss->idx()))
break;
else if (strack != -1)
tr.insert(ss->idx() + strack % VOICES, tr.value(strack, -1));
}
}
}
}
}
}
masterScore->setLayoutAll();
masterScore->endCmd();
masterScore->rebuildAndUpdateExpressive(MuseScore::synthesizer("Fluid"));
seq->initInstruments();
}