const StaffType* StaffListItem::staffType() const { int typeIdx = staffTypeIdx(); Q_ASSERT(typeIdx != CUSTOM_STAFF_TYPE_IDX); if (typeIdx == CUSTOM_STAFF_TYPE_IDX) typeIdx = 0; return StaffType::preset(StaffTypes(typeIdx)); }
void StaffListItem::staffTypeChanged(int idx) { // check current clef matches new staff type const int typeIdx = staffTypeIdx(idx); if (typeIdx == CUSTOM_STAFF_TYPE_IDX) // consider it not changed return; const StaffType* stfType = StaffType::preset(StaffTypes(typeIdx)); PartListItem* pli = static_cast<PartListItem*>(QTreeWidgetItem::parent()); pli->updateClefs(); if (_staff && _staff->staffType(0)->name() != stfType->name()) { if (_op != ListItemOp::I_DELETE && _op != ListItemOp::ADD) _op = ListItemOp::UPDATE; } }
const StaffType* StaffListItem::staffType() const { return StaffType::preset(StaffTypes((staffTypeIdx()))); }
int StaffListItem::staffTypeIdx() const { return staffTypeIdx(_staffTypeCombo->currentIndex()); }