StaffListItem::StaffListItem() : QTreeWidgetItem(STAFF_LIST_ITEM) { op = ITEM_KEEP; staff = 0; setPartIdx(0); staffIdx = 0; setClef(ClefTypeList(ClefType::G, ClefType::G)); setLinked(false); _staffTypeCombo = 0; }
Clef::Clef(const PitchList *pitchList, const QPen *pen) :Symbol(pitchList, pen) { m_clefs = new QHash<int, QString>; m_clefs->insert(Clef::Treble, QString(":/mainwindow/images/clef_treble.svg")); m_clefs->insert(Clef::Bass, QString(":/mainwindow/images/clef_bass.svg")); m_clefs->insert(Clef::Alto, QString(":/mainwindow/images/clef_alto_tenor.svg")); m_clefs->insert(Clef::Tenor, QString(":/mainwindow/images/clef_alto_tenor.svg")); m_svgRenderer = new QSvgRenderer(m_clefs->value(m_clef), this); setClef(Treble); }
TscoreClef::TscoreClef(TscoreScene* scene, TscoreStaff* staff, Tclef clef) : TscoreItem(scene), m_clef(Tclef(Tclef::e_none)), m_textClef(0), m_readOnly(false) { setStaff(staff); setParentItem(staff); if (m_typesList.size() == 0) // initialize types list m_typesList << Tclef::e_treble_G << Tclef::e_bass_F << Tclef::e_bass_F_8down << Tclef::e_alto_C << Tclef::e_tenor_C << Tclef::e_treble_G_8down; m_textClef = new QGraphicsSimpleTextItem(); registryItem(m_textClef); m_textClef->setBrush(qApp->palette().text().color()); m_textClef->setFont(TnooFont(18)); setClef(clef); }
void StaffListItem::staffTypeChanged(int idx) { // check current clef matches new staff type int staffTypeIdx = _staffTypeCombo->itemData(idx).toInt(); const StaffType* stfType = StaffType::preset(staffTypeIdx); if (stfType->group() != ClefInfo::staffGroup(_clef._transposingClef)) { ClefType clefType; switch (stfType->group()) { case STANDARD_STAFF_GROUP: clefType = ClefType::G3; break; case TAB_STAFF_GROUP: clefType = ClefType::TAB2; break; case PERCUSSION_STAFF_GROUP: clefType = ClefType::PERC; break; } setClef(ClefTypeList(clefType, clefType)); } if (staff && staff->staffType()->name() != stfType->name()) if (op != ITEM_DELETE && op != ITEM_ADD) op = ITEM_UPDATE; }