本文整理汇总了C++中StaffType::genTimesig方法的典型用法代码示例。如果您正苦于以下问题:C++ StaffType::genTimesig方法的具体用法?C++ StaffType::genTimesig怎么用?C++ StaffType::genTimesig使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StaffType
的用法示例。
在下文中一共展示了StaffType::genTimesig方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateStaffType
void EditStaff::updateStaffType()
{
StaffType* staffType = staff->staffType();
lines->setValue(staffType->lines());
lineDistance->setValue(staffType->lineDistance().val());
showClef->setChecked(staffType->genClef());
showTimesig->setChecked(staffType->genTimesig());
showBarlines->setChecked(staffType->showBarlines());
staffGroupName->setText(qApp->translate("Staff type group name", staffType->groupName()));
}
示例2: typeChanged
void EditStaffType::typeChanged(QListWidgetItem* n, QListWidgetItem* o)
{
if (n == 0)
return;
if (o)
saveCurrent(o);
// retrieve staff type corresponding to new current item in type list
int idx = n->data(Qt::UserRole).toInt();
StaffType* st = staffTypes[idx];
// switch to stack page and set props specific to each staff group
switch(st->group()) {
case STANDARD_STAFF_GROUP:
{
StaffTypePitched* ps = static_cast<StaffTypePitched*>(st);
stack->setCurrentIndex(0);
name->setText(st->name());
lines->setValue(st->lines());
lineDistance->setValue(st->lineDistance().val());
genClef->setChecked(st->genClef());
showBarlines->setChecked(st->showBarlines());
genTimesig->setChecked(st->genTimesig());
genKeysigPitched->setChecked(ps->genKeysig());
showLedgerLinesPitched->setChecked(ps->showLedgerLines());
stemlessPitched->setChecked(st->slashStyle());
}
break;
case TAB_STAFF_GROUP:
{
StaffTypeTablature* stt = static_cast<StaffTypeTablature*>(st);
blockTabPreviewSignals(true);
setDlgFromTab(stt);
name->setText(stt->name()); // setDlgFromTab() does not copy the name and it shouldn't
stack->setCurrentIndex(1);
blockTabPreviewSignals(false);
}
break;
case PERCUSSION_STAFF_GROUP:
{
StaffTypePercussion* ps = static_cast<StaffTypePercussion*>(st);
blockPercPreviewSignals(true);
setDlgFromPerc(ps);
name->setText(ps->name()); // setDlgFromPerc() does not copy the name and it shouldn't
stack->setCurrentIndex(2);
blockPercPreviewSignals(false);
}
break;
}
}
示例3: saveCurrent
void EditStaffType::saveCurrent(QListWidgetItem* o)
{
bool modif = false; // assume no modifications
int idx = o->data(Qt::UserRole).toInt();
StaffType* st = staffTypes[idx];
// if any of the common properties is modified
if (name->text() != st->name()
|| st->lines() != lines->value()
|| st->lineDistance().val()!= lineDistance->value()
|| st->genClef() != genClef->isChecked()
|| st->showBarlines() != showBarlines->isChecked()
|| st->genTimesig() != genTimesig->isChecked()
) {
modif = true;
}
// or if any of the props specific to each group is modified
switch(st->group()) {
case STANDARD_STAFF_GROUP:
{
StaffTypePitched* sp = static_cast<StaffTypePitched*>(st);
if (sp->genKeysig() != genKeysigPitched->isChecked()
|| sp->showLedgerLines() != showLedgerLinesPitched->isChecked()
|| st->slashStyle() != stemlessPitched->isChecked()
) {
modif = true;
}
}
break;
case TAB_STAFF_GROUP:
{
StaffTypeTablature* stt = static_cast<StaffTypeTablature*>(st);
TablatureMinimStyle minimStyle = minimNoneRadio->isChecked() ? TAB_MINIM_NONE :
(minimShortRadio->isChecked() ? TAB_MINIM_SHORTER : TAB_MINIM_SLASHED);
if (stt->durationFontName() != durFontName->currentText()
|| stt->durationFontSize() != durFontSize->value()
|| stt->durationFontUserY()!= durY->value()
|| stt->fretFontName() != fretFontName->currentText()
|| stt->fretFontSize() != fretFontSize->value()
|| stt->fretFontUserY() != fretY->value()
|| stt->linesThrough() != linesThroughRadio->isChecked()
|| stt->onLines() != onLinesRadio->isChecked()
|| stt->upsideDown() != upsideDown->isChecked()
|| stt->useNumbers() != numbersRadio->isChecked()
|| ( noteValuesNone->isChecked() && (!stt->slashStyle() || stt->genDurations()) )
|| ( noteValuesSymb->isChecked() && (!stt->slashStyle() || !stt->genDurations()) )
// if stems, there are more values to take into account
|| ( noteValuesStems->isChecked()&& ( stt->slashStyle() || stt->genDurations()
|| stt->stemsDown() != stemBelowRadio->isChecked()
|| stt->stemThrough() != stemThroughRadio->isChecked()
|| stt->minimStyle() != minimStyle)
)
|| stt->showRests() != showRests->isChecked()
) {
modif = true;
}
}
break;
case PERCUSSION_STAFF_GROUP:
{
StaffTypePercussion* sp = static_cast<StaffTypePercussion*>(st);
if (sp->genKeysig() != genKeysigPercussion->isChecked()
|| sp->showLedgerLines() != showLedgerLinesPercussion->isChecked()
|| st->slashStyle() != stemlessPercussion->isChecked()
) {
modif = true;
}
}
break;
}
if (modif) {
// save common properties
// save-group specific properties
if(name->text().isEmpty()) {
QString n = createUniqueStaffTypeName(st->group());
name->setText(n);
o->setText(n);
}
switch(st->group()) {
case STANDARD_STAFF_GROUP:
{
StaffTypePitched* stp = static_cast<StaffTypePitched*>(st);
stp->setName(name->text());
stp->setLines(lines->value());
stp->setLineDistance(Spatium(lineDistance->value()));
stp->setShowBarlines(showBarlines->isChecked());
stp->setGenClef(genClef->isChecked());
stp->setGenTimesig(genTimesig->isChecked());
stp->setGenKeysig(genKeysigPitched->isChecked());
stp->setShowLedgerLines(showLedgerLinesPitched->isChecked());
stp->setSlashStyle(stemlessPitched->isChecked());
}
break;
case TAB_STAFF_GROUP:
{
StaffTypeTablature* stt = static_cast<StaffTypeTablature*>(st);
//.........这里部分代码省略.........